bfg-common 1.5.674 → 1.5.676

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.
Files changed (26) hide show
  1. package/components/common/pages/auth/TheFooter.vue +104 -0
  2. package/lib/models/enums.ts +1 -65
  3. package/package.json +1 -1
  4. package/components/common/layout/bottomPanel/BottomPanel.vue +0 -80
  5. package/components/common/layout/bottomPanel/New.vue +0 -239
  6. package/components/common/layout/bottomPanel/Old.vue +0 -154
  7. package/components/common/layout/bottomPanel/alarms/Alarms.vue +0 -76
  8. package/components/common/layout/bottomPanel/alarms/lib/models/interfaces.ts +0 -23
  9. package/components/common/layout/bottomPanel/alarms/new/New.vue +0 -212
  10. package/components/common/layout/bottomPanel/alarms/new/lib/config/config.ts +0 -193
  11. package/components/common/layout/bottomPanel/alarms/new/lib/models/enums.ts +0 -10
  12. package/components/common/layout/bottomPanel/alarms/new/lib/models/interfaces.ts +0 -12
  13. package/components/common/layout/bottomPanel/alarms/old/Old.vue +0 -191
  14. package/components/common/layout/bottomPanel/alarms/old/lib/config/alarmTables.ts +0 -89
  15. package/components/common/layout/bottomPanel/alarms/old/lib/config/tableKeys.ts +0 -11
  16. package/components/common/layout/bottomPanel/alarms/old/lib/models/types.ts +0 -8
  17. package/components/common/layout/bottomPanel/lib/config/statusFilter.ts +0 -19
  18. package/components/common/layout/bottomPanel/lib/models/types.ts +0 -1
  19. package/components/common/layout/bottomPanel/recentTasks/RecentTasks.vue +0 -43
  20. package/components/common/layout/bottomPanel/recentTasks/lib/models/interfaces.ts +0 -14
  21. package/components/common/layout/bottomPanel/recentTasks/new/New.vue +0 -419
  22. package/components/common/layout/bottomPanel/recentTasks/new/lib/config/config.ts +0 -259
  23. package/components/common/layout/bottomPanel/recentTasks/old/Old.vue +0 -275
  24. package/components/common/layout/bottomPanel/recentTasks/old/lib/config/recentTaskTable.ts +0 -240
  25. package/components/common/layout/bottomPanel/recentTasks/old/lib/config/tableKeys.ts +0 -15
  26. package/components/common/layout/bottomPanel/recentTasks/old/lib/models/types.ts +0 -14
@@ -1,275 +0,0 @@
1
- <template>
2
- <div class="data-table-view">
3
- <atoms-table-data-grid
4
- v-model:selected-row="selectedRow"
5
- v-model:column-keys="columnKeys"
6
- v-model:page-size="paginationLocal.pageSize"
7
- v-model:page="paginationLocal.page"
8
- :head-items="headItems"
9
- :body-items="bodyItems"
10
- :total-items="props.totalItems"
11
- :total-pages="props.totalPages"
12
- :items-per-page="itemsPerPage"
13
- :loading="props.loading"
14
- test-id="bottom-panel-table"
15
- class="data-table"
16
- row-attribute-id-name="data-recent-tasks-id"
17
- hide-pagination
18
- server-off
19
- @sorting="onSorting"
20
- >
21
- <template #icon="{ item }">
22
- <div v-if="item.data.isIconSvg" class="data-table-view__col-icon">
23
- <atoms-the-icon :name="item.data.iconClassName" />
24
- </div>
25
- <span v-else :class="['datagrid-cell-icon', item.data.iconClassName]" />
26
- <a
27
- v-if="item.data.isLink"
28
- :id="item.data.id"
29
- :data-id="`rtask-${item.data.testId}`"
30
- :title="item.text"
31
- href="javascript:void(0)"
32
- class="text-ellipsis"
33
- @click="onSelectNodeOfTree(item)"
34
- >{{ item.text }}</a
35
- >
36
- <span
37
- v-else
38
- :data-id="`rtask-${item.data.testId}`"
39
- :title="item.text"
40
- class="text-ellipsis"
41
- >
42
- {{ item.text }}
43
- </span>
44
-
45
- <div v-if="item.data.operations?.length">
46
- <div
47
- :id="'status-details-help-icon' + item.id"
48
- class="status-details-help-icon signpost-container relative"
49
- >
50
- <atoms-the-icon
51
- :data-id="'toggle-status-details-help-icon' + item.id"
52
- fill="#0072a3"
53
- width="21px"
54
- height="21px"
55
- name="info-circle"
56
- class="cursor-pointer"
57
- @click.stop="
58
- item.data.isShowStatusDetails = !item.data.isShowStatusDetails
59
- "
60
- />
61
- <atoms-tooltip-signpost
62
- v-if="item.data.isShowStatusDetails"
63
- :elem-id="'status-details-help-icon' + item.id"
64
- test-id="select-datastore-type"
65
- @hide="item.data.isShowStatusDetails = false"
66
- >
67
- <ul class="status-details flex flex-col">
68
- <li
69
- v-for="(item2, key2) in item.data.operations"
70
- :key="key2"
71
- :data-id="item2.testId"
72
- class="status-detail-item flex flex-align-baseline"
73
- >
74
- <atoms-the-icon
75
- :name="item2.iconClassName"
76
- width="16px"
77
- height="16px"
78
- />
79
- <span>{{ item2.operation_type }}:</span>
80
- <span
81
- :title="item2.message"
82
- class="status-detail-item-message"
83
- >{{ item2.message || '--' }}</span
84
- >
85
- </li>
86
- </ul>
87
- </atoms-tooltip-signpost>
88
- </div>
89
- </div>
90
- </template>
91
-
92
- <template #action>
93
- <div class="flex-space-between flex-align-center">
94
- <div class="flex-align-center">
95
- <div class="select">
96
- <select
97
- id="bottom-panel-select-type"
98
- v-model="selectedStatus"
99
- data-id="bottom-panel-select-type-select"
100
- class="clr-select"
101
- >
102
- <option :value="-1">{{ localization.common.all }}</option>
103
- <option :value="1">{{ localization.common.running }}</option>
104
- <option :value="3">{{ localization.common.failed }}</option>
105
- </select>
106
- </div>
107
- </div>
108
- </div>
109
- </template>
110
- </atoms-table-data-grid>
111
- </div>
112
- </template>
113
-
114
- <script lang="ts" setup>
115
- import type {
116
- UI_I_ColumnKey,
117
- UI_I_HeadItem,
118
- UI_I_BodyItem,
119
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
120
- import type { UI_I_Localization } from '~/lib/models/interfaces'
121
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
122
- import type { UI_I_TreeNodeShort } from '~/components/common/recursionTree/lib/models/interfaces'
123
- import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
124
- import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
125
- import type { UI_T_SelectedStatus } from '~/components/common/layout/bottomPanel/recentTasks/old/lib/models/types'
126
- import type { UI_I_SelectNodePayload } from '~/components/common/pages/home/widgets/warnings/table/lib/models/interfaces'
127
- import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
128
- import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
129
- import * as table from '~/components/common/layout/bottomPanel/recentTasks/old/lib/config/recentTaskTable'
130
-
131
- const props = defineProps<{
132
- dataTable: UI_I_RecentTaskItem<UI_T_NodeType>[]
133
- pagination: UI_I_Pagination
134
- totalItems: number
135
- totalPages: number
136
- loading: boolean
137
- }>()
138
- const emits = defineEmits<{
139
- (event: 'pagination', value: UI_I_Pagination | null): void
140
- (event: 'sort', value: string): void
141
- }>()
142
-
143
- const localization = computed<UI_I_Localization>(() => useLocal())
144
-
145
- const selectedRow = ref<number[]>([])
146
-
147
- const selectedStatus = ref<UI_T_SelectedStatus>(-1)
148
-
149
- const onSorting = (event: [number, boolean]): void => {
150
- const [column, status] = event
151
- const direction = status ? 'desc' : 'asc'
152
-
153
- const sort = `${column}.${direction}`
154
-
155
- emits('sort', sort)
156
- }
157
-
158
- const paginationLocal = ref<UI_I_Pagination | null>(null)
159
- watch(
160
- () => props.pagination,
161
- (newValue) => {
162
- paginationLocal.value = newValue
163
- },
164
- { immediate: true }
165
- )
166
- watch(
167
- paginationLocal,
168
- (newValue) => {
169
- emits('pagination', newValue)
170
- },
171
- { deep: true, immediate: true }
172
- )
173
-
174
- const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
175
- watch(localization, () => {
176
- columnKeys.value = table.columnKeys(localization.value)
177
- })
178
-
179
- const headItems = computed<UI_I_HeadItem[]>(() =>
180
- table.headItems(localization.value)
181
- )
182
-
183
- const { $store }: any = useNuxtApp()
184
- const timeFormat = computed<UI_T_TimeValue>(
185
- () => $store.getters['main/getTimeFormat']
186
- )
187
-
188
- const bodyItems = ref<UI_I_BodyItem[][]>([])
189
- watch(
190
- [
191
- (): UI_I_RecentTaskItem<UI_T_NodeType>[] => props.dataTable,
192
- selectedStatus,
193
- timeFormat,
194
- localization,
195
- ],
196
- ([newValue1]) => {
197
- if (!newValue1?.length) {
198
- bodyItems.value = []
199
- return
200
- }
201
-
202
- bodyItems.value = table.bodyItems(newValue1, selectedStatus.value)
203
- },
204
- { deep: true, immediate: true }
205
- )
206
-
207
- const onSelectNodeOfTree = (data: UI_I_BodyItem): void => {
208
- const { type, id, nav } = data.data
209
-
210
- const node: UI_I_TreeNodeShort = {
211
- id,
212
- type,
213
- }
214
-
215
- // useLocalStorage('sSpec', node)
216
-
217
- const path = `/inventory/type=${type};nav=${nav};id=${id}/summary`
218
-
219
- navigateTo(path)
220
-
221
- const payload: UI_I_SelectNodePayload = {
222
- node,
223
- type,
224
- }
225
- $store.dispatch('inventory/A_SELECT_NODE', payload)
226
- }
227
- </script>
228
-
229
- <style lang="scss" scoped>
230
- .data-table-view {
231
- height: inherit;
232
- .data-table {
233
- height: inherit;
234
- :deep(.datagrid-outer-wrapper) {
235
- height: inherit;
236
-
237
- .datagrid-footer__action {
238
- width: 100%;
239
-
240
- .select {
241
- margin-left: 10px;
242
- }
243
- }
244
- }
245
- }
246
- &__col-icon {
247
- min-width: 16px;
248
- height: 16px;
249
- margin-right: 2px;
250
- }
251
- &__action {
252
- padding-left: 0.3rem;
253
- }
254
-
255
- .status-details-help-icon {
256
- margin: 4px 0 0 2px;
257
- }
258
- .status-details {
259
- gap: 4px;
260
-
261
- .status-detail-item {
262
- gap: 4px;
263
-
264
- .status-detail-item-message {
265
- max-width: 200px;
266
- margin-left: 4px;
267
- }
268
-
269
- span {
270
- color: var(--table-color) !important;
271
- }
272
- }
273
- }
274
- }
275
- </style>
@@ -1,240 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type {
3
- UI_I_BodyItem,
4
- UI_I_ColumnKey,
5
- UI_I_HeadItem,
6
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
7
- import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
8
- import type { UI_I_DataTargetForTable } from '~/components/common/layout/bottomPanel/recentTasks/lib/models/interfaces'
9
- import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
10
- import type { UI_T_SelectedStatus } from '~/components/common/layout/bottomPanel/recentTasks/old/lib/models/types'
11
- import { UI_E_NodeIconsByState } from '~/lib/models/enums'
12
- import { UI_E_TabsByTypeEnum } from '~/components/common/pages/home/widgets/warnings/table/lib/models/enums'
13
- import { UI_E_LocatorByRecentTaskStatus } from '~/lib/models/store/tasks/enums'
14
- import { recentTaskTableKeys } from '~/components/common/layout/bottomPanel/recentTasks/old/lib/config/tableKeys'
15
- import {
16
- constructColumnKey,
17
- constructHeadItem,
18
- } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
19
-
20
- const getItems = (
21
- localization: UI_I_Localization
22
- ): [string, boolean, string, string][] => {
23
- return [
24
- [localization.tasks.taskName, true, '120px', recentTaskTableKeys[0]],
25
- [localization.common.target, true, '180px', recentTaskTableKeys[1]],
26
- [localization.common.status, true, '180px', recentTaskTableKeys[2]],
27
- [localization.common.details, true, '180px', recentTaskTableKeys[3]],
28
- [localization.common.initiator, true, '180px', recentTaskTableKeys[4]],
29
- [localization.common.queuedFor, true, '180px', recentTaskTableKeys[5]],
30
- [localization.common.startTime, true, '180px', recentTaskTableKeys[6]],
31
- [localization.common.completionTime, true, '180px', recentTaskTableKeys[7]],
32
- [localization.common.executionTime, true, '180px', recentTaskTableKeys[8]],
33
- [localization.common.server, true, '180px', recentTaskTableKeys[9]],
34
- [localization.common.zone, true, '180px', recentTaskTableKeys[10]],
35
- ]
36
- }
37
-
38
- export const columnKeys = (
39
- localization: UI_I_Localization
40
- ): UI_I_ColumnKey[] => {
41
- const result: UI_I_ColumnKey[] = []
42
- getItems(localization).forEach((item, i) => {
43
- const col = i === 1 || i === 2 || i === 10 ? 'icon' : `col${i}`
44
- result.push(constructColumnKey(col, item[0], item[1]))
45
- })
46
- return result
47
- }
48
-
49
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
50
- const result: UI_I_HeadItem[] = []
51
- getItems(localization).forEach((item, i) => {
52
- const col = i === 1 || i === 2 || i === 10 ? 'icon' : `col${i}`
53
- result.push(
54
- constructHeadItem(
55
- col,
56
- item[0],
57
- item[3],
58
- true,
59
- item[2],
60
- '',
61
- `recent-task-${item[3]}`
62
- )
63
- )
64
- })
65
- return result
66
- }
67
-
68
- export const bodyItems = (
69
- data: UI_I_RecentTaskItem<UI_T_NodeType>[],
70
- status: UI_T_SelectedStatus
71
- ): UI_I_BodyItem[][] => {
72
- const localization = useLocal()
73
- const { $formattedDatetime, $time }: any = useNuxtApp()
74
-
75
- const currentLanguage:
76
- | 'en_US'
77
- | 'ru_RU'
78
- | 'hy_AM'
79
- | 'be_BY'
80
- | 'kk_KZ'
81
- | 'zh_CHS' = useLocalStorage('lang') || 'en_US'
82
-
83
- const bodyItems: UI_I_BodyItem[][] = []
84
-
85
- data.forEach((recent: UI_I_RecentTaskItem<UI_T_NodeType>, key) => {
86
- if (status !== -1 && recent.status !== status) return
87
-
88
- const iconClassName = UI_E_NodeIconsByState[`${recent.targetType}_Normal`]
89
- const id = recent.extra?.created_id || recent.target
90
- const name =
91
- recent.extra?.created_name || recent.args?.cloned_name || recent.target
92
- const targetData: UI_I_DataTargetForTable = {
93
- iconClassName,
94
- id,
95
- // id: recent.target,
96
- nav: UI_E_TabsByTypeEnum[recent.targetType],
97
- type: recent.targetType,
98
- isLink: !!iconClassName,
99
- testId: `${recent.targetType}-item-${name}`,
100
- }
101
-
102
- const statusData = {
103
- iconClassName: recent.statusIcon,
104
- isIconSvg: true,
105
- testId: `${recent.taskName}-${
106
- UI_E_LocatorByRecentTaskStatus[recent.status]
107
- }-progress`,
108
- operations: recent.statusDetails,
109
- isShowStatusDetails: false,
110
- }
111
-
112
- const zoneData: UI_I_DataTargetForTable = {
113
- iconClassName: 'vsphere-icon-vcenter',
114
- id: recent.zone,
115
- nav: 'v', // неважно
116
- type: 'vm', // неважно
117
- isLink: false,
118
- testId: `${recent.zone}-item-${name}`,
119
- }
120
-
121
- const startTime = recent[recentTaskTableKeys[6]]
122
- const formattedStartTime =
123
- startTime === '--'
124
- ? '--'
125
- : $formattedDatetime(+startTime * 1000, {
126
- hasSeconds: true,
127
- })
128
-
129
- const completionTime = recent[recentTaskTableKeys[7]]
130
- const formattedCompletionTime =
131
- completionTime === '--'
132
- ? '--'
133
- : $formattedDatetime(+completionTime * 1000, {
134
- hasSeconds: true,
135
- })
136
-
137
- // const queuedFor = `${recent[recentTaskTableKeys[5]]} ms`
138
- // const executionTime =
139
- // recent[recentTaskTableKeys[8]] === '--'
140
- // ? '--'
141
- // : `${recent[recentTaskTableKeys[8]]} ms`
142
- const queuedFor = $time.formatTime(
143
- recent[recentTaskTableKeys[5]],
144
- currentLanguage
145
- )
146
- const executionTime =
147
- recent[recentTaskTableKeys[8]] === '--'
148
- ? '--'
149
- : $time.formatTime(recent[recentTaskTableKeys[8]], currentLanguage)
150
-
151
- bodyItems.push([
152
- {
153
- key: 'col0',
154
- text: recent[recentTaskTableKeys[0]],
155
- id: key,
156
- dataId: recent.id,
157
- testId: `table-item-${recent.id}-${name}`,
158
- },
159
- {
160
- key: 'icon',
161
- text: recent[recentTaskTableKeys[1]],
162
- data: targetData,
163
- id: key,
164
- testId: `table-item-${recent.id}-${name}`,
165
- },
166
- {
167
- key: 'icon',
168
- text:
169
- localization.common[recent[recentTaskTableKeys[2]]] ||
170
- recent[recentTaskTableKeys[2]],
171
- data: statusData,
172
- id: key,
173
- testId: `table-item-${recent.id}-${name}`,
174
- },
175
- {
176
- key: 'col3',
177
- text: recent[recentTaskTableKeys[3]],
178
- id: key,
179
- testId: `table-item-${recent.id}-${name}`,
180
- },
181
- {
182
- key: 'col4',
183
- text: recent[recentTaskTableKeys[4]],
184
- id: key,
185
- testId: `table-item-${recent.id}-${name}`,
186
- },
187
- {
188
- key: 'col5',
189
- text: queuedFor,
190
- id: key,
191
- testId: `table-item-${recent.id}-${name}`,
192
- data: {
193
- sortValue: recent[recentTaskTableKeys[5]],
194
- },
195
- },
196
- {
197
- key: 'col6',
198
- text: formattedStartTime,
199
- id: key,
200
- testId: `table-item-${recent.id}-${name}`,
201
- data: {
202
- sortValue: recent[recentTaskTableKeys[6]],
203
- },
204
- },
205
- {
206
- key: 'col7',
207
- text: formattedCompletionTime,
208
- id: key,
209
- testId: `table-item-${recent.id}-${name}`,
210
- data: {
211
- sortValue: recent[recentTaskTableKeys[7]],
212
- },
213
- },
214
- {
215
- key: 'col8',
216
- text: executionTime,
217
- id: key,
218
- testId: `table-item-${recent.id}-${name}`,
219
- data: {
220
- sortValue: recent[recentTaskTableKeys[8]],
221
- },
222
- },
223
- {
224
- key: 'col9',
225
- text: recent[recentTaskTableKeys[9]],
226
- id: key,
227
- testId: `table-item-${recent.id}-${name}`,
228
- },
229
- {
230
- key: 'icon',
231
- text: recent[recentTaskTableKeys[10]],
232
- data: zoneData,
233
- id: key,
234
- testId: `table-item-${recent.id}-${name}`,
235
- },
236
- ])
237
- })
238
-
239
- return bodyItems
240
- }
@@ -1,15 +0,0 @@
1
- import type { UI_T_RecentTaskTableKeys } from '~/components/common/layout/bottomPanel/recentTasks/old/lib/models/types'
2
-
3
- export const recentTaskTableKeys: UI_T_RecentTaskTableKeys[] = [
4
- 'taskName',
5
- 'target',
6
- 'statusText',
7
- 'details',
8
- 'initiator',
9
- 'queuedFor',
10
- 'startTime',
11
- 'completion',
12
- 'execution',
13
- 'server',
14
- 'zone',
15
- ]
@@ -1,14 +0,0 @@
1
- export type UI_T_RecentTaskTableKeys =
2
- | 'taskName'
3
- | 'target'
4
- | 'statusText'
5
- | 'details'
6
- | 'initiator'
7
- | 'queuedFor'
8
- | 'startTime'
9
- | 'completion'
10
- | 'execution'
11
- | 'server'
12
- | 'zone'
13
-
14
- export type UI_T_SelectedStatus = -1 | 1 | 3