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,191 +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="pagination.pageSize"
7
- v-model:page="pagination.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.data)"
34
- >{{ item.text }}</a
35
- >
36
- <span v-else :title="item.text" class="text-ellipsis">
37
- {{ item.text }}
38
- </span>
39
- </template>
40
-
41
- <template #action>
42
- <div class="flex-space-between flex-align-center">
43
- <div class="flex-align-center"></div>
44
- </div>
45
- </template>
46
- </atoms-table-data-grid>
47
- </div>
48
- </template>
49
-
50
- <script lang="ts" setup>
51
- import type { UI_T_TimeValue } from '~/components/common/layout/theHeader/userMenu/modals/preferences/timeFormat/lib/models/types'
52
- import type {
53
- UI_I_ColumnKey,
54
- UI_I_HeadItem,
55
- UI_I_BodyItem,
56
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
57
- import type { UI_I_Localization } from '~/lib/models/interfaces'
58
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
59
- import type { UI_I_DataTargetForTable } from '~/components/common/layout/bottomPanel/recentTasks/lib/models/interfaces'
60
- import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
61
- import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
62
- import type { UI_T_LangValue } from '~/lib/models/types'
63
- import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
64
- import { UI_E_TaskTypeToCorrectType } from '~/components/common/layout/bottomPanel/alarms/new/lib/models/enums'
65
- import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
66
- import * as alarmTables from '~/components/common/layout/bottomPanel/alarms/old/lib/config/alarmTables'
67
-
68
- const props = defineProps<{
69
- dataTable: UI_I_RecentTaskItem<UI_T_NodeType>[]
70
- totalItems: number
71
- totalPages: number
72
- pagination: UI_I_Pagination
73
- loading: boolean
74
- }>()
75
- const emits = defineEmits<{
76
- (event: 'pagination', value: UI_I_Pagination | null): void
77
- (event: 'sort', value: string): void
78
- }>()
79
-
80
- const { $store }: any = useNuxtApp()
81
-
82
- const localization = computed<UI_I_Localization>(() => useLocal())
83
-
84
- const selectedRow = ref<UI_T_SelectedRow>([])
85
-
86
- const onSorting = (event: [number, boolean]): void => {
87
- const [column, status] = event
88
- const direction = status ? 'desc' : 'asc'
89
-
90
- const sort = `${column}.${direction}`
91
-
92
- emits('sort', sort)
93
- }
94
-
95
- const pagination = ref<UI_I_Pagination | null>(null)
96
- watch(
97
- () => props.pagination,
98
- (newValue) => {
99
- pagination.value = newValue
100
- },
101
- { immediate: true }
102
- )
103
- watch(
104
- pagination,
105
- (newValue) => {
106
- emits('pagination', newValue)
107
- },
108
- { deep: true, immediate: true }
109
- )
110
-
111
- const columnKeys = ref<UI_I_ColumnKey[]>(
112
- alarmTables.columnKeys(localization.value)
113
- )
114
- const headItems = computed<UI_I_HeadItem[]>(() =>
115
- alarmTables.headItems(localization.value)
116
- )
117
- const timeFormat = computed<UI_T_TimeValue>(
118
- () => $store.getters['main/getTimeFormat']
119
- )
120
-
121
- const interfaceLang = computed<UI_T_LangValue>(
122
- () => $store.getters['main/getInterfaceLang']
123
- )
124
-
125
- const bodyItems = ref<UI_I_BodyItem[][]>([])
126
- watch(
127
- [
128
- (): UI_I_RecentTaskItem<UI_T_NodeType>[] => props.dataTable,
129
- timeFormat,
130
- interfaceLang,
131
- ],
132
- ([newValue1]) => {
133
- if (!newValue1?.length) {
134
- bodyItems.value = []
135
- return
136
- }
137
-
138
- bodyItems.value = alarmTables.bodyItems(newValue1)
139
- },
140
- { deep: true, immediate: true }
141
- )
142
-
143
- const onSelectNodeOfTree = (item: UI_I_DataTargetForTable): void => {
144
- const id = item.id
145
- const type = UI_E_TaskTypeToCorrectType[item.type]
146
- let nav = item.nav
147
- switch (type) {
148
- case 'zone':
149
- case 'datacenter':
150
- case 'folder':
151
- nav = useRoute().params.nav || nav
152
- break
153
- }
154
-
155
- const params = `type=${type};nav=${nav};id=${id}`
156
- const path = `/inventory/${params}`
157
-
158
- // Переход в inventory
159
- navigateTo({
160
- path,
161
- })
162
- }
163
- </script>
164
-
165
- <style lang="scss" scoped>
166
- .data-table-view {
167
- height: inherit;
168
- .data-table {
169
- height: inherit;
170
- :deep(.datagrid-outer-wrapper) {
171
- height: inherit;
172
-
173
- .datagrid-footer__action {
174
- width: 100%;
175
-
176
- .select {
177
- margin-left: 10px;
178
- }
179
- }
180
- }
181
- }
182
- &__col-icon {
183
- min-width: 16px;
184
- height: 16px;
185
- margin-right: 2px;
186
- }
187
- &__action {
188
- padding-left: 0.3rem;
189
- }
190
- }
191
- </style>
@@ -1,89 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type {
3
- UI_I_ColumnKey,
4
- UI_I_HeadItem,
5
- UI_I_BodyItem,
6
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
7
- import type { UI_I_AlarmItem } from '~/components/common/layout/bottomPanel/alarms/new/lib/models/interfaces'
8
- import {
9
- constructColumnKey,
10
- constructHeadItem,
11
- } from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
12
- import { alarmsTableKeys } from '~/components/common/layout/bottomPanel/alarms/old/lib/config/tableKeys'
13
-
14
- const getItems = (
15
- localization: UI_I_Localization
16
- ): [string, boolean, string, string][] => {
17
- return [
18
- [localization.common.object, true, '96px', alarmsTableKeys[0]],
19
- [localization.common.status, true, '180px', alarmsTableKeys[1]],
20
- [localization.common.name, true, '250px', alarmsTableKeys[2]],
21
- [localization.layout.triggered, true, '180px', alarmsTableKeys[3]],
22
- [localization.layout.acknowledged, true, '180px', alarmsTableKeys[4]],
23
- [localization.layout.acknowledgedBy, true, '180px', alarmsTableKeys[5]],
24
- [localization.layout.triggeringEvent, true, '180px', alarmsTableKeys[6]],
25
- ]
26
- }
27
-
28
- export const columnKeys = (
29
- localization: UI_I_Localization
30
- ): UI_I_ColumnKey[] => {
31
- const result: UI_I_ColumnKey[] = []
32
- getItems(localization).forEach((item, i) => {
33
- const col = i === 0 ? 'icon' : `col${i}`
34
- result.push(constructColumnKey(col, item[0], item[1]))
35
- })
36
- return result
37
- }
38
-
39
- export const headItems = (localization: UI_I_Localization): UI_I_HeadItem[] => {
40
- const result: UI_I_HeadItem[] = []
41
- getItems(localization).forEach((item, i) => {
42
- const col = i === 0 ? 'icon' : `col${i}`
43
- result.push(constructHeadItem(col, item[0], item[3], true, item[2]))
44
- })
45
- return result
46
- }
47
-
48
- export const bodyItems = (data: UI_I_AlarmItem[]): UI_I_BodyItem[][] => {
49
- const bodyItems: UI_I_BodyItem[][] = []
50
- data.forEach((alarm: UI_I_AlarmItem, key) => {
51
- const objectData = {
52
- isLink: true,
53
- }
54
- const data = {
55
- iconClassName: 'vsphere-icon-status-warning',
56
- }
57
- const nameData = {
58
- isLink: true,
59
- }
60
- const triggeringData = {
61
- isLink: true,
62
- }
63
- bodyItems.push([
64
- {
65
- key: 'icon',
66
- text: alarm[alarmsTableKeys[0]],
67
- data: objectData,
68
- id: key,
69
- },
70
- { key: 'col1', text: alarm[alarmsTableKeys[1]], data, id: key },
71
- {
72
- key: 'col2',
73
- text: alarm[alarmsTableKeys[2]],
74
- data: nameData,
75
- id: key,
76
- },
77
- { key: 'col3', text: alarm[alarmsTableKeys[3]], id: key },
78
- { key: 'col4', text: alarm[alarmsTableKeys[4]], id: key },
79
- { key: 'col5', text: alarm[alarmsTableKeys[5]], id: key },
80
- {
81
- key: 'col6',
82
- text: alarm[alarmsTableKeys[6]],
83
- data: triggeringData,
84
- id: key,
85
- },
86
- ])
87
- })
88
- return bodyItems
89
- }
@@ -1,11 +0,0 @@
1
- import type { UI_T_AlarmsTableKeys } from '~/components/common/layout/bottomPanel/alarms/old/lib/models/types'
2
-
3
- export const alarmsTableKeys: UI_T_AlarmsTableKeys[] = [
4
- 'object',
5
- 'status',
6
- 'name',
7
- 'triggered',
8
- 'acknowledged',
9
- 'acknowledged_by',
10
- 'triggering_event',
11
- ]
@@ -1,8 +0,0 @@
1
- export type UI_T_AlarmsTableKeys =
2
- | 'object'
3
- | 'status'
4
- | 'name'
5
- | 'triggered'
6
- | 'acknowledged'
7
- | 'acknowledged_by'
8
- | 'triggering_event'
@@ -1,19 +0,0 @@
1
- import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
2
- import type { UI_I_Localization } from '~/lib/models/interfaces'
3
-
4
- export const statusFilterItemsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_Dropdown[] => [
7
- {
8
- text: localization.common.all,
9
- value: -1,
10
- },
11
- {
12
- text: localization.common.running,
13
- value: 1,
14
- },
15
- {
16
- text: localization.common.failed,
17
- value: 3,
18
- },
19
- ]
@@ -1 +0,0 @@
1
- export type UI_T_BottomPanelTabType = 'recentTask' | 'alarms'
@@ -1,43 +0,0 @@
1
- <template>
2
- <component
3
- :is="currentComponent"
4
- :data-table="props.dataTable"
5
- :total-items="props.totalItems"
6
- :total-pages="props.totalPages"
7
- :pagination="props.pagination"
8
- :loading="props.loading"
9
- @pagination="emits('pagination', $event)"
10
- @sort="emits('sort', $event)"
11
- />
12
- </template>
13
-
14
- <script setup lang="ts">
15
- import type { UI_I_RecentTaskItem } from '~/lib/models/store/tasks/interfaces'
16
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
17
- import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
18
-
19
- const props = defineProps<{
20
- dataTable: UI_I_RecentTaskItem<UI_T_NodeType>[]
21
- totalItems: number
22
- totalPages: number
23
- pagination: UI_I_Pagination
24
- loading: boolean
25
- }>()
26
-
27
- const emits = defineEmits<{
28
- (event: 'pagination', value: UI_I_Pagination | null): void
29
- (event: 'sort', value: string): void
30
- }>()
31
-
32
- const { $store }: any = useNuxtApp()
33
-
34
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
35
-
36
- const currentComponent = computed(() =>
37
- isNewView.value
38
- ? defineAsyncComponent(() => import('./new/New.vue'))
39
- : defineAsyncComponent(() => import('./old/Old.vue'))
40
- )
41
- </script>
42
-
43
- <style scoped lang="scss"></style>
@@ -1,14 +0,0 @@
1
- import type { UI_T_NodeType } from '~/components/common/pages/home/lib/models/types'
2
- import type { UI_T_NavNodes } from '~/lib/models/types'
3
-
4
- interface UI_I_TargetData {
5
- id: string
6
- type: UI_T_NodeType
7
- }
8
-
9
- export interface UI_I_DataTargetForTable extends UI_I_TargetData {
10
- nav: UI_T_NavNodes
11
- isLink: boolean
12
- iconClassName: string
13
- testId?: string
14
- }