-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update(validator dashboard): validator subset states (#654)
* update and map new validator states in the validator subset modal * count based on the groups based and only default to the row data Bids 3232
- Loading branch information
1 parent
e0d9c21
commit 575f079
Showing
10 changed files
with
251 additions
and
102 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
74 changes: 74 additions & 0 deletions
74
frontend/components/dashboard/table/SummaryValidatorsIconRow.vue
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,74 @@ | ||
<script setup lang="ts"> | ||
import { FontAwesomeIcon } from '@fortawesome/vue-fontawesome' | ||
import { | ||
faPowerOff | ||
} from '@fortawesome/pro-solid-svg-icons' | ||
import type { SummaryValidatorsIconRowInfo } from '~/types/validator' | ||
interface Props { | ||
icons: SummaryValidatorsIconRowInfo[] | ||
total?: number | ||
absolute: boolean | ||
} | ||
const props = defineProps<Props>() | ||
const combinedTotal = computed<number>(() => props.total ?? props.icons?.reduce((sum, icon) => sum + icon.count, 0) ?? 0) | ||
</script> | ||
<template> | ||
<div v-for="status in icons" :key="status.key" class="status" :class="status.key"> | ||
<div class="icon"> | ||
<FontAwesomeIcon :icon="faPowerOff" /> | ||
</div> | ||
<BcFormatNumber v-if="absolute" :value="status.count" /> | ||
<BcFormatPercent v-else :value="status.count" :base="combinedTotal" /> | ||
</div> | ||
</template> | ||
|
||
<style lang="scss" scoped> | ||
@use '~/assets/css/utils.scss'; | ||
.status { | ||
display: flex; | ||
align-items: center; | ||
gap: 3px; | ||
.icon { | ||
display: flex; | ||
align-items: center; | ||
justify-content: center; | ||
width: 14px; | ||
height: 14px; | ||
border-radius: 50%; | ||
background-color: var(--text-color-disabled); | ||
svg { | ||
height: 8px; | ||
width: 8px; | ||
} | ||
} | ||
&.online { | ||
.icon { | ||
background-color: var(--positive-color); | ||
color: var(--positive-contrast-color); | ||
} | ||
span { | ||
color: var(--positive-color); | ||
} | ||
} | ||
&.offline { | ||
.icon { | ||
background-color: var(--negative-color); | ||
color: var(--negative-contrast-color); | ||
} | ||
span { | ||
color: var(--negative-color); | ||
} | ||
} | ||
} | ||
</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.