bfg-common 1.4.732 → 1.4.734

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 (84) hide show
  1. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  2. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  3. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  4. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  5. package/assets/localization/local_be.json +16 -2
  6. package/assets/localization/local_en.json +16 -2
  7. package/assets/localization/local_hy.json +16 -2
  8. package/assets/localization/local_kk.json +16 -2
  9. package/assets/localization/local_ru.json +16 -2
  10. package/assets/localization/local_zh.json +16 -2
  11. package/components/atoms/select/TheSelect.vue +10 -1
  12. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  13. package/components/common/browse/lib/models/interfaces.ts +5 -5
  14. package/components/common/diagramMain/Header.vue +211 -211
  15. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  16. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  17. package/components/common/diagramMain/lib/models/types.ts +21 -21
  18. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  19. package/components/common/diagramMain/modals/ManagePhysicalAdaptersModal.vue +330 -330
  20. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  21. package/components/common/diagramMain/modals/editSettings/EditSettings.vue +497 -497
  22. package/components/common/diagramMain/modals/editSettings/EditSettingsModal.vue +812 -812
  23. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  24. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  25. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  26. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  27. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +398 -398
  28. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  29. package/components/common/diagramMain/modals/editSettings/tabs/port/PortProperties.vue +205 -205
  30. package/components/common/diagramMain/modals/lib/config/diagramConfig.ts +23 -23
  31. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  32. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  33. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  34. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  35. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  36. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  37. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  38. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  39. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  40. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  41. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  42. package/components/common/diagramMain/port/Ports.vue +47 -47
  43. package/components/common/monitor/advanced/Advanced.vue +0 -5
  44. package/components/common/monitor/advanced/tools/Tools.vue +2 -9
  45. package/components/common/monitor/advanced/tools/chartOptionsModal/ChartOptionsModal.vue +2 -9
  46. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/Counters.vue +0 -2
  47. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/Timespan.vue +93 -95
  48. package/components/common/{chartOptionsModal → monitor/advanced/tools/chartOptionsModal}/counters/timespan/form/Form.vue +539 -544
  49. package/components/common/monitor/advanced/tools/chartOptionsModal/counters/timespan/form/lib/config/dateForm.ts +114 -0
  50. package/components/common/monitor/overview/filters/Filters.vue +0 -3
  51. package/components/common/monitor/overview/filters/customIntervalModal/CustomIntervalModal.vue +5 -15
  52. package/components/common/monitor/overview/filters/customIntervalModal/lib/config/dateChecker.ts +14 -24
  53. package/components/common/pages/hardwareHealth/HardwareHealth.vue +5 -12
  54. package/components/common/pages/hardwareHealth/historyTestimony/Graph.vue +451 -456
  55. package/components/common/pages/hardwareHealth/historyTestimony/tools/Tools.vue +380 -387
  56. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/ChartOptionsModal.vue +6 -13
  57. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/Counters.vue +94 -94
  58. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/Timespan.vue +66 -66
  59. package/components/common/pages/hardwareHealth/historyTestimony/tools/chartOptionsModal/counters/timespan/form/Form.vue +539 -0
  60. package/components/common/{chartOptionsModal → pages/hardwareHealth/historyTestimony/tools/chartOptionsModal}/counters/timespan/form/lib/config/dateForm.ts +115 -116
  61. package/components/common/pages/tasks/Tasks.vue +9 -0
  62. package/components/common/pages/tasks/table/Table.vue +0 -1
  63. package/components/common/pages/tasks/table/errorInfo/ErrorInfo.vue +10 -6
  64. package/components/common/pages/tasks/table/expandDetails/ExpandDetails.vue +8 -8
  65. package/components/common/vm/actions/add/Add.vue +2 -0
  66. package/components/common/vm/actions/clone/Clone.vue +2 -0
  67. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +3 -0
  68. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +2 -0
  69. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareOld.vue +2 -0
  70. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +9 -1
  71. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +5 -2
  72. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareOld.vue +3 -1
  73. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +6 -4
  74. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +52 -10
  75. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceNew.vue +31 -5
  76. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDeviceOld.vue +31 -5
  77. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +9 -2
  78. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/lib/config/options.ts +11 -4
  79. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionNew.vue +1 -1
  80. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/typeSelection/TypeSelectionOld.vue +1 -1
  81. package/components/common/vm/actions/editSettings/EditSettings.vue +3 -0
  82. package/components/common/vm/actions/editSettings/EditSettingsOld.vue +2 -0
  83. package/components/common/vm/actions/editSettings/new/New.vue +2 -0
  84. package/package.json +3 -3
@@ -1,116 +1,115 @@
1
- import type {
2
- UI_I_ArbitraryObject,
3
- UI_I_Localization,
4
- } from '~/lib/models/interfaces'
5
- import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
6
-
7
- export const timespanFunc = (
8
- localization: UI_I_Localization
9
- ): UI_I_OptionItem[] => [
10
- {
11
- text: localization.inventoryMonitor.realTime,
12
- value: 'real_time',
13
- },
14
- {
15
- text: localization.inventoryMonitor.lastDay,
16
- value: 'last_day',
17
- },
18
- {
19
- text: localization.inventoryMonitor.lastWeek,
20
- value: 'last_week',
21
- },
22
- {
23
- text: localization.inventoryMonitor.lastMonth,
24
- value: 'last_month',
25
- },
26
- // {
27
- // text: localization.inventoryMonitor.lastYear,
28
- // value: 'last_year',
29
- // },
30
- {
31
- text: localization.inventoryMonitor.customInterval,
32
- value: 'custom_interval',
33
- },
34
- ]
35
-
36
- export const customTimeFunc = (
37
- localization: UI_I_Localization,
38
- value: number,
39
- lang: string
40
- ): UI_I_OptionItem[] => {
41
- const isLangRu = lang === 'ru_RU'
42
-
43
- const hourText = isLangRu
44
- ? getCorrectRuForm(value, 'hour')
45
- : localization.common.hours2
46
- const dayText = isLangRu
47
- ? getCorrectRuForm(value, 'day')
48
- : localization.common.days2
49
- const weekText = isLangRu
50
- ? getCorrectRuForm(value, 'week')
51
- : localization.common.weeks2
52
- const monthText = isLangRu
53
- ? getCorrectRuForm(value, 'month')
54
- : localization.common.months2
55
-
56
- return [
57
- {
58
- text: hourText,
59
- value: 'hours',
60
- },
61
- {
62
- text: dayText,
63
- value: 'days',
64
- },
65
- {
66
- text: weekText,
67
- value: 'weeks',
68
- },
69
- {
70
- text: monthText,
71
- value: 'months',
72
- },
73
- ]
74
- }
75
-
76
- export const chartTypeFunc = (
77
- localization: UI_I_Localization
78
- ): UI_I_OptionItem[] => [
79
- {
80
- text: localization.inventoryMonitor.lineGraph,
81
- value: 'line_graph',
82
- },
83
- {
84
- text: localization.inventoryMonitor.stackedGraph,
85
- value: 'stacked_graph',
86
- },
87
- ]
88
-
89
- const getCorrectRuForm = (value: number, type: string): string => {
90
- // TODO поправить используя correctRuUnit из плагина date
91
- const forms: UI_I_ArbitraryObject<string[]> = {
92
- hour: ['Час', 'Часа', 'Часов'],
93
- day: ['День', 'Дня', 'Дней'],
94
- week: ['Неделя', 'Недели', 'Недель'],
95
- month: ['Месяц', 'Месяца', 'Месяцев'],
96
- }
97
-
98
- let text: string
99
-
100
- if (!value) {
101
- return getCorrectRuForm[type]
102
- }
103
-
104
- if (value % 10 === 1 && value % 100 !== 11) {
105
- text = forms[type][0]
106
- } else if (
107
- [2, 3, 4].includes(value % 10) &&
108
- ![12, 13, 14].includes(value % 100)
109
- ) {
110
- text = forms[type][1]
111
- } else {
112
- text = forms[type][2]
113
- }
114
- getCorrectRuForm[type] = text
115
- return text
116
- }
1
+ import type {
2
+ UI_I_ArbitraryObject,
3
+ UI_I_Localization,
4
+ } from '~/lib/models/interfaces'
5
+ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
6
+
7
+ export const timespanFunc = (
8
+ localization: UI_I_Localization
9
+ ): UI_I_OptionItem[] => [
10
+ {
11
+ text: localization.inventoryMonitor.realTime,
12
+ value: 'real_time',
13
+ },
14
+ {
15
+ text: localization.inventoryMonitor.lastDay,
16
+ value: 'last_day',
17
+ },
18
+ {
19
+ text: localization.inventoryMonitor.lastWeek,
20
+ value: 'last_week',
21
+ },
22
+ {
23
+ text: localization.inventoryMonitor.lastMonth,
24
+ value: 'last_month',
25
+ },
26
+ // {
27
+ // text: localization.inventoryMonitor.lastYear,
28
+ // value: 'last_year',
29
+ // },
30
+ {
31
+ text: localization.inventoryMonitor.customInterval,
32
+ value: 'custom_interval',
33
+ },
34
+ ]
35
+
36
+ export const customTimeFunc = (
37
+ localization: UI_I_Localization,
38
+ value: number,
39
+ lang: string
40
+ ): UI_I_OptionItem[] => {
41
+ const isLangRu = lang === 'ru_RU'
42
+
43
+ const hourText = isLangRu
44
+ ? getCorrectRuForm(value, 'hour')
45
+ : localization.common.hours2
46
+ const dayText = isLangRu
47
+ ? getCorrectRuForm(value, 'day')
48
+ : localization.common.days2
49
+ const weekText = isLangRu
50
+ ? getCorrectRuForm(value, 'week')
51
+ : localization.common.weeks2
52
+ const monthText = isLangRu
53
+ ? getCorrectRuForm(value, 'month')
54
+ : localization.common.months2
55
+
56
+ return [
57
+ {
58
+ text: hourText,
59
+ value: 'hours',
60
+ },
61
+ {
62
+ text: dayText,
63
+ value: 'days',
64
+ },
65
+ {
66
+ text: weekText,
67
+ value: 'weeks',
68
+ },
69
+ {
70
+ text: monthText,
71
+ value: 'months',
72
+ },
73
+ ]
74
+ }
75
+
76
+ export const chartTypeFunc = (
77
+ localization: UI_I_Localization
78
+ ): UI_I_OptionItem[] => [
79
+ {
80
+ text: localization.inventoryMonitor.lineGraph,
81
+ value: 'line_graph',
82
+ },
83
+ {
84
+ text: localization.inventoryMonitor.stackedGraph,
85
+ value: 'stacked_graph',
86
+ },
87
+ ]
88
+
89
+ const getCorrectRuForm = (value: number, type: string): string => {
90
+ const forms: UI_I_ArbitraryObject<string[]> = {
91
+ hour: ['Час', 'Часа', 'Часов'],
92
+ day: ['День', 'Дня', 'Дней'],
93
+ week: ['Неделя', 'Недели', 'Недель'],
94
+ month: ['Месяц', 'Месяца', 'Месяцев'],
95
+ }
96
+
97
+ let text: string
98
+
99
+ if (!value) {
100
+ return getCorrectRuForm[type]
101
+ }
102
+
103
+ if (value % 10 === 1 && value % 100 !== 11) {
104
+ text = forms[type][0]
105
+ } else if (
106
+ [2, 3, 4].includes(value % 10) &&
107
+ ![12, 13, 14].includes(value % 100)
108
+ ) {
109
+ text = forms[type][1]
110
+ } else {
111
+ text = forms[type][2]
112
+ }
113
+ getCorrectRuForm[type] = text
114
+ return text
115
+ }
@@ -74,11 +74,20 @@ onUnmounted(() => {
74
74
  })
75
75
  </script>
76
76
 
77
+ <style>
78
+ :root {
79
+ --main-bg-color: #fafafa;
80
+ }
81
+ :root.dark-theme {
82
+ --main-bg-color: #213444;
83
+ }
84
+ </style>
77
85
  <style lang="scss" scoped>
78
86
  .tasks {
79
87
  display: flex; // TODO надо удалить потом (clr style)
80
88
  flex-direction: column; // TODO надо удалить потом (clr style)
81
89
  height: inherit;
90
+ background-color: var(--main-bg-color);
82
91
  padding: 10px 16px 30px;
83
92
  &__headline {
84
93
  font-family: Inter, sans-serif;
@@ -228,7 +228,6 @@ const onSelectNodeOfTree = (
228
228
  }
229
229
  .chip-icon {
230
230
  min-width: 14px;
231
- margin-right: 6px;
232
231
  }
233
232
  .icon {
234
233
  margin-right: 4px;
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <div class="error-info">
3
3
  <ui-icon
4
- :id="`resent-task-error-info-icon-${props.id}`"
4
+ :id="`task-error-info-icon-${props.id}`"
5
5
  name="info"
6
6
  width="16px"
7
7
  height="16px"
@@ -13,7 +13,7 @@
13
13
  width="232px"
14
14
  top
15
15
  left
16
- :elem-id="`resent-task-error-info-icon-${props.id}`"
16
+ :elem-id="`task-error-info-icon-${props.id}`"
17
17
  >
18
18
  <div class="common-widget-info">
19
19
  <div class="headline justify-between flex-align-center">
@@ -39,7 +39,7 @@
39
39
  </template>
40
40
 
41
41
  <script lang="ts" setup>
42
- import type { UI_I_Localization } from '~/node_modules/bfg-common/lib/models/interfaces'
42
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
43
43
 
44
44
  const props = defineProps<{
45
45
  id: string
@@ -58,13 +58,13 @@ const isShowInfo = ref<boolean>(false)
58
58
  margin-left: 8px;
59
59
 
60
60
  .info-icon {
61
- color: #9da6ad;
61
+ color: var(--form-icon-color);
62
62
 
63
63
  &:hover {
64
- color: #4d5d69;
64
+ color: var(--close-icon);
65
65
  }
66
66
  &.show {
67
- color: #008fd6;
67
+ color: var(--switch-bg-checked-reverse);
68
68
  }
69
69
  }
70
70
 
@@ -79,6 +79,10 @@ const isShowInfo = ref<boolean>(false)
79
79
  margin-left: 8px;
80
80
  }
81
81
 
82
+ .hide-icon {
83
+ color: var(--alert-icon);
84
+ }
85
+
82
86
  .common-widget-info-description {
83
87
  font-size: 13px;
84
88
  line-height: 15.73px;
@@ -18,6 +18,7 @@
18
18
  <ui-chip
19
19
  :test-id="normalizedTaskDetails[2].data.testId"
20
20
  :color="normalizedTaskDetails[2].data.chipColor"
21
+ size="sm"
21
22
  rounded
22
23
  >
23
24
  <ui-icon
@@ -126,15 +127,18 @@ const onSelectNodeOfTree = (data: any): void => {
126
127
  line-height: 14.52px;
127
128
  }
128
129
  .expand-details {
130
+ display: grid;
131
+ grid-template-columns: auto 1fr;
132
+ column-gap: 24px;
133
+ row-gap: 8px;
129
134
  &__row {
130
- display: grid;
131
- grid-template-columns: 110px 1fr;
132
- column-gap: 12px;
133
- margin-bottom: 8px;
135
+ display: contents;
136
+ height: 18px;
134
137
  }
135
138
  &__label {
136
139
  @extend %properties;
137
140
  color: #9da6ad;
141
+ text-transform: capitalize;
138
142
  }
139
143
  &__value {
140
144
  @extend %properties;
@@ -158,10 +162,6 @@ const onSelectNodeOfTree = (data: any): void => {
158
162
  @include flex($align: center);
159
163
  .ui-chip {
160
164
  width: max-content;
161
- :deep(.ui-chip__label) {
162
- // TODO надо удалить потом (clr style)
163
- grid-gap: 4px;
164
- }
165
165
  }
166
166
  }
167
167
  }
@@ -94,6 +94,7 @@
94
94
  :datastore="props.datastore"
95
95
  :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
96
96
  :passthrough-devices="props.passthroughDevices"
97
+ :mediated-devices="props.mediatedDevices"
97
98
  @change-boot-order="onChangeBootOrder"
98
99
  @send-data="onChangeCustomizeHardware"
99
100
  @get-storage="emits('get-storage', $event)"
@@ -199,6 +200,7 @@ const props = defineProps<{
199
200
  [UI_T_SelectedNavItem, null | number] | null
200
201
  >
201
202
  passthroughDevices: UI_I_PciDevice[]
203
+ mediatedDevices: any[]
202
204
  vmNameInWizard: string
203
205
  capabilities?: UI_I_Capabilities
204
206
  dataCenter?: UI_I_TreeNode // для сферы
@@ -71,6 +71,7 @@
71
71
  :error-validation-fields="props.errorValidationFields"
72
72
  :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
73
73
  :passthrough-devices="props.passthroughDevices"
74
+ :mediated-devices="props.mediatedDevices"
74
75
  :get-datastore-table-func="props.getDatastoreTableFunc"
75
76
  :datastore="props.datastore"
76
77
  :project="props.project"
@@ -152,6 +153,7 @@ const props = defineProps<{
152
153
  getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
153
154
  validateSendDataFunc: any
154
155
  passthroughDevices: UI_I_ConfigurePciDevicesTable | null
156
+ mediatedDevices: any[]
155
157
  vmNameInWizard: string
156
158
  capabilities?: UI_I_Capabilities
157
159
  schedulerTask?: any // TODO надо interface переместить глобално
@@ -35,6 +35,7 @@
35
35
  :is-clone="props.isClone"
36
36
  :state="props.state"
37
37
  :passthrough-devices="props.passthroughDevices"
38
+ :mediated-devices="props.mediatedDevices"
38
39
  :project="props.project"
39
40
  :nav-items="navItems"
40
41
  :errors="errors"
@@ -88,6 +89,7 @@
88
89
  :is-clone="props.isClone"
89
90
  :state="props.state"
90
91
  :passthrough-devices="props.passthroughDevices"
92
+ :mediated-devices="props.mediatedDevices"
91
93
  :project="props.project"
92
94
  :nav-items="navItems"
93
95
  :errors="errors"
@@ -173,6 +175,7 @@ const props = defineProps<{
173
175
  isClone?: boolean
174
176
  state?: string | number
175
177
  passthroughDevices?: UI_I_PciDevice[]
178
+ mediatedDevices?: any[]
176
179
  project?: UI_T_Project
177
180
  }>()
178
181
  const emits = defineEmits<{
@@ -42,6 +42,7 @@
42
42
  :datastore="props.datastore"
43
43
  :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
44
44
  :passthrough-devices="props.passthroughDevices"
45
+ :mediated-devices="props.mediatedDevices"
45
46
  :project="props.project"
46
47
  :guest-machine-type="guestMachineType"
47
48
  @send-data="emits('send-data-virtual-hardware-method', $event)"
@@ -158,6 +159,7 @@ const props = defineProps<{
158
159
  cdDvdDrives?: UI_I_SendDataNewCdDvdDrive[] | null
159
160
  usbController?: string
160
161
  passthroughDevices?: UI_I_PciDevice[]
162
+ mediatedDevices?: any[]
161
163
  vmCpuHelpTextSecond?: string
162
164
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
163
165
  }>()
@@ -35,6 +35,7 @@
35
35
  :datastore="props.datastore"
36
36
  :vm-cpu-help-text-second="props.vmCpuHelpTextSecond"
37
37
  :passthrough-devices="props.passthroughDevices"
38
+ :mediated-devices="props.mediatedDevices"
38
39
  :project="props.project"
39
40
  :guest-machine-type="guestMachineType"
40
41
  @send-data="emits('send-data-virtual-hardware-method', $event)"
@@ -134,6 +135,7 @@ const props = defineProps<{
134
135
  cdDvdDrives?: UI_I_SendDataNewCdDvdDrive[] | null
135
136
  usbController?: string
136
137
  passthroughDevices?: UI_I_PciDevice[]
138
+ mediatedDevices?: any[]
137
139
  vmCpuHelpTextSecond?: string
138
140
  getDatastoreTableFunc?: (payload: UI_I_TablePayload) => Promise<void>
139
141
  }>()
@@ -37,6 +37,7 @@
37
37
  :usb-controller="usbController"
38
38
  :guest-machine-type="guestMachineType"
39
39
  :passthrough-devices="passthroughDevices"
40
+ :mediated-devices="mediatedDevices"
40
41
  :vm-cpu-help-text-second="vmCpuHelpTextSecond"
41
42
  @add-device="onAddDevice"
42
43
  @get-storage="emits('get-storage', $event)"
@@ -103,6 +104,7 @@
103
104
  :usb-controller="usbController"
104
105
  :guest-machine-type="guestMachineType"
105
106
  :passthrough-devices="passthroughDevices"
107
+ :mediated-devices="mediatedDevices"
106
108
  :vm-cpu-help-text-second="vmCpuHelpTextSecond"
107
109
  @add-device="onAddDevice"
108
110
  @get-storage="emits('get-storage', $event)"
@@ -195,6 +197,7 @@ const props = defineProps<{
195
197
  usbController?: string
196
198
  pciDevices?: UI_I_SendDataNewPciDevice[]
197
199
  passthroughDevices?: UI_I_PciDevice[]
200
+ mediatedDevices?: any[]
198
201
  project: UI_T_Project
199
202
  guestMachineType?: UI_I_OptionItem | null
200
203
  }>()
@@ -216,7 +219,12 @@ const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
216
219
  const localization = computed<UI_I_Localization>(() => useLocal())
217
220
 
218
221
  const dropdownItems = computed<UI_I_DropdownTreeItem[]>(() =>
219
- dropdownItemsFunc(localization.value, props.state, props.passthroughDevices)
222
+ dropdownItemsFunc(
223
+ localization.value,
224
+ props.state,
225
+ props.passthroughDevices,
226
+ props.mediatedDevices
227
+ )
220
228
  )
221
229
 
222
230
  const hardDisksIndex = ref<number[]>([0])
@@ -139,7 +139,7 @@
139
139
  :state="props.state"
140
140
  @send-data="emits('send-data-new-usb-controller-method', $event)"
141
141
  />
142
- <template v-if="props.passthroughDevices">
142
+ <template v-if="props.passthroughDevices || props.mediatedDevices">
143
143
  <common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device
144
144
  v-for="(item, key) in props.pciDevices"
145
145
  :key="props.pciDevicesIndex[key]"
@@ -147,6 +147,7 @@
147
147
  :pci-device="item"
148
148
  :error-validation-fields="props.errorValidationFields"
149
149
  :passthrough-devices="props.passthroughDevices"
150
+ :mediated-devices="props.mediatedDevices"
150
151
  :type="props.pciDevicesType[key]"
151
152
  :is-edit="props.isEdit"
152
153
  :state="props.state"
@@ -266,6 +267,7 @@ const props = defineProps<{
266
267
  usbController?: string
267
268
  guestMachineType?: UI_I_OptionItem | null
268
269
  passthroughDevices?: UI_I_PciDevice[]
270
+ mediatedDevices?: any[]
269
271
  vmCpuHelpTextSecond?: string
270
272
  }>()
271
273
  const emits = defineEmits<{
@@ -337,7 +339,8 @@ const dropdownItems = computed<UI_I_Dropdown[]>(() =>
337
339
  dropdownItemsNewFunc(
338
340
  localization.value,
339
341
  props.state,
340
- props.passthroughDevices
342
+ props.passthroughDevices,
343
+ props.mediatedDevices
341
344
  )
342
345
  )
343
346
 
@@ -99,7 +99,7 @@
99
99
  :state="props.state"
100
100
  @send-data="emits('send-data-new-usb-controller-method', $event)"
101
101
  />
102
- <template v-if="props.passthroughDevices">
102
+ <template v-if="props.passthroughDevices || props.mediatedDevices">
103
103
  <common-vm-actions-common-customize-hardware-virtual-hardware-new-pci-device
104
104
  v-for="(item, key) in props.pciDevices"
105
105
  :key="props.pciDevicesIndex[key]"
@@ -107,6 +107,7 @@
107
107
  :pci-device="item"
108
108
  :error-validation-fields="props.errorValidationFields"
109
109
  :passthrough-devices="props.passthroughDevices"
110
+ :mediated-devices="props.mediatedDevices"
110
111
  :type="props.pciDevicesType[key]"
111
112
  :is-edit="props.isEdit"
112
113
  :state="props.state"
@@ -220,6 +221,7 @@ const props = defineProps<{
220
221
  usbController?: string
221
222
  guestMachineType?: UI_I_OptionItem | null
222
223
  passthroughDevices?: UI_I_PciDevice[]
224
+ mediatedDevices?: any[]
223
225
  vmCpuHelpTextSecond?: string
224
226
  }>()
225
227
  const emits = defineEmits<{
@@ -6,7 +6,8 @@ import type { UI_I_PciDevice } from '~/lib/models/store/vm/interfaces'
6
6
  export const dropdownItemsFunc = (
7
7
  localization: UI_I_Localization,
8
8
  state: string | number | undefined,
9
- passthroughDevices?: UI_I_PciDevice[]
9
+ passthroughDevices?: UI_I_PciDevice[],
10
+ mediatedDevices?: any[]
10
11
  ): UI_I_DropdownTreeItem[] => {
11
12
  const { $text } = useNuxtApp()
12
13
 
@@ -51,7 +52,7 @@ export const dropdownItemsFunc = (
51
52
  {
52
53
  text: 'PCI Device',
53
54
  value: 10,
54
- disabled: state === 2 || !passthroughDevices?.length,
55
+ disabled: state === 2 || (!passthroughDevices?.length && !mediatedDevices?.length),
55
56
  testId: 'pci-device',
56
57
  },
57
58
  // { text: 'Watchdog Timer', value: 11 },
@@ -75,7 +76,8 @@ export const dropdownItemsFunc = (
75
76
  export const dropdownItemsNewFunc = (
76
77
  localization: UI_I_Localization,
77
78
  state: string | number | undefined,
78
- passthroughDevices?: UI_I_PciDevice[]
79
+ passthroughDevices?: UI_I_PciDevice[],
80
+ mediatedDevices?: any
79
81
  ): UI_I_Dropdown[] => {
80
82
  const { $text } = useNuxtApp()
81
83
 
@@ -124,7 +126,7 @@ export const dropdownItemsNewFunc = (
124
126
  {
125
127
  text: 'PCI Device',
126
128
  value: 10,
127
- disabled: state === 2 || !passthroughDevices?.length,
129
+ disabled: state === 2 || (!passthroughDevices?.length && !mediatedDevices?.length),
128
130
  testId: 'pci-device',
129
131
  },
130
132
  // { text: 'Watchdog Timer', value: 11 },