bfg-common 1.4.457 → 1.4.459

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -2825,7 +2825,8 @@
2825
2825
  "noClosedSessions": "На дадзены момант закрытых сеансаў няма.",
2826
2826
  "noSelectedSession": "Калі ласка, не забудзьцеся выбраць сеанс, каб праглядзець яго дэталі.",
2827
2827
  "endTime": "Час заканчэння",
2828
- "channels": "Каналы ({0})"
2828
+ "channels": "Каналы ({0})",
2829
+ "metricsNotFound": "Паказчыкі не знойдзены"
2829
2830
  },
2830
2831
  "vmWizard": {
2831
2832
  "devices": "Прылады ({0})"
@@ -2829,7 +2829,8 @@
2829
2829
  "noClosedSessions": "There are currently no closed sessions available.",
2830
2830
  "noSelectedSession": "Please make sure to select a session to view its details.",
2831
2831
  "endTime": "End time",
2832
- "channels": "Channels ({0})"
2832
+ "channels": "Channels ({0})",
2833
+ "metricsNotFound": "Metrics not found"
2833
2834
  },
2834
2835
  "vmWizard": {
2835
2836
  "devices": "Devices ({0})"
@@ -2829,7 +2829,8 @@
2829
2829
  "noClosedSessions": "Ներկայումս փակ նիստեր չկան:",
2830
2830
  "noSelectedSession": "Խնդրում ենք համոզվեք, որ ընտրել եք նիստ՝ դրա մանրամասները դիտելու համար:",
2831
2831
  "endTime": "Ավարտի ժամանակը",
2832
- "channels": "Ալիքներ ({0})"
2832
+ "channels": "Ալիքներ ({0})",
2833
+ "metricsNotFound": "Չափանիշները չեն գտնվել"
2833
2834
  },
2834
2835
  "vmWizard": {
2835
2836
  "devices": "Սարքեր ({0})"
@@ -2828,7 +2828,8 @@
2828
2828
  "noClosedSessions": "Қазіргі уақытта жабық сеанстар жоқ.",
2829
2829
  "noSelectedSession": "Мәліметтерін көру үшін сеансты таңдағаныңызға көз жеткізіңіз.",
2830
2830
  "endTime": "Аяқталу уақыты",
2831
- "channels": "Арналар ({0})"
2831
+ "channels": "Арналар ({0})",
2832
+ "metricsNotFound": "Көрсеткіштер табылмады"
2832
2833
  },
2833
2834
  "vmWizard": {
2834
2835
  "devices": "Құрылғылар ({0})"
@@ -2830,7 +2830,8 @@
2830
2830
  "noClosedSessions": "На данный момент закрытых сессий нет.",
2831
2831
  "noSelectedSession": "Обязательно выберите сеанс, чтобы просмотреть его подробности.",
2832
2832
  "endTime": "Время окончания",
2833
- "channels": "Каналы ({0})"
2833
+ "channels": "Каналы ({0})",
2834
+ "metricsNotFound": "Метрики не найдены"
2834
2835
  },
2835
2836
  "vmWizard": {
2836
2837
  "devices": "Устройства ({0})"
@@ -2827,7 +2827,8 @@
2827
2827
  "noClosedSessions": "目前没有可用的闭门会议。",
2828
2828
  "noSelectedSession": "请确保选择一个会话以查看其详细信息。",
2829
2829
  "endTime": "结束时间",
2830
- "channels": "频道 ({0})"
2830
+ "channels": "频道 ({0})",
2831
+ "metricsNotFound": "未找到指标"
2831
2832
  },
2832
2833
  "vmWizard": {
2833
2834
  "devices": "设备 ({0})"
@@ -2,6 +2,8 @@
2
2
  <div class="home-resource">
3
3
  <common-pages-home-resource-new
4
4
  v-if="isNewView"
5
+ :items="props.items"
6
+ :loading="false"
5
7
  ></common-pages-home-resource-new>
6
8
 
7
9
  <common-pages-home-resource-old
@@ -1,10 +1,41 @@
1
1
  <template>
2
- <div></div>
2
+ <ui-widget v-for="(item, key) in resourceMeter" :key="key">
3
+ <template v-if="props.loading">
4
+ <ui-widget-items-skeleton-line-bar />
5
+ </template>
6
+ <ui-widget-items-progress-bar-linear
7
+ v-else
8
+ id="host-summary-memory"
9
+ container-id="host"
10
+ :icon="item.icon"
11
+ :title="item.title"
12
+ :data="item.data"
13
+ :used-title="item.usedTitle"
14
+ :capacity-title="item.capacityTitle"
15
+ :status="item.status"
16
+ />
17
+ </ui-widget>
3
18
  </template>
4
19
 
5
20
  <script lang="ts" setup>
6
- </script>
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+ import type {
23
+ UI_I_ResourceMeter,
24
+ UI_I_MeterBlockItem,
25
+ } from '~/components/common/home/lib/models/interfaces'
26
+ import type { UI_I_ResourceBlock } from '~/components/common/pages/home/resource/lib/models/interfaces'
27
+ import { constructResourceMeter } from '~/components/common/pages/home/resource/lib/utils/resourceMeter'
28
+
29
+ const props = defineProps<{
30
+ items: UI_I_ResourceMeter<UI_I_MeterBlockItem>[]
31
+ loading: boolean
32
+ }>()
7
33
 
8
- <style lang="scss" scoped>
34
+ const localization = computed<UI_I_Localization>(() => useLocal())
35
+
36
+ const resourceMeter = computed<UI_I_ResourceBlock[]>(() =>
37
+ constructResourceMeter(props.items, localization.value)
38
+ )
39
+ </script>
9
40
 
10
- </style>
41
+ <style lang="scss" scoped></style>
@@ -0,0 +1,12 @@
1
+ import type { UI_I_ProgressWidgetData } from '~/node_modules/bfg-uikit/components/ui/widget/lib/models/interfaces'
2
+
3
+ export interface UI_I_ResourceBlock {
4
+ id: string
5
+ containerId?: string
6
+ icon: string
7
+ title: string
8
+ data: UI_I_ProgressWidgetData
9
+ usedTitle: string
10
+ capacityTitle: string
11
+ status: string
12
+ }
@@ -0,0 +1,50 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type {
3
+ UI_I_ResourceMeter,
4
+ UI_I_MeterBlockItem,
5
+ } from '~/components/common/home/lib/models/interfaces'
6
+ import type { UI_I_ResourceBlock } from '~/components/common/pages/home/resource/lib/models/interfaces'
7
+
8
+ export const constructResourceMeter = (
9
+ data: UI_I_ResourceMeter<UI_I_MeterBlockItem>[],
10
+ localization: UI_I_Localization
11
+ ): UI_I_ResourceBlock[] => {
12
+ if (!data) return []
13
+
14
+ return (
15
+ data
16
+ .filter((item) => ['memory', 'storage'].includes(item.type))
17
+ .map((item, key) => {
18
+ let title = ''
19
+ let icon = ''
20
+
21
+ switch (item.type) {
22
+ case 'memory':
23
+ title = localization.common.memory
24
+ icon = 'widget-memory'
25
+ break
26
+ case 'storage':
27
+ title = localization.common.storage
28
+ icon = 'widget-datastore'
29
+ break
30
+ }
31
+
32
+ return {
33
+ id: `${item.type}-${key}`,
34
+ containerId: `${key}`,
35
+ icon,
36
+ title,
37
+ data: {
38
+ used: item.used.text,
39
+ usedPureValue: item.used.value,
40
+ capacity: item.capacity.text,
41
+ capacityPureValue: item.capacity.value,
42
+ free: item.free.text,
43
+ },
44
+ usedTitle: localization.common.used,
45
+ capacityTitle: localization.common.capacity,
46
+ status: localization.common.available,
47
+ }
48
+ }) || []
49
+ )
50
+ }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.457",
4
+ "version": "1.4.459",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",