bfg-common 1.5.548 → 1.5.550

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 (158) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/Add.vue +251 -251
  14. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  15. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  16. package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
  17. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  18. package/components/common/diagramMain/port/Port.vue +580 -580
  19. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  20. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  21. package/components/common/pages/backups/DetailView.vue +52 -52
  22. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  23. package/components/common/pages/backups/modals/Modals.vue +243 -243
  24. package/components/common/pages/backups/modals/createBackup/New.vue +2 -8
  25. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  26. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  27. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  28. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  29. package/components/common/pages/backups/modals/restore/Restore.vue +5 -9
  30. package/components/common/pages/backups/modals/restore/RestoreNew.vue +3 -12
  31. package/components/common/pages/backups/modals/restore/RestoreOld.vue +18 -6
  32. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  33. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  34. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  35. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  36. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  37. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  38. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  39. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  40. package/components/common/select/radio/RadioGroup.vue +137 -137
  41. package/components/common/spiceConsole/Drawer.vue +420 -420
  42. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  43. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  44. package/components/common/tools/Actions.vue +207 -207
  45. package/components/common/treeView/TreeView.vue +52 -52
  46. package/components/common/vm/actions/add/Add.vue +877 -950
  47. package/components/common/vm/actions/add/New.vue +652 -690
  48. package/components/common/vm/actions/add/Old.vue +363 -402
  49. package/components/common/vm/actions/add/lib/config/steps.ts +347 -347
  50. package/components/common/vm/actions/clone/Clone.vue +809 -809
  51. package/components/common/vm/actions/clone/new/New.vue +457 -457
  52. package/components/common/vm/actions/clone/old/Old.vue +378 -378
  53. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +243 -308
  54. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +328 -373
  55. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +161 -205
  56. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +694 -728
  57. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +512 -523
  58. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +328 -339
  59. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +348 -368
  60. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuNew.vue +241 -248
  61. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuOld.vue +184 -189
  62. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  63. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  64. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +300 -313
  65. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +158 -158
  66. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryOld.vue +155 -155
  67. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +427 -427
  68. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  69. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +47 -58
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerNew.vue +68 -65
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newUsbController/NewUsbControllerOld.vue +64 -61
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCard.vue +140 -162
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardNew.vue +6 -5
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/VideoCardOld.vue +6 -5
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options.ts +4 -4
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  80. package/components/common/vm/actions/common/customizeHardware/vmoptions/Vmoptions.vue +76 -163
  81. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsNew.vue +87 -138
  82. package/components/common/vm/actions/common/customizeHardware/vmoptions/VmoptionsOld.vue +71 -120
  83. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptions.vue +46 -110
  84. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsNew.vue +65 -85
  85. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/BootOptionsOld.vue +70 -91
  86. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  87. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  88. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +156 -174
  89. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderNew.vue +109 -74
  90. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/OrderOld.vue +104 -66
  91. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +86 -101
  92. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsNew.vue +163 -173
  93. package/components/common/vm/actions/common/customizeHardware/vmoptions/generalOptions/GeneralOptionsOld.vue +162 -170
  94. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/New.vue +142 -148
  95. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/Old.vue +135 -141
  96. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +74 -178
  97. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  98. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapNew.vue → New.vue} +45 -45
  99. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/{KeymapOld.vue → Old.vue} +47 -47
  100. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +102 -103
  101. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  102. package/components/common/vm/actions/common/customizeHardware/vmoptions/tools/Tools.vue +26 -49
  103. package/components/common/vm/actions/common/lib/models/interfaces.ts +189 -157
  104. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  105. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  106. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  107. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  108. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  109. package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
  110. package/components/common/vm/actions/common/select/storage/Storage.vue +178 -178
  111. package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
  112. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  113. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  114. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  115. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  116. package/components/common/vm/actions/lib/models/interfaces.ts +15 -40
  117. package/components/common/vm/actions/lib/utils.ts +244 -239
  118. package/components/common/vm/actions/register/Register.vue +352 -352
  119. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  120. package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
  121. package/components/common/wizards/common/compatibility/New.vue +99 -99
  122. package/components/common/wizards/common/compatibility/Old.vue +53 -53
  123. package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +86 -86
  124. package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
  125. package/components/common/wizards/common/steps/computeResource/Old.vue +103 -103
  126. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  127. package/components/common/wizards/common/steps/name/New.vue +221 -221
  128. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  129. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  130. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  131. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  132. package/components/common/wizards/datastore/add/Add.vue +228 -228
  133. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  134. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  135. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -205
  136. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  137. package/composables/useAppVersion.ts +21 -21
  138. package/composables/useLocal.ts +6 -6
  139. package/composables/useLocalCommon.ts +39 -39
  140. package/package.json +1 -3
  141. package/plugins/console.ts +21 -21
  142. package/plugins/date.ts +233 -233
  143. package/plugins/mouse.ts +21 -21
  144. package/plugins/panelStates.ts +70 -70
  145. package/plugins/text.ts +59 -59
  146. package/public/spice-console/application/clientgui.js +854 -854
  147. package/public/spice-console/application/packetfactory.js +211 -211
  148. package/public/spice-console/application/virtualmouse.js +147 -147
  149. package/public/spice-console/lib/images/bitmap.js +203 -203
  150. package/public/spice-console/network/spicechannel.js +440 -440
  151. package/public/spice-console/process/cursorprocess.js +121 -121
  152. package/public/spice-console/process/inputprocess.js +227 -227
  153. package/public/spice-console/process/mainprocess.js +210 -210
  154. package/public/spice-console/run.js +210 -210
  155. package/store/main/mutations.ts +7 -7
  156. package/store/main/state.ts +7 -7
  157. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordNew.vue → New.vue} +0 -0
  158. /package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/{PasswordOld.vue → Old.vue} +0 -0
@@ -1,162 +1,140 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-new
3
- v-if="isNewView"
4
- v-model:invalid="invalid"
5
- v-model:number-displays="numberDisplays"
6
- v-model:video-card-model="videoCardModel"
7
- :is-edit="props.isEdit"
8
- :error-validation-fields="props.errorValidationFields"
9
- :video-card-model-name="videoCardModelName"
10
- :error-text="apiError"
11
- :is-disabled="isDisabled"
12
- :is-disabled-number-displays="isDisabledNumberDisplays"
13
- :state="props.state"
14
- :video-card-model-options="videoCardModelOptions"
15
- :number-displays-options="numberDisplaysOptions"
16
- @remove-error="onRemoveValidationError"
17
- @remove-error-by-title="emits('remove-error-by-title', $event)"
18
- />
19
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-old
20
- v-else
21
- v-model:invalid="invalid"
22
- v-model:number-displays="numberDisplays"
23
- v-model:video-card-model="videoCardModel"
24
- :is-edit="props.isEdit"
25
- :error-validation-fields="props.errorValidationFields"
26
- :video-card-model-name="videoCardModelName"
27
- :error-text="apiError"
28
- :is-disabled="isDisabled"
29
- :is-disabled-number-displays="isDisabledNumberDisplays"
30
- :state="props.state"
31
- :video-card-model-options="videoCardModelOptions"
32
- :number-displays-options="numberDisplaysOptions"
33
- @remove-error="onRemoveValidationError"
34
- @remove-error-by-title="emits('remove-error-by-title', $event)"
35
- />
36
- </template>
37
-
38
- <script setup lang="ts">
39
- import type { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
40
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
41
- import type { UI_I_Localization } from '~/lib/models/interfaces'
42
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
43
- import { videoCardModelOptionsConfigFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/lib/config/options'
44
- import { numberDisplaysOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options'
45
-
46
- const props = withDefaults(
47
- defineProps<{
48
- isEdit: boolean
49
- errorValidationFields: UI_I_ErrorValidationField[]
50
- videoCard?: UI_I_SendDataVideoCard
51
- state?: string | number
52
- }>(),
53
- {
54
- videoCard: undefined,
55
- state: undefined,
56
- }
57
- )
58
- const emits = defineEmits<{
59
- (event: 'send-data', value: UI_I_SendDataVideoCard): void
60
- (event: 'invalid', value: boolean): void
61
- (event: 'remove-error-by-title', value: string): void
62
- }>()
63
-
64
- const localization = computed<UI_I_Localization>(() => useLocal())
65
-
66
- const { $store }: any = useNuxtApp()
67
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
68
-
69
- const isDisabled = computed<boolean>(() => props.isEdit && props.state !== 1)
70
- const isDisabledNumberDisplays = computed<boolean>(
71
- () => videoCardModel.value === 'none'
72
- )
73
- watch(isDisabled, (newValue) => {
74
- if (!newValue) {
75
- return
76
- }
77
-
78
- numberDisplays.value = '1'
79
- })
80
-
81
- const videoCardModel = ref<string>('qxl')
82
- const videoCardModelOptions = computed<UI_I_OptionItem[]>(() =>
83
- videoCardModelOptionsConfigFunc(localization.value)
84
- )
85
- const videoCardModelName = computed<string>(
86
- () =>
87
- videoCardModelOptions.value.find(
88
- (videoCard) => videoCard.value === videoCardModel.value
89
- )?.text || ''
90
- )
91
-
92
- const numberDisplays = ref<string>('1')
93
- const numberDisplaysOptions = computed<UI_I_OptionItem[]>(() => {
94
- const result = numberDisplaysOptionsFunc()
95
- if (videoCardModel.value === 'none') {
96
- result.unshift({ text: '0', value: '0' })
97
- }
98
- return result
99
- })
100
-
101
- // const totalVideoMemory = ref<number>(64)
102
- const invalid = ref<boolean>(false)
103
- watch(
104
- invalid,
105
- (newValue) => {
106
- emits('invalid', newValue)
107
- },
108
- { immediate: true }
109
- )
110
-
111
- // const graphics = ref(false)
112
-
113
- const changeNumberDisplays = (model: any): void => {
114
- if (model === 'none') {
115
- numberDisplays.value = '0'
116
- } else if (numberDisplays.value === '0') {
117
- numberDisplays.value = '1'
118
- }
119
- }
120
- watch(
121
- // [numberDisplays, totalVideoMemory, videoCardModel],
122
- [numberDisplays, videoCardModel],
123
- ([_newValue1, newValue2]) => {
124
- changeNumberDisplays(newValue2)
125
-
126
- emits('send-data', {
127
- adapter: videoCardModel.value,
128
- displays: +numberDisplays.value,
129
- // memory_mb: totalVideoMemory.value,
130
- })
131
- },
132
- { immediate: true }
133
- )
134
-
135
- // Добавляем данные для редактирования
136
- watch(
137
- () => props.videoCard,
138
- (newValue) => {
139
- if (!newValue) return
140
-
141
- videoCardModel.value = newValue.adapter
142
- numberDisplays.value = '' + newValue.displays
143
- // totalVideoMemory.value = newValue.memory_mb
144
- },
145
- { immediate: true }
146
- )
147
-
148
- const typeError = 'video_card.adapter'
149
-
150
- const apiError = computed<string>(() => {
151
- return (
152
- props.errorValidationFields?.find((message) => message.field === typeError)
153
- ?.error_message || ''
154
- )
155
- })
156
-
157
- const onRemoveValidationError = (): void => {
158
- emits('remove-error-by-title', typeError)
159
- }
160
- </script>
161
-
162
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-new
3
+ v-if="isNewView"
4
+ v-model="model"
5
+ v-model:invalid="invalid"
6
+ :is-edit="props.isEdit"
7
+ :error-validation-fields="props.errorValidationFields"
8
+ :video-card-model-name="videoCardModelName"
9
+ :error-text="apiError"
10
+ :is-disabled="isDisabled"
11
+ :is-disabled-number-displays="isDisabledNumberDisplays"
12
+ :state="props.state"
13
+ :video-card-model-options="videoCardModelOptions"
14
+ :number-displays-options="numberDisplaysOptions"
15
+ @remove-error="onRemoveValidationError"
16
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
17
+ />
18
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-old
19
+ v-else
20
+ v-model="model"
21
+ v-model:invalid="invalid"
22
+ :is-edit="props.isEdit"
23
+ :error-validation-fields="props.errorValidationFields"
24
+ :video-card-model-name="videoCardModelName"
25
+ :error-text="apiError"
26
+ :is-disabled="isDisabled"
27
+ :is-disabled-number-displays="isDisabledNumberDisplays"
28
+ :state="props.state"
29
+ :video-card-model-options="videoCardModelOptions"
30
+ :number-displays-options="numberDisplaysOptions"
31
+ @remove-error="onRemoveValidationError"
32
+ @remove-error-by-title="emits('remove-error-by-title', $event)"
33
+ />
34
+ </template>
35
+
36
+ <script setup lang="ts">
37
+ import type { UI_I_SendDataVideoCard } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
38
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
39
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
40
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
41
+ import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
42
+ import { videoCardModelOptionsConfigFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/model/lib/config/options'
43
+ import { numberDisplaysOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/lib/config/options'
44
+
45
+ const model = defineModel<UI_I_CreateVmData['video_card']>({ required: true })
46
+
47
+ const props = withDefaults(
48
+ defineProps<{
49
+ isEdit: boolean
50
+ errorValidationFields: UI_I_ErrorValidationField[]
51
+ videoCard?: UI_I_SendDataVideoCard
52
+ state?: string | number
53
+ }>(),
54
+ {
55
+ videoCard: undefined,
56
+ state: undefined,
57
+ }
58
+ )
59
+ const emits = defineEmits<{
60
+ (event: 'invalid', value: boolean): void
61
+ (event: 'remove-error-by-title', value: string): void
62
+ }>()
63
+
64
+ const localization = computed<UI_I_Localization>(() => useLocal())
65
+
66
+ const { $store }: any = useNuxtApp()
67
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
68
+
69
+ const isDisabled = computed<boolean>(() => props.isEdit && props.state !== 1)
70
+ const isDisabledNumberDisplays = computed<boolean>(
71
+ () => model.value.adapter === 'none'
72
+ )
73
+ watch(isDisabled, (newValue) => {
74
+ if (!newValue) {
75
+ return
76
+ }
77
+
78
+ model.value.displays = 1
79
+ })
80
+
81
+ const videoCardModelOptions = computed<UI_I_OptionItem[]>(() =>
82
+ videoCardModelOptionsConfigFunc(localization.value)
83
+ )
84
+ const videoCardModelName = computed<string>(
85
+ () =>
86
+ videoCardModelOptions.value.find(
87
+ (videoCard) => videoCard.value === model.value.adapter
88
+ )?.text || ''
89
+ )
90
+
91
+ const numberDisplaysOptions = computed<UI_I_OptionItem[]>(() => {
92
+ const result = numberDisplaysOptionsFunc()
93
+ if (model.value.adapter === 'none') {
94
+ result.unshift({ text: '0', value: 0 })
95
+ }
96
+ return result
97
+ })
98
+
99
+ // const totalVideoMemory = ref<number>(64)
100
+ const invalid = ref<boolean>(false)
101
+ watch(
102
+ invalid,
103
+ (newValue) => {
104
+ emits('invalid', newValue)
105
+ },
106
+ { immediate: true }
107
+ )
108
+
109
+ // const graphics = ref(false)
110
+
111
+ const changeNumberDisplays = (modelLocal: string): void => {
112
+ if (modelLocal === 'none') {
113
+ model.value.displays = 0
114
+ } else if (model.value.displays === 0) {
115
+ model.value.displays = 1
116
+ }
117
+ }
118
+ watch(
119
+ () => model.value.adapter,
120
+ (newValue) => {
121
+ changeNumberDisplays(newValue)
122
+ },
123
+ { immediate: true }
124
+ )
125
+
126
+ const typeError = 'video_card.adapter'
127
+
128
+ const apiError = computed<string>(() => {
129
+ return (
130
+ props.errorValidationFields?.find((message) => message.field === typeError)
131
+ ?.error_message || ''
132
+ )
133
+ })
134
+
135
+ const onRemoveValidationError = (): void => {
136
+ emits('remove-error-by-title', typeError)
137
+ }
138
+ </script>
139
+
140
+ <style scoped lang="scss"></style>
@@ -26,7 +26,7 @@
26
26
  <template #stackBlockContent>
27
27
  <ui-select
28
28
  id="vm-wizard-video-card"
29
- v-model="videoCardModel"
29
+ v-model="model.adapter"
30
30
  :items="props.videoCardModelOptions"
31
31
  :disabled="props.isEdit && props.state !== 1"
32
32
  :error-text="props.errorText"
@@ -38,7 +38,7 @@
38
38
  </template>
39
39
  <template #stackChildren>
40
40
  <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
41
- v-model:number-displays="numberDisplays"
41
+ v-model:number-displays="model.displays"
42
42
  :number-displays-options="props.numberDisplaysOptions"
43
43
  :disabled="props.isDisabled || props.isDisabledNumberDisplays"
44
44
  :error-validation-fields="props.errorValidationFields"
@@ -56,7 +56,7 @@
56
56
  <!-- v-models:graphics="graphics"-->
57
57
  <!-- />-->
58
58
  <!-- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model-->
59
- <!-- v-model:video-card-model="videoCardModel"-->
59
+ <!-- v-model:video-card-model="model.adapter"-->
60
60
  <!-- :disabled="props.isDisabled"-->
61
61
  <!-- />-->
62
62
  </template>
@@ -67,13 +67,14 @@
67
67
  import type { UI_I_Localization } from '~/lib/models/interfaces'
68
68
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
69
69
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
70
+ import type {UI_I_CreateVmData} from "~/components/common/vm/actions/common/lib/models/interfaces";
71
+
72
+ const model = defineModel<UI_I_CreateVmData['video_card']>({ required: true })
70
73
 
71
74
  const invalid = defineModel<boolean>('invalid', { required: true })
72
- const numberDisplays = defineModel<string>('numberDisplays', { required: true })
73
75
  // const totalVideoMemory = defineModel<number>('totalVideoMemory', {
74
76
  // required: true,
75
77
  // })
76
- const videoCardModel = defineModel<string>('videoCardModel', { required: true })
77
78
 
78
79
  const props = withDefaults(
79
80
  defineProps<{
@@ -30,7 +30,7 @@
30
30
  <div class="select">
31
31
  <select
32
32
  id="vm-wizard-video-card"
33
- v-model="videoCardModel"
33
+ v-model="model.adapter"
34
34
  :disabled="props.isEdit && props.state !== 1"
35
35
  data-id="vm-wizard-video-card-select"
36
36
  class="vm-wizard-video-card input-text-color"
@@ -51,7 +51,7 @@
51
51
  </template>
52
52
  <template #stackChildren>
53
53
  <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays
54
- v-model:number-displays="numberDisplays"
54
+ v-model:number-displays="model.displays"
55
55
  :number-displays-options="props.numberDisplaysOptions"
56
56
  :disabled="props.isDisabled || props.isDisabledNumberDisplays"
57
57
  :error-validation-fields="props.errorValidationFields"
@@ -69,7 +69,7 @@
69
69
  <!-- v-models:graphics="graphics"-->
70
70
  <!-- />-->
71
71
  <!-- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-model-->
72
- <!-- v-model:video-card-model="videoCardModel"-->
72
+ <!-- v-model:video-card-model="model.adapter"-->
73
73
  <!-- :disabled="props.isDisabled"-->
74
74
  <!-- />-->
75
75
  </template>
@@ -81,13 +81,14 @@
81
81
  import type { UI_I_Localization } from '~/lib/models/interfaces'
82
82
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
83
83
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
84
+ import type {UI_I_CreateVmData} from "~/components/common/vm/actions/common/lib/models/interfaces";
85
+
86
+ const model = defineModel<UI_I_CreateVmData['video_card']>({ required: true })
84
87
 
85
88
  const invalid = defineModel<boolean>('invalid', { required: true })
86
- const numberDisplays = defineModel<string>('numberDisplays', { required: true })
87
89
  // const totalVideoMemory = defineModel<number>('totalVideoMemory', {
88
90
  // required: true,
89
91
  // })
90
- const videoCardModel = defineModel<string>('videoCardModel', { required: true })
91
92
 
92
93
  const props = withDefaults(
93
94
  defineProps<{
@@ -1,10 +1,10 @@
1
1
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
2
2
 
3
3
  export const numberDisplaysOptionsFunc = (): UI_I_OptionItem[] => [
4
- { text: '1', value: '1' },
5
- { text: '2', value: '2' },
6
- { text: '3', value: '3' },
7
- { text: '4', value: '4' },
4
+ { text: '1', value: 1 },
5
+ { text: '2', value: 2 },
6
+ { text: '3', value: 3 },
7
+ { text: '4', value: 4 },
8
8
  // { text: '5', value: '5' },
9
9
  // { text: '6', value: '6' },
10
10
  // { text: '7', value: '7' },
@@ -1,53 +1,53 @@
1
- <template>
2
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays-new
3
- v-if="isNewView"
4
- v-model:number-displays="numberDisplays"
5
- :disabled="props.disabled"
6
- :error-text="apiError"
7
- :number-displays-options="props.numberDisplaysOptions"
8
- @remove-error="onRemoveValidationError"
9
- />
10
- <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays-old
11
- v-else
12
- v-model:number-displays="numberDisplays"
13
- :disabled="props.disabled"
14
- :error-text="apiError"
15
- :number-displays-options="props.numberDisplaysOptions"
16
- @remove-error="onRemoveValidationError"
17
- />
18
- </template>
19
-
20
- <script setup lang="ts">
21
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
22
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
23
-
24
- const numberDisplays = defineModel<string>('numberDisplays', { required: true })
25
-
26
- const props = defineProps<{
27
- numberDisplaysOptions: UI_I_OptionItem[]
28
- disabled: boolean
29
- errorValidationFields: UI_I_ErrorValidationField[]
30
- }>()
31
-
32
- const emits = defineEmits<{
33
- (event: 'remove-error-by-title', value: string): void
34
- }>()
35
-
36
- const { $store }: any = useNuxtApp()
37
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
38
-
39
- const typeError = 'video_card.displays'
40
-
41
- const apiError = computed<string>(() => {
42
- return (
43
- props.errorValidationFields?.find((message) => message.field === typeError)
44
- ?.error_message || ''
45
- )
46
- })
47
-
48
- const onRemoveValidationError = (): void => {
49
- emits('remove-error-by-title', typeError)
50
- }
51
- </script>
52
-
53
- <style scoped></style>
1
+ <template>
2
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays-new
3
+ v-if="isNewView"
4
+ v-model:number-displays="numberDisplays"
5
+ :disabled="props.disabled"
6
+ :error-text="apiError"
7
+ :number-displays-options="props.numberDisplaysOptions"
8
+ @remove-error="onRemoveValidationError"
9
+ />
10
+ <common-vm-actions-common-customize-hardware-virtual-hardware-video-card-number-displays-old
11
+ v-else
12
+ v-model:number-displays="numberDisplays"
13
+ :disabled="props.disabled"
14
+ :error-text="apiError"
15
+ :number-displays-options="props.numberDisplaysOptions"
16
+ @remove-error="onRemoveValidationError"
17
+ />
18
+ </template>
19
+
20
+ <script setup lang="ts">
21
+ import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
22
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
23
+
24
+ const numberDisplays = defineModel<string>('numberDisplays', { required: true })
25
+
26
+ const props = defineProps<{
27
+ numberDisplaysOptions: UI_I_OptionItem[]
28
+ disabled: boolean
29
+ errorValidationFields: UI_I_ErrorValidationField[]
30
+ }>()
31
+
32
+ const emits = defineEmits<{
33
+ (event: 'remove-error-by-title', value: string): void
34
+ }>()
35
+
36
+ const { $store }: any = useNuxtApp()
37
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
38
+
39
+ const typeError = 'video_card.displays'
40
+
41
+ const apiError = computed<string>(() => {
42
+ return (
43
+ props.errorValidationFields?.find((message) => message.field === typeError)
44
+ ?.error_message || ''
45
+ )
46
+ })
47
+
48
+ const onRemoveValidationError = (): void => {
49
+ emits('remove-error-by-title', typeError)
50
+ }
51
+ </script>
52
+
53
+ <style scoped></style>