bfg-common 1.5.514 → 1.5.516
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/assets/localization/local_be.json +5 -3
- package/assets/localization/local_en.json +6 -4
- package/assets/localization/local_hy.json +5 -3
- package/assets/localization/local_kk.json +5 -3
- package/assets/localization/local_ru.json +5 -3
- package/assets/localization/local_zh.json +5 -3
- package/components/atoms/sortableView/SortableView.vue +2 -2
- package/components/common/browse/blocks/lib/models/types.ts +1 -1
- package/components/common/browse/lib/models/interfaces.ts +5 -5
- package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/network/Contents.vue +497 -497
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +196 -379
- package/components/common/pages/backups/modals/createBackup/New.vue +267 -0
- package/components/common/pages/backups/modals/createBackup/Old.vue +142 -0
- package/components/common/pages/backups/modals/createBackup/configuration/Configuration.vue +29 -29
- package/components/common/pages/backups/modals/createBackup/configuration/ConfigurationNew.vue +218 -0
- package/components/common/pages/backups/modals/createBackup/configuration/ConfigurationOld.vue +29 -0
- package/components/common/pages/backups/modals/createBackup/configuration/backupWindow/BackupWindow.vue +29 -29
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +69 -69
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
- package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +38 -38
- package/components/common/pages/backups/modals/createBackup/datastores/Datastores.vue +34 -59
- package/components/common/pages/backups/modals/createBackup/datastores/DatastoresNew.vue +23 -0
- package/components/common/pages/backups/modals/createBackup/datastores/DatastoresOld.vue +33 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/TableView.vue +134 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +219 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/models/enums.ts +15 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/models/interfaces.ts +5 -0
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{TableView.vue → old/TableView.vue} +95 -95
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{lib → old/lib}/config/keys.ts +14 -14
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{lib → old/lib}/config/table.ts +127 -127
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/{lib → old/lib}/models/types.ts +10 -10
- package/components/common/pages/backups/modals/createBackup/disks/Disks.vue +34 -28
- package/components/common/pages/backups/modals/createBackup/disks/DisksNew.vue +22 -0
- package/components/common/pages/backups/modals/createBackup/disks/DisksOld.vue +28 -0
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/TableView.vue +131 -0
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/lib/config/table.ts +178 -0
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{TableView.vue → old/TableView.vue} +119 -108
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{lib → old/lib}/config/keys.ts +12 -12
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{lib → old/lib}/config/table.ts +125 -125
- package/components/common/pages/backups/modals/createBackup/disks/tableView/{lib → old/lib}/models/types.ts +10 -10
- package/components/common/pages/backups/modals/createBackup/general/General.vue +33 -141
- package/components/common/pages/backups/modals/createBackup/general/GeneralNew.vue +128 -0
- package/components/common/pages/backups/modals/createBackup/general/GeneralOld.vue +66 -0
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +59 -0
- package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +123 -117
- package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +13 -12
- package/components/common/pages/backups/modals/createBackup/lib/models/interfaces.ts +8 -8
- package/components/common/pages/backups/modals/createBackup/lib/validation/validations.ts +145 -0
- package/package.json +1 -1
package/components/common/pages/backups/modals/createBackup/disks/tableView/new/lib/config/table.ts
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
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_Pvm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
8
|
+
import type {
|
|
9
|
+
UI_I_CreateBackupFormDiskDevice
|
|
10
|
+
} from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
export const getHeaderDataFunc = (
|
|
14
|
+
localization: UI_I_Localization
|
|
15
|
+
): UI_I_DataTableHeader[] => [
|
|
16
|
+
{
|
|
17
|
+
col: 'col0',
|
|
18
|
+
colName: 'source',
|
|
19
|
+
text: localization.common.source,
|
|
20
|
+
isSortable: true,
|
|
21
|
+
sort: 'asc',
|
|
22
|
+
width: '368px',
|
|
23
|
+
show: true,
|
|
24
|
+
filter: true
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
col: 'col1',
|
|
28
|
+
colName: 'deviceType',
|
|
29
|
+
text: localization.common.deviceType,
|
|
30
|
+
isSortable: true,
|
|
31
|
+
sort: 'asc',
|
|
32
|
+
width: '136px',
|
|
33
|
+
show: true,
|
|
34
|
+
filter: true
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
col: 'col2',
|
|
38
|
+
colName: 'bus',
|
|
39
|
+
text: localization.common.bus,
|
|
40
|
+
isSortable: true,
|
|
41
|
+
sort: 'asc',
|
|
42
|
+
width: '112px',
|
|
43
|
+
show: true,
|
|
44
|
+
filter: true
|
|
45
|
+
},
|
|
46
|
+
{
|
|
47
|
+
col: 'col3',
|
|
48
|
+
colName: 'target',
|
|
49
|
+
text: localization.common.target,
|
|
50
|
+
isSortable: true,
|
|
51
|
+
sort: 'asc',
|
|
52
|
+
width: '112px',
|
|
53
|
+
show: true,
|
|
54
|
+
filter: true
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
col: 'col4',
|
|
58
|
+
colName: 'capacity',
|
|
59
|
+
text: localization.common.capacity,
|
|
60
|
+
isSortable: true,
|
|
61
|
+
sort: 'asc',
|
|
62
|
+
width: '112px',
|
|
63
|
+
show: true,
|
|
64
|
+
filter: true
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
col: 'col5',
|
|
68
|
+
colName: 'used',
|
|
69
|
+
text: localization.common.used,
|
|
70
|
+
isSortable: true,
|
|
71
|
+
sort: 'asc',
|
|
72
|
+
width: '112px',
|
|
73
|
+
show: true,
|
|
74
|
+
filter: true
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
col: 'col6',
|
|
78
|
+
colName: 'free',
|
|
79
|
+
text: localization.common.free,
|
|
80
|
+
isSortable: true,
|
|
81
|
+
sort: 'asc',
|
|
82
|
+
width: '112px',
|
|
83
|
+
show: true,
|
|
84
|
+
filter: true
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
col: 'col7',
|
|
88
|
+
colName: 'volumePath',
|
|
89
|
+
text: localization.common.volumePath,
|
|
90
|
+
isSortable: true,
|
|
91
|
+
sort: 'asc',
|
|
92
|
+
width: '240px',
|
|
93
|
+
show: true,
|
|
94
|
+
filter: true
|
|
95
|
+
}
|
|
96
|
+
]
|
|
97
|
+
|
|
98
|
+
|
|
99
|
+
export const options: UI_I_DataTableOptions = {
|
|
100
|
+
perPageOptions: [{ text: '10', value: 100, default: true }],
|
|
101
|
+
isSelectable: true,
|
|
102
|
+
isFocusable: false,
|
|
103
|
+
showPagination: false,
|
|
104
|
+
showPaginationOnTop: false,
|
|
105
|
+
selectType: 'checkbox',
|
|
106
|
+
showPageInfo: false,
|
|
107
|
+
isSortable: true,
|
|
108
|
+
server: false,
|
|
109
|
+
isResizable: true,
|
|
110
|
+
showSearch: false,
|
|
111
|
+
showSelectedRows: false,
|
|
112
|
+
showColumnManager: true,
|
|
113
|
+
withActions: false,
|
|
114
|
+
inBlock: false,
|
|
115
|
+
inModal: true,
|
|
116
|
+
showExport: false,
|
|
117
|
+
withCollapse: false
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
export const getBodyDataFunc = (
|
|
121
|
+
bodyData: UI_I_Pvm['disk_devices'],
|
|
122
|
+
selectedDisks: UI_I_CreateBackupFormDiskDevice[]
|
|
123
|
+
): UI_I_DataTableBody[] => {
|
|
124
|
+
const { $binary } = useNuxtApp()
|
|
125
|
+
const lang = useLocalStorage('lang') === 'ru_RU' ? 'ru' : 'en'
|
|
126
|
+
|
|
127
|
+
return bodyData.map((disk, index: number) => {
|
|
128
|
+
return {
|
|
129
|
+
row: index,
|
|
130
|
+
collapse: false,
|
|
131
|
+
isHiddenCollapse: false,
|
|
132
|
+
collapseToggle: false,
|
|
133
|
+
isSelected: !!selectedDisks.find(item => item.location === disk.source),
|
|
134
|
+
data: [
|
|
135
|
+
{
|
|
136
|
+
key: 'icon',
|
|
137
|
+
col: 'col0',
|
|
138
|
+
text: disk.source,
|
|
139
|
+
data: {
|
|
140
|
+
iconClassName: 'icon-vSphere-dsVmDisk',
|
|
141
|
+
data: {
|
|
142
|
+
location: disk.source,
|
|
143
|
+
target: disk.target
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
col: 'col1',
|
|
149
|
+
text: disk.device_type
|
|
150
|
+
},
|
|
151
|
+
{
|
|
152
|
+
col: 'col2',
|
|
153
|
+
text: disk.bus
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
col: 'col3',
|
|
157
|
+
text: disk.target
|
|
158
|
+
},
|
|
159
|
+
{
|
|
160
|
+
col: 'col4',
|
|
161
|
+
text: $binary.round(disk.capacity_mb, false, lang)
|
|
162
|
+
},
|
|
163
|
+
{
|
|
164
|
+
col: 'col5',
|
|
165
|
+
text: $binary.round(disk.used_mb, false, lang)
|
|
166
|
+
},
|
|
167
|
+
{
|
|
168
|
+
col: 'col7',
|
|
169
|
+
text: $binary.round(disk.free_mb, false, lang)
|
|
170
|
+
},
|
|
171
|
+
{
|
|
172
|
+
col: 'col6',
|
|
173
|
+
text: disk.volume_path || '--'
|
|
174
|
+
}
|
|
175
|
+
]
|
|
176
|
+
}
|
|
177
|
+
})
|
|
178
|
+
}
|
|
@@ -1,108 +1,119 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<div class="data-table-view overflow-hidden">
|
|
3
|
-
<div class="data-table-view__inner">
|
|
4
|
-
<atoms-table-data-grid
|
|
5
|
-
v-model:selected-row="selectedRowsLocal"
|
|
6
|
-
v-model:column-keys="columnKeys"
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
:
|
|
13
|
-
:
|
|
14
|
-
:items
|
|
15
|
-
:
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
</
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
)
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
()
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<div class="data-table-view overflow-hidden">
|
|
3
|
+
<div class="data-table-view__inner">
|
|
4
|
+
<atoms-table-data-grid
|
|
5
|
+
v-model:selected-row="selectedRowsLocal"
|
|
6
|
+
v-model:column-keys="columnKeys"
|
|
7
|
+
v-model:page-size="pagination.pageSize"
|
|
8
|
+
v-model:page="pagination.page"
|
|
9
|
+
class="data-table"
|
|
10
|
+
type="checkbox"
|
|
11
|
+
test-id="disks-table"
|
|
12
|
+
:head-items="headItems"
|
|
13
|
+
:body-items="bodyItems"
|
|
14
|
+
:total-items="props.totalItems"
|
|
15
|
+
:total-pages="props.totalPages"
|
|
16
|
+
:items-per-page="itemsPerPage"
|
|
17
|
+
:loading="loading"
|
|
18
|
+
hide-pagination
|
|
19
|
+
server-off
|
|
20
|
+
/>
|
|
21
|
+
</div>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
|
|
25
|
+
<script lang="ts" setup>
|
|
26
|
+
import type {
|
|
27
|
+
UI_I_HeadItem,
|
|
28
|
+
UI_I_ColumnKey,
|
|
29
|
+
UI_I_BodyItem,
|
|
30
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
31
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
32
|
+
import type {
|
|
33
|
+
UI_I_CreateBackupFormDiskDevice,
|
|
34
|
+
UI_I_Pvm
|
|
35
|
+
} from "~/components/common/pages/backups/modals/lib/models/interfaces";
|
|
36
|
+
import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
|
|
37
|
+
import * as table from '~/components/common/pages/backups/modals/createBackup/disks/tableView/old/lib/config/table'
|
|
38
|
+
import type {UI_I_Pagination} from "~/lib/models/table/interfaces";
|
|
39
|
+
|
|
40
|
+
const props = defineProps<{
|
|
41
|
+
dataTable: UI_I_Pvm['disk_devices']
|
|
42
|
+
loading: boolean
|
|
43
|
+
totalItems: number
|
|
44
|
+
totalPages: number
|
|
45
|
+
}>()
|
|
46
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
47
|
+
|
|
48
|
+
const selectedRows = defineModel<UI_I_CreateBackupFormDiskDevice[]>('selected', { required: true })
|
|
49
|
+
|
|
50
|
+
const pagination = ref<UI_I_Pagination>({
|
|
51
|
+
page: 1,
|
|
52
|
+
pageSize: 100,
|
|
53
|
+
})
|
|
54
|
+
|
|
55
|
+
const selectedRowsLocal = ref<string[]>(
|
|
56
|
+
selectedRows.value?.map((item) => item.location) || []
|
|
57
|
+
)
|
|
58
|
+
watch(
|
|
59
|
+
selectedRowsLocal,
|
|
60
|
+
(newValue) => {
|
|
61
|
+
const selected: UI_I_CreateBackupFormDiskDevice[] = []
|
|
62
|
+
bodyItems.value.forEach((row) => {
|
|
63
|
+
if (newValue.includes(row[0].id + '')) {
|
|
64
|
+
selected.push(row[0].data)
|
|
65
|
+
}
|
|
66
|
+
})
|
|
67
|
+
selectedRows.value = selected
|
|
68
|
+
},
|
|
69
|
+
{ deep: true }
|
|
70
|
+
)
|
|
71
|
+
|
|
72
|
+
const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
|
|
73
|
+
|
|
74
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
75
|
+
table.headItems(localization.value)
|
|
76
|
+
)
|
|
77
|
+
|
|
78
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
79
|
+
let result: UI_I_BodyItem[][] = []
|
|
80
|
+
if (props.dataTable.length) {
|
|
81
|
+
result = table.bodyItems(props.dataTable)
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
return result
|
|
85
|
+
})
|
|
86
|
+
|
|
87
|
+
// ToDo проверить почему опусташает selectedRows
|
|
88
|
+
|
|
89
|
+
// watch(
|
|
90
|
+
// bodyItems,
|
|
91
|
+
// () => {
|
|
92
|
+
// setTimeout(() => {
|
|
93
|
+
// selectedRows.value = []
|
|
94
|
+
// }, 0)
|
|
95
|
+
// },
|
|
96
|
+
// { deep: true, immediate: true }
|
|
97
|
+
// )
|
|
98
|
+
</script>
|
|
99
|
+
|
|
100
|
+
<style lang="scss" scoped>
|
|
101
|
+
.data-table-view {
|
|
102
|
+
height: inherit;
|
|
103
|
+
margin-bottom: 10px;
|
|
104
|
+
margin-right: 10px;
|
|
105
|
+
|
|
106
|
+
&__inner {
|
|
107
|
+
height: inherit;
|
|
108
|
+
}
|
|
109
|
+
:deep(.data-table) {
|
|
110
|
+
height: inherit;
|
|
111
|
+
.datagrid-outer-wrapper {
|
|
112
|
+
height: inherit;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
.vm-icon {
|
|
117
|
+
margin-right: 5px;
|
|
118
|
+
}
|
|
119
|
+
</style>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import type { UI_T_DiskTableKeysTuple } from '~/components/common/pages/backups/modals/createBackup/disks/tableView/lib/models/types'
|
|
2
|
-
|
|
3
|
-
export const tableKeys: UI_T_DiskTableKeysTuple = [
|
|
4
|
-
'source',
|
|
5
|
-
'device_type',
|
|
6
|
-
'bus',
|
|
7
|
-
'target',
|
|
8
|
-
'capacity_mb',
|
|
9
|
-
'used_mb',
|
|
10
|
-
'free_mb',
|
|
11
|
-
'volume_path',
|
|
12
|
-
]
|
|
1
|
+
import type { UI_T_DiskTableKeysTuple } from '~/components/common/pages/backups/modals/createBackup/disks/tableView/old/lib/models/types'
|
|
2
|
+
|
|
3
|
+
export const tableKeys: UI_T_DiskTableKeysTuple = [
|
|
4
|
+
'source',
|
|
5
|
+
'device_type',
|
|
6
|
+
'bus',
|
|
7
|
+
'target',
|
|
8
|
+
'capacity_mb',
|
|
9
|
+
'used_mb',
|
|
10
|
+
'free_mb',
|
|
11
|
+
'volume_path',
|
|
12
|
+
]
|
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
-
import type {
|
|
3
|
-
UI_I_HeadItem,
|
|
4
|
-
UI_I_ColumnKey,
|
|
5
|
-
UI_I_BodyItem,
|
|
6
|
-
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
7
|
-
import type { UI_I_Pvm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
8
|
-
import {
|
|
9
|
-
constructHeadItem,
|
|
10
|
-
constructColumnKey,
|
|
11
|
-
} from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
12
|
-
import { tableKeys } from '~/components/common/pages/backups/modals/createBackup/disks/tableView/lib/config/keys'
|
|
13
|
-
|
|
14
|
-
const getItems = (
|
|
15
|
-
localization: UI_I_Localization
|
|
16
|
-
): [string, boolean, string, string][] => {
|
|
17
|
-
return [
|
|
18
|
-
[localization.common.source, true, '180px', tableKeys[0]],
|
|
19
|
-
[localization.common.deviceType, true, '180px', tableKeys[1]],
|
|
20
|
-
[localization.common.bus, true, '180px', tableKeys[2]],
|
|
21
|
-
[localization.common.target, true, '180px', tableKeys[3]],
|
|
22
|
-
[localization.common.capacity, true, '180px', tableKeys[4]],
|
|
23
|
-
[localization.common.used, true, '180px', tableKeys[5]],
|
|
24
|
-
[localization.common.free, true, '180px', tableKeys[6]],
|
|
25
|
-
[localization.common.volumePath, true, '180px', tableKeys[7]],
|
|
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
|
-
result.push(
|
|
34
|
-
constructColumnKey(`col${i}`, item[0], item[1], `show-column-${item[3]}`)
|
|
35
|
-
)
|
|
36
|
-
})
|
|
37
|
-
return result
|
|
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
|
-
result.push(
|
|
43
|
-
constructHeadItem(
|
|
44
|
-
`col${i}`,
|
|
45
|
-
item[0],
|
|
46
|
-
item[3],
|
|
47
|
-
true,
|
|
48
|
-
item[2],
|
|
49
|
-
undefined,
|
|
50
|
-
item[3]
|
|
51
|
-
)
|
|
52
|
-
)
|
|
53
|
-
})
|
|
54
|
-
return result
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
export const bodyItems = (
|
|
58
|
-
data: UI_I_Pvm['disk_devices']
|
|
59
|
-
): UI_I_BodyItem[][] => {
|
|
60
|
-
const { $binary }: any = useNuxtApp()
|
|
61
|
-
const lang = useLocalStorage('lang') === 'ru_RU' ? 'ru' : 'en'
|
|
62
|
-
|
|
63
|
-
const bodyItems: UI_I_BodyItem[][] = []
|
|
64
|
-
data.forEach((disk: UI_I_Pvm['disk_devices'][0], key) => {
|
|
65
|
-
bodyItems.push([
|
|
66
|
-
{
|
|
67
|
-
key: 'col0',
|
|
68
|
-
text: disk[tableKeys[0]],
|
|
69
|
-
id: disk.source,
|
|
70
|
-
data: {
|
|
71
|
-
location: disk.source,
|
|
72
|
-
target: disk.target,
|
|
73
|
-
},
|
|
74
|
-
testId: `disk-table-item-${key}`,
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
key: 'col1',
|
|
78
|
-
text: disk[tableKeys[1]],
|
|
79
|
-
id: disk.source,
|
|
80
|
-
testId: `disk-table-item-${key}`,
|
|
81
|
-
},
|
|
82
|
-
{
|
|
83
|
-
key: 'col2',
|
|
84
|
-
text: disk[tableKeys[2]],
|
|
85
|
-
id: disk.source,
|
|
86
|
-
testId: `disk-table-item-${key}`,
|
|
87
|
-
},
|
|
88
|
-
{
|
|
89
|
-
key: 'col3',
|
|
90
|
-
text: disk[tableKeys[3]],
|
|
91
|
-
id: disk.source,
|
|
92
|
-
testId: `disk-table-item-${key}`,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
key: 'col4',
|
|
96
|
-
text: $binary.round(disk[tableKeys[4]], false, lang),
|
|
97
|
-
id: disk.source,
|
|
98
|
-
testId: `disk-table-item-${key}`,
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
key: 'col5',
|
|
102
|
-
text: $binary.round(
|
|
103
|
-
disk[tableKeys[4]] - disk[tableKeys[6]],
|
|
104
|
-
false,
|
|
105
|
-
lang
|
|
106
|
-
),
|
|
107
|
-
id: disk.source,
|
|
108
|
-
testId: `disk-table-item-${key}`,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
key: 'col6',
|
|
112
|
-
text: $binary.round(disk[tableKeys[6]], false, lang),
|
|
113
|
-
id: disk.source,
|
|
114
|
-
testId: `disk-table-item-${key}`,
|
|
115
|
-
},
|
|
116
|
-
{
|
|
117
|
-
key: 'col7',
|
|
118
|
-
text: disk[tableKeys[7]],
|
|
119
|
-
id: disk.source,
|
|
120
|
-
testId: `disk-table-item-${key}`,
|
|
121
|
-
},
|
|
122
|
-
])
|
|
123
|
-
})
|
|
124
|
-
return bodyItems
|
|
125
|
-
}
|
|
1
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
2
|
+
import type {
|
|
3
|
+
UI_I_HeadItem,
|
|
4
|
+
UI_I_ColumnKey,
|
|
5
|
+
UI_I_BodyItem,
|
|
6
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
7
|
+
import type { UI_I_Pvm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
8
|
+
import {
|
|
9
|
+
constructHeadItem,
|
|
10
|
+
constructColumnKey,
|
|
11
|
+
} from '~/components/atoms/table/dataGrid/lib/utils/constructDataTable'
|
|
12
|
+
import { tableKeys } from '~/components/common/pages/backups/modals/createBackup/disks/tableView/old/lib/config/keys'
|
|
13
|
+
|
|
14
|
+
const getItems = (
|
|
15
|
+
localization: UI_I_Localization
|
|
16
|
+
): [string, boolean, string, string][] => {
|
|
17
|
+
return [
|
|
18
|
+
[localization.common.source, true, '180px', tableKeys[0]],
|
|
19
|
+
[localization.common.deviceType, true, '180px', tableKeys[1]],
|
|
20
|
+
[localization.common.bus, true, '180px', tableKeys[2]],
|
|
21
|
+
[localization.common.target, true, '180px', tableKeys[3]],
|
|
22
|
+
[localization.common.capacity, true, '180px', tableKeys[4]],
|
|
23
|
+
[localization.common.used, true, '180px', tableKeys[5]],
|
|
24
|
+
[localization.common.free, true, '180px', tableKeys[6]],
|
|
25
|
+
[localization.common.volumePath, true, '180px', tableKeys[7]],
|
|
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
|
+
result.push(
|
|
34
|
+
constructColumnKey(`col${i}`, item[0], item[1], `show-column-${item[3]}`)
|
|
35
|
+
)
|
|
36
|
+
})
|
|
37
|
+
return result
|
|
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
|
+
result.push(
|
|
43
|
+
constructHeadItem(
|
|
44
|
+
`col${i}`,
|
|
45
|
+
item[0],
|
|
46
|
+
item[3],
|
|
47
|
+
true,
|
|
48
|
+
item[2],
|
|
49
|
+
undefined,
|
|
50
|
+
item[3]
|
|
51
|
+
)
|
|
52
|
+
)
|
|
53
|
+
})
|
|
54
|
+
return result
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
export const bodyItems = (
|
|
58
|
+
data: UI_I_Pvm['disk_devices']
|
|
59
|
+
): UI_I_BodyItem[][] => {
|
|
60
|
+
const { $binary }: any = useNuxtApp()
|
|
61
|
+
const lang = useLocalStorage('lang') === 'ru_RU' ? 'ru' : 'en'
|
|
62
|
+
|
|
63
|
+
const bodyItems: UI_I_BodyItem[][] = []
|
|
64
|
+
data.forEach((disk: UI_I_Pvm['disk_devices'][0], key) => {
|
|
65
|
+
bodyItems.push([
|
|
66
|
+
{
|
|
67
|
+
key: 'col0',
|
|
68
|
+
text: disk[tableKeys[0]],
|
|
69
|
+
id: disk.source,
|
|
70
|
+
data: {
|
|
71
|
+
location: disk.source,
|
|
72
|
+
target: disk.target,
|
|
73
|
+
},
|
|
74
|
+
testId: `disk-table-item-${key}`,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
key: 'col1',
|
|
78
|
+
text: disk[tableKeys[1]],
|
|
79
|
+
id: disk.source,
|
|
80
|
+
testId: `disk-table-item-${key}`,
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
key: 'col2',
|
|
84
|
+
text: disk[tableKeys[2]],
|
|
85
|
+
id: disk.source,
|
|
86
|
+
testId: `disk-table-item-${key}`,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
key: 'col3',
|
|
90
|
+
text: disk[tableKeys[3]],
|
|
91
|
+
id: disk.source,
|
|
92
|
+
testId: `disk-table-item-${key}`,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
key: 'col4',
|
|
96
|
+
text: $binary.round(disk[tableKeys[4]], false, lang),
|
|
97
|
+
id: disk.source,
|
|
98
|
+
testId: `disk-table-item-${key}`,
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
key: 'col5',
|
|
102
|
+
text: $binary.round(
|
|
103
|
+
disk[tableKeys[4]] - disk[tableKeys[6]],
|
|
104
|
+
false,
|
|
105
|
+
lang
|
|
106
|
+
),
|
|
107
|
+
id: disk.source,
|
|
108
|
+
testId: `disk-table-item-${key}`,
|
|
109
|
+
},
|
|
110
|
+
{
|
|
111
|
+
key: 'col6',
|
|
112
|
+
text: $binary.round(disk[tableKeys[6]], false, lang),
|
|
113
|
+
id: disk.source,
|
|
114
|
+
testId: `disk-table-item-${key}`,
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
key: 'col7',
|
|
118
|
+
text: disk[tableKeys[7]],
|
|
119
|
+
id: disk.source,
|
|
120
|
+
testId: `disk-table-item-${key}`,
|
|
121
|
+
},
|
|
122
|
+
])
|
|
123
|
+
})
|
|
124
|
+
return bodyItems
|
|
125
|
+
}
|