bfg-common 1.5.771 → 1.5.774
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.
- package/CODE_STYLE.md +109 -109
- package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
- package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
- package/assets/img/icons/icons-sprite-light-3.svg +227 -227
- package/assets/img/icons/icons-sprite-light-5.svg +488 -488
- package/assets/localization/local_be.json +3 -0
- package/assets/localization/local_en.json +3 -0
- package/assets/localization/local_hy.json +3 -0
- package/assets/localization/local_kk.json +3 -0
- package/assets/localization/local_ru.json +3 -0
- package/assets/localization/local_zh.json +3 -0
- package/components/atoms/TheIcon3.vue +50 -50
- package/components/atoms/collapse/CollapseNav.vue +170 -170
- package/components/atoms/perPage/PerPage.vue +58 -58
- package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
- package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
- package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
- package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
- package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
- package/components/common/configure/advancedSystemSettings/AdvancedSystemSettings.vue +49 -0
- package/components/common/configure/advancedSystemSettings/modals/edit/Edit.vue +55 -0
- package/components/common/configure/advancedSystemSettings/modals/edit/New.vue +37 -0
- package/components/common/configure/advancedSystemSettings/modals/edit/Old.vue +46 -0
- package/components/common/configure/advancedSystemSettings/tableView/TableView.vue +30 -0
- package/components/common/configure/advancedSystemSettings/tableView/new/New.vue +193 -0
- package/components/common/configure/advancedSystemSettings/tableView/new/lib/config/hostTable.ts +308 -0
- package/components/common/configure/advancedSystemSettings/tableView/old/Old.vue +128 -0
- package/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table.ts +93 -0
- package/components/common/configure/advancedSystemSettings/tableView/old/lib/config/tableKeys.ts +9 -0
- package/components/common/configure/advancedSystemSettings/tableView/old/lib/models/types.ts +5 -0
- package/components/common/configure/advancedSystemSettings/tools/New.vue +5 -0
- package/components/common/configure/advancedSystemSettings/tools/Old.vue +28 -0
- package/components/common/configure/advancedSystemSettings/tools/Tools.vue +28 -0
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/console/Console.vue +70 -70
- package/components/common/layout/theHeader/userMenu/modals/preferences/lib/models/types.ts +7 -7
- package/components/common/layout/theHeader/userMenu/modals/preferences/view/New.vue +64 -64
- package/components/common/pages/backups/DetailView.vue +52 -52
- package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
- package/components/common/pages/backups/modals/Modals.vue +243 -243
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/lib/config/restore.ts +116 -116
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +187 -187
- package/components/common/pages/backups/modals/restore/Restore.vue +302 -302
- package/components/common/pages/backups/modals/restore/disks/Disks.vue +50 -50
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +94 -94
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +130 -130
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/backups/modals/restore/types/New.vue +95 -95
- package/components/common/pages/backups/modals/restore/types/Old.vue +62 -62
- package/components/common/pages/backups/modals/restore/types/Types.vue +31 -31
- package/components/common/pages/home/lib/models/interfaces.ts +48 -48
- package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
- package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
- package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
- package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
- package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
- package/components/common/pages/tasks/Tasks.vue +125 -125
- package/components/common/pages/tasks/table/Table.vue +373 -373
- package/components/common/pages/tasks/table/lib/config/config.ts +279 -279
- package/components/common/pages/tasks/table/lib/models/interfaces.ts +9 -9
- package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
- package/components/common/select/radio/RadioGroup.vue +137 -137
- package/components/common/spiceConsole/Drawer.vue +420 -420
- package/components/common/spiceConsole/SpiceConsole.vue +184 -184
- package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
- package/components/common/tools/Actions.vue +207 -207
- package/components/common/treeView/TreeView.vue +52 -52
- package/components/common/vm/actions/clone/lib/config/steps.ts +295 -295
- package/components/common/vm/actions/clone/new/New.vue +438 -438
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +283 -283
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -156
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/options/New.vue +264 -264
- package/components/common/vm/actions/common/select/options/Options.vue +58 -58
- package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
- package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
- package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
- package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
- package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
- package/components/common/wizards/common/steps/name/Name.vue +178 -178
- package/components/common/wizards/common/steps/name/New.vue +221 -221
- package/components/common/wizards/common/steps/name/Old.vue +121 -121
- package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/Add.vue +227 -227
- package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
- package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
- package/composables/useAppVersion.ts +21 -21
- package/composables/useBrowse.ts +24 -24
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/lib/models/types.ts +59 -59
- package/package.json +1 -1
- package/plugins/console.ts +21 -21
- package/plugins/mouse.ts +21 -21
- package/plugins/panelStates.ts +70 -70
- package/plugins/text.ts +59 -59
- package/public/spice-console/application/clientgui.js +854 -854
- package/public/spice-console/application/packetfactory.js +211 -211
- package/public/spice-console/application/virtualmouse.js +147 -147
- package/public/spice-console/lib/images/bitmap.js +203 -203
- package/public/spice-console/network/spicechannel.js +440 -440
- package/public/spice-console/process/cursorprocess.js +128 -128
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +212 -212
- package/public/spice-console/run.js +210 -210
- package/store/inventory/modules/configure/advancedSystemSettings/actions.ts +122 -0
- package/store/inventory/modules/configure/advancedSystemSettings/getters.ts +9 -0
- package/store/inventory/modules/configure/advancedSystemSettings/lib/models/interfaces.ts +11 -0
- package/store/inventory/modules/configure/advancedSystemSettings/mutations.ts +12 -0
- package/store/inventory/modules/configure/advancedSystemSettings/state.ts +9 -0
- package/store/inventory/modules/configure/advancedSystemSettings/store.ts +12 -0
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/store/tasks/mappers/recentTasks.ts +123 -123
- package/store/tasks/mutations.ts +82 -82
package/components/common/configure/advancedSystemSettings/tableView/new/lib/config/hostTable.ts
ADDED
|
@@ -0,0 +1,308 @@
|
|
|
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_Localization } from '~/lib/models/interfaces'
|
|
7
|
+
import type { UI_I_HostTableItem } from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/lib/models/interfaces'
|
|
8
|
+
import {
|
|
9
|
+
UI_E_DeviceStatus,
|
|
10
|
+
UI_E_DeviceStatusChipColor,
|
|
11
|
+
UI_E_DeviceStatusIcon,
|
|
12
|
+
} from '~/components/common/wizards/vm/migrate/steps/computeResource/tableView/new/lib/models/enums'
|
|
13
|
+
import {
|
|
14
|
+
hostIconByState,
|
|
15
|
+
hostLocalizationByState,
|
|
16
|
+
} from '~/components/common/lib/config/states'
|
|
17
|
+
|
|
18
|
+
// Маппинг для статусов
|
|
19
|
+
const STATUS_MAPPING = {
|
|
20
|
+
[UI_E_DeviceStatus.Unknown]: {
|
|
21
|
+
icon: UI_E_DeviceStatusIcon.HelpIcon,
|
|
22
|
+
chipColor: UI_E_DeviceStatusChipColor.Primary,
|
|
23
|
+
},
|
|
24
|
+
[UI_E_DeviceStatus.Supported]: {
|
|
25
|
+
icon: UI_E_DeviceStatusIcon.StatusCheck,
|
|
26
|
+
chipColor: UI_E_DeviceStatusChipColor.Green,
|
|
27
|
+
},
|
|
28
|
+
[UI_E_DeviceStatus.NotSupported]: {
|
|
29
|
+
icon: UI_E_DeviceStatusIcon.Close,
|
|
30
|
+
chipColor: UI_E_DeviceStatusChipColor.Red,
|
|
31
|
+
},
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
export const getHeaderDataFunc = (
|
|
35
|
+
localization: UI_I_Localization
|
|
36
|
+
): UI_I_DataTableHeader[] => [
|
|
37
|
+
{
|
|
38
|
+
col: 'col0',
|
|
39
|
+
colName: 'name',
|
|
40
|
+
text: localization.common.name,
|
|
41
|
+
isSortable: true,
|
|
42
|
+
sort: 'asc',
|
|
43
|
+
width: '180px',
|
|
44
|
+
show: true,
|
|
45
|
+
filter: false,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
col: 'col1',
|
|
49
|
+
colName: 'state',
|
|
50
|
+
text: localization.inventorySummary.state,
|
|
51
|
+
isSortable: true,
|
|
52
|
+
sort: 'asc',
|
|
53
|
+
width: '96px',
|
|
54
|
+
show: true,
|
|
55
|
+
filter: false,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
col: 'col2',
|
|
59
|
+
colName: 'cluster',
|
|
60
|
+
text: localization.common.cluster,
|
|
61
|
+
isSortable: true,
|
|
62
|
+
sort: 'asc',
|
|
63
|
+
width: '96px',
|
|
64
|
+
show: true,
|
|
65
|
+
filter: false,
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
col: 'col3',
|
|
69
|
+
colName: 'fault_domain',
|
|
70
|
+
text: localization.common.faultDomain,
|
|
71
|
+
isSortable: true,
|
|
72
|
+
sort: 'asc',
|
|
73
|
+
width: '96px',
|
|
74
|
+
show: true,
|
|
75
|
+
filter: false,
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
col: 'col4',
|
|
79
|
+
colName: 'consumed_cpu',
|
|
80
|
+
text: `${localization.common.consumedCpu} %`,
|
|
81
|
+
isSortable: true,
|
|
82
|
+
sort: 'asc',
|
|
83
|
+
width: '96px',
|
|
84
|
+
show: true,
|
|
85
|
+
filter: false,
|
|
86
|
+
},
|
|
87
|
+
{
|
|
88
|
+
col: 'col5',
|
|
89
|
+
colName: 'consumed_mem',
|
|
90
|
+
text: `${localization.common.consumedMemory} %`,
|
|
91
|
+
isSortable: true,
|
|
92
|
+
sort: 'asc',
|
|
93
|
+
width: '96px',
|
|
94
|
+
show: true,
|
|
95
|
+
filter: false,
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
col: 'col6',
|
|
99
|
+
colName: 'ha_state',
|
|
100
|
+
text: localization.common.haState,
|
|
101
|
+
isSortable: true,
|
|
102
|
+
sort: 'asc',
|
|
103
|
+
width: '96px',
|
|
104
|
+
show: true,
|
|
105
|
+
filter: false,
|
|
106
|
+
},
|
|
107
|
+
{
|
|
108
|
+
col: 'col7',
|
|
109
|
+
colName: 'uptime',
|
|
110
|
+
text: localization.inventorySummary.uptime,
|
|
111
|
+
isSortable: true,
|
|
112
|
+
sort: 'asc',
|
|
113
|
+
width: '96px',
|
|
114
|
+
show: true,
|
|
115
|
+
filter: false,
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
col: 'col8',
|
|
119
|
+
colName: 'cert_valid_to',
|
|
120
|
+
text: localization.common.certificateValidTo,
|
|
121
|
+
isSortable: true,
|
|
122
|
+
sort: 'asc',
|
|
123
|
+
width: '96px',
|
|
124
|
+
show: true,
|
|
125
|
+
filter: false,
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
col: 'col9',
|
|
129
|
+
colName: 'mem_size',
|
|
130
|
+
text: `${localization.common.memorySize} (${localization.common.mb})`,
|
|
131
|
+
isSortable: true,
|
|
132
|
+
sort: 'asc',
|
|
133
|
+
width: '96px',
|
|
134
|
+
show: true,
|
|
135
|
+
filter: false,
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
col: 'col10',
|
|
139
|
+
colName: 'cpus',
|
|
140
|
+
text: localization.common.cpus,
|
|
141
|
+
isSortable: true,
|
|
142
|
+
sort: 'asc',
|
|
143
|
+
width: '96px',
|
|
144
|
+
show: true,
|
|
145
|
+
filter: false,
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
col: 'col11',
|
|
149
|
+
colName: 'nics',
|
|
150
|
+
text: localization.inventorySummary.nics,
|
|
151
|
+
isSortable: true,
|
|
152
|
+
sort: 'asc',
|
|
153
|
+
width: '96px',
|
|
154
|
+
show: true,
|
|
155
|
+
filter: false,
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
col: 'col12',
|
|
159
|
+
colName: 'version',
|
|
160
|
+
text: localization.common.version,
|
|
161
|
+
isSortable: true,
|
|
162
|
+
sort: 'asc',
|
|
163
|
+
width: '96px',
|
|
164
|
+
show: true,
|
|
165
|
+
filter: false,
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
col: 'col13',
|
|
169
|
+
colName: 'alarm_action',
|
|
170
|
+
text: localization.common.alarmActions,
|
|
171
|
+
isSortable: true,
|
|
172
|
+
sort: 'asc',
|
|
173
|
+
width: '96px',
|
|
174
|
+
show: true,
|
|
175
|
+
filter: false,
|
|
176
|
+
},
|
|
177
|
+
]
|
|
178
|
+
export const options: UI_I_DataTableOptions = {
|
|
179
|
+
perPageOptions: [{ text: '10', value: 100, default: true }],
|
|
180
|
+
isSelectable: true,
|
|
181
|
+
selectType: 'radio',
|
|
182
|
+
showPagination: false,
|
|
183
|
+
showPageInfo: false,
|
|
184
|
+
isSortable: true,
|
|
185
|
+
server: true,
|
|
186
|
+
isResizable: true,
|
|
187
|
+
showSelectedRows: false,
|
|
188
|
+
showColumnManager: true,
|
|
189
|
+
inModal: true,
|
|
190
|
+
inBlock: false,
|
|
191
|
+
// isFocusable: false,
|
|
192
|
+
// showPaginationOnTop: false,
|
|
193
|
+
// showSearch: false,
|
|
194
|
+
// withActions: false,
|
|
195
|
+
// showExport: false,
|
|
196
|
+
// withCollapse: false,
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export const getBodyDataFunc = (
|
|
200
|
+
bodyData: UI_I_HostTableItem[],
|
|
201
|
+
localization: UI_I_Localization
|
|
202
|
+
): UI_I_DataTableBody[] => {
|
|
203
|
+
const { $number } = useNuxtApp() as any
|
|
204
|
+
|
|
205
|
+
return bodyData.map((host, index: number) => {
|
|
206
|
+
const statusKey = host.state
|
|
207
|
+
? UI_E_DeviceStatus.Unknown
|
|
208
|
+
: UI_E_DeviceStatus.Supported
|
|
209
|
+
const statusData = {
|
|
210
|
+
...STATUS_MAPPING[statusKey],
|
|
211
|
+
testId: `${host.name}-${index}-status`,
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
return {
|
|
215
|
+
row: index,
|
|
216
|
+
collapse: false,
|
|
217
|
+
isHiddenCollapse: false,
|
|
218
|
+
collapseToggle: false,
|
|
219
|
+
|
|
220
|
+
data: [
|
|
221
|
+
{
|
|
222
|
+
key: 'icon',
|
|
223
|
+
col: 'col0',
|
|
224
|
+
text: host.name,
|
|
225
|
+
data: `vsphere-icon-${hostIconByState[host.state]}`,
|
|
226
|
+
testId: `migrate-host-table-item-${index}`,
|
|
227
|
+
},
|
|
228
|
+
|
|
229
|
+
{
|
|
230
|
+
key: 'status',
|
|
231
|
+
col: 'col1',
|
|
232
|
+
text: localization.common[hostLocalizationByState[host.state]],
|
|
233
|
+
testId: `migrate-host-table-item-${index}`,
|
|
234
|
+
data: statusData,
|
|
235
|
+
},
|
|
236
|
+
{
|
|
237
|
+
col: 'col2',
|
|
238
|
+
text: host.cluster,
|
|
239
|
+
testId: `migrate-host-table-item-${index}`,
|
|
240
|
+
},
|
|
241
|
+
{
|
|
242
|
+
col: 'col3',
|
|
243
|
+
text: host.fault_domain,
|
|
244
|
+
testId: `migrate-host-table-item-${index}`,
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
key: 'progress',
|
|
248
|
+
col: 'col4',
|
|
249
|
+
text: `${host.consumed_cpu.toFixed(2)}%`,
|
|
250
|
+
data: host.consumed_cpu,
|
|
251
|
+
testId: `migrate-host-table-item-${index}`,
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
key: 'progress',
|
|
255
|
+
col: 'col5',
|
|
256
|
+
text: `${host.consumed_mem.toFixed(2)}%`,
|
|
257
|
+
data: host.consumed_mem,
|
|
258
|
+
testId: `migrate-host-table-item-${index}`,
|
|
259
|
+
},
|
|
260
|
+
{
|
|
261
|
+
col: 'col6',
|
|
262
|
+
text: host.ha_state,
|
|
263
|
+
testId: `migrate-host-table-item-${index}`,
|
|
264
|
+
},
|
|
265
|
+
{
|
|
266
|
+
col: 'col7',
|
|
267
|
+
text: host.uptime + '',
|
|
268
|
+
testId: `migrate-host-table-item-${index}`,
|
|
269
|
+
},
|
|
270
|
+
{
|
|
271
|
+
col: 'col8',
|
|
272
|
+
text: host.cert_valid_to,
|
|
273
|
+
testId: `migrate-host-table-item-${index}`,
|
|
274
|
+
},
|
|
275
|
+
|
|
276
|
+
{
|
|
277
|
+
col: 'col9',
|
|
278
|
+
text: `${$number.format(host.mem_size, 'en')} ${
|
|
279
|
+
localization.common.mb
|
|
280
|
+
}`,
|
|
281
|
+
testId: `migrate-host-table-item-${index}`,
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
col: 'col10',
|
|
285
|
+
text: host.cpus + '',
|
|
286
|
+
testId: `migrate-host-table-item-${index}`,
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
col: 'col11',
|
|
290
|
+
text: host.nics + '',
|
|
291
|
+
testId: `migrate-host-table-item-${index}`,
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
col: 'col12',
|
|
295
|
+
text: host.version,
|
|
296
|
+
testId: `migrate-host-table-item-${index}`,
|
|
297
|
+
},
|
|
298
|
+
{
|
|
299
|
+
key: 'status',
|
|
300
|
+
col: 'col13',
|
|
301
|
+
text: host.alarm_action,
|
|
302
|
+
data: statusData,
|
|
303
|
+
testId: `migrate-host-table-item-${index}`,
|
|
304
|
+
},
|
|
305
|
+
],
|
|
306
|
+
}
|
|
307
|
+
})
|
|
308
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-table-view">
|
|
3
|
+
<atoms-table-data-grid
|
|
4
|
+
v-model:column-keys="columnKeys"
|
|
5
|
+
v-model:page-size="paginationLocal.pageSize"
|
|
6
|
+
v-model:page="paginationLocal.page"
|
|
7
|
+
:head-items="headItems"
|
|
8
|
+
:body-items="bodyItems"
|
|
9
|
+
:total-items="props.totalItems"
|
|
10
|
+
:total-pages="props.totalPages"
|
|
11
|
+
class="data-table"
|
|
12
|
+
test-id="any-table"
|
|
13
|
+
server-off
|
|
14
|
+
hide-page-size
|
|
15
|
+
hide-pagination
|
|
16
|
+
>
|
|
17
|
+
<template #value="{ item }">
|
|
18
|
+
<div v-if="item.data.type === 'int'">
|
|
19
|
+
<input
|
|
20
|
+
type="number"
|
|
21
|
+
:value="item.data.value"
|
|
22
|
+
@change="onChangeSetting($event, item.data.key)"
|
|
23
|
+
/>
|
|
24
|
+
</div>
|
|
25
|
+
<div v-if="item.data.type === 'string'">
|
|
26
|
+
<input
|
|
27
|
+
type="text"
|
|
28
|
+
:value="item.data.value"
|
|
29
|
+
@change="onChangeSetting($event, item.data.key)"
|
|
30
|
+
/>
|
|
31
|
+
</div>
|
|
32
|
+
<div v-if="item.data.type === 'boolean'">
|
|
33
|
+
<select
|
|
34
|
+
@change="onChangeSetting($event, item.data.key)"
|
|
35
|
+
:value="item.data.value"
|
|
36
|
+
>
|
|
37
|
+
<option value="false">false</option>
|
|
38
|
+
<option value="true">true</option>
|
|
39
|
+
</select>
|
|
40
|
+
</div>
|
|
41
|
+
<div v-if="item.data.type === 'select'">
|
|
42
|
+
<select
|
|
43
|
+
@change="onChangeSetting($event, item.data.key)"
|
|
44
|
+
:value="item.data.value"
|
|
45
|
+
>
|
|
46
|
+
<option
|
|
47
|
+
v-for="item2 in item.data.options"
|
|
48
|
+
:key="item2.key"
|
|
49
|
+
:value="item2.key"
|
|
50
|
+
>
|
|
51
|
+
{{ item2.value }}
|
|
52
|
+
</option>
|
|
53
|
+
</select>
|
|
54
|
+
</div>
|
|
55
|
+
</template>
|
|
56
|
+
</atoms-table-data-grid>
|
|
57
|
+
</div>
|
|
58
|
+
</template>
|
|
59
|
+
|
|
60
|
+
<script lang="ts" setup>
|
|
61
|
+
import type {
|
|
62
|
+
UI_I_ColumnKey,
|
|
63
|
+
UI_I_HeadItem,
|
|
64
|
+
UI_I_BodyItem,
|
|
65
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
66
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
67
|
+
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
68
|
+
import * as table from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/config/table'
|
|
69
|
+
|
|
70
|
+
const settings = defineModel<any>('settings', { required: true })
|
|
71
|
+
|
|
72
|
+
const props = defineProps<{
|
|
73
|
+
dataTable: any[]
|
|
74
|
+
totalItems: number
|
|
75
|
+
totalPages: number
|
|
76
|
+
isEdit: boolean
|
|
77
|
+
}>()
|
|
78
|
+
|
|
79
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
80
|
+
|
|
81
|
+
const onChangeSetting = (event: any, key: string): void => {
|
|
82
|
+
let value = event.target.value
|
|
83
|
+
settings.value.items = settings.value.items.map((item) => {
|
|
84
|
+
if (item.key === key) {
|
|
85
|
+
if (item.type === 'boolean') value = !!value
|
|
86
|
+
if (item.type === 'int') value = +value
|
|
87
|
+
item.value = value
|
|
88
|
+
}
|
|
89
|
+
return item
|
|
90
|
+
})
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
const paginationLocal = ref<UI_I_Pagination>({
|
|
94
|
+
page: 1,
|
|
95
|
+
pageSize: 100,
|
|
96
|
+
})
|
|
97
|
+
|
|
98
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
99
|
+
table.headItems(localization.value, props.isEdit)
|
|
100
|
+
)
|
|
101
|
+
|
|
102
|
+
const columnKeys = computed<UI_I_ColumnKey[]>(() =>
|
|
103
|
+
table.columnKeys(localization.value, props.isEdit)
|
|
104
|
+
)
|
|
105
|
+
|
|
106
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
107
|
+
return table.bodyItems(props.dataTable, localization.value, props.isEdit)
|
|
108
|
+
})
|
|
109
|
+
</script>
|
|
110
|
+
|
|
111
|
+
<style lang="scss" scoped>
|
|
112
|
+
@import 'assets/scss/common/mixins.scss';
|
|
113
|
+
.data-table-view {
|
|
114
|
+
@include flex($dir: column);
|
|
115
|
+
overflow: hidden;
|
|
116
|
+
height: inherit;
|
|
117
|
+
max-height: 250px;
|
|
118
|
+
.data-table {
|
|
119
|
+
@include flex($dir: column);
|
|
120
|
+
flex-direction: column;
|
|
121
|
+
overflow: hidden;
|
|
122
|
+
height: inherit;
|
|
123
|
+
:deep(.datagrid-outer-wrapper) {
|
|
124
|
+
height: inherit;
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
</style>
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import type {
|
|
2
|
+
UI_I_ColumnKey,
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_BodyItem,
|
|
5
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
6
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
7
|
+
import {
|
|
8
|
+
constructColumnKey,
|
|
9
|
+
constructHeadItem,
|
|
10
|
+
} from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
11
|
+
import { tableItemKeys } from '~/components/common/configure/advancedSystemSettings/tableView/old/lib/config/tableKeys'
|
|
12
|
+
|
|
13
|
+
const getItems = (
|
|
14
|
+
_localization: UI_I_Localization,
|
|
15
|
+
isEdit = false
|
|
16
|
+
): [string, boolean, string, string][] => {
|
|
17
|
+
const items: [string, boolean, string, string][] = [
|
|
18
|
+
['localization.common.key', true, '280px', tableItemKeys[0]],
|
|
19
|
+
['localization.common.value', true, '280px', tableItemKeys[1]],
|
|
20
|
+
]
|
|
21
|
+
if (!isEdit) {
|
|
22
|
+
items.push(['localization.common.summary', true, '280px', tableItemKeys[2]])
|
|
23
|
+
}
|
|
24
|
+
return items
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export const columnKeys = (
|
|
28
|
+
localization: UI_I_Localization,
|
|
29
|
+
isEdit = false
|
|
30
|
+
): UI_I_ColumnKey[] => {
|
|
31
|
+
const result: UI_I_ColumnKey[] = []
|
|
32
|
+
getItems(localization, isEdit).forEach((item, i) => {
|
|
33
|
+
const col = isEdit && i === 1 ? 'value' : `col${i}`
|
|
34
|
+
result.push(constructColumnKey(col, item[0], item[1]))
|
|
35
|
+
})
|
|
36
|
+
return result
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
export const headItems = (
|
|
40
|
+
localization: UI_I_Localization,
|
|
41
|
+
isEdit = false
|
|
42
|
+
): UI_I_HeadItem[] => {
|
|
43
|
+
const result: UI_I_HeadItem[] = []
|
|
44
|
+
getItems(localization, isEdit).forEach((item, i) => {
|
|
45
|
+
const col = isEdit && i === 1 ? 'value' : `col${i}`
|
|
46
|
+
result.push(
|
|
47
|
+
constructHeadItem(col, item[0], item[3], false, item[2], '', 'any')
|
|
48
|
+
)
|
|
49
|
+
})
|
|
50
|
+
return result
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export const bodyItems = (
|
|
54
|
+
data: any[],
|
|
55
|
+
_localization: UI_I_Localization,
|
|
56
|
+
isEdit = false
|
|
57
|
+
): UI_I_BodyItem[][] => {
|
|
58
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
59
|
+
data.forEach((item, key) => {
|
|
60
|
+
const editData = {
|
|
61
|
+
key: item.key,
|
|
62
|
+
type: item.type,
|
|
63
|
+
value: item.value,
|
|
64
|
+
validation: item.validation,
|
|
65
|
+
options: item.options,
|
|
66
|
+
}
|
|
67
|
+
const cols = [
|
|
68
|
+
{
|
|
69
|
+
key: 'col0',
|
|
70
|
+
text: item[tableItemKeys[0]],
|
|
71
|
+
id: key,
|
|
72
|
+
testId: `any-table-item-${key}`,
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
key: isEdit ? 'value' : 'col1',
|
|
76
|
+
text: item[tableItemKeys[1]],
|
|
77
|
+
id: key,
|
|
78
|
+
testId: `any-table-item-${key}`,
|
|
79
|
+
data: isEdit ? editData : null
|
|
80
|
+
}
|
|
81
|
+
]
|
|
82
|
+
if (!isEdit) {
|
|
83
|
+
cols.push({
|
|
84
|
+
key: 'col2',
|
|
85
|
+
text: item[tableItemKeys[2]],
|
|
86
|
+
id: key,
|
|
87
|
+
testId: `any-table-item-${key}`,
|
|
88
|
+
})
|
|
89
|
+
}
|
|
90
|
+
bodyItems.push(cols)
|
|
91
|
+
})
|
|
92
|
+
return bodyItems
|
|
93
|
+
}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<common-headline :headline="props.title" class="items-center">
|
|
3
|
+
<template #action>
|
|
4
|
+
<button
|
|
5
|
+
class="btn btn-sm btn-secondary ng-star-inserted"
|
|
6
|
+
@click="emits('show-edit')"
|
|
7
|
+
>
|
|
8
|
+
{{ localization.common.edit }}...
|
|
9
|
+
</button>
|
|
10
|
+
</template>
|
|
11
|
+
</common-headline>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script setup lang="ts">
|
|
15
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
16
|
+
|
|
17
|
+
const props = defineProps<{
|
|
18
|
+
title: string
|
|
19
|
+
}>()
|
|
20
|
+
|
|
21
|
+
const emits = defineEmits<{
|
|
22
|
+
(event: 'show-edit'): void
|
|
23
|
+
}>()
|
|
24
|
+
|
|
25
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style scoped lang="scss"></style>
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<component
|
|
3
|
+
:is="currentComponent"
|
|
4
|
+
:title="localization.common.advancedSystemSettings"
|
|
5
|
+
@show-edit="emits('show-edit')"
|
|
6
|
+
/>
|
|
7
|
+
</template>
|
|
8
|
+
|
|
9
|
+
<script setup lang="ts">
|
|
10
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
11
|
+
|
|
12
|
+
const emits = defineEmits<{
|
|
13
|
+
(event: 'show-edit'): void
|
|
14
|
+
}>()
|
|
15
|
+
|
|
16
|
+
const { $store }: any = useNuxtApp()
|
|
17
|
+
|
|
18
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
19
|
+
|
|
20
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
21
|
+
const currentComponent = computed(() =>
|
|
22
|
+
isNewView.value
|
|
23
|
+
? defineAsyncComponent(() => import('./New.vue'))
|
|
24
|
+
: defineAsyncComponent(() => import('./Old.vue'))
|
|
25
|
+
)
|
|
26
|
+
</script>
|
|
27
|
+
|
|
28
|
+
<style scoped lang="scss"></style>
|