bfg-common 1.5.956 → 1.5.959

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.
@@ -2262,7 +2262,7 @@
2262
2262
  "embedded": "Embedded",
2263
2263
  "offUser": "Off User",
2264
2264
  "addingStorage": "Adding Storage",
2265
- "historyTestimony": "History of testimony",
2265
+ "historyTestimony": "History of Testimony",
2266
2266
  "alarmName": "Alarm Name",
2267
2267
  "objectType": "Object type",
2268
2268
  "lastModified": "Last modified",
@@ -49,47 +49,48 @@
49
49
  <common-pages-backups-modals-restore-name
50
50
  v-model="model"
51
51
  :show="selectedStep.id === dynamicSteps.selectName"
52
- :message-error-field="props.alertMessages[dynamicSteps.selectName][0]"
52
+ :message-error-field="
53
+ props.alertMessages[dynamicSteps.selectName][0]
54
+ "
53
55
  :is-loading="isLoading"
54
56
  />
55
57
  </div>
56
58
  </template>
57
59
  </ui-wizard-block>
58
60
 
59
- <ui-wizard-block
60
- v-if="selectedStep.id === dynamicSteps.selectStorage"
61
- :sub-title-height="height2"
62
- >
63
- <template #subTitle>
64
- <div ref="subTitleBlock2">
65
- <ui-alert
66
- v-if="props.alertMessages[dynamicSteps.selectStorage].length"
67
- :messages="props.alertMessages[dynamicSteps.selectStorage]"
68
- test-id="backup-restore-datastores-error-alert"
69
- type="error"
70
- size="md"
71
- class="mb-4"
72
- />
73
-
74
- <div class="subtitle-block flex-row w-full items-start">
75
- <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
61
+ <div v-show="selectedStep.id === dynamicSteps.selectStorage">
62
+ <ui-wizard-block :sub-title-height="height2">
63
+ <template #subTitle>
64
+ <div ref="subTitleBlock2">
65
+ <ui-alert
66
+ v-if="props.alertMessages[dynamicSteps.selectStorage].length"
67
+ :messages="props.alertMessages[dynamicSteps.selectStorage]"
68
+ test-id="backup-restore-datastores-error-alert"
69
+ type="error"
70
+ size="md"
71
+ class="mb-4"
72
+ />
73
+
74
+ <div class="subtitle-block flex-row w-full items-start">
75
+ <ui-wizard-subtitle :sub-title="selectedStep.subTitle" />
76
+ </div>
76
77
  </div>
77
- </div>
78
- </template>
79
- <template #content>
80
- <div class="restore-select-storage mb-4">
81
- <common-vm-actions-common-select-storage
82
- :storage-submit="props.storageSubmit"
83
- :is-datastore-loading="props.datastoreLoading"
84
- :get-datastore-table-func="getDatastoreTableFunc"
85
- :datastore="props.datastore"
86
- :storage="props.selectedStorage"
87
- hide-alert
88
- @change-storage="onChangeStorage"
89
- />
90
- </div>
91
- </template>
92
- </ui-wizard-block>
78
+ </template>
79
+ <template #content>
80
+ <div class="restore-select-storage mb-4">
81
+ <common-vm-actions-common-select-storage
82
+ :storage-submit="props.storageSubmit"
83
+ :is-datastore-loading="props.datastoreLoading"
84
+ :get-datastore-table-func="getDatastoreTableFunc"
85
+ :datastore="props.datastore"
86
+ :storage="model.pvm.storage"
87
+ hide-alert
88
+ @change-storage="onChangeStorage"
89
+ />
90
+ </div>
91
+ </template>
92
+ </ui-wizard-block>
93
+ </div>
93
94
 
94
95
  <ui-wizard-block
95
96
  v-if="selectedStep.id === dynamicSteps.selectDisks"
@@ -228,7 +229,6 @@ const props = defineProps<{
228
229
  alertMessages: string[][]
229
230
  readyCompleteData: UI_I_TableInfoItem[]
230
231
  storageSubmit: null | Function
231
- selectedStorage: UI_I_DatastoreTableItem | null
232
232
  datastore: UI_I_DatastoreTableItem[]
233
233
  datastoreLoading: boolean
234
234
  networks: UI_I_NetworkTableItem[]
@@ -11,7 +11,6 @@
11
11
  :datastore-loading="props.datastoreLoading"
12
12
  :networks="props.networks"
13
13
  :ready-complete-data="readyToCompleteInfo"
14
- :selected-storage="selectedStorage"
15
14
  :is-loading="isLoading"
16
15
  :errors="errors"
17
16
  @change-storage="onChangeStorage"
@@ -242,12 +241,10 @@ const getDatastoreTableFunc = async (): Promise<void> => {
242
241
  }
243
242
 
244
243
  const selectedStorageName = ref<string>('')
245
- const selectedStorage = ref<UI_I_DatastoreTableItem | null>(null)
246
244
  const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
247
245
  if (!storage) return
248
246
 
249
247
  selectedStorageName.value = storage.name
250
- selectedStorage.value = storage
251
248
  model.value.pvm.storage = {
252
249
  id: storage.id,
253
250
  folder: model.value.pvm.storage.folder || '',
@@ -105,9 +105,14 @@ watch(
105
105
  const onSelectRow = (value: UI_I_DataTableBody[]): void => {
106
106
  const allNotDisks =
107
107
  model.value.filter((row) => row.device_type !== 'disk') || []
108
+
109
+ const selectedSources = value.map(
110
+ (item) => item.data[0]?.data?.data?.source || ''
111
+ )
112
+
108
113
  model.value = [
109
114
  ...allNotDisks,
110
- ...value.map((item) => item.data[0]?.data?.data),
115
+ ...(props.disks.filter((item) => selectedSources.includes(item.source)) || []),
111
116
  ]
112
117
  }
113
118
  </script>
@@ -182,7 +182,7 @@ const statusCounts = computed<UI_I_IndicatorAlerts>(() => {
182
182
 
183
183
  <style scoped lang="scss">
184
184
  .hardware-health {
185
- padding-top: 6px;
185
+ padding-top: 16px;
186
186
 
187
187
  &-title {
188
188
  color: var(--title-form-first-color);
@@ -191,6 +191,10 @@ const statusCounts = computed<UI_I_IndicatorAlerts>(() => {
191
191
  .tab-list {
192
192
  overflow-x: auto;
193
193
  min-height: max-content;
194
+
195
+ &::-webkit-scrollbar {
196
+ height: 0;
197
+ }
194
198
  }
195
199
 
196
200
  :deep(.ui-alert-item.lg) {
@@ -65,13 +65,21 @@ const props = defineProps<{
65
65
  const localization = computed<UI_I_Localization>(() => useLocal())
66
66
  </script>
67
67
 
68
+ <style>
69
+ :root {
70
+ --chip-line-bg: #e9ebeda3;
71
+ }
72
+ :root.dark-theme {
73
+ --chip-line-bg: #e9ebed1f;
74
+ }
75
+ </style>
68
76
  <style scoped lang="scss">
69
77
  .chip-item {
70
78
  &:not(:first-child)::before {
71
79
  content: '';
72
80
  width: 1px;
73
81
  height: 20px;
74
- background: #e9ebeda3;
82
+ background: var(--chip-line-bg);
75
83
  margin-right: 16px;
76
84
  }
77
85
 
@@ -8,9 +8,15 @@
8
8
  :total-items="props.totalItems"
9
9
  :texts="texts"
10
10
  :skeleton="tableSkeleton"
11
- :size="tableSize"
11
+ size="md"
12
12
  test-id="hardware-health-table"
13
13
  >
14
+ <template #skeleton-header>
15
+ <div class="flex gap-4 justify-between items-center">
16
+ <ui-skeleton-item width="80" height="20" />
17
+ <ui-skeleton-item width="112" height="36" border-radius="8" />
18
+ </div>
19
+ </template>
14
20
  <template v-if="props.tableMode !== 'history-testimony'" #insteadOfTitleActions>
15
21
  <ui-button
16
22
  test-id="vm-migrate-configure-button"
@@ -37,7 +43,7 @@
37
43
  item.data.statusText
38
44
  }}</span>
39
45
  </ui-chip>
40
- <div v-if="item.data.warning" class="ml-2">
46
+ <div v-if="item.data.warning" class="ml-2 hardware-health-tooltip">
41
47
  <common-pages-hardware-health-tooltip
42
48
  :id="row"
43
49
  :text="item.data.warning"
@@ -45,7 +51,7 @@
45
51
  />
46
52
  </div>
47
53
  </div>
48
- <div v-else class="flex gap-1">
54
+ <div v-else class="flex gap-1 items-center">
49
55
  <span :class="item.data.iconClassName" />
50
56
  <span class="text-ellipsis">{{ item.text }}</span>
51
57
  </div>
@@ -98,30 +104,38 @@ const table: any = {
98
104
  'history-testimony': historyTestimonyTable,
99
105
  }
100
106
 
101
- const tableSize = computed<string>(() => (props.loading ? 'sm' : 'md'))
102
-
103
- const tableTitle = ref<string>(localization.value.common.sensors)
107
+ const tableTitle = computed<string>(() => {
108
+ switch (props.tableMode) {
109
+ case 'sensor':
110
+ return localization.value.common.sensors
111
+ case 'history-testimony':
112
+ return localization.value.common.sensors
113
+ case 'storage-sensor':
114
+ return localization.value.common.storageSensors
115
+ case 'alert-warning':
116
+ return localization.value.common.alertsAndWarnings
117
+ case 'system-log':
118
+ return localization.value.common.systemEvents
119
+ default:
120
+ return ''
121
+ }
122
+ })
104
123
  watch(() => props.tableMode, (newValue) => {
105
124
  switch (newValue) {
106
125
  case 'sensor':
107
126
  tableSkeleton.value.columnsCount = 6
108
- tableTitle.value = localization.value.common.sensors
109
127
  break
110
128
  case 'history-testimony':
111
129
  tableSkeleton.value.columnsCount = 4
112
- tableTitle.value = localization.value.common.sensors
113
130
  break
114
131
  case 'storage-sensor':
115
132
  tableSkeleton.value.columnsCount = 3
116
- tableTitle.value = localization.value.common.storageSensors
117
133
  break
118
134
  case 'alert-warning':
119
135
  tableSkeleton.value.columnsCount = 3
120
- tableTitle.value = localization.value.common.alertsAndWarnings
121
136
  break
122
137
  case 'system-log':
123
138
  tableSkeleton.value.columnsCount = 2
124
- tableTitle.value = localization.value.common.systemEvents
125
139
  break
126
140
  }
127
141
  })
@@ -142,7 +156,7 @@ const texts = computed<UI_I_TableTexts>(() => ({
142
156
  }))
143
157
 
144
158
  const tableSkeleton = ref<UI_I_DataTableSkeleton>({
145
- withoutPagination: true,
159
+ withoutPagination: false,
146
160
  columnsCount: 6
147
161
  })
148
162
 
@@ -150,7 +164,7 @@ const data = computed<UI_I_DataTable>(() => ({
150
164
  id: 'hardware-health-table',
151
165
  header: tableHeadItems.value,
152
166
  body: tableBodyItems.value,
153
- title: `${tableTitle.value}(${props.totalItems})`
167
+ title: `${tableTitle.value} (${props.totalItems})`
154
168
  }))
155
169
 
156
170
  const tableHeadItems = computed<UI_I_DataTableHeader[]>(() =>
@@ -159,16 +173,16 @@ const tableHeadItems = computed<UI_I_DataTableHeader[]>(() =>
159
173
 
160
174
  const tableBodyItems = ref<UI_I_DataTableBody[]>([])
161
175
  watch(
162
- () => props.tableData,
163
- (newValue) => {
176
+ [() => props.tableData, localization],
177
+ ([newValue]) => {
164
178
  if (!newValue?.length) {
165
179
  tableBodyItems.value = []
166
180
  return
167
181
  }
168
182
 
169
183
  tableBodyItems.value = table[props.tableMode].getBodyDataFunc(
170
- newValue,
171
- localization.value
184
+ newValue,
185
+ localization.value
172
186
  )
173
187
  },
174
188
  { deep: true, immediate: true }
@@ -182,8 +196,35 @@ const onUpdateTable = () => {
182
196
 
183
197
  <style lang="scss" scoped>
184
198
  .hardware-health-table {
199
+ .hardware-health-tooltip {
200
+ margin-top: 2px;
201
+ }
202
+ :deep(.table-title-actions-container) {
203
+ grid-column-gap: 16px;
204
+ }
185
205
  :deep(.table-container) {
186
206
  grid-template-rows: auto 1fr;
187
207
  }
208
+ :deep(.row-size-md .ui-main-no-items-found) {
209
+ top: 50%;
210
+ }
211
+ :deep(.data-table-skeleton) {
212
+ height: 100%;
213
+ overflow: hidden;
214
+ }
215
+ :deep(.body.with-actions) {
216
+ height: calc(100% - 86px);
217
+ }
218
+ :deep(.body-row > .body-col:last-child) {
219
+ display: none !important;
220
+ }
221
+ :deep(.default-header > div:last-child) {
222
+ width: 112px !important;
223
+ height: 36px !important;
224
+ }
225
+ :deep(.default-header > div:first-child .skeleton-item) {
226
+ width: 80px !important;
227
+ height: 20px !important;
228
+ }
188
229
  }
189
230
  </style>
@@ -46,7 +46,12 @@ export const getHeaderDataFunc = (
46
46
  }
47
47
  ]
48
48
  export const options: UI_I_DataTableOptions = {
49
- perPageOptions: [{ text: '10', value: 100, default: true }],
49
+ perPageOptions: [
50
+ { text: '10', value: 10, default: true },
51
+ { text: '25', value: 25 },
52
+ { text: '50', value: 50 },
53
+ { text: '100', value: 100 },
54
+ ],
50
55
  isSelectable: false,
51
56
  showPagination: true,
52
57
  showPageInfo: true,
@@ -62,8 +67,6 @@ export const getBodyDataFunc = (
62
67
  bodyData: UI_I_HardwareHealthSensors[],
63
68
  localization: UI_I_Localization
64
69
  ): UI_I_DataTableBody[] => {
65
- const { $formattedDatetime }: any = useNuxtApp()
66
-
67
70
  return bodyData.map((sensor, _index: number) => {
68
71
  return {
69
72
  row: sensor.id as number,
@@ -57,7 +57,12 @@ export const getHeaderDataFunc = (
57
57
  },
58
58
  ]
59
59
  export const options: UI_I_DataTableOptions = {
60
- perPageOptions: [{ text: '10', value: 100, default: true }],
60
+ perPageOptions: [
61
+ { text: '10', value: 10, default: true },
62
+ { text: '25', value: 25 },
63
+ { text: '50', value: 50 },
64
+ { text: '100', value: 100 },
65
+ ],
61
66
  isSelectable: false,
62
67
  showPagination: true,
63
68
  showPageInfo: true,
@@ -73,8 +78,6 @@ export const getBodyDataFunc = (
73
78
  bodyData: UI_I_HardwareHealthSensors[],
74
79
  localization: UI_I_Localization
75
80
  ): UI_I_DataTableBody[] => {
76
- const { $formattedDatetime }: any = useNuxtApp()
77
-
78
81
  return bodyData.map((sensor, _index: number) => {
79
82
 
80
83
  return {
@@ -41,7 +41,7 @@ export const getHeaderDataFunc = (
41
41
  text: localization.common.reading,
42
42
  isSortable: true,
43
43
  sort: 'asc',
44
- width: '128px',
44
+ width: '144px',
45
45
  show: true,
46
46
  filter: true,
47
47
  },
@@ -51,7 +51,7 @@ export const getHeaderDataFunc = (
51
51
  text: localization.common.categories,
52
52
  isSortable: true,
53
53
  sort: 'asc',
54
- width: '144px',
54
+ width: '160px',
55
55
  show: true,
56
56
  filter: true,
57
57
  },
@@ -77,7 +77,12 @@ export const getHeaderDataFunc = (
77
77
  },
78
78
  ]
79
79
  export const options: UI_I_DataTableOptions = {
80
- perPageOptions: [{ text: '10', value: 100, default: true }],
80
+ perPageOptions: [
81
+ { text: '10', value: 10, default: true },
82
+ { text: '25', value: 25 },
83
+ { text: '50', value: 50 },
84
+ { text: '100', value: 100 },
85
+ ],
81
86
  isSelectable: false,
82
87
  showPagination: true,
83
88
  showPageInfo: true,
@@ -41,7 +41,12 @@ export const getHeaderDataFunc = (
41
41
  }
42
42
  ]
43
43
  export const options: UI_I_DataTableOptions = {
44
- perPageOptions: [{ text: '10', value: 100, default: true }],
44
+ perPageOptions: [
45
+ { text: '10', value: 10, default: true },
46
+ { text: '25', value: 25 },
47
+ { text: '50', value: 50 },
48
+ { text: '100', value: 100 },
49
+ ],
45
50
  isSelectable: false,
46
51
  showPagination: true,
47
52
  showPageInfo: true,
@@ -31,7 +31,12 @@ export const getHeaderDataFunc = (
31
31
  }
32
32
  ]
33
33
  export const options: UI_I_DataTableOptions = {
34
- perPageOptions: [{ text: '10', value: 100, default: true }],
34
+ perPageOptions: [
35
+ { text: '10', value: 10, default: true },
36
+ { text: '25', value: 25 },
37
+ { text: '50', value: 50 },
38
+ { text: '100', value: 100 },
39
+ ],
35
40
  isSelectable: false,
36
41
  showPagination: true,
37
42
  showPageInfo: true,
@@ -11,6 +11,7 @@
11
11
  info="warning"
12
12
  type="click"
13
13
  width="320"
14
+ :margin-between-trigger="8"
14
15
  @open="isShowTooltip = true"
15
16
  @close="isShowTooltip = false"
16
17
  />
@@ -38,9 +39,23 @@ const isShowTooltip = ref<boolean>(false)
38
39
 
39
40
  <style scoped lang="scss">
40
41
  .tooltip-info {
42
+ :deep(.tooltip) {
43
+ min-width: 320px;
44
+ }
45
+ :deep(.tooltip.popped) {
46
+ min-width: max-content;
47
+ }
48
+
49
+ :deep(.tooltip:not(.variant-2).md .tooltip-info-header span) {
50
+ font-size: 14px;
51
+ }
52
+ :deep(.tooltip:not(.variant-2).md .tooltip-info-body span) {
53
+ font-size: 13px;
54
+ font-weight: 400;
55
+ }
41
56
  :deep(.tooltip-info-close) {
42
57
  position: static;
43
- margin-left: 25px;
58
+ margin-left: auto;
44
59
  }
45
60
 
46
61
  &__icon {
@@ -63,7 +63,6 @@ const props = withDefaults(
63
63
  datastore: UI_I_DatastoreTableItem[]
64
64
  isDatastoreLoading: boolean
65
65
  errors: string[]
66
- selectedStorage: UI_I_DatastoreTableItem | null
67
66
  compatibility: [UI_T_CompatibilityStatus, string]
68
67
  hideCompatibility?: boolean
69
68
  }>(),
@@ -6,7 +6,6 @@
6
6
  :datastore="props.datastore"
7
7
  :is-datastore-loading="props.isDatastoreLoading"
8
8
  :errors="errors"
9
- :selected-storage="selectedStorage"
10
9
  :hide-compatibility="props.hideCompatibility"
11
10
  :hide-alert="props.hideAlert"
12
11
  :is-in-wizard="props.isInWizard"
@@ -100,8 +99,8 @@ const setStorageFromProps = (): void => {
100
99
  }
101
100
  watch(
102
101
  () => props.storage,
103
- () => {
104
- setStorageFromProps()
102
+ (newValue, oldValue) => {
103
+ if (newValue?.id !== oldValue?.id) setStorageFromProps()
105
104
  },
106
105
  { immediate: true }
107
106
  )
@@ -89,7 +89,6 @@ const props = withDefaults(
89
89
  datastore: UI_I_DatastoreTableItem[]
90
90
  isDatastoreLoading: boolean
91
91
  errors: string[]
92
- selectedStorage: UI_I_DatastoreTableItem | null
93
92
  compatibility: [UI_T_CompatibilityStatus, string]
94
93
  hideCompatibility?: boolean
95
94
  hideAlert?: boolean
@@ -146,15 +145,19 @@ watch(
146
145
  // { deep: true }
147
146
  )
148
147
 
149
- watch(selectedRow, (newValue) => {
150
- if (newValue && props.datastore.length) {
151
- data.value.body = tableBodyFunc(
152
- props.datastore,
153
- localization.value,
154
- newValue
155
- )
156
- }
157
- })
148
+ watch(
149
+ selectedRow,
150
+ (newValue) => {
151
+ if (newValue && props.datastore.length) {
152
+ data.value.body = tableBodyFunc(
153
+ props.datastore,
154
+ localization.value,
155
+ newValue
156
+ )
157
+ }
158
+ },
159
+ { once: true }
160
+ )
158
161
 
159
162
  const onSelectRow = (selectedData: UI_I_DataTable): void => {
160
163
  const selectedId = selectedData[0]?.data[0]?.data.id
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.956",
4
+ "version": "1.5.959",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",