From 490e8995b9a5a22368cd6a20c8b69ba2046e34ee Mon Sep 17 00:00:00 2001 From: "Alisa | Side.one" Date: Tue, 6 Jun 2023 15:11:27 +0800 Subject: [PATCH] feat: badge add background color --- src/modules/[chain]/consensus/index.vue | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/modules/[chain]/consensus/index.vue b/src/modules/[chain]/consensus/index.vue index 7fd2a280..d1080a9b 100644 --- a/src/modules/[chain]/consensus/index.vue +++ b/src/modules/[chain]/consensus/index.vue @@ -73,6 +73,12 @@ function showName(i, text) { const val = validators.value.find((x) => x.hex.startsWith(txt)); return `${val?.description?.moniker || txt} - ${sig[2]}`; } +function color(i, txt) { + if (i === roundState?.proposer?.index) { + return txt === 'nil-Vote' ? 'dark' : 'primary'; + } + return txt === 'nil-Vote' ? 'secondary' : 'success'; +} function onChange() { httpstatus.value = 200; httpStatusText.value = ''; @@ -246,25 +252,27 @@ async function update() { -
+
-

+

Updated at {{ newTime || '' }}

-
Round: {{ item.round }}
-
{{ item.prevotes_bit_array }}
- -
+
Round: {{ item.round }}
+
{{ item.prevotes_bit_array }}
+ +
- {{ showName(i, pre) }}
+ {{ color(i, pre) }} ??? + {{ showName(i, pre) }} +