bfg-common 1.3.618 → 1.3.620
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.
|
@@ -1,206 +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
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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>
|