bfg-common 1.6.113 → 1.6.114

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 (91) hide show
  1. package/assets/img/icons/icons-sprite-dark-4.svg +38 -17
  2. package/assets/img/icons/icons-sprite-light-4.svg +49 -17
  3. package/assets/localization/local_be.json +43 -4
  4. package/assets/localization/local_en.json +43 -4
  5. package/assets/localization/local_hy.json +43 -4
  6. package/assets/localization/local_kk.json +43 -4
  7. package/assets/localization/local_ru.json +43 -4
  8. package/assets/localization/local_zh.json +43 -4
  9. package/components/common/configure/advancedSystemSettings/AdvancedSystemSettings.vue +25 -17
  10. package/components/common/configure/advancedSystemSettings/New.vue +41 -0
  11. package/components/common/configure/advancedSystemSettings/Old.vue +36 -0
  12. package/components/common/configure/advancedSystemSettings/modals/edit/Edit.vue +4 -4
  13. package/components/common/configure/advancedSystemSettings/modals/edit/New.vue +42 -23
  14. package/components/common/configure/advancedSystemSettings/modals/edit/Old.vue +5 -3
  15. package/components/common/configure/advancedSystemSettings/tableView/TableView.vue +27 -2
  16. package/components/common/configure/advancedSystemSettings/tableView/{old/field → field}/Field.vue +20 -50
  17. package/components/common/configure/advancedSystemSettings/tableView/field/New.vue +88 -0
  18. package/components/common/configure/advancedSystemSettings/tableView/field/Old.vue +73 -0
  19. package/components/common/configure/advancedSystemSettings/tableView/field/lib/config/index.ts +10 -0
  20. package/components/common/configure/advancedSystemSettings/tableView/field/lib/models/enums.ts +14 -0
  21. package/components/common/configure/advancedSystemSettings/tableView/new/New.vue +60 -130
  22. package/components/common/configure/advancedSystemSettings/tableView/new/lib/config/index.ts +112 -0
  23. package/components/common/configure/advancedSystemSettings/tableView/old/Old.vue +14 -41
  24. package/components/common/configure/advancedSystemSettings/tools/New.vue +64 -3
  25. package/components/common/configure/advancedSystemSettings/tools/Old.vue +2 -2
  26. package/components/common/configure/advancedSystemSettings/tools/Tools.vue +2 -2
  27. package/components/common/configure/physicalAdapters/modals/edit/lib/config/config.ts +59 -59
  28. package/components/common/configure/physicalAdapters/tableView/TableViewNew.vue +353 -345
  29. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsNew.vue +327 -323
  30. package/components/common/graph/Graph.vue +19 -8
  31. package/components/common/graph/{graphNew/GraphNew.vue → new/New.vue} +3 -3
  32. package/components/common/modals/confirmation/Confirmation.vue +1 -0
  33. package/components/common/monitor/advanced/Advanced.vue +9 -49
  34. package/components/common/monitor/advanced/graphView/GraphView.vue +8 -12
  35. package/components/common/monitor/advanced/graphView/{GraphViewNew.vue → New.vue} +1 -1
  36. package/components/common/monitor/advanced/table/Table.vue +9 -8
  37. package/components/common/monitor/advanced/table/{tableNew/TableNew.vue → new/New.vue} +6 -5
  38. package/components/common/monitor/advanced/table/{tableNew → new}/lib/config/options.ts +1 -1
  39. package/components/common/monitor/advanced/table/{tableOld/TableOld.vue → old/Old.vue} +6 -3
  40. package/components/common/monitor/advanced/tools/{ToolsNew.vue → New.vue} +4 -0
  41. package/components/common/monitor/advanced/tools/{ToolsOld.vue → Old.vue} +2 -0
  42. package/components/common/monitor/advanced/tools/Tools.vue +11 -53
  43. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/Actions.vue +9 -13
  44. package/components/common/monitor/advanced/tools/chartOptionsModal/actions/{ActionsNew.vue → New.vue} +6 -3
  45. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +12 -44
  46. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/Table.vue +8 -7
  47. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew/TableNew.vue → new/New.vue} +2 -2
  48. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew → new}/config/tableData.ts +1 -1
  49. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableOld/TableOld.vue → old/Old.vue} +1 -1
  50. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableOld → old}/lib/config/tableConfig.ts +1 -1
  51. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +9 -36
  52. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/Object.vue +8 -9
  53. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew/ObjectNew.vue → new/New.vue} +2 -2
  54. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew → new}/lib/config/tableData.ts +1 -1
  55. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectOld/ObjectOld.vue → old/Old.vue} +1 -2
  56. package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/Metrics.vue +8 -7
  57. package/components/common/monitor/advanced/tools/chartOptionsModal/{NotificationNew.vue → notification/New.vue} +1 -1
  58. package/components/common/monitor/advanced/tools/chartOptionsModal/{Notification.vue → notification/Notification.vue} +8 -6
  59. package/components/common/monitor/advanced/tools/chartOptionsModal/{NotificationOld.vue → notification/Old.vue} +1 -5
  60. package/components/common/monitor/overview/OverviewNew.vue +1 -1
  61. package/components/common/monitor/overview/OverviewOld.vue +1 -1
  62. package/components/common/monitor/overview/filters/FiltersNew.vue +1 -0
  63. package/components/common/monitor/overview/filters/FiltersOld.vue +1 -0
  64. package/components/common/pages/hardwareHealth/historyTestimony/GraphNew.vue +2 -2
  65. package/lib/models/interfaces.ts +1 -0
  66. package/package.json +1 -1
  67. package/components/common/configure/advancedSystemSettings/tableView/new/lib/config/hostTable.ts +0 -308
  68. package/components/common/configure/advancedSystemSettings/tableView/old/field/lib/models/enums.ts +0 -14
  69. package/components/common/graph/lib/utils/renderGraph.ts +0 -393
  70. /package/components/common/graph/{GraphOld.vue → Old.vue} +0 -0
  71. /package/components/common/graph/{graphNew → new}/EmptyBlock.vue +0 -0
  72. /package/components/common/graph/{graphNew → new}/lib/models/enums.ts +0 -0
  73. /package/components/common/monitor/advanced/{AdvancedNew.vue → New.vue} +0 -0
  74. /package/components/common/monitor/advanced/{AdvancedOld.vue → Old.vue} +0 -0
  75. /package/components/common/monitor/advanced/graphView/{GraphViewOld.vue → Old.vue} +0 -0
  76. /package/components/common/monitor/advanced/table/{tableNew → new}/lib/utils/constructBody.ts +0 -0
  77. /package/components/common/monitor/advanced/table/{tableOld → old}/lib/config/performanceDatatable.ts +0 -0
  78. /package/components/common/monitor/advanced/tools/chartOptionsModal/{ChartOptionsModalNew.vue → New.vue} +0 -0
  79. /package/components/common/monitor/advanced/tools/chartOptionsModal/{ChartOptionsModalOld.vue → Old.vue} +0 -0
  80. /package/components/common/monitor/advanced/tools/chartOptionsModal/actions/{ActionsOld.vue → Old.vue} +0 -0
  81. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/{CountersNew.vue → New.vue} +0 -0
  82. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/{CountersOld.vue → Old.vue} +0 -0
  83. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew → new}/config/options.ts +0 -0
  84. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableNew → new}/utils/constructTable.ts +0 -0
  85. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/table/{tableOld → old}/lib/models/types.ts +0 -0
  86. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/{TimespanNew.vue → New.vue} +0 -0
  87. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/{TimespanOld.vue → Old.vue} +0 -0
  88. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew → new}/lib/config/options.ts +0 -0
  89. /package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/object/{objectNew → new}/lib/utils/constructTable.ts +0 -0
  90. /package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/{MetricsNew.vue → New.vue} +0 -0
  91. /package/components/common/monitor/advanced/tools/chartOptionsModal/metrics/{MetricsOld.vue → Old.vue} +0 -0
@@ -1,345 +1,353 @@
1
- <template>
2
- <div class="physical-adapters-table">
3
- <ui-data-table
4
- :data="data"
5
- :options="options"
6
- :total-items="props.adapters.total_items"
7
- :total-pages="props.adapters.total_pages"
8
- :texts="texts"
9
- :skeleton="skeletonDataLocal"
10
- :actions="actions"
11
- :loading="props.isLoading"
12
- test-id="physical-adapters-table"
13
- class="physical-adapters-tables"
14
- server-off
15
- @action="onSelectAction"
16
- @select-row="onSelectRow"
17
- >
18
- <template #insteadOfTitleActions>
19
- <div class="title-actions">
20
- <ui-button
21
- test-id="refresh-physical-adapters-btn"
22
- class="refresh-btn"
23
- size="md"
24
- variant="outline"
25
- @click="emits('refresh')"
26
- >
27
- <template #icon> <ui-icon name="reset" width="24" /> </template>
28
- {{ localization.common.refresh }}
29
- </ui-button>
30
- <ui-button
31
- v-permission="
32
- 'Networks.CreateSysx Networks.CreatePortGroup Networks.UpdateSwitch Networks.CreateSwitch'
33
- "
34
- test-id="add-physical-adapters-btn"
35
- class="add-btn"
36
- size="md"
37
- @click="emits('add')"
38
- >
39
- <template #icon> <ui-icon name="plus" width="24" /> </template>
40
- {{ localization.common.addNetworkingWithDots }}
41
- </ui-button>
42
- </div>
43
- </template>
44
-
45
- <template #icon="{ item }">
46
- <div v-if="item.data.icon !== 'pill'" class="cell">
47
- <div
48
- :class="[
49
- 'cell-icon',
50
- {
51
- 'cell-icon-device': item.col === 'col0',
52
- },
53
- ]"
54
- >
55
- <ui-icon
56
- v-if="item.col === 'col0'"
57
- :name="item.data.icon"
58
- width="18"
59
- height="18"
60
- />
61
- <span v-else class="network-lib-ui-icon-vswitch"></span>
62
- </div>
63
- <span class="cell-text">
64
- {{ item.text }}
65
- </span>
66
- </div>
67
- <div v-else>
68
- <ui-status-pill
69
- :type="item.data.value ? 'success' : 'error'"
70
- :text="item.text"
71
- size="md"
72
- />
73
- </div>
74
- </template>
75
-
76
- <template #default-actions="{ item }">
77
- <div class="actions flex w-full">
78
- <ui-tooltip
79
- :id="`host-item-${item.data.id}-action`"
80
- :test-id="`host-item-${item.data.id}-action-tooltip`"
81
- size="md"
82
- position="bottom"
83
- position-by-tooltip="center"
84
- show-type="variant-1"
85
- timing="660"
86
- >
87
- <template #target>
88
- <ui-button
89
- :id="`host-item-${item.data.id}-action`"
90
- :test-id="`host-item-${item.data.id}-action`"
91
- variant="text"
92
- is-without-height
93
- is-without-sizes
94
- @click.stop="onShowEditModal(item.data.id)"
95
- >
96
- <span class="action-icon">
97
- <ui-icon name="edit" width="20" height="20" />
98
- </span>
99
- </ui-button>
100
- </template>
101
- <template #content>
102
- <div class="tooltip-text">
103
- {{ localization.common.edit }}
104
- </div>
105
- </template>
106
- </ui-tooltip>
107
- </div>
108
- </template>
109
-
110
- <template #skeleton-header>
111
- <div class="skeleton-header">
112
- <div class="left-skeleton">
113
- <ui-skeleton-item width="80" height="20" />
114
- </div>
115
- <div class="right-skeleton">
116
- <ui-skeleton-item width="112" height="36" border-radius="8" />
117
- <ui-skeleton-item width="160" height="36" border-radius="8" />
118
- </div>
119
- </div>
120
- </template>
121
- </ui-data-table>
122
- </div>
123
- </template>
124
-
125
- <script setup lang="ts">
126
- import type {
127
- UI_I_DataTable,
128
- UI_I_DataTableBody,
129
- UI_I_DataTableHeader,
130
- UI_I_DataTableSkeleton,
131
- UI_I_TableTexts,
132
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
133
- import type { UI_I_ButtonsGroup } from '~/node_modules/bfg-uikit/components/ui/button/group/lib/models/interfaces'
134
- import type {
135
- UI_I_Localization,
136
- UI_I_ItemsWithTotalCounts,
137
- } from '~/lib/models/interfaces'
138
- import type { UI_I_SwitchAdapterItem } from '~/components/common/diagramMain/lib/models/interfaces'
139
- import type {
140
- UI_I_BodyItem,
141
- UI_I_HeadItem,
142
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
143
- import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
144
- import type { UI_I_PhysicalAdapter } from '~/components/common/configure/physicalAdapters/tableView/lib/models/interfaces'
145
- import {
146
- getBodyDataFunc,
147
- getHeaderDataFunc,
148
- options,
149
- skeletonData,
150
- } from '~/components/common/configure/physicalAdapters/tableView/lib/config/physicalAdaptersTableConfigNew'
151
- import { constructPhysicalAdaptersTableFunc } from '~/components/common/configure/physicalAdapters/tableView/mappers/mappers'
152
-
153
- const props = defineProps<{
154
- adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
155
- isLoading: boolean
156
- hasSelectedAdapter: boolean
157
- }>()
158
-
159
- const emits = defineEmits<{
160
- (event: 'add'): void
161
- (event: 'refresh'): void
162
- (event: 'edit', id?: string): void
163
- }>()
164
-
165
- const localization = computed<UI_I_Localization>(() => useLocal())
166
-
167
- const actions = computed<UI_I_ButtonsGroup>(() => [
168
- {
169
- text: localization.value.common.edit,
170
- value: 'edit',
171
- testId: 'edit-physical-adapted',
172
- id: 'edit-physical-adapted',
173
- iconName: 'edit',
174
- disabled: !props.hasSelectedAdapter,
175
- development: true,
176
- },
177
- ])
178
-
179
- const onSelectAction = (action: string): void => {
180
- emits(action)
181
- }
182
-
183
- const selectedRow = defineModel<UI_T_SelectedRow>()
184
-
185
- const onSelectRow = (value: UI_I_DataTableBody[]): void => {
186
- if (typeof value[0].row !== 'number') return
187
- selectedRow.value = value[0].row
188
- }
189
-
190
- const networkTableData = computed<UI_I_PhysicalAdapter[]>(() =>
191
- constructPhysicalAdaptersTableFunc(props.adapters.items, localization.value)
192
- )
193
-
194
- const texts = computed<UI_I_TableTexts>(() => ({
195
- searchHere: localization.value.common.searchHere,
196
- rowsPerPage: localization.value.common.rowsPerPage,
197
- of: localization.value.common.of,
198
- selected: localization.value.common.selected,
199
- columns: localization.value.common.columns,
200
- previous: localization.value.common.previous,
201
- next: localization.value.common.next,
202
- noItemsFound: localization.value.common.noItemsFound,
203
- exportAll: localization.value.common.exportAll,
204
- exportSelected: localization.value.common.exportSelected,
205
- all: localization.value.common.all,
206
- filter: localization.value.common.filter,
207
- }))
208
-
209
- const data = computed<UI_I_DataTable>(() => ({
210
- id: 'physical-adapters-table',
211
- selectedRows: [],
212
- isAllSelected: false,
213
- header: headItems.value,
214
- body: bodyItems.value,
215
- }))
216
-
217
- const headItems = computed<UI_I_DataTableHeader[]>(() =>
218
- getHeaderDataFunc(localization.value)
219
- )
220
- const bodyItems = ref<UI_I_DataTableBody[]>([])
221
-
222
- watch(
223
- () => networkTableData.value,
224
- (newValue: UI_I_PhysicalAdapter[]) => {
225
- console.log(!newValue?.length)
226
- if (!newValue?.length) {
227
- bodyItems.value = []
228
- } else {
229
- bodyItems.value = getBodyDataFunc(newValue, selectedRow.value)
230
- }
231
- },
232
- { deep: true }
233
- )
234
-
235
- const skeletonDataLocal = ref<UI_I_DataTableSkeleton>(skeletonData)
236
-
237
- const actionsIsShow = ref<string>()
238
-
239
- const onShowEditModal = (id: string): void => {
240
- emits('edit', id)
241
- }
242
- </script>
243
-
244
- <style scoped lang="scss">
245
- .physical-adapters-table {
246
- height: calc(100% - 52px);
247
- }
248
-
249
- :deep(.table-container) {
250
- height: 100%;
251
- grid-template-rows: min-content auto min-content;
252
-
253
- .title-container {
254
- margin-right: 16px;
255
- }
256
-
257
- &.full-width-search {
258
- grid-template-rows: min-content min-content auto min-content;
259
- }
260
- }
261
-
262
- .actions {
263
- justify-content: flex-end;
264
- padding-right: 4px;
265
-
266
- .action-icon {
267
- height: 20px;
268
- width: 20px;
269
- color: var(--actions-icon-color);
270
-
271
- &:hover {
272
- color: var(--actions-icon-icative-color);
273
- }
274
- }
275
- }
276
-
277
- .title-actions {
278
- display: flex;
279
- column-gap: 16px;
280
-
281
- :deep(.ui-btn) {
282
- white-space: nowrap;
283
- }
284
- }
285
-
286
- :deep(.ui-button-group) {
287
- padding-left: 0;
288
- }
289
-
290
- :deep(.table-fixed-height) {
291
- all: unset;
292
- .table-fixed-full-height {
293
- all: unset;
294
- }
295
- }
296
-
297
- :deep(.data-table-skeleton) {
298
- height: 100%;
299
- grid-template-rows: min-content auto min-content;
300
- &.full-width-search {
301
- grid-template-rows: min-content min-content auto min-content;
302
- }
303
-
304
- .body.with-actions {
305
- height: calc(100% - 92px);
306
- }
307
- }
308
-
309
- .skeleton-header {
310
- display: flex;
311
- justify-content: space-between;
312
- align-items: center;
313
-
314
- .right-skeleton {
315
- display: flex;
316
- column-gap: 16px;
317
- }
318
- }
319
-
320
- .cell {
321
- display: flex;
322
- column-gap: 4px;
323
-
324
- &-icon {
325
- height: 18px;
326
-
327
- &.cell-icon-device {
328
- color: var(--text-green);
329
- }
330
- }
331
- &-text {
332
- line-height: 18px;
333
- }
334
- }
335
-
336
- :deep(.status-container) {
337
- span:not(.icon-container) {
338
- white-space: nowrap;
339
- }
340
- }
341
-
342
- :deep(.ui-button-group-dots-icon) {
343
- padding-left: 0;
344
- }
345
- </style>
1
+ <template>
2
+ <div class="physical-adapters-table">
3
+ <ui-data-table
4
+ :data="data"
5
+ :options="options"
6
+ :total-items="props.adapters.total_items"
7
+ :total-pages="props.adapters.total_pages"
8
+ :texts="texts"
9
+ :skeleton="skeletonDataLocal"
10
+ :actions="actions"
11
+ :loading="props.isLoading"
12
+ test-id="physical-adapters-table"
13
+ class="physical-adapters-tables"
14
+ server-off
15
+ @action="onSelectAction"
16
+ @select-row="onSelectRow"
17
+ >
18
+ <template #insteadOfTitleActions>
19
+ <div class="title-actions">
20
+ <ui-button
21
+ test-id="refresh-physical-adapters-btn"
22
+ class="refresh-btn"
23
+ size="md"
24
+ variant="outline"
25
+ @click="emits('refresh')"
26
+ >
27
+ <template #icon> <ui-icon name="reset" width="24" /> </template>
28
+ {{ localization.common.refresh }}
29
+ </ui-button>
30
+ <ui-button
31
+ v-permission="
32
+ 'Networks.CreateSysx Networks.CreatePortGroup Networks.UpdateSwitch Networks.CreateSwitch'
33
+ "
34
+ test-id="add-physical-adapters-btn"
35
+ class="add-btn"
36
+ size="md"
37
+ @click="emits('add')"
38
+ >
39
+ <template #icon> <ui-icon name="plus" width="24" /> </template>
40
+ {{ localization.common.addNetworkingWithDots }}
41
+ </ui-button>
42
+ </div>
43
+ </template>
44
+
45
+ <template #icon="{ item }">
46
+ <div v-if="item.data.icon !== 'pill'" class="cell">
47
+ <div
48
+ :class="[
49
+ 'cell-icon',
50
+ {
51
+ 'cell-icon-device': item.col === 'col0',
52
+ },
53
+ ]"
54
+ >
55
+ <ui-icon
56
+ v-if="item.col === 'col0'"
57
+ :name="item.data.icon"
58
+ width="18"
59
+ height="18"
60
+ />
61
+ <span v-else class="network-lib-ui-icon-vswitch"></span>
62
+ </div>
63
+ <span class="cell-text">
64
+ {{ item.text }}
65
+ </span>
66
+ </div>
67
+ <div v-else>
68
+ <ui-status-pill
69
+ :type="item.data.value ? 'success' : 'error'"
70
+ :text="item.text"
71
+ size="md"
72
+ />
73
+ </div>
74
+ </template>
75
+
76
+ <template #default-actions="{ item }">
77
+ <!-- TODO Удалить
78
+ <div title="in-development" style="cursor: not-allowed"> и v-development="true"
79
+ когда будет апи для редактирования-->
80
+ <div title="in-development" style="cursor: not-allowed">
81
+ <div v-development="true" class="actions flex w-full">
82
+ <ui-tooltip
83
+ :id="`host-item-${item.data.id}-action`"
84
+ :test-id="`host-item-${item.data.id}-action-tooltip`"
85
+ size="md"
86
+ position="bottom"
87
+ position-by-tooltip="center"
88
+ show-type="variant-1"
89
+ timing="660"
90
+ style="pointer-event: none"
91
+ >
92
+ <template #target>
93
+ <ui-button
94
+ :id="`host-item-${item.data.id}-action`"
95
+ :test-id="`host-item-${item.data.id}-action`"
96
+ variant="text"
97
+ is-without-height
98
+ is-without-sizes
99
+ @click.stop="onShowEditModal(item.data.id)"
100
+ >
101
+ <span class="action-icon">
102
+ <ui-icon name="edit" width="20" height="20" />
103
+ </span>
104
+ </ui-button>
105
+ </template>
106
+ <template #content>
107
+ <div class="tooltip-text">
108
+ {{ localization.common.edit }}
109
+ </div>
110
+ </template>
111
+ </ui-tooltip>
112
+ </div>
113
+ </div>
114
+ </template>
115
+
116
+ <template #skeleton-header>
117
+ <div class="skeleton-header">
118
+ <div class="left-skeleton">
119
+ <ui-skeleton-item width="80" height="20" />
120
+ </div>
121
+ <div class="right-skeleton">
122
+ <ui-skeleton-item width="112" height="36" border-radius="8" />
123
+ <ui-skeleton-item width="160" height="36" border-radius="8" />
124
+ </div>
125
+ </div>
126
+ </template>
127
+ </ui-data-table>
128
+ </div>
129
+ </template>
130
+
131
+ <script setup lang="ts">
132
+ import type {
133
+ UI_I_DataTable,
134
+ UI_I_DataTableBody,
135
+ UI_I_DataTableHeader,
136
+ UI_I_DataTableSkeleton,
137
+ UI_I_TableTexts,
138
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
139
+ import type { UI_I_ButtonsGroup } from '~/node_modules/bfg-uikit/components/ui/button/group/lib/models/interfaces'
140
+ import type {
141
+ UI_I_Localization,
142
+ UI_I_ItemsWithTotalCounts,
143
+ } from '~/lib/models/interfaces'
144
+ import type { UI_I_SwitchAdapterItem } from '~/components/common/diagramMain/lib/models/interfaces'
145
+ import type {
146
+ UI_I_BodyItem,
147
+ UI_I_HeadItem,
148
+ } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
149
+ import type { UI_T_SelectedRow } from '~/components/atoms/table/dataGrid/lib/models/types'
150
+ import type { UI_I_PhysicalAdapter } from '~/components/common/configure/physicalAdapters/tableView/lib/models/interfaces'
151
+ import {
152
+ getBodyDataFunc,
153
+ getHeaderDataFunc,
154
+ options,
155
+ skeletonData,
156
+ } from '~/components/common/configure/physicalAdapters/tableView/lib/config/physicalAdaptersTableConfigNew'
157
+ import { constructPhysicalAdaptersTableFunc } from '~/components/common/configure/physicalAdapters/tableView/mappers/mappers'
158
+
159
+ const props = defineProps<{
160
+ adapters: UI_I_ItemsWithTotalCounts<UI_I_SwitchAdapterItem>
161
+ isLoading: boolean
162
+ hasSelectedAdapter: boolean
163
+ }>()
164
+
165
+ const emits = defineEmits<{
166
+ (event: 'add'): void
167
+ (event: 'refresh'): void
168
+ (event: 'edit', id?: string): void
169
+ }>()
170
+
171
+ const localization = computed<UI_I_Localization>(() => useLocal())
172
+
173
+ const actions = computed<UI_I_ButtonsGroup>(() => [
174
+ {
175
+ text: localization.value.common.edit,
176
+ value: 'edit',
177
+ testId: 'edit-physical-adapted',
178
+ id: 'edit-physical-adapted',
179
+ iconName: 'edit',
180
+ disabled: !props.hasSelectedAdapter,
181
+ development: true,
182
+ },
183
+ ])
184
+
185
+ const onSelectAction = (action: string): void => {
186
+ emits(action)
187
+ }
188
+
189
+ const selectedRow = defineModel<UI_T_SelectedRow>()
190
+
191
+ const onSelectRow = (value: UI_I_DataTableBody[]): void => {
192
+ if (typeof value[0].row !== 'number') return
193
+ selectedRow.value = value[0].row
194
+ }
195
+
196
+ const networkTableData = computed<UI_I_PhysicalAdapter[]>(() =>
197
+ constructPhysicalAdaptersTableFunc(props.adapters.items, localization.value)
198
+ )
199
+
200
+ const texts = computed<UI_I_TableTexts>(() => ({
201
+ searchHere: localization.value.common.searchHere,
202
+ rowsPerPage: localization.value.common.rowsPerPage,
203
+ of: localization.value.common.of,
204
+ selected: localization.value.common.selected,
205
+ columns: localization.value.common.columns,
206
+ previous: localization.value.common.previous,
207
+ next: localization.value.common.next,
208
+ noItemsFound: localization.value.common.noItemsFound,
209
+ exportAll: localization.value.common.exportAll,
210
+ exportSelected: localization.value.common.exportSelected,
211
+ all: localization.value.common.all,
212
+ filter: localization.value.common.filter,
213
+ }))
214
+
215
+ const data = computed<UI_I_DataTable>(() => ({
216
+ id: 'physical-adapters-table',
217
+ selectedRows: [],
218
+ isAllSelected: false,
219
+ header: headItems.value,
220
+ body: bodyItems.value,
221
+ }))
222
+
223
+ const headItems = computed<UI_I_DataTableHeader[]>(() =>
224
+ getHeaderDataFunc(localization.value)
225
+ )
226
+ const bodyItems = ref<UI_I_DataTableBody[]>([])
227
+
228
+ watch(
229
+ () => networkTableData.value,
230
+ (newValue: UI_I_PhysicalAdapter[]) => {
231
+ console.log(!newValue?.length)
232
+ if (!newValue?.length) {
233
+ bodyItems.value = []
234
+ } else {
235
+ bodyItems.value = getBodyDataFunc(newValue, selectedRow.value)
236
+ }
237
+ },
238
+ { deep: true }
239
+ )
240
+
241
+ const skeletonDataLocal = ref<UI_I_DataTableSkeleton>(skeletonData)
242
+
243
+ const actionsIsShow = ref<string>()
244
+
245
+ const onShowEditModal = (id: string): void => {
246
+ emits('edit', id)
247
+ }
248
+ </script>
249
+
250
+ <style scoped lang="scss">
251
+ .physical-adapters-table {
252
+ height: calc(100% - 52px);
253
+ }
254
+
255
+ :deep(.table-container) {
256
+ height: 100%;
257
+ grid-template-rows: min-content auto min-content;
258
+
259
+ .title-container {
260
+ margin-right: 16px;
261
+ }
262
+
263
+ &.full-width-search {
264
+ grid-template-rows: min-content min-content auto min-content;
265
+ }
266
+ }
267
+
268
+ .actions {
269
+ justify-content: flex-end;
270
+ padding-right: 4px;
271
+ // TODO Удалить когда будет апи для редактирования
272
+ pointer-events: none;
273
+
274
+ .action-icon {
275
+ height: 20px;
276
+ width: 20px;
277
+ color: var(--actions-icon-color);
278
+
279
+ &:hover {
280
+ color: var(--actions-icon-icative-color);
281
+ }
282
+ }
283
+ }
284
+
285
+ .title-actions {
286
+ display: flex;
287
+ column-gap: 16px;
288
+
289
+ :deep(.ui-btn) {
290
+ white-space: nowrap;
291
+ }
292
+ }
293
+
294
+ :deep(.ui-button-group) {
295
+ padding-left: 0;
296
+ }
297
+
298
+ :deep(.table-fixed-height) {
299
+ all: unset;
300
+ .table-fixed-full-height {
301
+ all: unset;
302
+ }
303
+ }
304
+
305
+ :deep(.data-table-skeleton) {
306
+ height: 100%;
307
+ grid-template-rows: min-content auto min-content;
308
+ &.full-width-search {
309
+ grid-template-rows: min-content min-content auto min-content;
310
+ }
311
+
312
+ .body.with-actions {
313
+ height: calc(100% - 92px);
314
+ }
315
+ }
316
+
317
+ .skeleton-header {
318
+ display: flex;
319
+ justify-content: space-between;
320
+ align-items: center;
321
+
322
+ .right-skeleton {
323
+ display: flex;
324
+ column-gap: 16px;
325
+ }
326
+ }
327
+
328
+ .cell {
329
+ display: flex;
330
+ column-gap: 4px;
331
+
332
+ &-icon {
333
+ height: 18px;
334
+
335
+ &.cell-icon-device {
336
+ color: var(--text-green);
337
+ }
338
+ }
339
+ &-text {
340
+ line-height: 18px;
341
+ }
342
+ }
343
+
344
+ :deep(.status-container) {
345
+ span:not(.icon-container) {
346
+ white-space: nowrap;
347
+ }
348
+ }
349
+
350
+ :deep(.ui-button-group-dots-icon) {
351
+ padding-left: 0;
352
+ }
353
+ </style>