bfg-common 1.4.397 → 1.4.399

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 (123) hide show
  1. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +1 -1
  2. package/components/common/vm/actions/editSettings/EditSettingsNew.vue +1 -1
  3. package/package.json +1 -1
  4. package/components/common/vm/actions/common/_customizeHardware/CustomizeHardware.vue +0 -274
  5. package/components/common/vm/actions/common/_customizeHardware/lib/config/navItems.ts +0 -21
  6. package/components/common/vm/actions/common/_customizeHardware/lib/models/interfaces.ts +0 -7
  7. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/VirtualHardware.vue +0 -702
  8. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/BrowseView.vue +0 -203
  9. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/browseView/lib/models/interfaces.ts +0 -8
  10. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/Bus.vue +0 -156
  11. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/bus/lib/config/options.ts +0 -20
  12. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/CdDvdDrive.vue +0 -270
  13. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/fileTypes.ts +0 -9
  14. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/config/options.ts +0 -11
  15. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/lib/models/types.ts +0 -1
  16. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cdDvdDrive/media/Media.vue +0 -57
  17. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CoresPerSocket.vue +0 -110
  18. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Cpu.vue +0 -403
  19. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuHotPlug.vue +0 -56
  20. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/CpuModel.vue +0 -225
  21. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Hv.vue +0 -99
  22. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Iommu.vue +0 -55
  23. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/MaxCpu.vue +0 -106
  24. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Pc.vue +0 -55
  25. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/Sa.vue +0 -106
  26. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/lib/config/cpuOptions.ts +0 -21
  27. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/Shares.vue +0 -160
  28. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +0 -28
  29. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/cpu/tooltip/Tooltip.vue +0 -59
  30. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/binaryOptions.ts +0 -12
  31. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/config/dropdownItems.ts +0 -66
  32. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/interfaces.ts +0 -118
  33. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/lib/models/types.ts +0 -4
  34. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/Limit.vue +0 -236
  35. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/limit/lib/config/options.ts +0 -28
  36. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/Memory.vue +0 -329
  37. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/MemoryHotPlug.vue +0 -54
  38. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/memory/lib/config/memoryOptions.ts +0 -35
  39. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/DiskFile.vue +0 -24
  40. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/MaximumSize.vue +0 -27
  41. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +0 -462
  42. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/Cache.vue +0 -81
  43. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/cache/lib/config/options.ts +0 -7
  44. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/LimitIops.vue +0 -153
  45. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/limitIops/lib/config/options.ts +0 -28
  46. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/Location.vue +0 -172
  47. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/StorageModalOld.vue +0 -52
  48. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/StorageModalNew.vue +0 -175
  49. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/location/storageModalNew/lib/config/table.ts +0 -167
  50. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/Mode.vue +0 -88
  51. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/mode/lib/config/options.ts +0 -18
  52. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/Provisioning.vue +0 -88
  53. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/provisioning/lib/config/options.ts +0 -15
  54. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/Sharing.vue +0 -86
  55. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newHardDisk/sharing/lib/config/options.ts +0 -12
  56. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/Location.vue +0 -145
  57. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +0 -305
  58. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/AdapterType.vue +0 -87
  59. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/adapterType/lib/config/options.ts +0 -9
  60. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +0 -148
  61. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newNetwork/macAddress/lib/config/options.ts +0 -11
  62. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +0 -168
  63. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/directPathIo/DirectPathIo.vue +0 -48
  64. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +0 -49
  65. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/lib/config/options.ts +0 -10
  66. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +0 -7
  67. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/note/Note.vue +0 -27
  68. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/nvidiaGrid/NvidiaGrid.vue +0 -42
  69. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelection.vue +0 -57
  70. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/NewUsbController.vue +0 -82
  71. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/newUsbController/lib/config/options.ts +0 -6
  72. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/InputDevices.vue +0 -21
  73. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/other/Other.vue +0 -32
  74. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/Reservation.vue +0 -237
  75. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/reservation/lib/config/options.ts +0 -33
  76. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/Graphics.vue +0 -50
  77. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/TotalVideoMemory.vue +0 -121
  78. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/VideoCard.vue +0 -182
  79. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/lib/config/options.ts +0 -11
  80. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/Model.vue +0 -59
  81. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/model/lib/config/options.ts +0 -10
  82. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +0 -83
  83. package/components/common/vm/actions/common/_customizeHardware/virtualHardware/videoCard/numberDisplays/lib/config/options.ts +0 -14
  84. package/components/common/vm/actions/common/_customizeHardware/vmoptions/Vmoptions.vue +0 -181
  85. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/BootOptions.vue +0 -114
  86. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Menu.vue +0 -50
  87. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/Secure.vue +0 -50
  88. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/Delay.vue +0 -54
  89. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/delay/lib/config/config.ts +0 -14
  90. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +0 -84
  91. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/firmware/lib/config/config.ts +0 -11
  92. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/Order.vue +0 -201
  93. package/components/common/vm/actions/common/_customizeHardware/vmoptions/bootOptions/order/lib/models/interfaces.ts +0 -9
  94. package/components/common/vm/actions/common/_customizeHardware/vmoptions/generalOptions/GeneralOptions.vue +0 -192
  95. package/components/common/vm/actions/common/_customizeHardware/vmoptions/lib/models/interfaces.ts +0 -34
  96. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/CopyPaste.vue +0 -52
  97. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FileTransfer.vue +0 -52
  98. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/FolderSharing.vue +0 -51
  99. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PlaybackCompression.vue +0 -52
  100. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/PowerControl.vue +0 -50
  101. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/RemoteConsoleOptions.vue +0 -254
  102. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/ImgCompression.vue +0 -85
  103. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/imgCompression/lib/config/config.ts +0 -14
  104. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/JpegCompression.vue +0 -85
  105. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/jpegCompression/lib/config/config.ts +0 -12
  106. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +0 -56
  107. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/keymap/lib/config/config.ts +0 -6
  108. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/MouseMode.vue +0 -57
  109. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/mouseMode/lib/config/config.ts +0 -11
  110. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +0 -142
  111. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/models/interfaces.ts +0 -5
  112. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/password/lib/utils.ts +0 -12
  113. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/SharePolicy.vue +0 -56
  114. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/sharePolicy/lib/config/config.ts +0 -11
  115. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/StreamingMode.vue +0 -85
  116. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/streamingMode/lib/config/config.ts +0 -12
  117. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/Type.vue +0 -85
  118. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/type/lib/config/config.ts +0 -7
  119. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +0 -57
  120. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/lib/config/config.ts +0 -14
  121. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/ZlibCompression.vue +0 -85
  122. package/components/common/vm/actions/common/_customizeHardware/vmoptions/remoteConsoleOptions/zlibCompression/lib/config/config.ts +0 -12
  123. package/components/common/vm/actions/common/_customizeHardware/vmoptions/tools/Tools.vue +0 -72
@@ -1,88 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.diskProvisioning }}
6
- </template>
7
- <template #stackBlockContent>
8
- <atoms-tooltip-error
9
- :has-error="!!apiError"
10
- :selector="`.vm-wizard-disk-device-provisioning-field-${props.index}`"
11
- @remove="onRemoveValidationError"
12
- >
13
- <template #elem>
14
- <div class="select">
15
- <select
16
- :id="`vm-wizard-disk-device-provisioning-field-${props.index}`"
17
- v-model="diskProvisioningLocal"
18
- :data-id="`vm-wizard-disk-device-provisioning-field-${props.index}`"
19
- :disabled="props.disabled"
20
- :class="`vm-wizard-disk-device-provisioning-field-${props.index}`"
21
- >
22
- <option
23
- v-for="(item, key) in diskProvisioningOptions"
24
- :key="key"
25
- :value="item.value"
26
- >
27
- {{ item.text }}
28
- </option>
29
- </select>
30
- </div>
31
- </template>
32
- <template #content>{{ apiError }}</template>
33
- </atoms-tooltip-error>
34
- </template>
35
- </atoms-stack-block>
36
- </div>
37
- </template>
38
-
39
- <script setup lang="ts">
40
- import type { UI_I_Localization } from '~/lib/models/interfaces'
41
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
42
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
43
- import { diskProvisioningOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/provisioning/lib/config/options'
44
-
45
- const localization = computed<UI_I_Localization>(() => useLocal())
46
-
47
- const props = defineProps<{
48
- diskProvisioning: string
49
- index: number
50
- errorValidationFields: UI_I_ErrorValidationField[]
51
- disabled: boolean
52
- }>()
53
- const emits = defineEmits<{
54
- (event: 'update:disk-provisioning', value: string): void
55
- (event: 'remove-error-by-title', value: string): void
56
- }>()
57
-
58
- const diskProvisioningOptions = ref<UI_I_OptionItem[]>(
59
- diskProvisioningOptionsFunc(localization.value)
60
- )
61
-
62
- const diskProvisioningLocal = computed<string>({
63
- get() {
64
- return props.diskProvisioning
65
- },
66
- set(newValue) {
67
- emits('update:disk-provisioning', newValue)
68
- },
69
- })
70
-
71
- const typeError = computed<string>(
72
- () => `disk_devices[${props.index}].provision_type`
73
- )
74
-
75
- const apiError = computed<string>(() => {
76
- return (
77
- props.errorValidationFields?.find(
78
- (message) => message.field === typeError.value
79
- )?.error_message || ''
80
- )
81
- })
82
-
83
- const onRemoveValidationError = (): void => {
84
- emits('remove-error-by-title', typeError.value)
85
- }
86
- </script>
87
-
88
- <style scoped></style>
@@ -1,15 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
-
4
- export const diskProvisioningOptionsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_OptionItem[] => {
7
- return [
8
- { text: localization.common.thickProvisionLazyZeroed, value: 'thick' },
9
- {
10
- text: localization.common.thickProvisionEagerZeroed,
11
- value: 'thickzero',
12
- },
13
- { text: localization.common.thinProvision, value: 'thin' },
14
- ]
15
- }
@@ -1,86 +0,0 @@
1
- <template>
2
- <div class="">
3
- <atoms-stack-block :has-children="false">
4
- <template #stackBlockKey>
5
- {{ localization.common.sharing }}
6
- </template>
7
- <template #stackBlockContent>
8
- <atoms-tooltip-error
9
- :has-error="!!apiError"
10
- :selector="`.vm-wizard-disk-device-sharing-field-${props.index}`"
11
- @remove="onRemoveValidationError"
12
- >
13
- <template #elem>
14
- <div class="select">
15
- <select
16
- :id="`vm-wizard-disk-device-sharing-field-${props.index}`"
17
- v-model="sharingLocal"
18
- :data-id="`vm-wizard-disk-device-sharing-field-${props.index}`"
19
- :class="`vm-wizard-disk-device-sharing-field-${props.index}`"
20
- :disabled="props.disabled"
21
- >
22
- <option
23
- v-for="(item, key) in sharingOptions"
24
- :key="key"
25
- :value="item.value"
26
- >
27
- {{ item.text }}
28
- </option>
29
- </select>
30
- </div>
31
- </template>
32
- <template #content>{{ apiError }}</template>
33
- </atoms-tooltip-error>
34
- </template>
35
- </atoms-stack-block>
36
- </div>
37
- </template>
38
-
39
- <script setup lang="ts">
40
- import type { UI_I_Localization } from '~/lib/models/interfaces'
41
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
42
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
43
- import { sharingOptionsFunc } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/sharing/lib/config/options'
44
-
45
- const localization = computed<UI_I_Localization>(() => useLocal())
46
-
47
- const props = defineProps<{
48
- sharing: string
49
- index: number
50
- disabled: boolean
51
- errorValidationFields: UI_I_ErrorValidationField<string>[]
52
- }>()
53
- const emits = defineEmits<{
54
- (event: 'update:sharing', value: string): void
55
- (event: 'remove-error-by-title', value: string): void
56
- }>()
57
-
58
- const sharingOptions = ref<UI_I_OptionItem[]>(
59
- sharingOptionsFunc(localization.value)
60
- )
61
-
62
- const sharingLocal = computed<string>({
63
- get() {
64
- return props.sharing
65
- },
66
- set(newValue) {
67
- emits('update:sharing', newValue)
68
- },
69
- })
70
-
71
- const typeError = computed<string>(() => `disk_devices[${props.index}].sharing`)
72
-
73
- const apiError = computed<string>(() => {
74
- return (
75
- props.errorValidationFields?.find(
76
- (message) => message.field === typeError.value
77
- )?.error_message || ''
78
- )
79
- })
80
-
81
- const onRemoveValidationError = (): void => {
82
- emits('remove-error-by-title', typeError.value)
83
- }
84
- </script>
85
-
86
- <style scoped></style>
@@ -1,12 +0,0 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
-
4
- export const sharingOptionsFunc = (
5
- localization: UI_I_Localization
6
- ): UI_I_OptionItem[] => {
7
- return [
8
- { text: localization.common.unspecified, value: '' },
9
- { text: localization.common.noSharing, value: 'no' },
10
- { text: localization.common.multiWriter, value: 'yes' },
11
- ]
12
- }
@@ -1,145 +0,0 @@
1
- <template>
2
- <div>
3
- <Teleport to="body">
4
- <atoms-modal
5
- class="network-modal"
6
- :show="props.locationModalIsShow"
7
- :title="localization.common.selectNetwork"
8
- test-id="select-network-modal"
9
- @submit="onSubmitLocationModal"
10
- @hide="onHideLocationModal"
11
- >
12
- <template #modalBody>
13
- <atoms-alert
14
- v-show="errors.length"
15
- status="alert-danger"
16
- :items="errors"
17
- test-id="location-alert"
18
- @remove="onRemoveValidationErrors"
19
- />
20
- <div class="network-select-dialog-content">
21
- <div class="k-header k-grid-toolbar flex-justify-end">
22
- <div class="filter-input pull-right flex">
23
- <button
24
- id="location-filter-button"
25
- data-id="location-filter-button"
26
- class="nav-icon fa fa-filter filter-button"
27
- >
28
- <atoms-the-icon
29
- class="filter-icon"
30
- fill="#4c5356"
31
- name="filter"
32
- />
33
- </button>
34
- <input
35
- id="location-filter"
36
- v-model="locationFilter"
37
- data-id="location-filter-input"
38
- type="text"
39
- :placeholder="localization.common.filter"
40
- />
41
- </div>
42
- </div>
43
- <atoms-table-simple-table
44
- :head-items="tagsHeadItems"
45
- :body-items="tagsBodyItems"
46
- editable
47
- @select="onSelectLocation"
48
- />
49
- </div>
50
- </template>
51
- </atoms-modal>
52
- </Teleport>
53
- </div>
54
- </template>
55
-
56
- <script setup lang="ts">
57
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
58
- import type { UI_I_Localization } from '~/lib/models/interfaces'
59
- import type {
60
- UI_I_TableHeadItem,
61
- UI_I_TableBodyItem,
62
- } from '~/components/atoms/table/simpleTable/lib/models/interfaces'
63
-
64
- const localization = computed<UI_I_Localization>(() => useLocal())
65
-
66
- const props = defineProps<{
67
- locationModalIsShow: boolean
68
- networksTable: UI_I_NetworkTableItem[]
69
- }>()
70
- const emits = defineEmits<{
71
- (event: 'hide'): void
72
- (event: 'select', value: UI_I_NetworkTableItem): void
73
- }>()
74
-
75
- const onSubmitLocationModal = (): void => {
76
- if (selectedLocation.value === null) {
77
- errors.value = [localization.value.common.noNetworkSelected]
78
- return
79
- }
80
- emits('select', selectedLocation.value)
81
- }
82
- const onHideLocationModal = (): void => {
83
- emits('hide')
84
- }
85
-
86
- const locationFilter = ref<string>('')
87
- const tagsHeadItems = ref<UI_I_TableHeadItem[]>([
88
- { text: localization.value.common.name },
89
- { text: localization.value.common.nsxPortGroupId },
90
- { text: localization.value.common.distributedSwitch },
91
- ])
92
- const tagsBodyItemsDefault = ref<UI_I_TableBodyItem[][]>([])
93
- const tagsBodyItems = computed<UI_I_TableBodyItem[][]>(() => {
94
- const term = locationFilter.value.trim().toLowerCase()
95
- return tagsBodyItemsDefault.value.filter((row) => {
96
- return row.some((item) => item.text.trim().toLowerCase().includes(term))
97
- })
98
- })
99
- watch(
100
- () => props.networksTable,
101
- (newValue) => {
102
- tagsBodyItemsDefault.value = []
103
- newValue?.forEach((network) => {
104
- tagsBodyItemsDefault.value.push([
105
- { text: network.name, editable: false, testId: `network-${network.name}` },
106
- { text: '--', editable: false },
107
- { text: '--', editable: false },
108
- ])
109
- })
110
- },
111
- { immediate: true }
112
- )
113
-
114
- const selectedLocation = ref<UI_I_NetworkTableItem | null>(null)
115
- const getNetworkByName = (name: string): UI_I_NetworkTableItem | null => {
116
- return props.networksTable?.find((network) => network.name === name) || null
117
- }
118
- const onSelectLocation = (_key: number, value: UI_I_TableBodyItem[]): void => {
119
- const networkName = value[0].text
120
- selectedLocation.value = getNetworkByName(networkName)
121
- }
122
-
123
- const errors = ref<string[]>([])
124
- const onRemoveValidationErrors = (): void => {
125
- errors.value = []
126
- }
127
- </script>
128
-
129
- <style scoped lang="scss">
130
- .network-select-dialog-content {
131
- min-height: 300px;
132
- margin-top: 10px;
133
-
134
- .filter-button {
135
- border-style: none;
136
- background-color: transparent;
137
- padding: 0;
138
-
139
- .filter-icon {
140
- width: 18px;
141
- height: 18px;
142
- }
143
- }
144
- }
145
- </style>
@@ -1,305 +0,0 @@
1
- <template>
2
- <div class="hardware-network">
3
- <atoms-stack-block
4
- :has-children="true"
5
- :removable="isRemovable"
6
- :test-id="`network-stack-block-${props.index}`"
7
- @remove="removeNetwork"
8
- >
9
- <template #stackBlockKey>
10
- <div
11
- :id="`vm-wizard-toggle-block-network-${props.index}`"
12
- :data-id="`vm-wizard-toggle-block-network-${props.index}`"
13
- class="vm-wizard-toggle-block-network flex-align-center"
14
- >
15
- <span>{{ label }}</span>
16
- <atoms-the-icon
17
- v-show="newNetworkInvalid"
18
- width="24px"
19
- height="24px"
20
- class="is-error tooltip-trigger"
21
- name="info"
22
- />
23
- </div>
24
- </template>
25
- <template #stackBlockContent>
26
- <div class="flex-align-center flex-space-between">
27
- <atoms-tooltip-error
28
- :has-error="!!apiError"
29
- :selector="`.vm-wizard-network-field-${props.index}`"
30
- @remove="onRemoveValidationError"
31
- >
32
- <template #elem>
33
- <div class="select">
34
- <select
35
- :id="`vm-wizard-network-field-${props.index}`"
36
- v-model="selectedLocation"
37
- :data-id="`vm-wizard-network-field-${props.index}`"
38
- :class="`vm-wizard-network-field-${props.index} input-text-color`"
39
- :disabled="props.type === 'edit' && state !== 1"
40
- @click.stop
41
- @change="changeLocation"
42
- >
43
- <option
44
- v-for="(item, key) in locationOptions"
45
- :key="key"
46
- :value="item.value"
47
- >
48
- {{ item.text }}
49
- </option>
50
- </select>
51
- </div>
52
- </template>
53
- <template #content>{{ apiError }}</template>
54
- </atoms-tooltip-error>
55
- </div>
56
- </template>
57
- <template #stackChildren>
58
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-adapter-type
59
- v-model:adapter-type="adapterType"
60
- :index="props.index"
61
- :disabled="props.type === 'edit' || isRunning"
62
- :error-validation-fields="props.errorValidationFields"
63
- @remove-error-by-title="emits('remove-error-by-title', $event)"
64
- />
65
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-mac-address
66
- v-model:mac-address="macAddress"
67
- v-model:mac-address-type="macAddressType"
68
- :index="props.index"
69
- :disabled="props.type === 'edit'"
70
- :error-validation-fields="props.errorValidationFields"
71
- @invalid="newNetworkInvalid = $event"
72
- @remove-error-by-title="emits('remove-error-by-title', $event)"
73
- />
74
- </template>
75
- </atoms-stack-block>
76
-
77
- <common-vm-actions-common-customize-hardware-virtual-hardware-new-network-location
78
- :location-modal-is-show="locationModalIsShow"
79
- :networks-table="networksTable"
80
- @hide="onHideLocationModal"
81
- @select="onSelectLocation"
82
- />
83
- </div>
84
- </template>
85
-
86
- <script setup lang="ts">
87
- import type { UI_T_Project } from '~/lib/models/types'
88
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
89
- import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interfaces'
90
- import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
91
- import type { UI_I_SendDataNewNetwork } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/interfaces'
92
- import type { UI_T_NetworkType } from '~/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/models/types'
93
- import type {
94
- UI_I_Localization,
95
- UI_I_HTMLSelectElement,
96
- } from '~/lib/models/interfaces'
97
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
98
-
99
- const props = defineProps<{
100
- project: UI_T_Project
101
- index: number
102
- type: UI_T_NetworkType
103
- network: UI_I_SendDataNewNetwork
104
- networksTable: UI_I_NetworkTableItem[]
105
- errorValidationFields: UI_I_ErrorValidationField[]
106
- isEdit: boolean
107
- state?: string | number
108
- }>()
109
-
110
- const emits = defineEmits<{
111
- (event: 'send-data', value: UI_I_SendDataNewNetwork): void
112
- (event: 'invalid', value: boolean): void
113
- (event: 'remove'): void
114
- (event: 'remove-error-by-title', value: string): void
115
- (event: 'get-networks-table', value: UI_I_TablePayload): void
116
- }>()
117
-
118
- const localization = computed<UI_I_Localization>(() => useLocal())
119
-
120
- const isRunning = computed<boolean>(() => {
121
- return props.state === 2
122
- })
123
-
124
- const isRemovable = computed<boolean>(() => {
125
- return (
126
- !props.isEdit ||
127
- !isRunning.value ||
128
- (isRunning.value && adapterType.value === 'virtio')
129
- )
130
- })
131
-
132
- const label = computed<string>(() => {
133
- if (props.type === 'edit')
134
- return `${localization.value.common.networkAdapter} ${props.index + 1}`
135
-
136
- return `${localization.value.common.newNetwork} *`
137
- })
138
-
139
- const removeNetwork = (): void => {
140
- emits('remove')
141
- }
142
-
143
- const selectedLocationOld = ref<string>('')
144
- const selectedLocation = ref<string>('')
145
- const locationOptions = ref<UI_I_OptionItem[]>([])
146
-
147
- const getNetworks = (): void => {
148
- // if (props.networksTable.length) return // Из-за этого кода был баг. Открыть визард вм -> создать сеть -> открыть визард вм и в списке сетей нету новой сети
149
-
150
- const payload: UI_I_TablePayload = {
151
- pagination: {
152
- page: 1,
153
- pageSize: 100,
154
- },
155
- schema: 'full',
156
- type: 'network',
157
- sortBy: null,
158
- }
159
- emits('get-networks-table', payload)
160
- }
161
- getNetworks()
162
-
163
- const valueProp: 'net_bridge' | 'id' =
164
- props.project === 'procurator' ? 'net_bridge' : 'id'
165
- watch(
166
- () => props.networksTable,
167
- (newValue) => {
168
- const isExistValue = newValue.some(
169
- (network) => network[valueProp] === selectedLocation.value
170
- )
171
- if (!newValue.length || props.type === 'edit' || isExistValue) return
172
-
173
- selectedLocationOld.value = newValue[0][valueProp]
174
- selectedLocation.value = newValue[0][valueProp]
175
-
176
- locationOptions.value = [
177
- { text: newValue[0].name, value: newValue[0][valueProp] },
178
- { text: `${localization.value.common.browse}...`, value: '' },
179
- ]
180
- },
181
- { immediate: true }
182
- )
183
-
184
- const locationModalIsShow = ref<boolean>(false)
185
- const onHideLocationModal = (): void => {
186
- locationModalIsShow.value = false
187
- selectedLocation.value = selectedLocationOld.value
188
- }
189
- const changeLocation = (event: UI_I_HTMLSelectElement): void => {
190
- const value = event.target.value
191
- if (value === '') {
192
- locationModalIsShow.value = true
193
- return
194
- }
195
-
196
- selectedLocationOld.value = value
197
- selectedLocation.value = value
198
- // netBridge.value = value
199
- }
200
- const onSelectLocation = (network: UI_I_NetworkTableItem): void => {
201
- locationModalIsShow.value = false
202
-
203
- selectedLocationOld.value = network[valueProp]
204
- selectedLocation.value = network[valueProp]
205
-
206
- const hasNetwork = locationOptions.value.some(
207
- (option) => option.value === network[valueProp]
208
- )
209
- if (hasNetwork) {
210
- return
211
- }
212
-
213
- locationOptions.value = [
214
- ...locationOptions.value.slice(0, -1),
215
- { text: network.name, value: network[valueProp] },
216
- locationOptions.value[locationOptions.value.length - 1],
217
- ]
218
- }
219
-
220
- const adapterType = ref<string>('rtl8139')
221
-
222
- const target = ref<string>('')
223
-
224
- const macAddress = ref<string>('')
225
- const macAddressType = ref<string>('automatic')
226
- const newNetworkInvalid = ref<boolean>(false)
227
- watch(
228
- newNetworkInvalid,
229
- (newValue) => {
230
- emits('invalid', newValue)
231
- },
232
- { immediate: true }
233
- )
234
-
235
- watch(
236
- [selectedLocation, adapterType, macAddress, macAddressType, locationOptions],
237
- () => {
238
- const option = locationOptions.value.find(
239
- (option) => option.value === selectedLocation.value
240
- )
241
- if (!option) return
242
-
243
- emits('send-data', {
244
- network: option.text,
245
- net_bridge: props.project === 'procurator' ? option.value : '',
246
- target: target.value,
247
- model: adapterType.value,
248
- mac: macAddress.value,
249
- boot_order: props.network.boot_order,
250
- })
251
- },
252
- { immediate: true }
253
- )
254
-
255
- // Добавляем данные для редактирования
256
- watch(
257
- () => props.network,
258
- (newValue) => {
259
- if (props.type !== 'edit') return
260
-
261
- locationOptions.value = [
262
- { text: newValue.network, value: newValue[valueProp] },
263
- { text: `${localization.value.common.browse}...`, value: '' },
264
- ]
265
- selectedLocation.value = newValue[valueProp]
266
-
267
- adapterType.value = newValue.model
268
- macAddress.value = newValue.mac
269
- target.value = newValue.target
270
- },
271
- { immediate: true }
272
- )
273
-
274
- watch(
275
- isRunning,
276
- (newValue) => {
277
- if (newValue && props.type === 'new') {
278
- adapterType.value = 'virtio'
279
- }
280
- },
281
- { immediate: true }
282
- )
283
-
284
- const typeError = computed<string>(
285
- () => `network_devices[${props.index}].network`
286
- )
287
-
288
- const apiError = computed<string>(() => {
289
- return (
290
- props.errorValidationFields?.find(
291
- (message) => message.field === typeError.value
292
- )?.error_message || ''
293
- )
294
- })
295
-
296
- const onRemoveValidationError = (): void => {
297
- emits('remove-error-by-title', typeError.value)
298
- }
299
- </script>
300
-
301
- <style scoped lang="scss">
302
- #network-connect {
303
- margin-right: 4px;
304
- }
305
- </style>