Skip to content

Commit 36a1b4f

Browse files
committed
fix(NamespaceOverview): blobs_count & pfb_count
1 parent c6bcc6d commit 36a1b4f

File tree

1 file changed

+23
-6
lines changed

1 file changed

+23
-6
lines changed

components/modules/namespace/NamespaceOverview.vue

Lines changed: 23 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,15 +27,26 @@ const props = defineProps({
2727
},
2828
})
2929
30-
const tabs = ref(["Blobs", "Messages"])
31-
const activeTab = ref(tabs.value[0])
30+
const tabs = ref([
31+
{
32+
name: "Blobs",
33+
icon: "blob",
34+
},
35+
{
36+
name: "Messages",
37+
icon: "message",
38+
},
39+
])
40+
const activeTab = ref(tabs.value[0].name)
3241
3342
const isRefetching = ref(false)
3443
const messages = ref([])
3544
const blobs = ref([])
3645
3746
const page = ref(1)
38-
const pages = computed(() => Math.ceil(props.namespace.pfb_count / 10))
47+
const pages = computed(() => {
48+
return Math.ceil((activeTab.value === "Blobs" ? props.namespace.blobs_count : props.namespace.pfb_count) / 10)
49+
})
3950
const handleNext = () => {
4051
if (page.value === pages.value) return
4152
page.value += 1
@@ -194,6 +205,11 @@ const handleViewRawMessages = () => {
194205
<Text size="12" weight="600" color="secondary"> {{ comma(namespace.pfb_count) }} </Text>
195206
</Flex>
196207
208+
<Flex align="center" justify="between">
209+
<Text size="12" weight="600" color="tertiary"> Blobs</Text>
210+
<Text size="12" weight="600" color="secondary"> {{ comma(namespace.blobs_count) }} </Text>
211+
</Flex>
212+
197213
<Flex align="center" justify="between">
198214
<Text size="12" weight="600" color="tertiary"> Version</Text>
199215
<Text size="12" weight="600" color="secondary"> {{ namespace.version }} </Text>
@@ -213,13 +229,14 @@ const handleViewRawMessages = () => {
213229
<Flex align="center" justify="between" :class="$style.tabs_wrapper">
214230
<Flex gap="4" :class="$style.tabs">
215231
<Flex
216-
@click="activeTab = tab"
232+
@click="activeTab = tab.name"
217233
v-for="tab in tabs"
218234
align="center"
219235
gap="6"
220-
:class="[$style.tab, activeTab === tab && $style.active]"
236+
:class="[$style.tab, activeTab === tab.name && $style.active]"
221237
>
222-
<Text size="13" weight="600">{{ tab }}</Text>
238+
<Icon :name="tab.icon" size="12" color="secondary" />
239+
<Text size="13" weight="600">{{ tab.name }}</Text>
223240
</Flex>
224241
</Flex>
225242
</Flex>

0 commit comments

Comments
 (0)