bfg-common 1.5.674 → 1.5.675

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,275 +1,277 @@
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
+ <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="statusFilter"
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 statusFilter = defineModel<UI_T_SelectedStatus>('statusFilter', {
132
+ required: true,
133
+ })
134
+
135
+ const props = defineProps<{
136
+ dataTable: UI_I_RecentTaskItem<UI_T_NodeType>[]
137
+ pagination: UI_I_Pagination
138
+ totalItems: number
139
+ totalPages: number
140
+ loading: boolean
141
+ }>()
142
+ const emits = defineEmits<{
143
+ (event: 'pagination', value: UI_I_Pagination | null): void
144
+ (event: 'sort', value: string): void
145
+ }>()
146
+
147
+ const localization = computed<UI_I_Localization>(() => useLocal())
148
+
149
+ const selectedRow = ref<number[]>([])
150
+
151
+ const onSorting = (event: [number, boolean]): void => {
152
+ const [column, status] = event
153
+ const direction = status ? 'desc' : 'asc'
154
+
155
+ const sort = `${column}.${direction}`
156
+
157
+ emits('sort', sort)
158
+ }
159
+
160
+ const paginationLocal = ref<UI_I_Pagination | null>(null)
161
+ watch(
162
+ () => props.pagination,
163
+ (newValue) => {
164
+ paginationLocal.value = newValue
165
+ },
166
+ { immediate: true }
167
+ )
168
+ watch(
169
+ paginationLocal,
170
+ (newValue) => {
171
+ emits('pagination', newValue)
172
+ },
173
+ { deep: true, immediate: true }
174
+ )
175
+
176
+ const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
177
+ watch(localization, () => {
178
+ columnKeys.value = table.columnKeys(localization.value)
179
+ })
180
+
181
+ const headItems = computed<UI_I_HeadItem[]>(() =>
182
+ table.headItems(localization.value)
183
+ )
184
+
185
+ const { $store }: any = useNuxtApp()
186
+ const timeFormat = computed<UI_T_TimeValue>(
187
+ () => $store.getters['main/getTimeFormat']
188
+ )
189
+
190
+ const bodyItems = ref<UI_I_BodyItem[][]>([])
191
+ watch(
192
+ [
193
+ (): UI_I_RecentTaskItem<UI_T_NodeType>[] => props.dataTable,
194
+ statusFilter,
195
+ timeFormat,
196
+ localization,
197
+ ],
198
+ ([newValue1]) => {
199
+ if (!newValue1?.length) {
200
+ bodyItems.value = []
201
+ return
202
+ }
203
+
204
+ bodyItems.value = table.bodyItems(newValue1, statusFilter.value)
205
+ },
206
+ { deep: true, immediate: true }
207
+ )
208
+
209
+ const onSelectNodeOfTree = (data: UI_I_BodyItem): void => {
210
+ const { type, id, nav } = data.data
211
+
212
+ const node: UI_I_TreeNodeShort = {
213
+ id,
214
+ type,
215
+ }
216
+
217
+ // useLocalStorage('sSpec', node)
218
+
219
+ const path = `/inventory/type=${type};nav=${nav};id=${id}/summary`
220
+
221
+ navigateTo(path)
222
+
223
+ const payload: UI_I_SelectNodePayload = {
224
+ node,
225
+ type,
226
+ }
227
+ $store.dispatch('inventory/A_SELECT_NODE', payload)
228
+ }
229
+ </script>
230
+
231
+ <style lang="scss" scoped>
232
+ .data-table-view {
233
+ height: inherit;
234
+ .data-table {
235
+ height: inherit;
236
+ :deep(.datagrid-outer-wrapper) {
237
+ height: inherit;
238
+
239
+ .datagrid-footer__action {
240
+ width: 100%;
241
+
242
+ .select {
243
+ margin-left: 10px;
244
+ }
245
+ }
246
+ }
247
+ }
248
+ &__col-icon {
249
+ min-width: 16px;
250
+ height: 16px;
251
+ margin-right: 2px;
252
+ }
253
+ &__action {
254
+ padding-left: 0.3rem;
255
+ }
256
+
257
+ .status-details-help-icon {
258
+ margin: 4px 0 0 2px;
259
+ }
260
+ .status-details {
261
+ gap: 4px;
262
+
263
+ .status-detail-item {
264
+ gap: 4px;
265
+
266
+ .status-detail-item-message {
267
+ max-width: 200px;
268
+ margin-left: 4px;
269
+ }
270
+
271
+ span {
272
+ color: var(--table-color) !important;
273
+ }
274
+ }
275
+ }
276
+ }
277
+ </style>
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.674",
4
+ "version": "1.5.675",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",