-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Bids 2821/dashboard validator management - group selection, dashboard…
… loading (#78) * dropdown styles * group selection * load dashboard group --------- Co-authored-by: D13ce <[email protected]>
- Loading branch information
1 parent
7589800
commit aa94361
Showing
22 changed files
with
335 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
@mixin truncate-text() { | ||
white-space: nowrap; | ||
overflow: hidden; | ||
text-overflow: ellipsis; | ||
} | ||
|
||
.truncate-text{ | ||
@include truncate-text; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
<script setup lang="ts"> | ||
interface Props { | ||
variant?: 'default' | 'table' | ||
} | ||
defineProps<Props>() | ||
</script> | ||
|
||
<template> | ||
<Dropdown :class="variant" :panel-class="variant"> | ||
<template #value="slotProps"> | ||
<slot name="value" v-bind="slotProps" /> | ||
</template> | ||
<template #option="slotProps"> | ||
<slot name="option" v-bind="slotProps.option" /> | ||
</template> | ||
</Dropdown> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
<script setup lang="ts"> | ||
import type { VDBOverviewGroup } from '~/types/api/validator_dashboard' | ||
import { DAHSHBOARDS_ALL_GROUPS_ID } from '~/types/dashboard' | ||
interface Props { | ||
group: VDBOverviewGroup, | ||
} | ||
const props = defineProps<Props>() | ||
const { t: $t } = useI18n() | ||
const name = computed(() => { | ||
if (props.group.id === DAHSHBOARDS_ALL_GROUPS_ID) { | ||
return $t('dashboard.group.selection.all') | ||
} else if (props.group.id === 0) { | ||
return props.group.name && props.group.name !== 'default' ? props.group.name : $t('dashboard.group.selection.default') | ||
} | ||
return props.group.name | ||
}) | ||
</script> | ||
|
||
<template> | ||
<span><span>{{ name }}</span> <span v-if="group.id >= 0" class="discreet">(ID: {{ group.id }})</span></span> | ||
</template> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,47 @@ | ||
<script setup lang="ts"> | ||
import { DAHSHBOARDS_ALL_GROUPS_ID } from '~/types/dashboard' | ||
interface Props { | ||
includeAll?: boolean, | ||
} | ||
const props = defineProps<Props>() | ||
const { overview } = storeToRefs(useValidatorDashboardOverviewStore()) | ||
const list = computed(() => { | ||
const groups = overview.value?.groups ?? [] | ||
if (props.includeAll) { | ||
return [{ id: DAHSHBOARDS_ALL_GROUPS_ID, name: '' }].concat(groups) | ||
} | ||
return groups | ||
}) | ||
const selected = defineModel<number>({ required: true }) | ||
const selectedGroup = computed(() => { | ||
return list.value.find(item => item.id === selected.value) | ||
}) | ||
</script> | ||
|
||
<template> | ||
<BcDropdown | ||
v-model="selected" | ||
:options="list" | ||
option-value="id" | ||
option-label="name" | ||
:placeholder="$t('dashboard.group.selection.placeholder')" | ||
> | ||
<template v-if="selectedGroup" #value> | ||
<span>{{ $t('dashboard.group.selection.group') }}: | ||
<DashboardGroupLabel :group="selectedGroup" /> | ||
</span> | ||
</template> | ||
|
||
<template #option="slotProps"> | ||
<DashboardGroupLabel :group="slotProps" /> | ||
</template> | ||
</BcDropdown> | ||
</template> | ||
|
||
<style lang="scss" scoped></style> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.