bfg-common 1.5.322 → 1.5.325

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (20) hide show
  1. package/assets/localization/local_be.json +1 -0
  2. package/assets/localization/local_en.json +1 -0
  3. package/assets/localization/local_hy.json +1 -0
  4. package/assets/localization/local_kk.json +1 -0
  5. package/assets/localization/local_ru.json +1 -0
  6. package/assets/localization/local_zh.json +1 -0
  7. package/components/common/monitor/overview/filters/lib/config/filterOptions.ts +1 -1
  8. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +3 -0
  9. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +2 -0
  10. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +2 -0
  11. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +3 -0
  12. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +2 -0
  13. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +2 -0
  14. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +12 -0
  15. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +2 -1
  16. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +4 -3
  17. package/components/common/vm/actions/editSettings/EditSettings.vue +242 -239
  18. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -0
  19. package/components/common/vm/actions/editSettings/new/New.vue +2 -0
  20. package/package.json +1 -1
@@ -1721,6 +1721,7 @@
1721
1721
  "vmLocation": "Месцазнаходжанне віртуальнай машыны",
1722
1722
  "vmMonitoring": "Маніторынг ВМ",
1723
1723
  "vmName": "Імя VM",
1724
+ "vmtName": "Імя шаблона",
1724
1725
  "vmNameExistInSelectedLocation": "Віртуальная машына, шаблон з такой жа назвай існуе ў выбраным месцы. ",
1725
1726
  "vmNetwork": "Сетка ВМ",
1726
1727
  "vMOptions": "Параметры VM",
@@ -1720,6 +1720,7 @@
1720
1720
  "vmLocation": "VM Location",
1721
1721
  "vmMonitoring": "VM Monitoring",
1722
1722
  "vmName": "VM Name",
1723
+ "vmtName": "Template Name",
1723
1724
  "vmNameExistInSelectedLocation": "A virtual machine, template with the same name exists in the selected location. Enter a new name.",
1724
1725
  "vmNetwork": "VM Network",
1725
1726
  "vMOptions": "VM Options",
@@ -1720,6 +1720,7 @@
1720
1720
  "vmLocation": "Վիրտուալ մեքենայի գտնվելու վայրը",
1721
1721
  "vmMonitoring": "ՎՄ մոնիտորինգ",
1722
1722
  "vmName": "ՎՄ անունը",
1723
+ "vmtName": "Կաղապարի անվանումը",
1723
1724
  "vmNameExistInSelectedLocation": "Ընտրված վայրում կա ՎՄ, կաղապար նույն անունով: ",
1724
1725
  "vmNetwork": "ՎՄ ցանց",
1725
1726
  "vMOptions": "VM կարգավորումներ",
@@ -1720,6 +1720,7 @@
1720
1720
  "vmLocation": "Виртуалды машинаның орналасқан жері",
1721
1721
  "vmMonitoring": "ВМ бақылау",
1722
1722
  "vmName": "VM атауы",
1723
+ "vmtName": "Шаблонның атауы",
1723
1724
  "vmNameExistInSelectedLocation": "Таңдалған жерде аттас VM, үлгі бар. ",
1724
1725
  "vmNetwork": "VM желісі",
1725
1726
  "vMOptions": "VM параметрлері",
@@ -1720,6 +1720,7 @@
1720
1720
  "vmLocation": "Местоположение виртуальных машин",
1721
1721
  "vmMonitoring": "Мониторинг ВМ",
1722
1722
  "vmName": "Имя ВМ",
1723
+ "vmtName": "Имя шаблона",
1723
1724
  "vmNameExistInSelectedLocation": "В выбранном расположении существует виртуальная машина, шаблон с таким же именем. Введите новое имя.",
1724
1725
  "vmNetwork": "Сеть ВМ",
1725
1726
  "vMOptions": "Параметры ВМ",
@@ -1719,6 +1719,7 @@
1719
1719
  "vmLocation": "虚拟机位置",
1720
1720
  "vmMonitoring": "虚拟机监控",
1721
1721
  "vmName": "虚拟机名称",
1722
+ "vmtName": "模板的名称",
1722
1723
  "vmNameExistInSelectedLocation": "所选位置已存在同名的虚拟机或模板。",
1723
1724
  "vmNetwork": "虚拟机网络",
1724
1725
  "vMOptions": "虚拟机设置",
@@ -69,7 +69,7 @@ export const viewFunc = (
69
69
  { text: localization.inventoryMonitor.overview, value: 'overview' },
70
70
  // { text: localization.common.space, value: 'space' },
71
71
  // { text: localization.inventoryMonitor.spaceUtilization, value: 'space_utilization' },
72
- { text: localization.common.network, value: 'network' },
72
+ // { text: localization.common.network, value: 'network' }, TODO 700
73
73
  { text: localization.common.disks, value: 'disks' },
74
74
  ],
75
75
  cluster: [
@@ -42,6 +42,7 @@
42
42
  :errors="errors"
43
43
  :compute-resource="props.computeResource"
44
44
  :compatibility-info="props.compatibilityInfo"
45
+ :is-vmt="props.isVmt"
45
46
  @change-boot-order="emits('change-boot-order', $event)"
46
47
  @send-data="emits('send-data', $event)"
47
48
  @next="emits('next')"
@@ -98,6 +99,7 @@
98
99
  :nav-items="navItems"
99
100
  :errors="errors"
100
101
  :compute-resource="props.computeResource"
102
+ :is-vmt="props.isVmt"
101
103
  @change-boot-order="emits('change-boot-order', $event)"
102
104
  @send-data="emits('send-data', $event)"
103
105
  @next="emits('next')"
@@ -188,6 +190,7 @@ const props = defineProps<{
188
190
  project?: UI_T_Project
189
191
  computeResource?: UI_I_TreeNode | null
190
192
  compatibilityInfo?: string
193
+ isVmt?: boolean
191
194
  }>()
192
195
  const emits = defineEmits<{
193
196
  (event: 'change-boot-order', value: UI_T_ChangeBootOrder): void
@@ -81,6 +81,7 @@
81
81
  :error-validation-fields="props.errorValidationFields"
82
82
  :state="props.state"
83
83
  :compatibility-info="props.compatibilityInfo"
84
+ :is-vmt="props.isVmt"
84
85
  @change-boot-order="emits('change-boot-order', $event)"
85
86
  @send-data="emits('send-data-vm-options-method', $event)"
86
87
  @invalid="vmOptionsInvalid = $event"
@@ -177,6 +178,7 @@ const props = defineProps<{
177
178
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
178
179
  computeResource?: UI_I_TreeNode | null
179
180
  compatibilityInfo?: string
181
+ isVmt?: boolean
180
182
  }>()
181
183
  const emits = defineEmits<{
182
184
  (event: 'get-storage', value: UI_I_TablePayload): void
@@ -65,6 +65,7 @@
65
65
  :is-clone="props.isClone"
66
66
  :error-validation-fields="props.errorValidationFields"
67
67
  :state="props.state"
68
+ :is-vmt="props.isVmt"
68
69
  @change-boot-order="emits('change-boot-order', $event)"
69
70
  @send-data="emits('send-data-vm-options-method', $event)"
70
71
  @invalid="vmOptionsInvalid = $event"
@@ -158,6 +159,7 @@ const props = defineProps<{
158
159
  vmCpuHelpTextSecond?: string
159
160
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
160
161
  computeResource?: UI_I_TreeNode | null
162
+ isVmt?: boolean
161
163
  }>()
162
164
  const emits = defineEmits<{
163
165
  (event: 'get-storage', value: UI_I_TablePayload): void
@@ -15,6 +15,7 @@
15
15
  :options="props.options"
16
16
  :state="props.state"
17
17
  :compatibility-info="props.compatibilityInfo"
18
+ :is-vmt="props.isVmt"
18
19
  @change-boot-order="emits('change-boot-order', $event)"
19
20
  @send-data-remote-console-options="sendDataRemoteConsoleOptionsMethod"
20
21
  @send-data-tools="sendDataToolsMethod"
@@ -36,6 +37,7 @@
36
37
  :error-validation-fields="props.errorValidationFields"
37
38
  :options="props.options"
38
39
  :state="props.state"
40
+ :is-vmt="props.isVmt"
39
41
  @change-boot-order="emits('change-boot-order', $event)"
40
42
  @send-data-remote-console-options="sendDataRemoteConsoleOptionsMethod"
41
43
  @send-data-tools="sendDataToolsMethod"
@@ -88,6 +90,7 @@ const props = defineProps<{
88
90
  options?: UI_I_SendDataVmoptions
89
91
  state?: string | number
90
92
  compatibilityInfo?: string
93
+ isVmt?: boolean
91
94
  }>()
92
95
  const emits = defineEmits<{
93
96
  (
@@ -8,6 +8,7 @@
8
8
  :is-edit="props.isEdit"
9
9
  :is-clone="props.isClone"
10
10
  :state="props.state"
11
+ :is-vmt="props.isVmt"
11
12
  />
12
13
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options
13
14
  :error-validation-fields="props.errorValidationFields"
@@ -85,6 +86,7 @@ const props = defineProps<{
85
86
  options?: UI_I_SendDataVmoptions
86
87
  state?: string | number
87
88
  compatibilityInfo?: string
89
+ isVmt?: boolean
88
90
  }>()
89
91
  const emits = defineEmits<{
90
92
  (
@@ -10,6 +10,7 @@
10
10
  :is-edit="props.isEdit"
11
11
  :is-clone="props.isClone"
12
12
  :state="props.state"
13
+ :is-vmt="props.isVmt"
13
14
  />
14
15
  <common-vm-actions-common-customize-hardware-vmoptions-remote-console-options
15
16
  :error-validation-fields="props.errorValidationFields"
@@ -81,6 +82,7 @@ const props = defineProps<{
81
82
  errorValidationFields: UI_I_ErrorValidationField[]
82
83
  options?: UI_I_SendDataVmoptions
83
84
  state?: string | number
85
+ isVmt?: boolean
84
86
  }>()
85
87
  const emits = defineEmits<{
86
88
  (
@@ -6,6 +6,7 @@
6
6
  v-model:guest-os-family="guestOsFamily"
7
7
  v-model:guest-os-version="guestOsVersion"
8
8
  v-model:block-is-open="blockIsOpen"
9
+ :name-label="nameLabel"
9
10
  :is-disabled="isDisabled"
10
11
  :machine-type-options="machineTypeOptions"
11
12
  :os-options="osOptions"
@@ -19,6 +20,7 @@
19
20
  v-model:guest-os-family="guestOsFamily"
20
21
  v-model:guest-os-version="guestOsVersion"
21
22
  v-model:block-is-open="blockIsOpen"
23
+ :name-label="nameLabel"
22
24
  :is-disabled="isDisabled"
23
25
  :machine-type-options="machineTypeOptions"
24
26
  :os-options="osOptions"
@@ -29,6 +31,7 @@
29
31
 
30
32
  <script setup lang="ts">
31
33
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
34
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
32
35
  import { capabilities } from '~/components/common/vm/actions/common/lib/config/capabilities'
33
36
 
34
37
  const vmName = defineModel<string>('vmName', { required: true })
@@ -47,6 +50,7 @@ const props = defineProps<{
47
50
  isEdit: boolean
48
51
  isClone: boolean
49
52
  state?: string | number
53
+ isVmt?: boolean
50
54
  }>()
51
55
 
52
56
  const { $store }: any = useNuxtApp()
@@ -78,6 +82,14 @@ watch(
78
82
  )
79
83
 
80
84
  const blockIsOpen = ref<boolean>(false)
85
+
86
+ const localization = computed<UI_I_Localization>(() => useLocal())
87
+
88
+ const nameLabel = computed<string>(() => {
89
+ return props.isVmt
90
+ ? localization.value.common.vmtName
91
+ : localization.value.common.vmName
92
+ })
81
93
  </script>
82
94
 
83
95
  <style scoped lang="scss"></style>
@@ -25,7 +25,7 @@
25
25
  <template #stackChildren>
26
26
  <ui-stack-block :has-children="false">
27
27
  <template #stackBlockKey>
28
- {{ localization.common.vmName }}
28
+ {{ props.nameLabel }}
29
29
  </template>
30
30
  <template #stackBlockContent>
31
31
  <div class="vm-name-wrap">
@@ -124,6 +124,7 @@ const guestOsVersion = defineModel<UI_I_OptionItem | null>('guestOsVersion', {
124
124
 
125
125
  const props = defineProps<{
126
126
  isDisabled: boolean
127
+ nameLabel: string
127
128
  machineTypeOptions: UI_I_OptionItem[]
128
129
  osOptions: UI_I_OptionItem[]
129
130
  versionsOptions: UI_I_OptionItem[]
@@ -16,13 +16,13 @@
16
16
  </template>
17
17
  <template #stackBlockContent>
18
18
  <div v-show="!blockIsOpen">
19
- {{ localization.common.vmName }}: {{ vmName }}
19
+ {{ props.nameLabel }}: {{ vmName }}
20
20
  </div>
21
21
  </template>
22
22
  <template #stackChildren>
23
23
  <atoms-stack-block :has-children="false">
24
24
  <template #stackBlockKey>
25
- {{ localization.common.vmName }}
25
+ {{ props.nameLabel }}
26
26
  </template>
27
27
  <template #stackBlockContent>
28
28
  <span>{{ vmName }}</span>
@@ -138,11 +138,12 @@ const guestOsVersion = defineModel<UI_I_OptionItem | null>('guestOsVersion', {
138
138
  const props = defineProps<{
139
139
  isEdit: boolean
140
140
  isClone: boolean
141
- state?: string | number
142
141
  isDisabled: boolean
142
+ nameLabel: string
143
143
  machineTypeOptions: UI_I_OptionItem[]
144
144
  osOptions: UI_I_OptionItem[]
145
145
  versionsOptions: UI_I_OptionItem[]
146
+ state?: string | number
146
147
  }>()
147
148
  const emits = defineEmits<{
148
149
  (event: 'change-os'): void
@@ -1,239 +1,242 @@
1
- <template>
2
- <common-vm-actions-edit-settings-new
3
- v-if="isNewView"
4
- v-model:vm-name="vmName"
5
- v-model:vm-settings="vmSettingsLocal"
6
- :nodes="props.nodes"
7
- :files="props.files"
8
- :project="props.project"
9
- :loading="loadingLocal"
10
- :datastore="props.datastore"
11
- :is-datastore-loading="props.isDatastoreLoading"
12
- :networks-table="props.networksTable"
13
- :selected-nav-item="selectedNavItem"
14
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
15
- :error-validation-fields="props.errorValidationFields"
16
- :virtual-hardware-networks="virtualHardwareNetworksLocal"
17
- :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
18
- :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
19
- :state="props.state"
20
- :vm-name-old="props.vmSettings?.name"
21
- :passthrough-devices="props.passthroughDevices"
22
- :mediated-devices="props.mediatedDevices"
23
- :get-datastore-table-func="props.getDatastoreTableFunc"
24
- :customize-hardware-submit="customizeHardwareSubmit"
25
- @hide="emits('hide')"
26
- @validate="validateSendData"
27
- @update-vm="emits('update-vm')"
28
- @get-storage="emits('get-storage', $event)"
29
- @get-pci-devices="emits('get-pci-devices')"
30
- @change-boot-order="onChangeBootOrder"
31
- @get-networks-table="emits('get-networks-table', $event)"
32
- @get-folders-or-files="emits('get-folders-or-files', $event)"
33
- @show-datastore-child="emits('show-datastore-child', $event)"
34
- @get-active-device-child="emits('get-active-device-child', $event)"
35
- @change-customize-hardware="onChangeCustomizeHardware"
36
- />
37
- <common-vm-actions-edit-settings-old
38
- v-else
39
- v-model:vm-name="vmName"
40
- v-model:vm-settings="vmSettingsLocal"
41
- :nodes="props.nodes"
42
- :files="props.files"
43
- :project="props.project"
44
- :loading="loadingLocal"
45
- :datastore="props.datastore"
46
- :is-datastore-loading="props.isDatastoreLoading"
47
- :networks-table="props.networksTable"
48
- :selected-nav-item="selectedNavItem"
49
- :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
50
- :error-validation-fields="props.errorValidationFields"
51
- :virtual-hardware-networks="virtualHardwareNetworksLocal"
52
- :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
53
- :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
54
- :state="props.state"
55
- :vm-name-old="props.vmSettings?.name"
56
- :passthrough-devices="props.passthroughDevices"
57
- :mediated-devices="props.mediatedDevices"
58
- :get-datastore-table-func="props.getDatastoreTableFunc"
59
- :customize-hardware-submit="customizeHardwareSubmit"
60
- @hide="emits('hide')"
61
- @validate="validateSendData"
62
- @update-vm="emits('update-vm')"
63
- @get-storage="emits('get-storage', $event)"
64
- @get-pci-devices="emits('get-pci-devices')"
65
- @change-boot-order="onChangeBootOrder"
66
- @get-networks-table="emits('get-networks-table', $event)"
67
- @get-folders-or-files="emits('get-folders-or-files', $event)"
68
- @show-datastore-child="emits('show-datastore-child', $event)"
69
- @get-active-device-child="emits('get-active-device-child', $event)"
70
- @change-customize-hardware="onChangeCustomizeHardware"
71
- />
72
- </template>
73
-
74
- <script setup lang="ts">
75
- import type { UI_T_Project } from '~/lib/models/types'
76
- import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
77
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
78
- import type {
79
- UI_I_MediatedDevice,
80
- UI_I_PciDevice,
81
- UI_I_VmSettings,
82
- } from '~/lib/models/store/vm/interfaces'
83
- import type { UI_I_Localization } from '~/lib/models/interfaces'
84
- import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
85
- import type {
86
- UI_I_SendDataNewCdDvdDrive,
87
- UI_I_SendDataNewHardDisk,
88
- UI_I_SendDataNewNetwork,
89
- UI_I_SendDataCpu,
90
- UI_I_SendDataMemory,
91
- } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
92
- import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
93
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
94
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
95
- import type {
96
- UI_I_DatastoreTableItem,
97
- UI_I_FolderOrFileTreePayload,
98
- } from '~/lib/models/store/storage/interfaces'
99
- import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
100
- import type { UI_T_EditVmFinishFunc } from '~/components/common/vm/actions/editSettings/lib/models/types'
101
- import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
102
- import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
103
-
104
- const props = defineProps<{
105
- project: UI_T_Project
106
- loading: boolean
107
- vmSettings: UI_I_VmSettings | null
108
- nodes: UI_I_FileTreeNode[]
109
- files: UI_I_FileTreeNode[]
110
- networksTable: UI_I_NetworkTableItem[]
111
- errorValidationFields: UI_I_ErrorValidationField<string>[]
112
- vmCpuHelpTextSecond: string
113
- vmId: string
114
- datastore: UI_I_DatastoreTableItem[]
115
- isDatastoreLoading: boolean
116
- validateSendDataFunc: UI_T_EditVmFinishFunc
117
- getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
118
- state?: string | number
119
- passthroughDevices?: UI_I_PciDevice[]
120
- mediatedDevices?: UI_I_MediatedDevice[]
121
- capabilities?: UI_I_Capabilities
122
- }>()
123
-
124
- const emits = defineEmits<{
125
- (event: 'hide'): void
126
- (event: 'update-vm'): void
127
- (event: 'get-storage', value: UI_I_TablePayload): void
128
- (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
129
- (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
130
- (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
131
- (event: 'get-networks-table', value: UI_I_TablePayload): void
132
- (event: 'get-pci-devices'): void
133
- }>()
134
-
135
- const { $store }: any = useNuxtApp()
136
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
137
-
138
- const localization = computed<UI_I_Localization>(() => useLocal())
139
-
140
- watch(
141
- () => props.capabilities,
142
- () => {
143
- if (props.capabilities) mapCapabilities(props.capabilities)
144
- },
145
- { deep: true, immediate: true }
146
- )
147
-
148
- const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
149
-
150
- const loadingLocal = ref<boolean>(false)
151
- watch(
152
- () => props.loading,
153
- (newValue: boolean) => {
154
- loadingLocal.value = newValue
155
- },
156
- { immediate: true }
157
- )
158
-
159
- const vmSettingsLocal = computed<UI_I_VmSettings | null>(() => props.vmSettings)
160
-
161
- const vmName = ref<string>(vmSettingsLocal.value?.name || '')
162
- watch(vmSettingsLocal, (newValue) => {
163
- vmName.value = newValue?.name || ''
164
- })
165
-
166
- const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
167
- const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
168
- null
169
- )
170
- const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
171
- const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
172
- virtualHardwareHardDisks.value = data[0]
173
- virtualHardwareCdDvdDrives.value = data[1]
174
- virtualHardwareNetworks.value = data[2]
175
- }
176
-
177
- const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
178
- const onChangeCustomizeHardware = (
179
- data: UI_I_SendDataCustomizeHardware
180
- ): void => {
181
- customizeHardware.value = data
182
- }
183
- const virtualHardwareHardDisksLocal = computed<
184
- UI_I_SendDataNewHardDisk[] | null
185
- >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
186
- const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
187
- () => customizeHardware.value?.virtualHardware?.networks || null
188
- )
189
- const virtualHardwareCdDvdDrivesLocal = computed<
190
- UI_I_SendDataNewCdDvdDrive[] | null
191
- >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
192
-
193
- const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
194
- () => customizeHardware.value?.virtualHardware?.cpu || null
195
- )
196
- const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
197
- () => customizeHardware.value?.virtualHardware?.memory || null
198
- )
199
-
200
- const customizeHardwareSubmit = ref<null | Function>(null)
201
- const checkCustomizeHardware = async (): Promise<boolean> => {
202
- return new Promise((resolve) => {
203
- customizeHardwareSubmit.value = (data: boolean) => {
204
- customizeHardwareSubmit.value = null
205
-
206
- resolve(data)
207
- }
208
- })
209
- }
210
-
211
- const validateSendData = async (): Promise<void> => {
212
- const isValid = await checkCustomizeHardware()
213
- if (!isValid) {
214
- return
215
- }
216
-
217
- loadingLocal.value = true
218
- props
219
- .validateSendDataFunc(
220
- vmSettingsLocal.value,
221
- virtualHardwareCpu.value,
222
- virtualHardwareMemory.value,
223
- customizeHardware.value,
224
- virtualHardwareNetworks.value,
225
- virtualHardwareHardDisks.value,
226
- virtualHardwareCdDvdDrives.value,
227
- vmName.value,
228
- localization.value,
229
- props.vmId
230
- )
231
- .then((data) => {
232
- loadingLocal.value = false
233
-
234
- !data && emits('update-vm')
235
- })
236
- }
237
- </script>
238
-
239
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <common-vm-actions-edit-settings-new
3
+ v-if="isNewView"
4
+ v-model:vm-name="vmName"
5
+ v-model:vm-settings="vmSettingsLocal"
6
+ :nodes="props.nodes"
7
+ :files="props.files"
8
+ :project="props.project"
9
+ :loading="loadingLocal"
10
+ :datastore="props.datastore"
11
+ :is-datastore-loading="props.isDatastoreLoading"
12
+ :networks-table="props.networksTable"
13
+ :selected-nav-item="selectedNavItem"
14
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
15
+ :error-validation-fields="props.errorValidationFields"
16
+ :virtual-hardware-networks="virtualHardwareNetworksLocal"
17
+ :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
18
+ :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
19
+ :state="props.state"
20
+ :vm-name-old="props.vmSettings?.name"
21
+ :passthrough-devices="props.passthroughDevices"
22
+ :mediated-devices="props.mediatedDevices"
23
+ :get-datastore-table-func="props.getDatastoreTableFunc"
24
+ :customize-hardware-submit="customizeHardwareSubmit"
25
+ :is-vmt="props.isVmt"
26
+ @hide="emits('hide')"
27
+ @validate="validateSendData"
28
+ @update-vm="emits('update-vm')"
29
+ @get-storage="emits('get-storage', $event)"
30
+ @get-pci-devices="emits('get-pci-devices')"
31
+ @change-boot-order="onChangeBootOrder"
32
+ @get-networks-table="emits('get-networks-table', $event)"
33
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
34
+ @show-datastore-child="emits('show-datastore-child', $event)"
35
+ @get-active-device-child="emits('get-active-device-child', $event)"
36
+ @change-customize-hardware="onChangeCustomizeHardware"
37
+ />
38
+ <common-vm-actions-edit-settings-old
39
+ v-else
40
+ v-model:vm-name="vmName"
41
+ v-model:vm-settings="vmSettingsLocal"
42
+ :nodes="props.nodes"
43
+ :files="props.files"
44
+ :project="props.project"
45
+ :loading="loadingLocal"
46
+ :datastore="props.datastore"
47
+ :is-datastore-loading="props.isDatastoreLoading"
48
+ :networks-table="props.networksTable"
49
+ :selected-nav-item="selectedNavItem"
50
+ :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
51
+ :error-validation-fields="props.errorValidationFields"
52
+ :virtual-hardware-networks="virtualHardwareNetworksLocal"
53
+ :virtual-hardware-hard-disks="virtualHardwareHardDisksLocal"
54
+ :virtual-hardware-cd-dvd-drives="virtualHardwareCdDvdDrivesLocal"
55
+ :state="props.state"
56
+ :vm-name-old="props.vmSettings?.name"
57
+ :passthrough-devices="props.passthroughDevices"
58
+ :mediated-devices="props.mediatedDevices"
59
+ :get-datastore-table-func="props.getDatastoreTableFunc"
60
+ :customize-hardware-submit="customizeHardwareSubmit"
61
+ :is-vmt="props.isVmt"
62
+ @hide="emits('hide')"
63
+ @validate="validateSendData"
64
+ @update-vm="emits('update-vm')"
65
+ @get-storage="emits('get-storage', $event)"
66
+ @get-pci-devices="emits('get-pci-devices')"
67
+ @change-boot-order="onChangeBootOrder"
68
+ @get-networks-table="emits('get-networks-table', $event)"
69
+ @get-folders-or-files="emits('get-folders-or-files', $event)"
70
+ @show-datastore-child="emits('show-datastore-child', $event)"
71
+ @get-active-device-child="emits('get-active-device-child', $event)"
72
+ @change-customize-hardware="onChangeCustomizeHardware"
73
+ />
74
+ </template>
75
+
76
+ <script setup lang="ts">
77
+ import type { UI_T_Project } from '~/lib/models/types'
78
+ import type { UI_I_FileTreeNode } from '~/components/lib/models/interfaces'
79
+ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
80
+ import type {
81
+ UI_I_MediatedDevice,
82
+ UI_I_PciDevice,
83
+ UI_I_VmSettings,
84
+ } from '~/lib/models/store/vm/interfaces'
85
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
86
+ import type { UI_I_SendDataCustomizeHardware } from '~/components/common/vm/actions/common/customizeHardware/lib/models/interfaces'
87
+ import type {
88
+ UI_I_SendDataNewCdDvdDrive,
89
+ UI_I_SendDataNewHardDisk,
90
+ UI_I_SendDataNewNetwork,
91
+ UI_I_SendDataCpu,
92
+ UI_I_SendDataMemory,
93
+ } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
94
+ import type { UI_T_SelectedNavItem } from '~/components/common/vm/actions/common/lib/models/types'
95
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
96
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
97
+ import type {
98
+ UI_I_DatastoreTableItem,
99
+ UI_I_FolderOrFileTreePayload,
100
+ } from '~/lib/models/store/storage/interfaces'
101
+ import type { UI_T_ChangeBootOrder } from '~/components/common/vm/actions/lib/models/types'
102
+ import type { UI_T_EditVmFinishFunc } from '~/components/common/vm/actions/editSettings/lib/models/types'
103
+ import type { UI_I_Capabilities } from '~/components/common/vm/actions/common/lib/models/interfaces'
104
+ import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
105
+
106
+ const props = defineProps<{
107
+ project: UI_T_Project
108
+ loading: boolean
109
+ vmSettings: UI_I_VmSettings | null
110
+ nodes: UI_I_FileTreeNode[]
111
+ files: UI_I_FileTreeNode[]
112
+ networksTable: UI_I_NetworkTableItem[]
113
+ errorValidationFields: UI_I_ErrorValidationField<string>[]
114
+ vmCpuHelpTextSecond: string
115
+ vmId: string
116
+ datastore: UI_I_DatastoreTableItem[]
117
+ isDatastoreLoading: boolean
118
+ validateSendDataFunc: UI_T_EditVmFinishFunc
119
+ getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
120
+ state?: string | number
121
+ passthroughDevices?: UI_I_PciDevice[]
122
+ mediatedDevices?: UI_I_MediatedDevice[]
123
+ capabilities?: UI_I_Capabilities
124
+ isVmt?: boolean
125
+ }>()
126
+
127
+ const emits = defineEmits<{
128
+ (event: 'hide'): void
129
+ (event: 'update-vm'): void
130
+ (event: 'get-storage', value: UI_I_TablePayload): void
131
+ (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
132
+ (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
133
+ (event: 'show-datastore-child', value: UI_I_FileTreeNode): void
134
+ (event: 'get-networks-table', value: UI_I_TablePayload): void
135
+ (event: 'get-pci-devices'): void
136
+ }>()
137
+
138
+ const { $store }: any = useNuxtApp()
139
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
140
+
141
+ const localization = computed<UI_I_Localization>(() => useLocal())
142
+
143
+ watch(
144
+ () => props.capabilities,
145
+ () => {
146
+ if (props.capabilities) mapCapabilities(props.capabilities)
147
+ },
148
+ { deep: true, immediate: true }
149
+ )
150
+
151
+ const selectedNavItem = ref<UI_T_SelectedNavItem>(0)
152
+
153
+ const loadingLocal = ref<boolean>(false)
154
+ watch(
155
+ () => props.loading,
156
+ (newValue: boolean) => {
157
+ loadingLocal.value = newValue
158
+ },
159
+ { immediate: true }
160
+ )
161
+
162
+ const vmSettingsLocal = computed<UI_I_VmSettings | null>(() => props.vmSettings)
163
+
164
+ const vmName = ref<string>(vmSettingsLocal.value?.name || '')
165
+ watch(vmSettingsLocal, (newValue) => {
166
+ vmName.value = newValue?.name || ''
167
+ })
168
+
169
+ const virtualHardwareHardDisks = ref<UI_I_SendDataNewHardDisk[] | null>(null)
170
+ const virtualHardwareCdDvdDrives = ref<UI_I_SendDataNewCdDvdDrive[] | null>(
171
+ null
172
+ )
173
+ const virtualHardwareNetworks = ref<UI_I_SendDataNewNetwork[] | null>(null)
174
+ const onChangeBootOrder = (data: UI_T_ChangeBootOrder): void => {
175
+ virtualHardwareHardDisks.value = data[0]
176
+ virtualHardwareCdDvdDrives.value = data[1]
177
+ virtualHardwareNetworks.value = data[2]
178
+ }
179
+
180
+ const customizeHardware = ref<UI_I_SendDataCustomizeHardware | null>(null)
181
+ const onChangeCustomizeHardware = (
182
+ data: UI_I_SendDataCustomizeHardware
183
+ ): void => {
184
+ customizeHardware.value = data
185
+ }
186
+ const virtualHardwareHardDisksLocal = computed<
187
+ UI_I_SendDataNewHardDisk[] | null
188
+ >(() => customizeHardware.value?.virtualHardware?.hardDisks || null)
189
+ const virtualHardwareNetworksLocal = computed<UI_I_SendDataNewNetwork[] | null>(
190
+ () => customizeHardware.value?.virtualHardware?.networks || null
191
+ )
192
+ const virtualHardwareCdDvdDrivesLocal = computed<
193
+ UI_I_SendDataNewCdDvdDrive[] | null
194
+ >(() => customizeHardware.value?.virtualHardware?.cdDvdDrives || null)
195
+
196
+ const virtualHardwareCpu = computed<UI_I_SendDataCpu | null>(
197
+ () => customizeHardware.value?.virtualHardware?.cpu || null
198
+ )
199
+ const virtualHardwareMemory = computed<UI_I_SendDataMemory | null>(
200
+ () => customizeHardware.value?.virtualHardware?.memory || null
201
+ )
202
+
203
+ const customizeHardwareSubmit = ref<null | Function>(null)
204
+ const checkCustomizeHardware = async (): Promise<boolean> => {
205
+ return new Promise((resolve) => {
206
+ customizeHardwareSubmit.value = (data: boolean) => {
207
+ customizeHardwareSubmit.value = null
208
+
209
+ resolve(data)
210
+ }
211
+ })
212
+ }
213
+
214
+ const validateSendData = async (): Promise<void> => {
215
+ const isValid = await checkCustomizeHardware()
216
+ if (!isValid) {
217
+ return
218
+ }
219
+
220
+ loadingLocal.value = true
221
+ props
222
+ .validateSendDataFunc(
223
+ vmSettingsLocal.value,
224
+ virtualHardwareCpu.value,
225
+ virtualHardwareMemory.value,
226
+ customizeHardware.value,
227
+ virtualHardwareNetworks.value,
228
+ virtualHardwareHardDisks.value,
229
+ virtualHardwareCdDvdDrives.value,
230
+ vmName.value,
231
+ localization.value,
232
+ props.vmId
233
+ )
234
+ .then((data) => {
235
+ loadingLocal.value = false
236
+
237
+ !data && emits('update-vm')
238
+ })
239
+ }
240
+ </script>
241
+
242
+ <style scoped lang="scss"></style>
@@ -53,6 +53,7 @@
53
53
  :is-datastore-loading="props.isDatastoreLoading"
54
54
  :customize-hardware-submit="props.customizeHardwareSubmit"
55
55
  is-edit
56
+ :is-vmt="props.isVmt"
56
57
  @get-storage="emits('get-storage', $event)"
57
58
  @get-folders-or-files="emits('get-folders-or-files', $event)"
58
59
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -118,6 +119,7 @@ const props = defineProps<{
118
119
  mediatedDevices?: any[]
119
120
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
120
121
  customizeHardwareSubmit?: null | Function
122
+ isVmt?: boolean
121
123
  }>()
122
124
 
123
125
  const emits = defineEmits<{
@@ -56,6 +56,7 @@
56
56
  :is-datastore-loading="props.isDatastoreLoading"
57
57
  :customize-hardware-submit="props.customizeHardwareSubmit"
58
58
  is-edit
59
+ :is-vmt="props.isVmt"
59
60
  @get-storage="emits('get-storage', $event)"
60
61
  @get-folders-or-files="emits('get-folders-or-files', $event)"
61
62
  @get-active-device-child="emits('get-active-device-child', $event)"
@@ -125,6 +126,7 @@ const props = defineProps<{
125
126
  mediatedDevices?: any[]
126
127
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
127
128
  customizeHardwareSubmit?: null | Function
129
+ isVmt?: boolean
128
130
  }>()
129
131
 
130
132
  const emits = defineEmits<{
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.322",
4
+ "version": "1.5.325",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",