bfg-common 1.5.418 → 1.5.420
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/components/common/backup/storage/actions/delete/Delete.vue +1 -1
- package/components/common/modals/confirmation/ConfirmationNew.vue +1 -1
- package/components/common/pages/backups/lib/models/interfaces.ts +13 -1
- package/components/common/pages/backups/lib/models/types.ts +3 -3
- package/components/common/{backup → pages/backups}/lib/utils/getBackupOrBackupStorageId.ts +0 -4
- package/components/common/pages/backups/modals/Modals.vue +16 -37
- package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +15 -33
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +3 -2
- package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +2 -2
- package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +2 -3
- package/components/common/pages/backups/modals/createBackup/datastores/Datastores.vue +5 -4
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue +95 -94
- package/components/common/pages/backups/modals/createBackup/datastores/tableView/lib/config/table.ts +119 -117
- package/components/common/pages/backups/modals/createBackup/disks/tableView/lib/config/table.ts +117 -117
- package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +2 -2
- package/components/common/pages/backups/modals/deleteBackup/DeleteBackup.vue +12 -5
- package/components/common/pages/backups/modals/lib/models/interfaces.ts +185 -164
- package/components/common/pages/backups/modals/restore/Restore.vue +74 -45
- package/components/common/pages/backups/modals/restore/disks/Disks.vue +4 -5
- package/components/common/pages/backups/modals/restore/disks/tableView/TableView.vue +9 -8
- package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -114
- package/components/common/pages/backups/modals/restore/lib/config/restoreCodes.ts +5 -0
- package/components/common/pages/backups/modals/restore/lib/config/steps.ts +108 -92
- package/components/common/pages/backups/modals/restore/name/Name.vue +160 -159
- package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -0
- package/components/common/pages/backups/modals/restore/networks/Networks.vue +67 -67
- package/components/common/pages/backups/modals/restore/networks/table/Table.vue +3 -5
- package/components/common/pages/backups/modals/restore/networks/table/lib/config/networkTable.ts +1 -8
- package/components/common/pages/backups/modals/restore/types/Types.vue +10 -11
- package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -24
- package/components/common/pages/backups/tools/lib/config/tabs.ts +7 -7
- package/package.json +1 -1
- package/components/common/pages/backups/modals/createBackup/lib/config/createBackup.ts +0 -14
- package/components/common/pages/backups/modals/restore/disks/tableView/lib/models/interfaces.ts +0 -4
@@ -26,7 +26,7 @@
|
|
26
26
|
<script setup lang="ts">
|
27
27
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
28
28
|
import type { UI_I_DeleteItem } from '~/components/common/backup/storage/actions/delete/lib/models/interfaces'
|
29
|
-
import { getBackupTreeNodeIdByTypeFromRoute } from '~/components/common/
|
29
|
+
import { getBackupTreeNodeIdByTypeFromRoute } from '~/components/common/pages/backups/lib/utils/getBackupOrBackupStorageId'
|
30
30
|
|
31
31
|
const props = defineProps<{
|
32
32
|
datastore: UI_I_DeleteItem | null
|
@@ -1,4 +1,6 @@
|
|
1
|
+
import type { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
|
1
2
|
import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
|
3
|
+
import type { UI_T_BackupActionType } from '~/components/common/pages/backups/lib/models/types'
|
2
4
|
|
3
5
|
export interface API_UI_I_Backup {
|
4
6
|
creation_time: number
|
@@ -17,8 +19,18 @@ export interface API_UI_I_Backup {
|
|
17
19
|
|
18
20
|
export interface UI_I_Backup extends API_UI_I_Backup {}
|
19
21
|
|
20
|
-
export interface UI_I_BackupsTreeNode
|
22
|
+
export interface UI_I_BackupsTreeNode
|
23
|
+
extends UI_I_TreeNode<UI_I_BackupsTreeNode> {
|
21
24
|
parent_id: string
|
22
25
|
timestamp: string
|
23
26
|
description: string
|
24
27
|
}
|
28
|
+
|
29
|
+
export interface UI_I_BackupAction {
|
30
|
+
action: UI_T_BackupActionType | ''
|
31
|
+
id?: string
|
32
|
+
name?: string
|
33
|
+
backupId?: string
|
34
|
+
bucketId?: string
|
35
|
+
storageId?: string
|
36
|
+
}
|
@@ -4,10 +4,6 @@ export const getBackupTreeNodeIdByTypeFromRoute = (type: 'host' | 'backupStorage
|
|
4
4
|
const idFromRoute = useRoute().params.id?.toString() || ''
|
5
5
|
|
6
6
|
let result = ''
|
7
|
-
// if typeFromRoute === 'bucket' ids === [hostId, storageId, bucketId|vmId]
|
8
|
-
// if typeFromRoute === 'backup' ids === [hostId, storageId]
|
9
|
-
// if typeFromRoute === 'vm' ids === [bucketId|vmId]
|
10
|
-
// vmId === bucketId
|
11
7
|
|
12
8
|
const ids = idFromRoute.split('_')
|
13
9
|
switch(type) {
|
@@ -30,27 +30,21 @@
|
|
30
30
|
/>
|
31
31
|
|
32
32
|
<common-pages-backups-modals-delete-backup
|
33
|
-
v-if="isShowDeleteBackupModal"
|
33
|
+
v-if="isShowDeleteBackupModal || isShowDeleteAllBackupsModal"
|
34
34
|
:name="action.name"
|
35
35
|
:is-loading="isLoadingDeleteBackup"
|
36
|
-
|
37
|
-
@hide="onHide"
|
38
|
-
/>
|
39
|
-
<common-pages-backups-modals-delete-backup
|
40
|
-
v-if="isShowDeleteAllBackupsModal"
|
41
|
-
is-all
|
42
|
-
:is-loading="isLoadingDeleteBackup"
|
36
|
+
:is-all="isShowDeleteAllBackupsModal"
|
43
37
|
@remove="onDeleteBackup"
|
44
38
|
@hide="onHide"
|
45
39
|
/>
|
46
40
|
</template>
|
47
41
|
|
48
42
|
<script lang="ts" setup>
|
49
|
-
import { sendTask } from '~/lib/utils/sendTask'
|
50
43
|
import type { UI_T_Project } from '~/lib/models/types'
|
51
44
|
import type { UI_I_SendTaskParams } from '~/lib/models/interfaces'
|
52
45
|
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
53
46
|
import type {
|
47
|
+
UI_I_BackupDatastoreTable,
|
54
48
|
UI_I_CreateBackupForm,
|
55
49
|
UI_I_CreateBackupFormDiskDevice,
|
56
50
|
UI_I_RestoreForm,
|
@@ -58,12 +52,15 @@ import type {
|
|
58
52
|
import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
|
59
53
|
import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
|
60
54
|
import type { UI_I_WizardStep } from '~/components/atoms/wizard/lib/models/interfaces'
|
55
|
+
import type { UI_I_BackupAction } from '~/components/common/pages/backups/lib/models/interfaces'
|
56
|
+
import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
|
57
|
+
import { sendTask } from '~/lib/utils/sendTask'
|
61
58
|
import { scheduledTaskDefaultFormFunc } from '~/components/common/pages/scheduledTasks/modals/lib/config/createScheduledTask'
|
62
59
|
import { backupDefaultFormFunc } from '~/components/common/pages/backups/modals/lib/config/createBackup'
|
63
60
|
import { restoreDefaultFormFunc } from '~/components/common/pages/backups/modals/lib/config/restore'
|
64
61
|
import { scheduledTasks } from '~/components/common/pages/scheduledTasks/lib/utils/utils'
|
65
62
|
|
66
|
-
const action = defineModel<
|
63
|
+
const action = defineModel<UI_I_BackupAction>('action', { required: true })
|
67
64
|
|
68
65
|
const props = defineProps<{
|
69
66
|
project: UI_T_Project
|
@@ -71,7 +68,7 @@ const props = defineProps<{
|
|
71
68
|
selectedVmName: string
|
72
69
|
disks: UI_I_CreateBackupFormDiskDevice[]
|
73
70
|
disksLoading: boolean
|
74
|
-
datastoreTable:
|
71
|
+
datastoreTable: UI_I_BackupDatastoreTable
|
75
72
|
datastoreTableLoading: boolean
|
76
73
|
restoreDatastore: UI_I_DatastoreTableItem[]
|
77
74
|
isRestoreDatastoreLoading: boolean
|
@@ -81,7 +78,8 @@ const emits = defineEmits<{
|
|
81
78
|
(event: 'change-step-create-backup', value: UI_I_WizardStep[]): void
|
82
79
|
(event: 'get-restore-datastore', value: string): void
|
83
80
|
(event: 'get-restore-networks', value: string): void
|
84
|
-
(event: 'check-restore-name', value:
|
81
|
+
(event: 'check-restore-name', value: UI_I_NameCheck): void
|
82
|
+
(event: 'delete-backup', value: boolean): void
|
85
83
|
}>()
|
86
84
|
|
87
85
|
const { $store }: any = useNuxtApp()
|
@@ -100,7 +98,7 @@ const schedulerTaskForm = ref<UI_I_ScheduleNewTasksForm>(
|
|
100
98
|
const restoreForm = ref<UI_I_RestoreForm>(useDeepCopy(restoreDefaultFormFunc()))
|
101
99
|
const deleteBackupId = ref<string>('')
|
102
100
|
|
103
|
-
// TODO
|
101
|
+
// TODO fix after refactor schedule tasks
|
104
102
|
const isShowCreateBackupModal = computed<any>( // ??
|
105
103
|
() => $store.getters['backup/getCreateBackupModal']
|
106
104
|
)
|
@@ -110,6 +108,7 @@ const isLoadingDeleteBackup = ref<boolean>(false)
|
|
110
108
|
const isShowRestoreModal = ref<boolean>(false)
|
111
109
|
|
112
110
|
const onCreateBackup = (): void => {
|
111
|
+
// TODO
|
113
112
|
const backupTask: UI_I_SendTaskParams = {
|
114
113
|
method:
|
115
114
|
props.project === 'sphere'
|
@@ -139,26 +138,7 @@ const onCreateBackup = (): void => {
|
|
139
138
|
|
140
139
|
const onDeleteBackup = async (isAll: boolean): Promise<void> => {
|
141
140
|
isLoadingDeleteBackup.value = true
|
142
|
-
|
143
|
-
await sendTask({
|
144
|
-
method:
|
145
|
-
props.project === 'sphere'
|
146
|
-
? 'VirtualMachines.DeleteBackups'
|
147
|
-
: 'backup.delete_backups',
|
148
|
-
target: props.target,
|
149
|
-
})
|
150
|
-
} else {
|
151
|
-
await sendTask({
|
152
|
-
method:
|
153
|
-
props.project === 'sphere'
|
154
|
-
? 'VirtualMachines.DeleteBackup'
|
155
|
-
: 'backup.delete_backup',
|
156
|
-
target: props.target,
|
157
|
-
args: {
|
158
|
-
backup_uuid: deleteBackupId.value,
|
159
|
-
},
|
160
|
-
})
|
161
|
-
}
|
141
|
+
emits('delete-backup', isAll)
|
162
142
|
isLoadingDeleteBackup.value = false
|
163
143
|
onHide()
|
164
144
|
}
|
@@ -190,7 +170,7 @@ watch(
|
|
190
170
|
},
|
191
171
|
})
|
192
172
|
break
|
193
|
-
case '
|
173
|
+
case 'restoreBackup':
|
194
174
|
isShowRestoreModal.value = true
|
195
175
|
restoreForm.value.backup_storage = newValue.storageId || ''
|
196
176
|
restoreForm.value.bucket = newValue.bucketId || ''
|
@@ -200,7 +180,7 @@ watch(
|
|
200
180
|
deleteBackupId.value = newValue.backupId || ''
|
201
181
|
isShowDeleteBackupModal.value = true
|
202
182
|
break
|
203
|
-
case '
|
183
|
+
case 'deleteBackupAll':
|
204
184
|
isShowDeleteAllBackupsModal.value = true
|
205
185
|
break
|
206
186
|
}
|
@@ -238,8 +218,7 @@ const onGetRestoreDatastore = (bucket: string): void => {
|
|
238
218
|
const onGetRestoreNetworks = (hostId: string): void => {
|
239
219
|
emits('get-restore-networks', hostId)
|
240
220
|
}
|
241
|
-
const onCheckRestoreName = (data:
|
242
|
-
// ??
|
221
|
+
const onCheckRestoreName = (data: UI_I_NameCheck): void => {
|
243
222
|
emits('check-restore-name', data)
|
244
223
|
}
|
245
224
|
</script>
|
@@ -62,9 +62,7 @@
|
|
62
62
|
</template>
|
63
63
|
|
64
64
|
<script setup lang="ts">
|
65
|
-
// TODO move to common
|
66
65
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
67
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
68
66
|
import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
|
69
67
|
import type {
|
70
68
|
UI_I_WizardStep,
|
@@ -72,14 +70,16 @@ import type {
|
|
72
70
|
} from '~/components/atoms/wizard/lib/models/interfaces'
|
73
71
|
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
74
72
|
import type {
|
73
|
+
UI_I_BackupDatastoreTable,
|
75
74
|
UI_I_CreateBackupForm,
|
76
|
-
UI_I_CreateBackupFormDiskDevice
|
75
|
+
UI_I_CreateBackupFormDiskDevice,
|
77
76
|
} from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
78
|
-
import type {
|
77
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
79
78
|
import Wizard from '~/components/atoms/wizard/lib/utils/utils'
|
80
79
|
import {
|
81
80
|
stepsSchemeInitial,
|
82
|
-
stepsFunc,
|
81
|
+
stepsFunc,
|
82
|
+
dynamicSteps,
|
83
83
|
} from '~/components/common/pages/backups/modals/createBackup/lib/config/steps'
|
84
84
|
import { strategyOptionsFunc } from '~/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions'
|
85
85
|
|
@@ -97,7 +97,7 @@ const props = defineProps<{
|
|
97
97
|
selectedVmName: string
|
98
98
|
disks: UI_I_CreateBackupFormDiskDevice[]
|
99
99
|
disksLoading: boolean
|
100
|
-
datastoreTable:
|
100
|
+
datastoreTable: UI_I_BackupDatastoreTable
|
101
101
|
datastoreTableLoading: boolean
|
102
102
|
}>()
|
103
103
|
|
@@ -158,11 +158,7 @@ const validationFunc = async (
|
|
158
158
|
}
|
159
159
|
|
160
160
|
if (
|
161
|
-
wizard.isValidateForStep(
|
162
|
-
dynamicSteps.general,
|
163
|
-
currentStep.id,
|
164
|
-
nextStep.id
|
165
|
-
)
|
161
|
+
wizard.isValidateForStep(dynamicSteps.general, currentStep.id, nextStep.id)
|
166
162
|
) {
|
167
163
|
const nameValidation = checkName(value)
|
168
164
|
|
@@ -171,11 +167,7 @@ const validationFunc = async (
|
|
171
167
|
}
|
172
168
|
|
173
169
|
if (
|
174
|
-
wizard.isValidateForStep(
|
175
|
-
dynamicSteps.disks,
|
176
|
-
currentStep.id,
|
177
|
-
nextStep.id
|
178
|
-
)
|
170
|
+
wizard.isValidateForStep(dynamicSteps.disks, currentStep.id, nextStep.id)
|
179
171
|
) {
|
180
172
|
const validation = checkDisks(value)
|
181
173
|
|
@@ -229,21 +221,13 @@ const checkDisks = (value: UI_I_WizardStep[]): UI_I_ValidationReturn => {
|
|
229
221
|
|
230
222
|
const isValidStores = !!model.value?.disk_devices.length
|
231
223
|
if (!isValidStores) {
|
232
|
-
stepHasError = wizard.setValidation(
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
fieldMessage: localization.value.common.diskIsRequired,
|
237
|
-
alertMessage: localization.value.common.diskIsRequired,
|
238
|
-
}
|
239
|
-
)
|
224
|
+
stepHasError = wizard.setValidation(dynamicSteps.disks, 'disk_devices', {
|
225
|
+
fieldMessage: localization.value.common.diskIsRequired,
|
226
|
+
alertMessage: localization.value.common.diskIsRequired,
|
227
|
+
})
|
240
228
|
showValidationErrors([localization.value.common.diskIsRequired])
|
241
229
|
} else if (wizard.hasMessage(dynamicSteps.disks, 'disk_devices')) {
|
242
|
-
value = wizard.removeValidation(
|
243
|
-
dynamicSteps.disks,
|
244
|
-
'disk_devices',
|
245
|
-
value
|
246
|
-
)
|
230
|
+
value = wizard.removeValidation(dynamicSteps.disks, 'disk_devices', value)
|
247
231
|
onRemoveValidationErrors()
|
248
232
|
}
|
249
233
|
|
@@ -267,9 +251,7 @@ const checkDatastore = (value: UI_I_WizardStep[]): UI_I_ValidationReturn => {
|
|
267
251
|
}
|
268
252
|
)
|
269
253
|
showValidationErrors([localization.value.common.datastoreIsRequired])
|
270
|
-
} else if (
|
271
|
-
wizard.hasMessage(dynamicSteps.datastores, 'backup_storage')
|
272
|
-
) {
|
254
|
+
} else if (wizard.hasMessage(dynamicSteps.datastores, 'backup_storage')) {
|
273
255
|
value = wizard.removeValidation(
|
274
256
|
dynamicSteps.datastores,
|
275
257
|
'backup_storage',
|
@@ -289,7 +271,7 @@ const onChangeDatastore = (names: string[]): void => {
|
|
289
271
|
selectedDatastoresNames.value = names
|
290
272
|
}
|
291
273
|
|
292
|
-
const strategyOptions = ref<
|
274
|
+
const strategyOptions = ref<UI_I_SelectInputItem[]>(
|
293
275
|
strategyOptionsFunc(localization.value)
|
294
276
|
)
|
295
277
|
|
@@ -26,8 +26,8 @@
|
|
26
26
|
<script lang="ts" setup>
|
27
27
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
28
28
|
import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
29
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
30
29
|
import type { UI_T_BandwidthOption } from '~/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/models/types'
|
30
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
31
31
|
import { maxBandwidthOptions } from '~/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options'
|
32
32
|
|
33
33
|
const model = defineModel<UI_I_CreateBackupForm>({ required: true })
|
@@ -35,7 +35,8 @@ const model = defineModel<UI_I_CreateBackupForm>({ required: true })
|
|
35
35
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
36
36
|
const { $binary }: any = useNuxtApp()
|
37
37
|
|
38
|
-
const maxBandwidthOptionsLocal =
|
38
|
+
const maxBandwidthOptionsLocal =
|
39
|
+
ref<UI_I_SelectInputItem[]>(maxBandwidthOptions)
|
39
40
|
|
40
41
|
const maxBindwidthLocal = computed<number>({
|
41
42
|
get() {
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import type {
|
1
|
+
import type {UI_I_SelectInputItem} from "~/components/common/select/input/lib/models/interfaces";
|
2
2
|
|
3
|
-
export const maxBandwidthOptions:
|
3
|
+
export const maxBandwidthOptions: UI_I_SelectInputItem[] = [
|
4
4
|
{ label: 'Mbps', value: 0 },
|
5
5
|
{ label: 'Gbps', value: 1 },
|
6
6
|
]
|
package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue
CHANGED
@@ -14,17 +14,16 @@
|
|
14
14
|
</template>
|
15
15
|
|
16
16
|
<script lang="ts" setup>
|
17
|
-
// TODO merge with common-backups-modals-new-rule-retention-strategy
|
18
17
|
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
19
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
20
18
|
import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
19
|
+
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
21
20
|
import { strategyOptionsFunc } from '~/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions'
|
22
21
|
|
23
22
|
const model = defineModel<UI_I_CreateBackupForm>({ required: true })
|
24
23
|
|
25
24
|
const localization = computed<UI_I_Localization>(() => useLocal())
|
26
25
|
|
27
|
-
const strategyOptions = ref<
|
26
|
+
const strategyOptions = ref<UI_I_SelectInputItem[]>(
|
28
27
|
strategyOptionsFunc(localization.value)
|
29
28
|
)
|
30
29
|
</script>
|
@@ -11,10 +11,13 @@
|
|
11
11
|
</template>
|
12
12
|
|
13
13
|
<script lang="ts" setup>
|
14
|
-
import type {
|
14
|
+
import type {
|
15
|
+
UI_I_BackupDatastoreTable,
|
16
|
+
UI_I_CreateBackupForm
|
17
|
+
} from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
15
18
|
|
16
19
|
const props = defineProps<{
|
17
|
-
datastoreTable:
|
20
|
+
datastoreTable: UI_I_BackupDatastoreTable
|
18
21
|
datastoreTableLoading: boolean
|
19
22
|
}>()
|
20
23
|
const emits = defineEmits<{
|
@@ -23,8 +26,6 @@ const emits = defineEmits<{
|
|
23
26
|
|
24
27
|
const model = defineModel<UI_I_CreateBackupForm>({ required: true })
|
25
28
|
|
26
|
-
const { $store }: any = useNuxtApp()
|
27
|
-
|
28
29
|
const selectedKeys = ref<string[]>([])
|
29
30
|
|
30
31
|
watch(
|
package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue
CHANGED
@@ -1,94 +1,95 @@
|
|
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="selectedRows"
|
6
|
-
v-model:column-keys="columnKeys"
|
7
|
-
class="data-table"
|
8
|
-
type="radio"
|
9
|
-
test-id="disks-table"
|
10
|
-
:head-items="headItems"
|
11
|
-
:body-items="bodyItems"
|
12
|
-
:total-items="props.totalItems"
|
13
|
-
:total-pages="props.totalPages"
|
14
|
-
:items-per-page="itemsPerPage"
|
15
|
-
:loading="loading"
|
16
|
-
hide-pagination
|
17
|
-
server-off
|
18
|
-
>
|
19
|
-
<template #icon="{ item }">
|
20
|
-
<span :class="['datagrid-cell-icon', item.data]" />
|
21
|
-
<span class="text-ellipsis">
|
22
|
-
{{ item.text }}
|
23
|
-
</span>
|
24
|
-
</template>
|
25
|
-
</atoms-table-data-grid>
|
26
|
-
</div>
|
27
|
-
</div>
|
28
|
-
</template>
|
29
|
-
|
30
|
-
<script lang="ts" setup>
|
31
|
-
import type {
|
32
|
-
UI_I_HeadItem,
|
33
|
-
UI_I_ColumnKey,
|
34
|
-
UI_I_BodyItem,
|
35
|
-
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
36
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
37
|
-
import {
|
38
|
-
import
|
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
|
-
margin-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
}
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
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="selectedRows"
|
6
|
+
v-model:column-keys="columnKeys"
|
7
|
+
class="data-table"
|
8
|
+
type="radio"
|
9
|
+
test-id="disks-table"
|
10
|
+
:head-items="headItems"
|
11
|
+
:body-items="bodyItems"
|
12
|
+
:total-items="props.totalItems"
|
13
|
+
:total-pages="props.totalPages"
|
14
|
+
:items-per-page="itemsPerPage"
|
15
|
+
:loading="loading"
|
16
|
+
hide-pagination
|
17
|
+
server-off
|
18
|
+
>
|
19
|
+
<template #icon="{ item }">
|
20
|
+
<span :class="['datagrid-cell-icon', item.data]" />
|
21
|
+
<span class="text-ellipsis">
|
22
|
+
{{ item.text }}
|
23
|
+
</span>
|
24
|
+
</template>
|
25
|
+
</atoms-table-data-grid>
|
26
|
+
</div>
|
27
|
+
</div>
|
28
|
+
</template>
|
29
|
+
|
30
|
+
<script lang="ts" setup>
|
31
|
+
import type {
|
32
|
+
UI_I_HeadItem,
|
33
|
+
UI_I_ColumnKey,
|
34
|
+
UI_I_BodyItem,
|
35
|
+
} from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
36
|
+
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
37
|
+
import type { UI_I_BackupDatastore } from '~/components/common/pages/backups/modals/lib/models/interfaces'
|
38
|
+
import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
|
39
|
+
import * as table from '~/components/common/pages/backups/modals/createBackup/datastores/tableView/lib/config/table'
|
40
|
+
|
41
|
+
const props = defineProps<{
|
42
|
+
dataTable: UI_I_BackupDatastore[]
|
43
|
+
loading: boolean
|
44
|
+
totalItems: number
|
45
|
+
totalPages: number
|
46
|
+
}>()
|
47
|
+
const localization = computed<UI_I_Localization>(() => useLocal())
|
48
|
+
|
49
|
+
const selectedRows = defineModel<string>('selected')
|
50
|
+
|
51
|
+
const columnKeys = ref<UI_I_ColumnKey[]>(table.columnKeys(localization.value))
|
52
|
+
|
53
|
+
const headItems = computed<UI_I_HeadItem[]>(() =>
|
54
|
+
table.headItems(localization.value)
|
55
|
+
)
|
56
|
+
|
57
|
+
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
58
|
+
let result: UI_I_BodyItem[][] = []
|
59
|
+
if (props.dataTable) {
|
60
|
+
result = table.bodyItems(props.dataTable, localization.value)
|
61
|
+
}
|
62
|
+
|
63
|
+
return result
|
64
|
+
})
|
65
|
+
watch(
|
66
|
+
bodyItems,
|
67
|
+
() => {
|
68
|
+
setTimeout(() => {
|
69
|
+
selectedRows.value = ''
|
70
|
+
}, 0)
|
71
|
+
},
|
72
|
+
{ deep: true, immediate: true }
|
73
|
+
)
|
74
|
+
</script>
|
75
|
+
|
76
|
+
<style lang="scss" scoped>
|
77
|
+
.data-table-view {
|
78
|
+
height: inherit;
|
79
|
+
margin-bottom: 10px;
|
80
|
+
margin-right: 10px;
|
81
|
+
|
82
|
+
&__inner {
|
83
|
+
height: inherit;
|
84
|
+
}
|
85
|
+
:deep(.data-table) {
|
86
|
+
height: inherit;
|
87
|
+
.datagrid-outer-wrapper {
|
88
|
+
height: inherit;
|
89
|
+
}
|
90
|
+
}
|
91
|
+
}
|
92
|
+
.vm-icon {
|
93
|
+
margin-right: 5px;
|
94
|
+
}
|
95
|
+
</style>
|