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,76 +0,0 @@
1
- <template>
2
- <component
3
- :is="currentComponent"
4
- :data-table="props.dataTable?.items || []"
5
- :total-items="props.dataTable?.items.length || 1"
6
- :total-pages="1"
7
- :pagination="pagination"
8
- :loading="props.isLoading"
9
- @pagination="onUpdatePagination"
10
- @sort="onSortTable"
11
- />
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
16
- import type {
17
- UI_I_Alarm,
18
- UI_I_AlarmPayload,
19
- } from '~/components/common/layout/bottomPanel/alarms/lib/models/interfaces'
20
-
21
- const props = defineProps<{
22
- dataTable: UI_I_Alarm | null
23
- isLoading: boolean
24
- }>()
25
-
26
- const emits = defineEmits<{
27
- (event: 'pause-global-refresh'): void
28
- (event: 'get-alarms', value: UI_I_AlarmPayload): void
29
- }>()
30
-
31
- const { $store }: any = useNuxtApp()
32
-
33
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
34
-
35
- const currentComponent = computed(() =>
36
- isNewView.value
37
- ? defineAsyncComponent(() => import('./new/New.vue'))
38
- : defineAsyncComponent(() => import('./old/Old.vue'))
39
- )
40
-
41
- const sort = ref<string | null>(null)
42
- const pagination = ref<UI_I_Pagination>({
43
- page: 1,
44
- pageSize: 35,
45
- })
46
-
47
- const getAlarms = (): void => {
48
- pauseGlobalRefresh()
49
-
50
- const payload: UI_I_AlarmPayload = {
51
- ...pagination.value,
52
- sortBy: sort.value || '',
53
- }
54
- emits('get-alarms', payload)
55
- }
56
- const pauseGlobalRefresh = (): void => {
57
- emits('pause-global-refresh')
58
- }
59
- getAlarms()
60
-
61
- const onUpdatePagination = (event: UI_I_Pagination): void => {
62
- pagination.value = event
63
- getAlarms()
64
- }
65
-
66
- const onSortTable = (event: string): void => {
67
- sort.value = event
68
- getAlarms()
69
- }
70
-
71
- onUnmounted(() => {
72
- pauseGlobalRefresh()
73
- })
74
- </script>
75
-
76
- <style scoped lang="scss"></style>
@@ -1,23 +0,0 @@
1
- import type {
2
- API_UI_I_DataTable,
3
- UI_I_Pagination,
4
- } from '~/lib/models/table/interfaces'
5
-
6
- export interface UI_I_AlarmPayload extends UI_I_Pagination {
7
- sortBy: string
8
- }
9
-
10
- export interface UI_API_I_AlarmItem {
11
- id: number
12
- object: string
13
- status: string
14
- name: string
15
- triggered: string
16
- acknowledged: string
17
- acknowledged_by: string
18
- triggering_event: string
19
- statusIcon: string
20
- }
21
- export interface UI_I_AlarmItem extends UI_API_I_AlarmItem {}
22
-
23
- export interface UI_I_Alarm extends API_UI_I_DataTable<UI_I_AlarmItem> {}
@@ -1,212 +0,0 @@
1
- <template>
2
- <ui-data-table
3
- :data="data"
4
- :options="options"
5
- :loading="props.loading"
6
- test-id="bottom-alarms-table"
7
- classes="alarms-table"
8
- @sort="onSorting"
9
- >
10
- <template #icon="{ item }">
11
- <span class="flex-align-center">
12
- <span :class="['icon', item.data.icon]" />
13
-
14
- <span
15
- :data-id="`rtask-${item.data.testId}`"
16
- :class="item.data.isLink && 'target-link'"
17
- @click="onSelectNodeOfTree(item.data)"
18
- >
19
- {{ item.text }}
20
- </span>
21
- </span>
22
- </template>
23
-
24
- <template #status="{ item }">
25
- <ui-chip :test-id="item.data.testId" :color="item.data.chipColor" rounded>
26
- <ui-icon
27
- :name="item.data.icon"
28
- width="14px"
29
- height="14px"
30
- class="chip-icon"
31
- ></ui-icon>
32
- {{ item.text }}
33
- </ui-chip>
34
- </template>
35
-
36
- <template #default-actions="{ item }">
37
- <div class="actions">
38
- <ui-button
39
- :test-id="`resent-task-item-${item.data.id}-action`"
40
- variant="text"
41
- is-without-height
42
- is-without-sizes
43
- @click.stop="onShowActions(item.data.id)"
44
- >
45
- <ui-icon
46
- :class="['action-icon', { active: actionsIsShow[item.data.id] }]"
47
- name="vertical-dotes"
48
- width="24"
49
- />
50
- </ui-button>
51
- <ui-dropdown
52
- :show="actionsIsShow[item.data.id]"
53
- :test-id="`resent-task-item-action-${item.data.id}`"
54
- :items="actions"
55
- :elem-id="`resent-task-item-${item.data.id}-action`"
56
- width="max-content"
57
- @select="onSelectAction(item.data.target, $event, item.data.id)"
58
- @hide="onHideActionsDropdown(item.data.id)"
59
- @click.stop
60
- >
61
- <template #row="{ item: dropMenu }">
62
- <ui-icon
63
- v-if="dropMenu.iconName === 'hide'"
64
- name="password-hide"
65
- width="16"
66
- height="16"
67
- />
68
- <span class="action-text">
69
- {{ dropMenu.text }}
70
- </span>
71
- </template>
72
- </ui-dropdown>
73
- </div>
74
- </template>
75
- </ui-data-table>
76
- </template>
77
-
78
- <script setup lang="ts">
79
- import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
80
- import type {
81
- UI_I_DataTable,
82
- UI_I_DataTableHeader,
83
- UI_I_DataTableBody,
84
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
85
- import type { UI_I_Localization } from '~/lib/models/interfaces'
86
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
87
- import type { UI_I_DataTargetForTable } from '~/components/common/layout/bottomPanel/recentTasks/lib/models/interfaces'
88
- import type { UI_I_AlarmItem } from '~/components/common/layout/bottomPanel/alarms/new/lib/models/interfaces'
89
- import {
90
- getAlarmRowQuickActionsFunc,
91
- options,
92
- getHeaderDataFunc,
93
- getBodyDataFunc,
94
- } from '~/components/common/layout/bottomPanel/alarms/new/lib/config/config'
95
-
96
- const props = defineProps<{
97
- dataTable: UI_I_AlarmItem[]
98
- loading: boolean
99
- pagination: UI_I_Pagination
100
- }>()
101
- const emits = defineEmits<{
102
- (event: 'sort', value: string): void
103
- }>()
104
-
105
- const localization = computed<UI_I_Localization>(() => useLocal())
106
- // const { $store }: any = useNuxtApp()
107
-
108
- const actionsIsShow = ref<boolean[]>([])
109
-
110
- const data = computed<UI_I_DataTable>(() => ({
111
- id: 'bottom-alarms-table',
112
- header: resentTaskHeadItems.value,
113
- body: resentTaskBodyItems.value,
114
- }))
115
-
116
- const resentTaskHeadItems = computed<UI_I_DataTableHeader[]>(() =>
117
- getHeaderDataFunc(localization.value)
118
- )
119
-
120
- const resentTaskBodyItems = ref<UI_I_DataTableBody[]>([])
121
- watch(
122
- () => props.dataTable,
123
- (newValue) => {
124
- if (!newValue?.length) return
125
-
126
- resentTaskBodyItems.value = getBodyDataFunc(newValue)
127
- },
128
- { deep: true, immediate: true }
129
- )
130
- const onSorting = (value: string): void => {
131
- emits('sort', value)
132
- }
133
-
134
- const actions = computed<UI_I_Dropdown[]>(() =>
135
- getAlarmRowQuickActionsFunc(localization.value)
136
- )
137
- const onShowActions = (id: number): void => {
138
- actionsIsShow.value[id] = true
139
- }
140
- const onSelectAction = (
141
- _data: UI_I_DataTargetForTable,
142
- action: string,
143
- actionId: number
144
- ): void => {
145
- switch (action) {
146
- case 'view-object':
147
- // onSelectNodeOfTree(data)
148
- break
149
- case 'alarm-details':
150
- break
151
- case 'event-details':
152
- break
153
- }
154
- onHideActionsDropdown(actionId)
155
- }
156
- const onHideActionsDropdown = (id: number): void => {
157
- actionsIsShow.value[id] = false
158
- }
159
-
160
- // const onSelectNodeOfTree = (data: UI_I_DataTargetForTable): void => {
161
- // const { type, id, nav } = data
162
- //
163
- // const node = {
164
- // id,
165
- // type,
166
- // }
167
- //
168
- // const path = `/inventory/type=${type};nav=${nav};id=${id}/summary`
169
- // navigateTo(path)
170
- //
171
- // $store.dispatch('inventory/A_SELECT_NODE', { node, type })
172
- // }
173
- </script>
174
-
175
- <style scoped lang="scss">
176
- .alarms-table {
177
- height: inherit;
178
-
179
- .target-link {
180
- font-family: 'Inter', sans-serif;
181
- font-size: 13px;
182
- color: var(--bottom-pannel-rtask-link-text);
183
- font-weight: 400;
184
- line-height: 15.73px;
185
- cursor: pointer;
186
- &:hover {
187
- color: var(--bottom-pannel-rtask-link-hover-text);
188
- }
189
- }
190
- .chip-icon {
191
- min-width: 14px;
192
- margin-right: 4px;
193
- }
194
- .icon {
195
- margin-right: 4px;
196
- }
197
-
198
- .action-icon {
199
- width: 16px;
200
- height: 16px;
201
- fill: var(--summary-dropdown-notification-item-action-color);
202
-
203
- &.active {
204
- fill: var(--summary-dropdown-notification-item-hover-action-color);
205
- }
206
- }
207
-
208
- .action-text {
209
- margin-left: 8px;
210
- }
211
- }
212
- </style>
@@ -1,193 +0,0 @@
1
- import type {
2
- UI_I_DataTableBody,
3
- UI_I_DataTableOptions,
4
- UI_I_DataTableHeader,
5
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
6
- import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
7
- import type { UI_I_Localization } from '~/lib/models/interfaces'
8
- import type { UI_I_AlarmItem } from '~/components/common/layout/bottomPanel/alarms/new/lib/models/interfaces'
9
- import {
10
- UI_E_RTaskChipColor,
11
- UI_E_RTaskStatusIcon,
12
- } from '~/components/common/pages/tasks/table/lib/models/enums'
13
- import { UI_E_TaskTypeToCorrectType } from '~/components/common/layout/bottomPanel/alarms/new/lib/models/enums'
14
- import { UI_E_NodeIconsByState } from '~/lib/models/enums'
15
-
16
- export const getHeaderDataFunc = (
17
- localization: UI_I_Localization
18
- ): UI_I_DataTableHeader[] => [
19
- {
20
- col: 0,
21
- colName: 'object',
22
- text: localization.common.object,
23
- isSortable: true,
24
- sort: 'asc',
25
- sortColumn: true,
26
- width: '180px',
27
- show: true,
28
- filter: true,
29
- },
30
- {
31
- col: 1,
32
- colName: 'status',
33
- text: localization.common.status,
34
- isSortable: true,
35
- sort: 'asc',
36
- width: '180px',
37
- show: true,
38
- filter: true,
39
- },
40
- {
41
- col: 2,
42
- colName: 'name',
43
- text: localization.common.name,
44
- isSortable: true,
45
- sort: 'asc',
46
- width: '180px',
47
- show: true,
48
- filter: true,
49
- },
50
- {
51
- col: 3,
52
- colName: 'triggered',
53
- text: localization.layout.triggered,
54
- isSortable: true,
55
- sort: 'asc',
56
- width: '180px',
57
- show: true,
58
- filter: true,
59
- },
60
- {
61
- col: 4,
62
- colName: 'acknowledged',
63
- text: localization.layout.acknowledged,
64
- isSortable: true,
65
- sort: 'asc',
66
- width: '180px',
67
- show: true,
68
- filter: true,
69
- },
70
- {
71
- col: 5,
72
- colName: 'acknowledgedBy',
73
- text: localization.layout.acknowledgedBy,
74
- isSortable: true,
75
- sort: 'asc',
76
- width: '180px',
77
- show: true,
78
- filter: true,
79
- },
80
- {
81
- col: 6,
82
- colName: 'triggeringEvent',
83
- text: localization.layout.triggeringEvent,
84
- isSortable: true,
85
- sort: 'asc',
86
- width: '180px',
87
- show: true,
88
- filter: true,
89
- },
90
- {
91
- col: 7,
92
- colName: 'default-actions',
93
- text: '',
94
- show: true,
95
- },
96
- ]
97
- export const getAlarmRowQuickActionsFunc = (
98
- localization: UI_I_Localization
99
- ): UI_I_Dropdown[] => [
100
- {
101
- value: 'view-object',
102
- text: localization.common.viewObject,
103
- iconName: 'hide',
104
- selected: false,
105
- },
106
- {
107
- value: 'alarm-details',
108
- text: localization.common.alarmDetails,
109
- iconName: 'icon-policies-profiles',
110
- selected: false,
111
- },
112
- {
113
- value: 'event-details',
114
- text: localization.common.eventDetails,
115
- iconName: 'icon-policies-profiles',
116
- selected: false,
117
- },
118
- ]
119
-
120
- export const options: UI_I_DataTableOptions = {
121
- perPageOptions: [
122
- { text: '10', value: 10 },
123
- { text: '50', value: 50 },
124
- { text: '100', value: 100 },
125
- ],
126
- isSelectable: false,
127
- isFocusable: false,
128
- showPagination: true,
129
- showPageInfo: true,
130
- isSortable: true,
131
- server: false,
132
- isResizable: true,
133
- showSearch: false,
134
- showColumnManager: true,
135
- withActions: true,
136
- inBlock: true,
137
- inBlockOnlyLightMode: true,
138
- }
139
-
140
- export const getBodyDataFunc = (
141
- bodyData: UI_I_AlarmItem[]
142
- ): UI_I_DataTableBody[] => {
143
- return bodyData.map((alarm: UI_I_AlarmItem, index: number) => {
144
- const correctType =
145
- UI_E_TaskTypeToCorrectType[
146
- alarm?.targetType as keyof typeof UI_E_TaskTypeToCorrectType
147
- ]
148
- const iconClassName = UI_E_NodeIconsByState[`${correctType}_Normal`]
149
-
150
- const objectData = {
151
- id: alarm.id,
152
- icon: iconClassName,
153
- }
154
-
155
- const statusData = {
156
- icon: UI_E_RTaskStatusIcon[alarm.statusIcon],
157
- chipColor: UI_E_RTaskChipColor[alarm.status],
158
- testId: `${alarm.name}-progress`,
159
- }
160
-
161
- return {
162
- row: index,
163
- collapse: false,
164
- isHiddenCollapse: false,
165
- collapseToggle: false,
166
- data: [
167
- {
168
- key: 'icon',
169
- col: 0,
170
- text: alarm.object,
171
- data: objectData,
172
- },
173
- {
174
- key: 'status',
175
- col: 1,
176
- text: alarm.status,
177
- data: statusData,
178
- },
179
- { key: 'icon', col: 2, text: alarm.name },
180
- { col: 3, text: alarm.triggered },
181
- { col: 4, text: alarm.acknowledged },
182
- { col: 5, text: alarm.acknowledged_by },
183
- { key: 'icon', col: 6, text: alarm.triggering_event },
184
- {
185
- key: 'default-actions',
186
- col: 7,
187
- text: '',
188
- data: { id: index },
189
- },
190
- ],
191
- }
192
- })
193
- }
@@ -1,10 +0,0 @@
1
- export enum UI_E_TaskTypeToCorrectType {
2
- 'Zones' = 'zone',
3
- 'Datacenters' = 'datacenter',
4
- 'Clusters' = 'cluster',
5
- 'Hosts' = 'host',
6
- 'VirtualMachines' = 'vm',
7
- 'Datastores' = 'datastore',
8
- 'Networks' = 'network',
9
- }
10
-
@@ -1,12 +0,0 @@
1
- export interface UI_API_I_AlarmItem {
2
- id: number
3
- object: string
4
- status: string
5
- name: string
6
- triggered: string
7
- acknowledged: string
8
- acknowledged_by: string
9
- triggering_event: string
10
- statusIcon: string
11
- }
12
- export interface UI_I_AlarmItem extends UI_API_I_AlarmItem {}