bfg-common 1.3.620 → 1.3.622

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.
@@ -2481,5 +2481,12 @@
2481
2481
  "embedded": "Убудаваны",
2482
2482
  "offUser": "Адкл. Карыстальнік",
2483
2483
  "addingStorage": "Даданне сховішча",
2484
- "historyTestimony": "Гісторыя паказанняў"
2484
+ "historyTestimony": "Гісторыя паказанняў",
2485
+ "alarmName": "Імя будзільніка",
2486
+ "objectType": "Тып аб'екта",
2487
+ "lastModified": "Апошні раз зменена",
2488
+ "targets": "Мішэні",
2489
+ "alarmRules": "Правілы сігналізацыі",
2490
+ "deleteAlarmDefinition": "Выдаліць вызначэнне будзільніка",
2491
+ "deleteAlarmDefinitionDesc": "Вы ўпэўнены, што хочаце выдаліць вызначэнне будзільніка \"{0}\"?"
2485
2492
  }
@@ -2485,5 +2485,12 @@
2485
2485
  "embedded": "Embedded",
2486
2486
  "offUser": "Off User",
2487
2487
  "addingStorage": "Adding Storage",
2488
- "historyTestimony": "History of testimony"
2488
+ "historyTestimony": "History of testimony",
2489
+ "alarmName": "Alarm Name",
2490
+ "objectType": "Object type",
2491
+ "lastModified": "Last modified",
2492
+ "targets": "Targets",
2493
+ "alarmRules": "Alarm Rules",
2494
+ "deleteAlarmDefinition": "Delete Alarm Definition",
2495
+ "deleteAlarmDefinitionDesc": "Are you sure you want to delete alarm definition '{0}'?"
2489
2496
  }
@@ -2485,5 +2485,12 @@
2485
2485
  "embedded": "Ներկառուցված",
2486
2486
  "offUser": "Անջատված Օգտատեր",
2487
2487
  "addingStorage": "Պահպանման ավելացում",
2488
- "historyTestimony": "Վկայության պատմություն"
2488
+ "historyTestimony": "Վկայության պատմություն",
2489
+ "alarmName": "Ազդանշանի անվանումը",
2490
+ "objectType": "Օբյեկտի տեսակը",
2491
+ "lastModified": "Վերջին փոփոխությունը",
2492
+ "targets": "Թիրախներ",
2493
+ "alarmRules": "Տագնապային կանոններ",
2494
+ "deleteAlarmDefinition": "Ջնջել ահազանգի սահմանումը",
2495
+ "deleteAlarmDefinitionDesc": "Իսկապե՞ս ուզում եք ջնջել «{0}» ահազանգի սահմանումը:"
2489
2496
  }
@@ -2484,5 +2484,12 @@
2484
2484
  "embedded": "Ендірілген",
2485
2485
  "offUser": "Өшірулі Пайдаланушы",
2486
2486
  "addingStorage": "Жад қосу",
2487
- "historyTestimony": "Айғақтар тарихы"
2487
+ "historyTestimony": "Айғақтар тарихы",
2488
+ "alarmName": "Дабыл атауы",
2489
+ "objectType": "Нысан түрі",
2490
+ "lastModified": "Соңғы өзгертілген",
2491
+ "targets": "Мақсаттар",
2492
+ "alarmRules": "Дабыл ережелері",
2493
+ "deleteAlarmDefinition": "Дабыл анықтамасын жою",
2494
+ "deleteAlarmDefinitionDesc": "\"{0}\" дабыл анықтамасын шынымен жойғыңыз келе ме?"
2488
2495
  }
@@ -2487,5 +2487,12 @@
2487
2487
  "embedded": "Встроенный провайдер",
2488
2488
  "offUser": "Откл. Пользователь",
2489
2489
  "addingStorage": "Добавление хранилища",
2490
- "historyTestimony": "История показаний"
2490
+ "historyTestimony": "История показаний",
2491
+ "alarmName": "Имя сигнала тревоги",
2492
+ "objectType": "Тип объекта",
2493
+ "lastModified": "Последнее изменение",
2494
+ "targets": "Цели",
2495
+ "alarmRules": "Правила тревоги",
2496
+ "deleteAlarmDefinition": "Удалить определение тревоги",
2497
+ "deleteAlarmDefinitionDesc": "Вы уверены, что хотите удалить определение будильника «{0}»?"
2491
2498
  }
@@ -2483,5 +2483,12 @@
2483
2483
  "embedded": "嵌入式",
2484
2484
  "offUser": "离开用户",
2485
2485
  "addingStorage": "添加存储空间",
2486
- "historyTestimony": "见证历史"
2486
+ "historyTestimony": "见证历史",
2487
+ "alarmName": "报警名称",
2488
+ "objectType": "对象类型",
2489
+ "lastModified": "上次修改时间",
2490
+ "targets": "目标",
2491
+ "alarmRules": "报警规则",
2492
+ "deleteAlarmDefinition": "删除警报定义",
2493
+ "deleteAlarmDefinitionDesc": "您确定要删除警报定义“{0}”吗?"
2487
2494
  }
@@ -1,210 +1,210 @@
1
- <template>
2
- <div class="hardware-health">
3
- <common-headline :headline="localization.hardwareHealth" />
4
-
5
- <div class="hardware-health__description">
6
- {{ hardwareHealthDescription }}
7
- </div>
8
-
9
- <atoms-tabs
10
- v-model="activeTab"
11
- test-id="hardware-health-tabs"
12
- :items="hardwareHealthTabs"
13
- size="small"
14
- class="hardware-health__tabs"
15
- />
16
-
17
- <atoms-alert
18
- v-if="activeTab === 'storage-sensor'"
19
- :items="['content text']"
20
- status="alert-warning"
21
- test-id="select-storage-sensor-alert"
22
- hide-close-icon
23
- >
24
- <template #default="">
25
- <p>
26
- {{ generateAlertTextWithLink.before }}
27
- <a
28
- :href="generateAlertTextWithLink.link"
29
- data-id="general-alert-text-link"
30
- >
31
- {{ generateAlertTextWithLink.linkText }}
32
- </a>
33
- {{ generateAlertTextWithLink.after }}
34
- </p>
35
- </template>
36
- </atoms-alert>
37
-
38
- <common-pages-hardware-health-tools-panel :selected-tab="activeTab" />
39
-
40
- <common-pages-hardware-health-graph
41
- v-if="activeTab === 'history-testimony'"
42
- :data="props.historyTestimony"
43
- :loading="props.loadingHistoryTestimony"
44
- :is-dark-mode="props.isDarkMode"
45
- :formatted-datetime="props.formattedDatetime"
46
- :get-date-format="props.getDateFormat"
47
- :language="props.language"
48
- />
49
-
50
- <common-pages-hardware-health-table-view
51
- :key="uniqueKey"
52
- v-model:selected="selectedRow"
53
- :data-table="hardwareHealth"
54
- :total-items="hardwareHealth.length"
55
- :total-pages="1"
56
- :table-mode="activeTab"
57
- :loading="props.loading"
58
- />
59
- </div>
60
- </template>
61
-
62
- <script lang="ts" setup>
63
- import type { I_SeriesLine } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
64
- import type { UI_I_Localization } from '~/lib/models/interfaces'
65
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
66
- import type { UI_T_HardwareHealthTabMode } from '~/components/common/pages/hardwareHealth/lib/models/types'
67
- import type { UI_I_StorageSensorsAlert } from '~/components/common/pages/hardwareHealth/lib/models/interfaces'
68
- import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
69
- import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
70
- import { hardwareHealthTabsFunc } from '~/components/common/pages/hardwareHealth/lib/config/tabsPannel'
71
-
72
- const props = defineProps<{
73
- data: UI_I_HardwareHealthSensors[]
74
- loading: boolean
75
- historyTestimony: I_SeriesLine | null
76
- loadingHistoryTestimony: boolean
77
- isDarkMode: boolean
78
- formattedDatetime: any
79
- getDateFormat: any
80
- language: string
81
- }>()
82
-
83
- const emits = defineEmits<{
84
- (event: 'update-chart-data', value: string): void
85
- }>()
86
-
87
- const localization = computed<UI_I_Localization>(() => useLocal())
88
- const { $store }: any = useNuxtApp()
89
-
90
- const activeTab = ref<UI_T_HardwareHealthTabMode>('sensor')
91
- const uniqueKey = ref<number>(0)
92
-
93
- const selectedRow = ref<UI_T_SelectedRow>([])
94
-
95
- const hardwareHealthTabs = computed<UI_I_CollapseNavItem[]>(() =>
96
- hardwareHealthTabsFunc(localization.value)
97
- )
98
-
99
- const hardwareHealth = computed<UI_I_HardwareHealthSensors[]>(
100
- () => props.data || []
101
- )
102
-
103
- const hardwareHealthDescription = computed<string>(() => {
104
- const { thereIsAlertAndWarningOutOfSensors, noAlertsOrWarningsOutOfSensors } =
105
- localization.value
106
-
107
- let alertCount = 0
108
- let warningCount = 0
109
-
110
- hardwareHealth.value.forEach((sensor: UI_I_HardwareHealthSensors) => {
111
- if (sensor.status === 3) alertCount++
112
- if (sensor.status === 2) warningCount++
113
- })
114
-
115
- // const hasStatusTwoOrThree = hardwareHealth.value.some((sensor) =>
116
- // ['warning', 'alert'].includes(sensor.status)
117
- // )
118
-
119
- type Replacements = {
120
- alert: number
121
- warning: number
122
- sensors: number
123
- }
124
-
125
- const hasStatusTwoOrThree = alertCount > 0 || warningCount > 0
126
- const replacements: Replacements = {
127
- alert: alertCount,
128
- warning: warningCount,
129
- sensors: hardwareHealth.value.length || 0,
130
- }
131
- const text = hasStatusTwoOrThree
132
- ? thereIsAlertAndWarningOutOfSensors
133
- : noAlertsOrWarningsOutOfSensors
134
-
135
- return text?.replace(
136
- /{(\w+)}/g,
137
- (_, key: keyof Replacements) => replacements[key]
138
- )
139
- })
140
-
141
- const generateAlertTextWithLink = computed<UI_I_StorageSensorsAlert>(() => {
142
- const { storageSensorsAlert, thisKbArticle } = localization.value
143
-
144
- const [before, after] = storageSensorsAlert.split('{ link }')
145
-
146
- return {
147
- before,
148
- after,
149
- link: 'javascript:void(0)',
150
- linkText: thisKbArticle,
151
- }
152
- })
153
-
154
- const updateChartData = (isSendAll: boolean = false): void => {
155
- const selectedNames: string[] = []
156
- hardwareHealth.value.forEach((item, key) => {
157
- if (isSendAll) {
158
- if (['power', 'temperature'].includes(item.category.toLowerCase()))
159
- selectedNames.push(item.name)
160
- } else if (
161
- ['power', 'temperature'].includes(item.category.toLowerCase()) &&
162
- selectedRow.value.includes(key)
163
- ) {
164
- selectedNames.push(item.name)
165
- }
166
- })
167
- emits('update-chart-data', selectedNames.join(','))
168
- }
169
-
170
- watch(selectedRow, (newValue) => {
171
- newValue.length &&
172
- activeTab.value === 'history-testimony' &&
173
- updateChartData()
174
- })
175
-
176
- watch(activeTab, () => {
177
- uniqueKey.value++
178
- })
179
-
180
- watch(
181
- [hardwareHealth, activeTab],
182
- (newValue) => {
183
- newValue[0].length &&
184
- newValue[1] === 'history-testimony' &&
185
- updateChartData(true)
186
- },
187
- { immediate: true }
188
- )
189
-
190
- onMounted(() => {
191
- $store.dispatch('main/A_CONTINUE_GLOBAL_REFRESH', 'hardwareHealth')
192
- })
193
- onUnmounted(() => {
194
- $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', 'hardwareHealth')
195
- })
196
- </script>
197
-
198
- <style lang="scss" scoped>
199
- @import 'bfg-common/assets/scss/common/global.scss';
200
- .hardware-health {
201
- @extend %block-property;
202
- &__description {
203
- }
204
- &__tabs {
205
- :deep(.nav) {
206
- margin-top: 0;
207
- }
208
- }
209
- }
210
- </style>
1
+ <template>
2
+ <div class="hardware-health">
3
+ <common-headline :headline="localization.hardwareHealth" />
4
+
5
+ <div class="hardware-health__description">
6
+ {{ hardwareHealthDescription }}
7
+ </div>
8
+
9
+ <atoms-tabs
10
+ v-model="activeTab"
11
+ test-id="hardware-health-tabs"
12
+ :items="hardwareHealthTabs"
13
+ size="small"
14
+ class="hardware-health__tabs"
15
+ />
16
+
17
+ <atoms-alert
18
+ v-if="activeTab === 'storage-sensor'"
19
+ :items="['content text']"
20
+ status="alert-warning"
21
+ test-id="select-storage-sensor-alert"
22
+ hide-close-icon
23
+ >
24
+ <template #default="">
25
+ <p>
26
+ {{ generateAlertTextWithLink.before }}
27
+ <a
28
+ :href="generateAlertTextWithLink.link"
29
+ data-id="general-alert-text-link"
30
+ >
31
+ {{ generateAlertTextWithLink.linkText }}
32
+ </a>
33
+ {{ generateAlertTextWithLink.after }}
34
+ </p>
35
+ </template>
36
+ </atoms-alert>
37
+
38
+ <common-pages-hardware-health-tools-panel :selected-tab="activeTab" />
39
+
40
+ <common-pages-hardware-health-graph
41
+ v-if="activeTab === 'history-testimony'"
42
+ :data="props.historyTestimony"
43
+ :loading="props.loadingHistoryTestimony"
44
+ :is-dark-mode="props.isDarkMode"
45
+ :formatted-datetime="props.formattedDatetime"
46
+ :get-date-format="props.getDateFormat"
47
+ :language="props.language"
48
+ />
49
+
50
+ <common-pages-hardware-health-table-view
51
+ :key="uniqueKey"
52
+ v-model:selected="selectedRow"
53
+ :data-table="hardwareHealth"
54
+ :total-items="hardwareHealth.length"
55
+ :total-pages="1"
56
+ :table-mode="activeTab"
57
+ :loading="props.loading"
58
+ />
59
+ </div>
60
+ </template>
61
+
62
+ <script lang="ts" setup>
63
+ import type { I_SeriesLine } from '~/node_modules/bfg-nuxt-3-graph/graph/lib/models/interfaces'
64
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
65
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
66
+ import type { UI_T_HardwareHealthTabMode } from '~/components/common/pages/hardwareHealth/lib/models/types'
67
+ import type { UI_I_StorageSensorsAlert } from '~/components/common/pages/hardwareHealth/lib/models/interfaces'
68
+ import type { UI_I_HardwareHealthSensors } from '~/components/common/pages/hardwareHealth/tableView/lib/models/interfaces'
69
+ import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
70
+ import { hardwareHealthTabsFunc } from '~/components/common/pages/hardwareHealth/lib/config/tabsPannel'
71
+
72
+ const props = defineProps<{
73
+ data: UI_I_HardwareHealthSensors[]
74
+ loading: boolean
75
+ historyTestimony: I_SeriesLine | null
76
+ loadingHistoryTestimony: boolean
77
+ isDarkMode: boolean
78
+ formattedDatetime: any
79
+ getDateFormat: any
80
+ language: string
81
+ }>()
82
+
83
+ const emits = defineEmits<{
84
+ (event: 'update-chart-data', value: string): void
85
+ }>()
86
+
87
+ const localization = computed<UI_I_Localization>(() => useLocal())
88
+ const { $store }: any = useNuxtApp()
89
+
90
+ const activeTab = ref<UI_T_HardwareHealthTabMode>('sensor')
91
+ const uniqueKey = ref<number>(0)
92
+
93
+ const selectedRow = ref<UI_T_SelectedRow>([])
94
+
95
+ const hardwareHealthTabs = computed<UI_I_CollapseNavItem[]>(() =>
96
+ hardwareHealthTabsFunc(localization.value)
97
+ )
98
+
99
+ const hardwareHealth = computed<UI_I_HardwareHealthSensors[]>(
100
+ () => props.data || []
101
+ )
102
+
103
+ const hardwareHealthDescription = computed<string>(() => {
104
+ const { thereIsAlertAndWarningOutOfSensors, noAlertsOrWarningsOutOfSensors } =
105
+ localization.value
106
+
107
+ let alertCount = 0
108
+ let warningCount = 0
109
+
110
+ hardwareHealth.value.forEach((sensor: UI_I_HardwareHealthSensors) => {
111
+ if (sensor.status === 3) alertCount++
112
+ if (sensor.status === 2) warningCount++
113
+ })
114
+
115
+ // const hasStatusTwoOrThree = hardwareHealth.value.some((sensor) =>
116
+ // ['warning', 'alert'].includes(sensor.status)
117
+ // )
118
+
119
+ type Replacements = {
120
+ alert: number
121
+ warning: number
122
+ sensors: number
123
+ }
124
+
125
+ const hasStatusTwoOrThree = alertCount > 0 || warningCount > 0
126
+ const replacements: Replacements = {
127
+ alert: alertCount,
128
+ warning: warningCount,
129
+ sensors: hardwareHealth.value.length || 0,
130
+ }
131
+ const text = hasStatusTwoOrThree
132
+ ? thereIsAlertAndWarningOutOfSensors
133
+ : noAlertsOrWarningsOutOfSensors
134
+
135
+ return text?.replace(
136
+ /{(\w+)}/g,
137
+ (_, key: keyof Replacements) => replacements[key]
138
+ )
139
+ })
140
+
141
+ const generateAlertTextWithLink = computed<UI_I_StorageSensorsAlert>(() => {
142
+ const { storageSensorsAlert, thisKbArticle } = localization.value
143
+
144
+ const [before, after] = storageSensorsAlert.split('{ link }')
145
+
146
+ return {
147
+ before,
148
+ after,
149
+ link: 'javascript:void(0)',
150
+ linkText: thisKbArticle,
151
+ }
152
+ })
153
+
154
+ const updateChartData = (isSendAll: boolean = false): void => {
155
+ const selectedNames: string[] = []
156
+ hardwareHealth.value.forEach((item, key) => {
157
+ if (isSendAll) {
158
+ if (['power', 'temperature'].includes(item.category.toLowerCase()))
159
+ selectedNames.push(item.name)
160
+ } else if (
161
+ ['power', 'temperature'].includes(item.category.toLowerCase()) &&
162
+ selectedRow.value.includes(key)
163
+ ) {
164
+ selectedNames.push(item.name)
165
+ }
166
+ })
167
+ emits('update-chart-data', selectedNames.join(','))
168
+ }
169
+
170
+ watch(selectedRow, (newValue) => {
171
+ newValue.length &&
172
+ activeTab.value === 'history-testimony' &&
173
+ updateChartData()
174
+ })
175
+
176
+ watch(activeTab, () => {
177
+ uniqueKey.value++
178
+ })
179
+
180
+ watch(
181
+ [hardwareHealth, activeTab],
182
+ (newValue) => {
183
+ newValue[0].length &&
184
+ newValue[1] === 'history-testimony' &&
185
+ updateChartData(true)
186
+ },
187
+ { immediate: true }
188
+ )
189
+
190
+ onMounted(() => {
191
+ $store.dispatch('main/A_CONTINUE_GLOBAL_REFRESH', 'hardwareHealth')
192
+ })
193
+ onUnmounted(() => {
194
+ $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', 'hardwareHealth')
195
+ })
196
+ </script>
197
+
198
+ <style lang="scss" scoped>
199
+ @import 'bfg-common/assets/scss/common/global.scss';
200
+ .hardware-health {
201
+ @extend %block-property;
202
+ &__description {
203
+ }
204
+ &__tabs {
205
+ :deep(.nav) {
206
+ margin-top: 0;
207
+ }
208
+ }
209
+ }
210
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.620",
4
+ "version": "1.3.622",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",