bfg-common 1.1.66 → 1.1.68

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.
@@ -47,9 +47,9 @@
47
47
  <div v-show="selectedNavItem === 1">
48
48
  <common-vm-actions-add-customize-hardware-vmoptions
49
49
  v-model:vm-name="vmNameLocal"
50
- :guest-machine-type="props.guestMachineType"
51
- :guest-os-family="props.guestOsFamily"
52
- :guest-os-version="props.guestOsVersion"
50
+ v-model:guest-machine-type="guestMachineTypeLocal"
51
+ v-model:guest-os-family="guestOsFamilyLocal"
52
+ v-model:guest-os-version="guestOsVersionLocal"
53
53
  :hard-disks="props.hardDisksForBootOptions"
54
54
  :cd-dvd-drives="props.cdDvdDrivesForBootOptions"
55
55
  :networks="props.networksForBootOptions"
@@ -141,6 +141,9 @@ const emits = defineEmits<{
141
141
  (event: 'send-data', value: UI_I_SendDataCustomizeHardware): void
142
142
  (event: 'next'): void
143
143
  (event: 'update:vm-name', value: string): void
144
+ (event: 'update:guest-machine-type', value: UI_I_OptionItem | null): void
145
+ (event: 'update:guest-os-family', value: UI_I_OptionItem | null): void
146
+ (event: 'update:guest-os-version', value: UI_I_OptionItem | null): void
144
147
  (event: 'get-storage', value: UI_I_TablePayload): void
145
148
  (event: 'get-folders-or-files', value: UI_I_FolderOrFileTreePayload): void
146
149
  (event: 'get-active-device-child', value: UI_I_FileTreeNode): void
@@ -158,6 +161,30 @@ const vmNameLocal = computed<string>({
158
161
  emits('update:vm-name', newValue)
159
162
  },
160
163
  })
164
+ const guestMachineTypeLocal = computed<UI_I_OptionItem | null>({
165
+ get() {
166
+ return props.guestMachineType
167
+ },
168
+ set(newValue) {
169
+ emits('update:guest-machine-type', newValue)
170
+ },
171
+ })
172
+ const guestOsFamilyLocal = computed<UI_I_OptionItem | null>({
173
+ get() {
174
+ return props.guestOsFamily
175
+ },
176
+ set(newValue) {
177
+ emits('update:guest-os-family', newValue)
178
+ },
179
+ })
180
+ const guestOsVersionLocal = computed<UI_I_OptionItem | null>({
181
+ get() {
182
+ return props.guestOsVersion
183
+ },
184
+ set(newValue) {
185
+ emits('update:guest-os-version', newValue)
186
+ },
187
+ })
161
188
 
162
189
  const localization = computed<UI_I_Localization>(() => useLocal())
163
190
 
@@ -4,9 +4,9 @@
4
4
  <div class="stack-view">
5
5
  <common-vm-actions-add-customize-hardware-vmoptions-general-options
6
6
  v-model:vm-name="vmNameLocal"
7
- :guest-machine-type="props.guestMachineType"
8
- :guest-os-family="props.guestOsFamily"
9
- :guest-os-version="props.guestOsVersion"
7
+ v-model:guest-machine-type="guestMachineTypeLocal"
8
+ v-model:guest-os-family="guestOsFamilyLocal"
9
+ v-model:guest-os-version="guestOsVersionLocal"
10
10
  :is-edit="props.isEdit"
11
11
  :state="props.state"
12
12
  />
@@ -81,6 +81,9 @@ const emits = defineEmits<{
81
81
  (event: 'send-data', value: UI_I_SendDataVmoptions): void
82
82
  (event: 'invalid', value: string[]): void
83
83
  (event: 'update:vm-name', value: string): void
84
+ (event: 'update:guest-machine-type', value: UI_I_OptionItem | null): void
85
+ (event: 'update:guest-os-family', value: UI_I_OptionItem | null): void
86
+ (event: 'update:guest-os-version', value: UI_I_OptionItem | null): void
84
87
  (event: 'remove-error-by-title', value: string): void
85
88
  }>()
86
89
 
@@ -92,6 +95,30 @@ const vmNameLocal = computed<string>({
92
95
  emits('update:vm-name', newValue)
93
96
  },
94
97
  })
98
+ const guestMachineTypeLocal = computed<UI_I_OptionItem | null>({
99
+ get() {
100
+ return props.guestMachineType
101
+ },
102
+ set(newValue) {
103
+ emits('update:guest-machine-type', newValue)
104
+ },
105
+ })
106
+ const guestOsFamilyLocal = computed<UI_I_OptionItem | null>({
107
+ get() {
108
+ return props.guestOsFamily
109
+ },
110
+ set(newValue) {
111
+ emits('update:guest-os-family', newValue)
112
+ },
113
+ })
114
+ const guestOsVersionLocal = computed<UI_I_OptionItem | null>({
115
+ get() {
116
+ return props.guestOsVersion
117
+ },
118
+ set(newValue) {
119
+ emits('update:guest-os-version', newValue)
120
+ },
121
+ })
95
122
 
96
123
  const localization = computed<UI_I_Localization>(() => useLocal())
97
124
 
@@ -1,117 +1,182 @@
1
- <template>
2
- <div class="hardware-cpu">
3
- <atoms-stack-block :has-children="true" @toggle="blockIsOpen = $event">
4
- <template #stackBlockKey>
5
- <div class="flex-align-center">
6
- <span>{{ localization.generalOptions }}</span>
7
- </div>
8
- </template>
9
- <template #stackBlockContent>
10
- <div v-show="!blockIsOpen">
11
- {{ localization.vmName }}: {{ vmNameLocal }}
12
- </div>
13
- </template>
14
- <template #stackChildren>
15
- <atoms-stack-block :has-children="false">
16
- <template #stackBlockKey>
17
- {{ localization.vmName }}
18
- </template>
19
- <template #stackBlockContent>
20
- <span v-if="!props.isEdit">{{ vmNameLocal }}</span>
21
- <input
22
- v-else
23
- id="general-option-vm-name"
24
- v-model="vmNameLocal"
25
- type="text"
26
- />
27
- </template>
28
- </atoms-stack-block>
29
-
30
- <atoms-stack-block :has-children="false">
31
- <template #stackBlockKey>
32
- {{ localization.machineType }}
33
- </template>
34
- <template #stackBlockContent>
35
- <select
36
- v-if="props.guestMachineType"
37
- id="guest-machine-type-select"
38
- :disabled="isDisabled"
39
- >
40
- <option selected :value="props.guestMachineType.value">
41
- {{ props.guestMachineType.text }}
42
- </option>
43
- </select>
44
- </template>
45
- </atoms-stack-block>
46
-
47
- <atoms-stack-block :has-children="false">
48
- <template #stackBlockKey>
49
- {{ localization.guestOsFamily }}
50
- </template>
51
- <template #stackBlockContent>
52
- <select
53
- v-if="props.guestOsFamily"
54
- id="guest-os-family-select"
55
- :disabled="isDisabled"
56
- >
57
- <option selected :value="props.guestOsFamily.value">
58
- {{ props.guestOsFamily.text }}
59
- </option>
60
- </select>
61
- </template>
62
- </atoms-stack-block>
63
-
64
- <atoms-stack-block :has-children="false">
65
- <template #stackBlockKey>
66
- {{ localization.guestOsVersion }}
67
- </template>
68
- <template #stackBlockContent>
69
- <select
70
- v-if="props.guestOsVersion"
71
- id="guest-os-version-select"
72
- :disabled="isDisabled"
73
- >
74
- <option selected :value="props.guestOsVersion.value">
75
- {{ props.guestOsVersion.text }}
76
- </option>
77
- </select>
78
- </template>
79
- </atoms-stack-block>
80
- </template>
81
- </atoms-stack-block>
82
- </div>
83
- </template>
84
-
85
- <script setup lang="ts">
86
- import { UI_I_Localization } from '~/models/interfaces'
87
- import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
88
-
89
- const localization = computed<UI_I_Localization>(() => useLocal())
90
-
91
- const props = defineProps<{
92
- vmName: string
93
- guestMachineType: UI_I_OptionItem | null
94
- guestOsFamily: UI_I_OptionItem | null
95
- guestOsVersion: UI_I_OptionItem | null
96
- isEdit: boolean
97
- state?: string | number
98
- }>()
99
- const emits = defineEmits<{
100
- (event: 'update:vm-name', value: string): void
101
- }>()
102
-
103
- const isDisabled = computed<boolean>(() => !props.isEdit || props.isEdit && props.state !== 1)
104
-
105
- const vmNameLocal = computed<string>({
106
- get() {
107
- return props.vmName
108
- },
109
- set(newValue) {
110
- emits('update:vm-name', newValue)
111
- },
112
- })
113
-
114
- const blockIsOpen = ref<boolean>(false)
115
- </script>
116
-
117
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <div class="hardware-cpu">
3
+ <atoms-stack-block :has-children="true" @toggle="blockIsOpen = $event">
4
+ <template #stackBlockKey>
5
+ <div class="flex-align-center">
6
+ <span>{{ localization.generalOptions }}</span>
7
+ </div>
8
+ </template>
9
+ <template #stackBlockContent>
10
+ <div v-show="!blockIsOpen">
11
+ {{ localization.vmName }}: {{ vmNameLocal }}
12
+ </div>
13
+ </template>
14
+ <template #stackChildren>
15
+ <atoms-stack-block :has-children="false">
16
+ <template #stackBlockKey>
17
+ {{ localization.vmName }}
18
+ </template>
19
+ <template #stackBlockContent>
20
+ <span v-if="!props.isEdit">{{ vmNameLocal }}</span>
21
+ <input
22
+ v-else
23
+ id="general-option-vm-name"
24
+ v-model="vmNameLocal"
25
+ type="text"
26
+ />
27
+ </template>
28
+ </atoms-stack-block>
29
+
30
+ <atoms-stack-block :has-children="false">
31
+ <template #stackBlockKey>
32
+ {{ localization.machineType }}
33
+ </template>
34
+ <template #stackBlockContent>
35
+ <select
36
+ v-if="props.guestMachineType"
37
+ id="guest-machine-type-select"
38
+ :disabled="isDisabled"
39
+ v-model="guestMachineTypeLocal"
40
+ >
41
+ <option
42
+ v-for="item in machineTypeOptions"
43
+ :key="item.value"
44
+ :value="item"
45
+ >
46
+ {{ item.text }}
47
+ </option>
48
+ </select>
49
+ </template>
50
+ </atoms-stack-block>
51
+
52
+ <atoms-stack-block :has-children="false">
53
+ <template #stackBlockKey>
54
+ {{ localization.guestOsFamily }}
55
+ </template>
56
+ <template #stackBlockContent>
57
+ <select
58
+ v-if="props.guestOsFamily"
59
+ id="guest-os-family-select"
60
+ v-model="guestOsFamilyLocal"
61
+ :disabled="isDisabled"
62
+ @change="onChangeOS"
63
+ >
64
+ <option v-for="item in osOptions" :key="item.value" :value="item">
65
+ {{ item.text }}
66
+ </option>
67
+ </select>
68
+ </template>
69
+ </atoms-stack-block>
70
+
71
+ <atoms-stack-block :has-children="false">
72
+ <template #stackBlockKey>
73
+ {{ localization.guestOsVersion }}
74
+ </template>
75
+ <template #stackBlockContent>
76
+ <select
77
+ v-if="props.guestOsVersion"
78
+ id="guest-os-version-select"
79
+ v-model="guestOsVersionLocal"
80
+ :disabled="isDisabled"
81
+ >
82
+ <option
83
+ v-for="item in versionsOptions"
84
+ :key="item.value"
85
+ :value="item"
86
+ >
87
+ {{ item.text }}
88
+ </option>
89
+ </select>
90
+ </template>
91
+ </atoms-stack-block>
92
+ </template>
93
+ </atoms-stack-block>
94
+ </div>
95
+ </template>
96
+
97
+ <script setup lang="ts">
98
+ import { UI_I_Localization } from '~/models/interfaces'
99
+ import { UI_I_OptionItem } from '~/components/atoms/models/interfaces'
100
+ import { capabilities } from '~/components/common/vm/actions/add/config/capabilities'
101
+
102
+ const localization = computed<UI_I_Localization>(() => useLocal())
103
+
104
+ const props = defineProps<{
105
+ vmName: string
106
+ guestMachineType: UI_I_OptionItem | null
107
+ guestOsFamily: UI_I_OptionItem | null
108
+ guestOsVersion: UI_I_OptionItem | null
109
+ isEdit: boolean
110
+ state?: string | number
111
+ }>()
112
+ const emits = defineEmits<{
113
+ (event: 'update:vm-name', value: string): void
114
+ (event: 'update:guest-machine-type', value: UI_I_OptionItem | null): void
115
+ (event: 'update:guest-os-family', value: UI_I_OptionItem | null): void
116
+ (event: 'update:guest-os-version', value: UI_I_OptionItem | null): void
117
+ }>()
118
+
119
+ const isDisabled = computed<boolean>(
120
+ () => !props.isEdit || (props.isEdit && props.state !== 1)
121
+ )
122
+
123
+ const vmNameLocal = computed<string>({
124
+ get() {
125
+ return props.vmName
126
+ },
127
+ set(newValue) {
128
+ emits('update:vm-name', newValue)
129
+ },
130
+ })
131
+
132
+ const guestMachineTypeLocal = computed<UI_I_OptionItem | null>({
133
+ get() {
134
+ console.log(props.guestMachineType, 111);
135
+ return props.guestMachineType
136
+ },
137
+ set(newValue) {
138
+ emits('update:guest-machine-type', newValue)
139
+ },
140
+ })
141
+ const machineTypeOptions = ref<UI_I_OptionItem[]>(capabilities.machineTypes)
142
+
143
+ const guestOsFamilyLocal = computed<UI_I_OptionItem | null>({
144
+ get() {
145
+ console.log(props.guestOsFamily, 2222);
146
+ return props.guestOsFamily
147
+ },
148
+ set(newValue) {
149
+ emits('update:guest-os-family', newValue)
150
+ },
151
+ })
152
+ const osOptions = ref<UI_I_OptionItem[]>(capabilities.guestOsFamilies)
153
+ const onChangeOS = (): void => {
154
+ guestOsVersionLocal.value = versionsOptions.value[0]
155
+ }
156
+
157
+ const guestOsVersionLocal = computed<UI_I_OptionItem | null>({
158
+ get() {
159
+ console.log(props.guestOsVersion, 333);
160
+ return props.guestOsVersion
161
+ },
162
+ set(newValue) {
163
+ emits('update:guest-os-version', newValue)
164
+ },
165
+ })
166
+ const versionsOptions = computed<UI_I_OptionItem[]>(() => {
167
+ if (!guestOsFamilyLocal.value) return []
168
+
169
+ return capabilities.guestOsVersions[guestOsFamilyLocal.value.value] || []
170
+ })
171
+ watch(
172
+ versionsOptions,
173
+ () => {
174
+ guestOsVersionLocal.value = versionsOptions.value[0]
175
+ },
176
+ // { immediate: true }
177
+ )
178
+
179
+ const blockIsOpen = ref<boolean>(false)
180
+ </script>
181
+
182
+ <style scoped lang="scss"></style>
@@ -17,9 +17,9 @@
17
17
  <div v-if="vmSettings" class="add-vm-context">
18
18
  <common-vm-actions-add-customize-hardware
19
19
  v-model:vm-name="vmName"
20
- :guest-machine-type="vmSettings.guestMachineType"
21
- :guest-os-family="vmSettings.guestOsFamily"
22
- :guest-os-version="vmSettings.guestOsVersion"
20
+ v-model:guest-machine-type="vmSettings.guestMachineType"
21
+ v-model:guest-os-family="vmSettings.guestOsFamily"
22
+ v-model:guest-os-version="vmSettings.guestOsVersion"
23
23
  :storage="vmSettings.storage"
24
24
  :hard-disks-for-boot-options="virtualHardwareHardDisksLocal"
25
25
  :cd-dvd-drives-for-boot-options="virtualHardwareCdDvdDrivesLocal"
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.1.66",
4
+ "version": "1.1.68",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",