bfg-common 1.5.539 → 1.5.540
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/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/DataGrid.vue +1718 -1718
- 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/Add.vue +251 -251
- 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/diagramMain/modals/lib/config/portModal.ts +251 -251
- package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
- package/components/common/diagramMain/port/Port.vue +580 -580
- package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
- package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
- 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/CreateBackup.vue +195 -195
- 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/strategy/Strategy.vue +38 -38
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/TableView.vue +3 -3
- package/components/common/pages/backups/modals/createBackup/disks/tableView/new/lib/config/table.ts +1 -0
- package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
- package/components/common/pages/backups/modals/createBackup/lib/models/interfaces.ts +8 -8
- package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
- package/components/common/pages/backups/modals/restore/Restore.vue +78 -196
- package/components/common/pages/backups/modals/restore/RestoreNew.vue +289 -0
- package/components/common/pages/backups/modals/restore/RestoreOld.vue +173 -0
- package/components/common/pages/backups/modals/restore/disks/Disks.vue +32 -27
- package/components/common/pages/backups/modals/restore/disks/DisksNew.vue +17 -0
- package/components/common/pages/backups/modals/restore/disks/DisksOld.vue +21 -0
- package/components/common/pages/backups/modals/restore/disks/tableView/new/Table.vue +126 -0
- package/components/common/pages/backups/modals/restore/disks/tableView/new/lib/config/table.ts +175 -0
- package/components/common/pages/backups/modals/restore/disks/tableView/{TableView.vue → old/Table.vue} +6 -3
- package/components/common/pages/backups/modals/restore/disks/tableView/{lib → old/lib}/config/keys.ts +1 -1
- package/components/common/pages/backups/modals/restore/disks/tableView/{lib → old/lib}/config/table.ts +117 -117
- package/components/common/pages/backups/modals/restore/disks/tableView/{lib → old/lib}/models/types.ts +1 -1
- package/components/common/pages/backups/modals/restore/lib/config/readyToCompleteOptions.ts +62 -0
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +21 -21
- package/components/common/pages/backups/modals/restore/name/Name.vue +31 -166
- package/components/common/pages/backups/modals/restore/name/NameNew.vue +98 -0
- package/components/common/pages/backups/modals/restore/name/NameOld.vue +86 -0
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
- package/components/common/pages/backups/modals/restore/networks/Networks.vue +63 -70
- package/components/common/pages/backups/modals/restore/networks/NetworksNew.vue +78 -0
- package/components/common/pages/backups/modals/restore/networks/NetworksOld.vue +48 -0
- package/components/common/pages/backups/modals/restore/networks/table/new/Table.vue +269 -0
- package/components/common/pages/backups/modals/restore/networks/table/new/lib/config/table.ts +127 -0
- package/components/common/pages/backups/modals/restore/networks/table/{Table.vue → old/Table.vue} +219 -214
- package/components/common/pages/backups/modals/restore/networks/table/{adapterType → old/adapterType}/AdapterType.vue +1 -1
- package/components/common/pages/backups/modals/restore/networks/table/{lib → old/lib}/config/networkTable.ts +1 -1
- package/components/common/pages/backups/modals/restore/networks/table/old/lib/config/tableKeys.ts +8 -0
- package/components/common/pages/backups/modals/restore/types/Types.vue +9 -50
- package/components/common/pages/backups/modals/restore/types/TypesNew.vue +95 -0
- package/components/common/pages/backups/modals/restore/types/TypesOld.vue +61 -0
- package/components/common/pages/backups/modals/restore/types/lib/config/descriptions.ts +1 -0
- package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -25
- package/components/common/pages/backups/modals/restore/validation/validation.ts +108 -0
- 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/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/add/Add.vue +949 -950
- package/components/common/vm/actions/add/New.vue +689 -690
- package/components/common/vm/actions/add/Old.vue +400 -402
- package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
- package/components/common/vm/actions/clone/Clone.vue +808 -809
- package/components/common/vm/actions/clone/new/New.vue +454 -457
- package/components/common/vm/actions/clone/old/Old.vue +378 -378
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +368 -368
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +427 -427
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
- package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
- package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
- package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
- package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
- package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
- package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
- package/components/common/vm/actions/common/select/os/Old.vue +152 -152
- package/components/common/vm/actions/common/select/os/Os.vue +139 -139
- package/components/common/vm/actions/common/select/storage/Old.vue +132 -125
- package/components/common/vm/actions/common/select/storage/Storage.vue +167 -178
- package/components/common/vm/actions/common/select/storage/new/New.vue +330 -311
- 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/vm/actions/register/Register.vue +352 -352
- package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
- package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +85 -86
- package/components/common/wizards/common/steps/computeResource/New.vue +92 -93
- package/components/common/wizards/common/steps/computeResource/Old.vue +102 -103
- package/components/common/wizards/common/{compatibility → steps/computeResource/compatibility}/Compatibility.vue +31 -35
- package/components/common/wizards/common/{compatibility → steps/computeResource/compatibility}/New.vue +98 -99
- package/components/common/wizards/common/{compatibility → steps/computeResource/compatibility}/Old.vue +54 -53
- package/components/common/wizards/common/{compatibility → steps/computeResource/compatibility}/lib/models/enums.ts +1 -1
- 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/Location.vue +85 -85
- package/components/common/wizards/common/steps/name/location/New.vue +40 -40
- package/components/common/wizards/datastore/add/Add.vue +228 -228
- 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/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +195 -205
- package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
- package/components/common/wizards/vm/migrate/select/storage/Storage.vue +1 -1
- package/composables/useAppVersion.ts +21 -21
- package/composables/useLocal.ts +6 -6
- package/composables/useLocalCommon.ts +39 -39
- package/package.json +1 -1
- package/plugins/console.ts +21 -21
- package/plugins/date.ts +233 -233
- 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 +121 -121
- package/public/spice-console/process/inputprocess.js +227 -227
- package/public/spice-console/process/mainprocess.js +210 -210
- package/public/spice-console/run.js +210 -210
- package/store/main/mutations.ts +7 -7
- package/store/main/state.ts +7 -7
- package/components/common/pages/backups/modals/restore/networks/table/lib/config/tableKeys.ts +0 -10
- package/components/common/wizards/common/compatibility/lib/models/types.ts +0 -1
- /package/components/common/pages/backups/modals/restore/networks/table/{adapterType → old/adapterType}/lib/config/options.ts +0 -0
- /package/components/common/pages/backups/modals/restore/networks/table/{lib → old/lib}/models/types.ts +0 -0
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="restore">
|
|
3
|
+
<atoms-wizard
|
|
4
|
+
show
|
|
5
|
+
:wizard="props.wizard"
|
|
6
|
+
:selected-scheme="props.selectedScheme"
|
|
7
|
+
:title="localization.common.restore"
|
|
8
|
+
:localization="localization"
|
|
9
|
+
test-id="restore"
|
|
10
|
+
@change-steps="onChangeSteps"
|
|
11
|
+
@hide="onHideModal"
|
|
12
|
+
@submit="onRestore"
|
|
13
|
+
>
|
|
14
|
+
<template #modalBody="{ selectedStep }">
|
|
15
|
+
<div
|
|
16
|
+
v-show="props.isLoading"
|
|
17
|
+
class="loader-wrap absolute left-0 right-0 top-0 bottom-0"
|
|
18
|
+
>
|
|
19
|
+
<atoms-loader-pre-loader
|
|
20
|
+
id="loader"
|
|
21
|
+
:show="props.isLoading"
|
|
22
|
+
class="absolute-center"
|
|
23
|
+
test-id="backup-restore-spinner"
|
|
24
|
+
/>
|
|
25
|
+
</div>
|
|
26
|
+
<atoms-alert
|
|
27
|
+
v-show="props.errors.length"
|
|
28
|
+
:items="props.errors"
|
|
29
|
+
status="alert-danger"
|
|
30
|
+
test-id="restore-alert"
|
|
31
|
+
@remove="emits('remove-validation-errors')"
|
|
32
|
+
/>
|
|
33
|
+
|
|
34
|
+
<common-pages-backups-modals-restore-types
|
|
35
|
+
v-show="selectedStep.id === dynamicSteps.selectType"
|
|
36
|
+
v-model="model"
|
|
37
|
+
/>
|
|
38
|
+
|
|
39
|
+
<common-pages-backups-modals-restore-name
|
|
40
|
+
v-show="selectedStep.id === dynamicSteps.selectName"
|
|
41
|
+
v-model="model"
|
|
42
|
+
:show="selectedStep.id === dynamicSteps.selectName"
|
|
43
|
+
@check-name="onCheckName"
|
|
44
|
+
/>
|
|
45
|
+
|
|
46
|
+
<!-- TODO refactoring-->
|
|
47
|
+
<common-vm-actions-common-select-storage
|
|
48
|
+
v-show="selectedStep.id === dynamicSteps.selectStorage"
|
|
49
|
+
:storage-submit="props.storageSubmit"
|
|
50
|
+
:datastore="props.datastore"
|
|
51
|
+
:is-datastore-loading="props.datastoreLoading"
|
|
52
|
+
:storage="model.pvm.storage"
|
|
53
|
+
:get-datastore-table-func="getDatastoreTableFunc"
|
|
54
|
+
@submit="onChangeStorage"
|
|
55
|
+
/>
|
|
56
|
+
|
|
57
|
+
<common-pages-backups-modals-restore-disks
|
|
58
|
+
v-show="selectedStep.id === dynamicSteps.selectDisks"
|
|
59
|
+
v-model="model"
|
|
60
|
+
/>
|
|
61
|
+
<common-pages-backups-modals-restore-networks
|
|
62
|
+
v-if="selectedStep.id === dynamicSteps.selectNetwork"
|
|
63
|
+
v-model="model"
|
|
64
|
+
:alert-messages="[]"
|
|
65
|
+
:networks="props.networks"
|
|
66
|
+
@get-networks="onGetNetworks"
|
|
67
|
+
/>
|
|
68
|
+
|
|
69
|
+
<common-ready-to-complete
|
|
70
|
+
v-show="selectedStep.id === dynamicSteps.readyComplete"
|
|
71
|
+
:data="props.readyCompleteData"
|
|
72
|
+
/>
|
|
73
|
+
</template>
|
|
74
|
+
</atoms-wizard>
|
|
75
|
+
</div>
|
|
76
|
+
|
|
77
|
+
<common-modals-confirmation
|
|
78
|
+
v-if="isShowConfirm"
|
|
79
|
+
:headline="localization.common.attention"
|
|
80
|
+
:description="localization.common.restoreBackupConfirmDescription"
|
|
81
|
+
@hide-modal="isShowConfirm = false"
|
|
82
|
+
@confirm="onFinish"
|
|
83
|
+
/>
|
|
84
|
+
</template>
|
|
85
|
+
|
|
86
|
+
<script setup lang="ts">
|
|
87
|
+
import type { UI_I_WizardStep } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
|
|
88
|
+
import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
|
|
89
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
90
|
+
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
|
91
|
+
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
|
92
|
+
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
|
93
|
+
import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
|
|
94
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
95
|
+
import { dynamicSteps } from '~/components/common/pages/backups/modals/restore/lib/config/steps'
|
|
96
|
+
import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
|
|
97
|
+
|
|
98
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
99
|
+
|
|
100
|
+
const props = defineProps<{
|
|
101
|
+
wizard: Wizard
|
|
102
|
+
selectedScheme: number[]
|
|
103
|
+
readyCompleteData: UI_I_TableInfoItem[]
|
|
104
|
+
nameFormSubmit: null | Function
|
|
105
|
+
storageSubmit: null | Function
|
|
106
|
+
isLoading: boolean
|
|
107
|
+
errors: string[]
|
|
108
|
+
datastore: UI_I_DatastoreTableItem[]
|
|
109
|
+
datastoreLoading: boolean
|
|
110
|
+
networks: UI_I_NetworkTableItem[]
|
|
111
|
+
}>()
|
|
112
|
+
const emits = defineEmits<{
|
|
113
|
+
(event: 'remove-validation-errors'): void
|
|
114
|
+
(event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
|
|
115
|
+
(event: 'get-datastore', value: string): void
|
|
116
|
+
(event: 'get-networks', value: string): void
|
|
117
|
+
(event: 'check-name', value: UI_I_NameCheck): void
|
|
118
|
+
(event: 'change-steps', value: UI_I_WizardStep[]): void
|
|
119
|
+
(event: 'finish'): void
|
|
120
|
+
(event: 'hide'): void
|
|
121
|
+
}>()
|
|
122
|
+
|
|
123
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
124
|
+
|
|
125
|
+
const onChangeSteps = async (value: UI_I_WizardStep[]): Promise<void> => {
|
|
126
|
+
emits('change-steps', value)
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
const getDatastoreTableFunc = async (): Promise<void> => {
|
|
130
|
+
emits('get-datastore', model.value.bucket)
|
|
131
|
+
}
|
|
132
|
+
|
|
133
|
+
const onChangeStorage = (storage: UI_I_DatastoreTableItem | null): void => {
|
|
134
|
+
emits('change-storage', storage)
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
const onCheckName = async (data: UI_I_NameCheck): Promise<void> => {
|
|
138
|
+
emits('check-name', data)
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
const onFinish = (): void => {
|
|
142
|
+
emits('finish')
|
|
143
|
+
}
|
|
144
|
+
const onHideModal = (): void => {
|
|
145
|
+
emits('hide')
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
const onRestore = (): void => {
|
|
149
|
+
if (model.value.restore_code === restoreCodes.existing) {
|
|
150
|
+
isShowConfirm.value = true
|
|
151
|
+
} else {
|
|
152
|
+
onFinish()
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
const isShowConfirm = ref<boolean>(false)
|
|
157
|
+
|
|
158
|
+
const onGetNetworks = (hostId: string): void => {
|
|
159
|
+
emits('get-networks', hostId)
|
|
160
|
+
}
|
|
161
|
+
</script>
|
|
162
|
+
|
|
163
|
+
<style scoped lang="scss">
|
|
164
|
+
:deep(.modal-body) {
|
|
165
|
+
display: flex;
|
|
166
|
+
flex-direction: column;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
.loader-wrap {
|
|
170
|
+
background-color: rgba(0, 0, 0, 0.3);
|
|
171
|
+
z-index: var(--z-fixed);
|
|
172
|
+
}
|
|
173
|
+
</style>
|
|
@@ -1,27 +1,32 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
const {
|
|
18
|
-
|
|
19
|
-
const
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
)
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<common-pages-backups-modals-restore-disks-new
|
|
3
|
+
v-if="isNewView"
|
|
4
|
+
v-model="model"
|
|
5
|
+
:disks="disks"
|
|
6
|
+
/>
|
|
7
|
+
<common-pages-backups-modals-restore-disks-old
|
|
8
|
+
v-else
|
|
9
|
+
v-model="model"
|
|
10
|
+
:disks="disks"
|
|
11
|
+
/>
|
|
12
|
+
</template>
|
|
13
|
+
|
|
14
|
+
<script lang="ts" setup>
|
|
15
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
16
|
+
|
|
17
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
18
|
+
|
|
19
|
+
const { $store }: any = useNuxtApp()
|
|
20
|
+
|
|
21
|
+
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
22
|
+
|
|
23
|
+
const disks = computed<UI_I_RestoreForm['pvm']['disk_devices']>(
|
|
24
|
+
() =>
|
|
25
|
+
$store.getters['backup/getPvm']?.disk_devices.filter(
|
|
26
|
+
(disk: UI_I_RestoreForm['pvm']['disk_devices'][0]) => disk.source
|
|
27
|
+
) || []
|
|
28
|
+
)
|
|
29
|
+
|
|
30
|
+
</script>
|
|
31
|
+
|
|
32
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<common-pages-backups-modals-restore-disks-table-view-new-table
|
|
3
|
+
v-model="model.pvm.disk_devices"
|
|
4
|
+
:disks="props.disks"
|
|
5
|
+
/>
|
|
6
|
+
</template>
|
|
7
|
+
|
|
8
|
+
<script lang="ts" setup>
|
|
9
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
10
|
+
|
|
11
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
12
|
+
const props = defineProps<{
|
|
13
|
+
disks: UI_I_RestoreForm['pvm']['disk_devices']
|
|
14
|
+
}>()
|
|
15
|
+
</script>
|
|
16
|
+
|
|
17
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="disks h-full">
|
|
3
|
+
<common-pages-backups-modals-restore-disks-table-view-old-table
|
|
4
|
+
v-model:selected="model.pvm.disk_devices"
|
|
5
|
+
:data-table="props.disks"
|
|
6
|
+
:total-items="props.disks.length"
|
|
7
|
+
:total-pages="1"
|
|
8
|
+
/>
|
|
9
|
+
</div>
|
|
10
|
+
</template>
|
|
11
|
+
|
|
12
|
+
<script lang="ts" setup>
|
|
13
|
+
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
14
|
+
|
|
15
|
+
const model = defineModel<UI_I_RestoreForm>({ required: true })
|
|
16
|
+
const props = defineProps<{
|
|
17
|
+
disks: UI_I_RestoreForm['pvm']['disk_devices']
|
|
18
|
+
}>()
|
|
19
|
+
</script>
|
|
20
|
+
|
|
21
|
+
<style lang="scss" scoped></style>
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
<template>
|
|
2
|
+
<div class="disks-table">
|
|
3
|
+
<ui-data-table
|
|
4
|
+
:data="data"
|
|
5
|
+
:options="options"
|
|
6
|
+
:total-pages="1"
|
|
7
|
+
:total-items="props.disks?.length || 0"
|
|
8
|
+
:texts="texts"
|
|
9
|
+
:default-layout="false"
|
|
10
|
+
:skeleton="skeletonData"
|
|
11
|
+
size="sm"
|
|
12
|
+
test-id="vm-backup-disks-table"
|
|
13
|
+
@select-row="onSelectRow"
|
|
14
|
+
>
|
|
15
|
+
<template #icon="{ item }">
|
|
16
|
+
<span :class="['icon', item.data.iconClassName]"></span>
|
|
17
|
+
<span :title="item.text" class="text-ellipsis ml-1 disks-table-text">
|
|
18
|
+
{{ item.text }}
|
|
19
|
+
</span>
|
|
20
|
+
</template>
|
|
21
|
+
</ui-data-table>
|
|
22
|
+
</div>
|
|
23
|
+
</template>
|
|
24
|
+
<script setup lang="ts">
|
|
25
|
+
import type { UI_I_TableTexts } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
26
|
+
import type {
|
|
27
|
+
UI_I_DataTable,
|
|
28
|
+
UI_I_DataTableBody,
|
|
29
|
+
UI_I_DataTableHeader,
|
|
30
|
+
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
31
|
+
import type { UI_I_DataTableSkeleton } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
32
|
+
import type { UI_I_Pvm } from '~/lib/models/store/vm/interfaces'
|
|
33
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
34
|
+
import type { UI_I_CreateBackupFormDiskDevice } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
35
|
+
import {
|
|
36
|
+
getBodyDataFunc,
|
|
37
|
+
getHeaderDataFunc,
|
|
38
|
+
options,
|
|
39
|
+
} from '~/components/common/pages/backups/modals/restore/disks/tableView/new/lib/config/table'
|
|
40
|
+
|
|
41
|
+
const model = defineModel<UI_I_CreateBackupFormDiskDevice[]>({ required: true })
|
|
42
|
+
|
|
43
|
+
const props = defineProps<{
|
|
44
|
+
disks: UI_I_Pvm['disk_devices']
|
|
45
|
+
}>()
|
|
46
|
+
|
|
47
|
+
const { $text, $store }: any = useNuxtApp()
|
|
48
|
+
|
|
49
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
50
|
+
|
|
51
|
+
const texts = computed<UI_I_TableTexts>(() => ({
|
|
52
|
+
searchHere: localization.value.common.searchHere,
|
|
53
|
+
rowsPerPage: localization.value.common.rowsPerPage,
|
|
54
|
+
of: localization.value.common.of,
|
|
55
|
+
selected: localization.value.common.selected,
|
|
56
|
+
columns: localization.value.common.columns,
|
|
57
|
+
previous: localization.value.common.previous,
|
|
58
|
+
next: localization.value.common.next,
|
|
59
|
+
noItemsFound: localization.value.common.noItemsFound,
|
|
60
|
+
exportAll: localization.value.common.exportAll,
|
|
61
|
+
exportSelected: localization.value.common.exportSelected,
|
|
62
|
+
all: localization.value.common.all,
|
|
63
|
+
filter: localization.value.common.filter,
|
|
64
|
+
}))
|
|
65
|
+
const skeletonData = ref<UI_I_DataTableSkeleton>({
|
|
66
|
+
columnsCount: 5,
|
|
67
|
+
headColumns: [],
|
|
68
|
+
bodyColumns: [],
|
|
69
|
+
withoutPagination: true,
|
|
70
|
+
})
|
|
71
|
+
|
|
72
|
+
const data = computed<UI_I_DataTable>(() => ({
|
|
73
|
+
id: 'vm-backup-restore-disks-table',
|
|
74
|
+
header: headItems.value,
|
|
75
|
+
body: bodyItems.value,
|
|
76
|
+
}))
|
|
77
|
+
|
|
78
|
+
const lang = computed(() => $store.getters['main/getInterfaceLang'])
|
|
79
|
+
|
|
80
|
+
const headItems = computed<UI_I_DataTableHeader[]>(() =>
|
|
81
|
+
getHeaderDataFunc(localization.value).map((item) => ({
|
|
82
|
+
...item,
|
|
83
|
+
text:
|
|
84
|
+
lang.value === 'en_US'
|
|
85
|
+
? $text.toCapitalizeEveryWord(item.text)
|
|
86
|
+
: item.text,
|
|
87
|
+
}))
|
|
88
|
+
)
|
|
89
|
+
|
|
90
|
+
const bodyItems = ref<UI_I_DataTableBody[]>([])
|
|
91
|
+
watch(
|
|
92
|
+
() => props.disks,
|
|
93
|
+
(newValue) => {
|
|
94
|
+
if (!newValue?.length) {
|
|
95
|
+
bodyItems.value = []
|
|
96
|
+
return
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
bodyItems.value = getBodyDataFunc(newValue, model.value)
|
|
100
|
+
},
|
|
101
|
+
{ deep: true, immediate: true }
|
|
102
|
+
)
|
|
103
|
+
|
|
104
|
+
const onSelectRow = (value: UI_I_DataTableBody[]): void => {
|
|
105
|
+
model.value = value.map((item) => item.data[0]?.data?.data)
|
|
106
|
+
}
|
|
107
|
+
</script>
|
|
108
|
+
<style scoped lang="scss">
|
|
109
|
+
.disks-table {
|
|
110
|
+
:deep(.title-container-top-info h6.title-container-top-selected-rows) {
|
|
111
|
+
font-size: 12px;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
:deep(.ui-main-no-items-found span) {
|
|
115
|
+
font-size: 14px;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
:deep(.title-container) {
|
|
119
|
+
text-transform: lowercase;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
&-text {
|
|
123
|
+
font-size: 12px;
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
</style>
|
package/components/common/pages/backups/modals/restore/disks/tableView/new/lib/config/table.ts
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
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 { UI_I_CreateBackupFormDiskDevice } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
9
|
+
|
|
10
|
+
export const getHeaderDataFunc = (
|
|
11
|
+
localization: UI_I_Localization
|
|
12
|
+
): UI_I_DataTableHeader[] => [
|
|
13
|
+
{
|
|
14
|
+
col: 'col0',
|
|
15
|
+
colName: 'source',
|
|
16
|
+
text: localization.common.source,
|
|
17
|
+
isSortable: true,
|
|
18
|
+
sort: 'asc',
|
|
19
|
+
width: '368px',
|
|
20
|
+
show: true,
|
|
21
|
+
filter: true,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
col: 'col1',
|
|
25
|
+
colName: 'deviceType',
|
|
26
|
+
text: localization.common.deviceType,
|
|
27
|
+
isSortable: true,
|
|
28
|
+
sort: 'asc',
|
|
29
|
+
width: '136px',
|
|
30
|
+
show: true,
|
|
31
|
+
filter: true,
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
col: 'col2',
|
|
35
|
+
colName: 'bus',
|
|
36
|
+
text: localization.common.bus,
|
|
37
|
+
isSortable: true,
|
|
38
|
+
sort: 'asc',
|
|
39
|
+
width: '112px',
|
|
40
|
+
show: true,
|
|
41
|
+
filter: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
col: 'col3',
|
|
45
|
+
colName: 'target',
|
|
46
|
+
text: localization.common.target,
|
|
47
|
+
isSortable: true,
|
|
48
|
+
sort: 'asc',
|
|
49
|
+
width: '112px',
|
|
50
|
+
show: true,
|
|
51
|
+
filter: true,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
col: 'col4',
|
|
55
|
+
colName: 'capacity',
|
|
56
|
+
text: localization.common.capacity,
|
|
57
|
+
isSortable: true,
|
|
58
|
+
sort: 'asc',
|
|
59
|
+
width: '112px',
|
|
60
|
+
show: true,
|
|
61
|
+
filter: true,
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
col: 'col5',
|
|
65
|
+
colName: 'used',
|
|
66
|
+
text: localization.common.used,
|
|
67
|
+
isSortable: true,
|
|
68
|
+
sort: 'asc',
|
|
69
|
+
width: '112px',
|
|
70
|
+
show: true,
|
|
71
|
+
filter: true,
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
col: 'col6',
|
|
75
|
+
colName: 'free',
|
|
76
|
+
text: localization.common.free,
|
|
77
|
+
isSortable: true,
|
|
78
|
+
sort: 'asc',
|
|
79
|
+
width: '112px',
|
|
80
|
+
show: true,
|
|
81
|
+
filter: true,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
col: 'col7',
|
|
85
|
+
colName: 'volumePath',
|
|
86
|
+
text: localization.common.volumePath,
|
|
87
|
+
isSortable: true,
|
|
88
|
+
sort: 'asc',
|
|
89
|
+
width: '240px',
|
|
90
|
+
show: true,
|
|
91
|
+
filter: true,
|
|
92
|
+
},
|
|
93
|
+
]
|
|
94
|
+
|
|
95
|
+
export const options: UI_I_DataTableOptions = {
|
|
96
|
+
perPageOptions: [{ text: '10', value: 100, default: true }],
|
|
97
|
+
isSelectable: true,
|
|
98
|
+
isFocusable: false,
|
|
99
|
+
showPagination: false,
|
|
100
|
+
showPaginationOnTop: false,
|
|
101
|
+
selectType: 'checkbox',
|
|
102
|
+
showPageInfo: false,
|
|
103
|
+
isSortable: true,
|
|
104
|
+
server: false,
|
|
105
|
+
isResizable: true,
|
|
106
|
+
showSearch: false,
|
|
107
|
+
showSelectedRowsWithAll: true,
|
|
108
|
+
showColumnManager: true,
|
|
109
|
+
withActions: false,
|
|
110
|
+
inBlock: false,
|
|
111
|
+
inModal: true,
|
|
112
|
+
showExport: false,
|
|
113
|
+
withCollapse: false,
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export const getBodyDataFunc = (
|
|
117
|
+
bodyData: UI_I_Pvm['disk_devices'],
|
|
118
|
+
selectedDisks: UI_I_CreateBackupFormDiskDevice[]
|
|
119
|
+
): UI_I_DataTableBody[] => {
|
|
120
|
+
const { $binary } = useNuxtApp()
|
|
121
|
+
const lang = useLocalStorage('lang') === 'ru_RU' ? 'ru' : 'en'
|
|
122
|
+
|
|
123
|
+
return bodyData.map((disk, index: number) => {
|
|
124
|
+
return {
|
|
125
|
+
row: index,
|
|
126
|
+
collapse: false,
|
|
127
|
+
isHiddenCollapse: false,
|
|
128
|
+
collapseToggle: false,
|
|
129
|
+
isSelected: !!selectedDisks.find((item) => item.location === disk.source),
|
|
130
|
+
data: [
|
|
131
|
+
{
|
|
132
|
+
key: 'icon',
|
|
133
|
+
col: 'col0',
|
|
134
|
+
text: disk.source,
|
|
135
|
+
data: {
|
|
136
|
+
iconClassName: 'icon-vSphere-dsVmDisk',
|
|
137
|
+
data: {
|
|
138
|
+
source: disk.source,
|
|
139
|
+
location: disk.source,
|
|
140
|
+
target: disk.target,
|
|
141
|
+
},
|
|
142
|
+
},
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
col: 'col1',
|
|
146
|
+
text: disk.device_type,
|
|
147
|
+
},
|
|
148
|
+
{
|
|
149
|
+
col: 'col2',
|
|
150
|
+
text: disk.bus,
|
|
151
|
+
},
|
|
152
|
+
{
|
|
153
|
+
col: 'col3',
|
|
154
|
+
text: disk.target,
|
|
155
|
+
},
|
|
156
|
+
{
|
|
157
|
+
col: 'col4',
|
|
158
|
+
text: $binary.round(disk.capacity_mb, false, lang),
|
|
159
|
+
},
|
|
160
|
+
{
|
|
161
|
+
col: 'col5',
|
|
162
|
+
text: $binary.round(disk.used_mb, false, lang),
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
col: 'col7',
|
|
166
|
+
text: $binary.round(disk.free_mb, false, lang),
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
col: 'col6',
|
|
170
|
+
text: disk.volume_path || '--',
|
|
171
|
+
},
|
|
172
|
+
],
|
|
173
|
+
}
|
|
174
|
+
})
|
|
175
|
+
}
|
|
@@ -6,8 +6,8 @@
|
|
|
6
6
|
v-model:column-keys="columnKeys"
|
|
7
7
|
:head-items="headItems"
|
|
8
8
|
:body-items="bodyItems"
|
|
9
|
-
:total-items="props.totalItems"
|
|
10
|
-
:total-pages="props.totalPages"
|
|
9
|
+
:total-items="props.totalItems || 0"
|
|
10
|
+
:total-pages="props.totalPages || 1"
|
|
11
11
|
:items-per-page="itemsPerPage"
|
|
12
12
|
:page-size="pagination.pageSize"
|
|
13
13
|
:page="pagination.page"
|
|
@@ -31,7 +31,7 @@ import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
|
31
31
|
import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
|
32
32
|
import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
|
|
33
33
|
import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
|
|
34
|
-
import * as table from '~/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table'
|
|
34
|
+
import * as table from '~/components/common/pages/backups/modals/restore/disks/tableView/old/lib/config/table'
|
|
35
35
|
|
|
36
36
|
const props = defineProps<{
|
|
37
37
|
dataTable: UI_I_RestoreForm['pvm']['disk_devices']
|
|
@@ -96,13 +96,16 @@ const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
|
96
96
|
&__inner {
|
|
97
97
|
height: inherit;
|
|
98
98
|
}
|
|
99
|
+
|
|
99
100
|
:deep(.data-table) {
|
|
100
101
|
height: inherit;
|
|
102
|
+
|
|
101
103
|
.datagrid-outer-wrapper {
|
|
102
104
|
height: inherit;
|
|
103
105
|
}
|
|
104
106
|
}
|
|
105
107
|
}
|
|
108
|
+
|
|
106
109
|
.vm-icon {
|
|
107
110
|
margin-right: 5px;
|
|
108
111
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type {
|
|
2
2
|
UI_T_DiskTableKeysTuple
|
|
3
|
-
} from "~/components/common/pages/backups/modals/restore/disks/tableView/lib/models/types";
|
|
3
|
+
} from "~/components/common/pages/backups/modals/restore/disks/tableView/old/lib/models/types";
|
|
4
4
|
|
|
5
5
|
export const tableKeys: UI_T_DiskTableKeysTuple = [
|
|
6
6
|
'source',
|