bfg-common 1.5.487 → 1.5.488

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 (191) 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/assets/localization/local_be.json +7 -1
  7. package/assets/localization/local_en.json +17 -11
  8. package/assets/localization/local_hy.json +7 -1
  9. package/assets/localization/local_kk.json +7 -1
  10. package/assets/localization/local_ru.json +7 -1
  11. package/assets/localization/local_zh.json +7 -1
  12. package/components/atoms/TheIcon3.vue +50 -50
  13. package/components/atoms/collapse/CollapseNav.vue +170 -170
  14. package/components/atoms/perPage/PerPage.vue +58 -58
  15. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  16. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  17. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  18. package/components/common/adapterManager/AdapterManager.vue +189 -545
  19. package/components/common/adapterManager/AdapterManagerNew.vue +300 -0
  20. package/components/common/adapterManager/AdapterManagerOld.vue +498 -0
  21. package/components/common/adapterManager/addAdapterModal/AddAdapterModal.vue +70 -0
  22. package/components/common/adapterManager/addAdapterModal/AddAdapterModalNew.vue +77 -0
  23. package/components/common/adapterManager/{AddAdapterModal.vue → addAdapterModal/AddAdapterModalOld.vue} +16 -46
  24. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModal.vue +32 -0
  25. package/components/common/adapterManager/addAdapterWarningModal/AddAdapterWarningModalNew.vue +38 -0
  26. package/components/common/adapterManager/{AddAdapterWarningModal.vue → addAdapterWarningModal/AddAdapterWarningModalOld.vue} +5 -14
  27. package/components/common/adapterManager/noActiveAdaptersModal/NoActiveAdaptersModal.vue +31 -0
  28. package/components/common/adapterManager/noActiveAdaptersModal/NoActiveAdaptersModalNew.vue +34 -0
  29. package/components/common/adapterManager/{NoActiveAdaptersModal.vue → noActiveAdaptersModal/NoActiveAdaptersModalOld.vue} +2 -6
  30. package/components/common/adapterManager/noConnectedActiveAdaptersModal/NoConnectedActiveAdaptersModal.vue +31 -0
  31. package/components/common/adapterManager/noConnectedActiveAdaptersModal/NoConnectedActiveAdaptersModalNew.vue +34 -0
  32. package/components/common/adapterManager/{NoConnectedActiveAdaptersModal.vue → noConnectedActiveAdaptersModal/NoConnectedActiveAdaptersModalOld.vue} +2 -6
  33. package/components/common/adapterManager/ui/actions/bar/Bar.vue +57 -0
  34. package/components/common/adapterManager/ui/actions/bar/BarNew.vue +38 -0
  35. package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButton.vue +28 -0
  36. package/components/common/adapterManager/ui/actions/moveDownAdapterButton/MoveDownAdapterButtonNew.vue +75 -0
  37. package/components/common/adapterManager/ui/actions/{MoveDownAdapterButton.vue → moveDownAdapterButton/MoveDownAdapterButtonOld.vue} +3 -9
  38. package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButton.vue +28 -0
  39. package/components/common/adapterManager/ui/actions/moveUpAdapterButton/MoveUpAdapterButtonNew.vue +76 -0
  40. package/components/common/adapterManager/ui/actions/{MoveUpAdapterButton.vue → moveUpAdapterButton/MoveUpAdapterButtonOld.vue} +3 -9
  41. package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapter.vue +24 -0
  42. package/components/common/adapterManager/ui/noSelectedAdapter/NoSelectedAdapterNew.vue +13 -0
  43. package/components/common/adapterManager/ui/secondTitle/SecondTitle.vue +31 -0
  44. package/components/common/adapterManager/ui/secondTitle/SecondTitleNew.vue +36 -0
  45. package/components/common/adapterManager/ui/{SecondTitle.vue → secondTitle/SecondTitleOld.vue} +0 -1
  46. package/components/common/adapterManager/ui/table/Table.vue +59 -133
  47. package/components/common/adapterManager/ui/table/TableNew.vue +136 -0
  48. package/components/common/adapterManager/ui/table/TableOld.vue +141 -0
  49. package/components/common/adapterManager/ui/table/adapters/Adapters.vue +44 -0
  50. package/components/common/adapterManager/ui/table/adapters/AdaptersNew.vue +153 -0
  51. package/components/common/adapterManager/ui/table/{Adapters.vue → adapters/AdaptersOld.vue} +5 -10
  52. package/components/common/adapterManager/ui/table/header/Header.vue +57 -0
  53. package/components/common/adapterManager/ui/table/header/HeaderNew.vue +77 -0
  54. package/components/common/adapterManager/ui/table/{Header.vue → header/HeaderOld.vue} +3 -20
  55. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  56. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  57. package/components/common/browse/lib/models/interfaces.ts +5 -5
  58. package/components/common/context/lib/models/interfaces.ts +33 -33
  59. package/components/common/diagramMain/DiagramMain.vue +3 -1
  60. package/components/common/diagramMain/lib/models/interfaces.ts +5 -2
  61. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +6 -5
  62. package/components/common/diagramMain/modals/Modals.vue +19 -1
  63. package/components/common/diagramMain/modals/lib/config/adapterModal.ts +23 -20
  64. package/components/common/diagramMain/modals/lib/config/networkModal.ts +401 -398
  65. package/components/common/diagramMain/modals/lib/config/switchModal.ts +3 -0
  66. package/components/common/diagramMain/modals/remove/RemoveModal.vue +8 -0
  67. package/components/common/diagramMain/modals/remove/RemoveModalNew.vue +12 -1
  68. package/components/common/diagramMain/modals/remove/RemoveModalOld.vue +12 -1
  69. package/components/common/diagramMain/modals/viewSettings/info/Info.vue +0 -2
  70. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettings.vue +6 -0
  71. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsNew.vue +140 -71
  72. package/components/common/diagramMain/modals/viewSettings/viewSettings/ViewSettingsOld.vue +4 -4
  73. package/components/common/diagramMain/network/Contents.vue +497 -497
  74. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  75. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  76. package/components/common/pages/backups/DetailView.vue +52 -52
  77. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  78. package/components/common/pages/backups/modals/Modals.vue +243 -243
  79. package/components/common/pages/backups/modals/createBackup/configuration/Configuration.vue +29 -29
  80. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  81. package/components/common/pages/backups/modals/createBackup/datastores/tableView/TableView.vue +95 -95
  82. package/components/common/pages/backups/modals/createBackup/general/General.vue +141 -141
  83. package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +12 -12
  84. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  85. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  86. package/components/common/pages/backups/modals/restore/disks/Disks.vue +27 -27
  87. package/components/common/pages/backups/modals/restore/disks/tableView/lib/config/table.ts +117 -117
  88. package/components/common/pages/backups/modals/restore/name/Name.vue +166 -166
  89. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  90. package/components/common/pages/backups/modals/restore/networks/Networks.vue +67 -67
  91. package/components/common/pages/backups/modals/restore/networks/table/Table.vue +214 -214
  92. package/components/common/pages/backups/modals/restore/types/lib/config/typeOptions.ts +25 -25
  93. package/components/common/pages/backups/tools/Tools.vue +75 -75
  94. package/components/common/pages/backups/tools/lib/config/tabs.ts +36 -36
  95. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  96. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  97. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  98. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  99. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  100. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  101. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  102. package/components/common/select/radio/RadioGroup.vue +137 -137
  103. package/components/common/spiceConsole/Drawer.vue +392 -392
  104. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  105. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  106. package/components/common/tools/Actions.vue +207 -207
  107. package/components/common/treeView/TreeView.vue +52 -52
  108. package/components/common/vm/actions/add/Add.vue +877 -877
  109. package/components/common/vm/actions/add/folderTreeView/FolderTreeView.vue +72 -72
  110. package/components/common/vm/actions/add/folderTreeView/New.vue +40 -40
  111. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +368 -368
  112. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  113. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  114. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  115. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/location/new/table/Table.vue +99 -99
  116. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  117. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  118. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  119. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  120. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  121. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  122. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/order/Order.vue +174 -174
  123. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/keymap/Keymap.vue +32 -32
  124. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/password/Password.vue +103 -103
  125. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  126. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  127. package/components/common/vm/actions/common/select/computeResource/ComputeResource.vue +143 -143
  128. package/components/common/vm/actions/common/select/computeResource/New.vue +184 -184
  129. package/components/common/vm/actions/common/select/computeResource/treeView/TreeView.vue +131 -131
  130. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  131. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  132. package/components/common/vm/actions/common/select/name/Name.vue +200 -200
  133. package/components/common/vm/actions/common/select/name/Old.vue +131 -131
  134. package/components/common/vm/actions/common/select/os/Old.vue +152 -152
  135. package/components/common/vm/actions/common/select/os/Os.vue +139 -139
  136. package/components/common/vm/actions/common/select/storage/new/New.vue +320 -320
  137. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  138. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  139. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  140. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  141. package/components/common/vm/actions/register/Register.vue +267 -267
  142. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  143. package/components/common/vmt/actions/add/Add.vue +549 -549
  144. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  145. package/components/common/wizards/network/add/Add.vue +9 -3
  146. package/components/common/wizards/network/add/AddNew.vue +291 -354
  147. package/components/common/wizards/network/add/AddOld.vue +0 -3
  148. package/components/common/wizards/network/add/lib/config/config.ts +1 -0
  149. package/components/common/wizards/network/add/lib/config/initialData.ts +9 -0
  150. package/components/common/wizards/network/add/lib/config/steps.ts +35 -5
  151. package/components/common/wizards/network/add/lib/models/interfaces.ts +12 -2
  152. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettings.vue +83 -0
  153. package/components/common/wizards/network/add/steps/connectionSettings/ConnectionSettingsNew.vue +114 -0
  154. package/components/common/wizards/network/add/steps/{ConnectionSettings.vue → connectionSettings/ConnectionSettingsOld.vue} +11 -42
  155. package/components/common/wizards/network/add/steps/createStandardSwitch/CreateStandardSwitch.vue +99 -0
  156. package/components/common/wizards/network/add/steps/createStandardSwitch/CreateStandardSwitchNew.vue +80 -0
  157. package/components/common/wizards/network/add/steps/{CreateStandardSwitch.vue → createStandardSwitch/CreateStandardSwitchOld.vue} +24 -33
  158. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettings.vue +143 -0
  159. package/components/common/wizards/network/add/steps/ipFourSettings/IpFourSettingsNew.vue +224 -0
  160. package/components/common/wizards/network/add/steps/{IpFourSettings.vue → ipFourSettings/IpFourSettingsOld.vue} +13 -101
  161. package/components/common/wizards/network/add/steps/portProperties/PortProperties.vue +214 -0
  162. package/components/common/wizards/network/add/steps/portProperties/PortPropertiesNew.vue +289 -0
  163. package/components/common/wizards/network/add/steps/{PortProperties.vue → portProperties/PortPropertiesOld.vue} +19 -166
  164. package/components/common/wizards/network/add/steps/readyComplete/ReadyComplete.vue +22 -0
  165. package/components/common/wizards/network/add/steps/readyComplete/ReadyCompleteNew.vue +30 -0
  166. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDevice.vue +7 -2
  167. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +1 -3
  168. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceOld.vue +0 -2
  169. package/components/common/wizards/network/add/validations/common.ts +1 -2
  170. package/components/common/wizards/network/add/validations/connectionSettings.ts +14 -7
  171. package/components/common/wizards/network/add/validations/ipFourSettings.ts +24 -10
  172. package/components/common/wizards/network/add/validations/networkValidation.ts +1 -1
  173. package/components/common/wizards/network/add/validations/portProperties.ts +52 -20
  174. package/components/common/wizards/network/add/validations/targetDevice.ts +18 -4
  175. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  176. package/composables/useAppVersion.ts +21 -21
  177. package/composables/useLocal.ts +6 -6
  178. package/composables/useLocalCommon.ts +39 -39
  179. package/package.json +2 -2
  180. package/plugins/date.ts +233 -233
  181. package/plugins/panelStates.ts +70 -70
  182. package/plugins/text.ts +59 -59
  183. package/public/spice-console/lib/images/bitmap.js +203 -203
  184. package/public/spice-console/network/spicechannel.js +440 -440
  185. package/public/spice-console/run.js +210 -210
  186. package/store/main/mutations.ts +7 -7
  187. package/store/main/state.ts +7 -7
  188. package/components/common/wizards/network/add/steps/PhysicalAdapter.vue +0 -13
  189. /package/components/common/adapterManager/ui/actions/{ActionsBar.vue → bar/BarOld.vue} +0 -0
  190. /package/components/common/adapterManager/ui/{NoSelectedAdapter.vue → noSelectedAdapter/NoSelectedAdapterOld.vue} +0 -0
  191. /package/components/common/wizards/network/add/steps/{ReadyComplete.vue → readyComplete/ReadyCompleteOld.vue} +0 -0
@@ -0,0 +1,214 @@
1
+ <template>
2
+ <common-wizards-network-add-steps-port-properties-new
3
+ v-if="isNewView"
4
+ v-model="fields"
5
+ :messages-fields="props.messagesFields"
6
+ :tcp-stacks="props.tcpStacks"
7
+ :is-sphere-project="isSphereProject"
8
+ :port-properties-enabled-services="portPropertiesEnabledServices"
9
+ />
10
+ <common-wizards-network-add-steps-port-properties-old
11
+ v-else
12
+ v-model="fields"
13
+ :messages-fields="props.messagesFields"
14
+ :alert-messages="props.alertMessages"
15
+ :tcp-stacks="props.tcpStacks"
16
+ :is-sphere-project="isSphereProject"
17
+ :port-properties-enabled-services="portPropertiesEnabledServices"
18
+ @hide-alert="onHideAlert"
19
+ />
20
+ </template>
21
+
22
+ <script setup lang="ts">
23
+ import type { UI_I_ErrorFields } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
24
+ import type Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
25
+ import type {
26
+ UI_I_ArbitraryObject,
27
+ UI_I_Localization,
28
+ } from '~/lib/models/interfaces'
29
+ import type { UI_T_Project } from '~/lib/models/types'
30
+ import type {
31
+ UI_I_PortProperties,
32
+ UI_I_TCPStack,
33
+ UI_I_PortPropertiesEnabledService,
34
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
35
+ import type { UI_T_TCP } from '~/components/common/wizards/network/add/lib/models/types'
36
+ import {
37
+ servicesInitial,
38
+ portPropertiesEnabledServicesFunc,
39
+ } from '~/components/common/wizards/network/add/lib/config/config'
40
+ import {
41
+ validateMtuPortPropertiesLocal,
42
+ validateNetworkPortPropertiesLocal,
43
+ validateVlanIdPortPropertiesLocal,
44
+ } from '~/components/common/wizards/network/add/validations/validations'
45
+
46
+ const props = withDefaults(
47
+ defineProps<{
48
+ wizard: Wizard
49
+ portProperties: UI_I_PortProperties
50
+ mtuFromSwitch?: number
51
+ project: UI_T_Project
52
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
53
+ alertMessages: string[]
54
+ tcpStacks?: UI_I_TCPStack[]
55
+ }>(),
56
+ {
57
+ mtuFromSwitch: 1500,
58
+ tcpStacks: () => [],
59
+ }
60
+ )
61
+
62
+ const emits = defineEmits<{
63
+ (event: 'change-port-properties', portProperties: UI_I_PortProperties): void
64
+ (event: 'change-gateway-flag', value: boolean): void
65
+ (event: 'hide-alert', stepId: 3): void
66
+ }>()
67
+
68
+ const localization = computed<UI_I_Localization>(() => useLocal())
69
+
70
+ const { $store }: any = useNuxtApp()
71
+
72
+ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
73
+
74
+ const isSphereProject = computed<boolean>(() => props.project === 'sphere')
75
+
76
+ const portPropertiesEnabledServices = computed<
77
+ UI_I_PortPropertiesEnabledService[]
78
+ >(() =>
79
+ portPropertiesEnabledServicesFunc(localization.value, isSphereProject.value)
80
+ )
81
+
82
+ const mtuCustom = ref<number>()
83
+
84
+ const fields = ref<UI_I_PortProperties>({
85
+ ...props.portProperties,
86
+ mtu: {
87
+ ...props.portProperties.mtu,
88
+ size:
89
+ !mtuCustom.value && props.portProperties.mtu.option !== '1'
90
+ ? props.mtuFromSwitch
91
+ : props.portProperties.mtu.size,
92
+ },
93
+ })
94
+
95
+ const setEnabledServiceDefault = (
96
+ tcp: UI_T_TCP,
97
+ currentFields: UI_I_PortProperties
98
+ ): void => {
99
+ tcp === 'default' &&
100
+ (fields.value = {
101
+ ...currentFields,
102
+ services: servicesInitial,
103
+ })
104
+ }
105
+
106
+ const setEnabledServiceProvisioning = (
107
+ tcp: UI_T_TCP,
108
+ currentFields: UI_I_PortProperties,
109
+ newFields?: UI_I_PortProperties
110
+ ): void => {
111
+ tcp === 'provisioning' &&
112
+ (fields.value = {
113
+ ...(newFields || currentFields),
114
+ services: {
115
+ ...servicesInitial,
116
+ provisioning: true,
117
+ },
118
+ })
119
+ }
120
+
121
+ const setEnabledServiceVMotion = (
122
+ tcp: UI_T_TCP,
123
+ currentFields: UI_I_PortProperties,
124
+ newFields?: UI_I_PortProperties
125
+ ): void => {
126
+ tcp === '' &&
127
+ (fields.value = {
128
+ ...(newFields || currentFields),
129
+ services: {
130
+ ...servicesInitial,
131
+ vMotion: true,
132
+ },
133
+ })
134
+ }
135
+
136
+ let oldFields = useDeepCopy(fields.value)
137
+
138
+ watch(
139
+ fields,
140
+ (newFields: UI_I_PortProperties) => {
141
+ if (newFields.tcp && newFields.tcp !== oldFields.tcp) {
142
+ emits('change-gateway-flag', false)
143
+ setEnabledServiceDefault(newFields.tcp, fields.value)
144
+ setEnabledServiceProvisioning(newFields.tcp, fields.value, newFields)
145
+ setEnabledServiceVMotion(newFields.tcp, fields.value, newFields)
146
+ }
147
+
148
+ oldFields.networkLabel !== newFields.networkLabel &&
149
+ validateNetworkPortPropertiesLocal(
150
+ localization.value,
151
+ newFields,
152
+ props.wizard
153
+ )
154
+
155
+ oldFields.vlanId !== newFields.vlanId &&
156
+ validateVlanIdPortPropertiesLocal(
157
+ localization.value,
158
+ newFields,
159
+ props.wizard
160
+ )
161
+
162
+ oldFields.mtu.size !== newFields.mtu.size &&
163
+ validateMtuPortPropertiesLocal(
164
+ localization.value,
165
+ newFields,
166
+ props.wizard
167
+ )
168
+
169
+ oldFields = useDeepCopy(newFields)
170
+
171
+ emits('change-port-properties', newFields)
172
+ },
173
+ { deep: true, immediate: true }
174
+ )
175
+
176
+ watch(
177
+ () => fields.value.mtu,
178
+ (newMtu: { size: number; option: string }) => {
179
+ if (newMtu.option === '0') {
180
+ mtuCustom.value = props.mtuFromSwitch
181
+ fields.value.mtu.size = props.mtuFromSwitch
182
+ return
183
+ }
184
+ mtuCustom.value = newMtu.size
185
+ },
186
+ { deep: true, immediate: true }
187
+ )
188
+
189
+ watch(
190
+ () => fields.value.tcp,
191
+ (newTcp: UI_T_TCP, oldTcp: UI_T_TCP) => {
192
+ if (newTcp !== oldTcp) {
193
+ setEnabledServiceDefault(newTcp, fields.value)
194
+ setEnabledServiceProvisioning(newTcp, fields.value)
195
+ setEnabledServiceVMotion(newTcp, fields.value)
196
+ }
197
+ emits('change-port-properties', fields.value)
198
+ }
199
+ )
200
+
201
+ watch(
202
+ () => props.tcpStacks,
203
+ (newValue: UI_I_TCPStack[]) => {
204
+ if (fields.value.tcp === '') {
205
+ fields.value.tcp = newValue?.[0]?.id || ''
206
+ }
207
+ },
208
+ { deep: true, immediate: true }
209
+ )
210
+
211
+ const onHideAlert = (): void => {
212
+ emits('hide-alert', 3)
213
+ }
214
+ </script>
@@ -0,0 +1,289 @@
1
+ <template>
2
+ <div class="content">
3
+ <b class="content-title">
4
+ {{ localization.common.vmKernelPortSettings }}
5
+ </b>
6
+
7
+ <div class="content-fields">
8
+ <div class="col">
9
+ <h4 class="content-subtitle col-left">
10
+ {{ localization.common.networkLabel }}
11
+ </h4>
12
+ <div class="col-right">
13
+ <ui-input
14
+ id="network-label"
15
+ v-model="fields.networkLabel"
16
+ test-id="network-label"
17
+ type="text"
18
+ :placeholder="localization.common.networkLabel"
19
+ size="md"
20
+ :error="props.messagesFields.network_name.field"
21
+ />
22
+ </div>
23
+ </div>
24
+
25
+ <ui-line margin="16px 0" />
26
+
27
+ <div class="col">
28
+ <h4 class="content-subtitle col-left">
29
+ {{ localization.common.vlanId }}
30
+ </h4>
31
+ <div class="col-right">
32
+ <ui-combobox
33
+ v-model="fields.vlanId"
34
+ :items="vlanIdSelectData"
35
+ select-width="100%"
36
+ show-text
37
+ test-id="vlan-id-combobox"
38
+ :placeholder="localization.common.vlanId"
39
+ :error="!!props.messagesFields['new_network.vlan'].field"
40
+ :error-text="props.messagesFields['new_network.vlan'].field"
41
+ error-type="default"
42
+ width="auto"
43
+ />
44
+ </div>
45
+ </div>
46
+
47
+ <ui-line margin="16px 0" />
48
+
49
+ <div class="col">
50
+ <h4 class="content-subtitle col-left">
51
+ {{ localization.common.mtu }}
52
+ </h4>
53
+ <div class="col-right">
54
+ <div class="content-fields-col">
55
+ <div class="content-fields-col-left">
56
+ <ui-select
57
+ v-model="fields.mtu.option"
58
+ :items="mtuOptions"
59
+ select-width="100%"
60
+ show-text
61
+ test-id="mtu-select"
62
+ :placeholder="localization.common.mtu"
63
+ width="auto"
64
+ />
65
+ </div>
66
+ <div class="content-fields-col-right">
67
+ <ui-input
68
+ id="mtu-input"
69
+ v-model="fields.mtu.size"
70
+ test-id="mtu-input"
71
+ type="number"
72
+ :placeholder="localization.common.mtu"
73
+ size="md"
74
+ :error="props.messagesFields.mtu.field"
75
+ :disabled="fields.mtu.option === '0'"
76
+ />
77
+ </div>
78
+ </div>
79
+ </div>
80
+ </div>
81
+
82
+ <ui-line margin="16px 0" />
83
+
84
+ <div class="col">
85
+ <h4 class="content-subtitle col-left">
86
+ {{ localization.common.tcpIpStack }}
87
+ </h4>
88
+ <div class="col-right">
89
+ <ui-select
90
+ v-model="fields.tcp"
91
+ :items="tcpStacksOptions"
92
+ select-width="100%"
93
+ show-text
94
+ test-id="tsp-select"
95
+ :placeholder="localization.common.tcpIpStack"
96
+ width="auto"
97
+ />
98
+ </div>
99
+ </div>
100
+
101
+ <ui-line margin="16px 0" />
102
+
103
+ <b class="content-title">
104
+ {{ localization.common.availableServices }}
105
+ </b>
106
+
107
+ <div class="col mb-4">
108
+ <h4 class="content-subtitle col-left">
109
+ {{ localization.common.enabledServices }}
110
+ </h4>
111
+ <div class="col-right content-fields-services">
112
+ <ui-checkbox
113
+ v-if="props.isSphereProject"
114
+ id="services-v-motion"
115
+ v-model="fields.services.vMotion"
116
+ :label-text="localization.common.vMotion"
117
+ :disabled="fields.tcp !== 'default'"
118
+ test-id="services-v-motion-checkbox"
119
+ size="md"
120
+ />
121
+ <ui-checkbox
122
+ v-else
123
+ id="services-provisioning"
124
+ v-model="fields.services.provisioning"
125
+ :label-text="localization.common.provisioning"
126
+ :disabled="fields.tcp !== 'default'"
127
+ test-id="services-provisioning-checkbox"
128
+ size="md"
129
+ />
130
+ <template
131
+ v-for="enabledService in props.portPropertiesEnabledServices"
132
+ :key="enabledService.modelValue"
133
+ >
134
+ <ui-checkbox
135
+ :id="enabledService.testId"
136
+ v-model="fields.services[enabledService.modelValue]"
137
+ :label-text="enabledService.label"
138
+ :disabled="fields.tcp !== 'default'"
139
+ :test-id="`${enabledService.testId}-checkbox`"
140
+ size="md"
141
+ />
142
+ </template>
143
+ </div>
144
+ </div>
145
+ </div>
146
+ </div>
147
+ </template>
148
+
149
+ <script setup lang="ts">
150
+ import type { UI_I_ErrorFields } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
151
+ import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
152
+ import type {
153
+ UI_I_ArbitraryObject,
154
+ UI_I_Localization,
155
+ } from '~/lib/models/interfaces'
156
+ import type {
157
+ UI_I_PortProperties,
158
+ UI_I_TCPStack,
159
+ UI_I_PortPropertiesEnabledService,
160
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
161
+ import {
162
+ vlanIdSelectData,
163
+ mtuItemsFunc,
164
+ } from '~/components/common/wizards/network/add/lib/config/config'
165
+
166
+ const props = defineProps<{
167
+ modelValue: UI_I_PortProperties
168
+ messagesFields: UI_I_ArbitraryObject<UI_I_ErrorFields>
169
+ tcpStacks?: UI_I_TCPStack[]
170
+ isSphereProject: boolean
171
+ portPropertiesEnabledServices: UI_I_PortPropertiesEnabledService[]
172
+ }>()
173
+
174
+ const emits = defineEmits<{
175
+ (event: 'update:model-value', value: UI_I_PortProperties): void
176
+ }>()
177
+
178
+ const localization = computed<UI_I_Localization>(() => useLocal())
179
+
180
+ const fields = computed({
181
+ get(): UI_I_PortProperties {
182
+ return props.modelValue
183
+ },
184
+ set(newValue: UI_I_PortProperties) {
185
+ emits('update:model-value', newValue)
186
+ },
187
+ })
188
+
189
+ const mtuOptions = computed<UI_I_Dropdown[]>(() =>
190
+ mtuItemsFunc(localization.value)
191
+ )
192
+
193
+ const tcpStacksOptions = computed<UI_I_Dropdown[]>(() =>
194
+ props.tcpStacks.map((item: UI_I_TCPStack) => ({
195
+ text: localization.value.common[item.id],
196
+ value: item.id,
197
+ }))
198
+ )
199
+ </script>
200
+
201
+ <style scoped lang="scss">
202
+ .content {
203
+ &-title {
204
+ display: block;
205
+ margin: 16px 0;
206
+ font-weight: 500;
207
+ font-size: 16px;
208
+ line-height: 20px;
209
+ letter-spacing: 0;
210
+ color: var(--title-form-first-color);
211
+ }
212
+
213
+ &-subtitle {
214
+ font-weight: 400;
215
+ font-size: 13px;
216
+ line-height: 20px;
217
+ letter-spacing: 0;
218
+ vertical-align: middle;
219
+ color: var(--title-form-first-color);
220
+ }
221
+
222
+ .col {
223
+ display: flex;
224
+ column-gap: 16px;
225
+
226
+ &-left {
227
+ padding-top: 8px;
228
+ width: calc((100% - 8px) / 3);
229
+ }
230
+
231
+ &-right {
232
+ width: calc(((100% - 8px) / 3) * 2);
233
+ }
234
+ }
235
+
236
+ &-fields {
237
+ &-col {
238
+ display: flex;
239
+ column-gap: 12px;
240
+
241
+ &-left {
242
+ width: 60%;
243
+ }
244
+
245
+ &-right {
246
+ width: 40%;
247
+ }
248
+ }
249
+
250
+ &-services {
251
+ display: grid;
252
+ grid-template-columns: 1fr 1fr;
253
+ row-gap: 12px;
254
+ column-gap: 12px;
255
+ padding-top: 8px;
256
+ }
257
+ }
258
+ }
259
+
260
+ @media (max-width: 896px) {
261
+ .content-fields {
262
+ &-services {
263
+ grid-template-columns: 1fr;
264
+ }
265
+
266
+ &-col {
267
+ display: flex;
268
+ row-gap: 12px;
269
+ flex-direction: column;
270
+
271
+ &-left {
272
+ width: 100%;
273
+ }
274
+
275
+ &-right {
276
+ width: 100%;
277
+ }
278
+ }
279
+ }
280
+ }
281
+
282
+ :deep(.combobox-input) {
283
+ width: 100%;
284
+ height: 36px;
285
+ }
286
+ :deep(.ui-select-toggle-button.md) {
287
+ padding: 0 8px 0 12px;
288
+ }
289
+ </style>