bfg-common 1.5.585 → 1.5.586

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 (104) hide show
  1. package/CODE_STYLE.md +109 -109
  2. package/assets/img/icons/icons-sprite-dark-3.svg +227 -227
  3. package/assets/img/icons/icons-sprite-dark-5.svg +488 -488
  4. package/assets/img/icons/icons-sprite-light-3.svg +227 -227
  5. package/assets/img/icons/icons-sprite-light-5.svg +488 -488
  6. package/components/atoms/TheIcon3.vue +50 -50
  7. package/components/atoms/collapse/CollapseNav.vue +170 -170
  8. package/components/atoms/perPage/PerPage.vue +58 -58
  9. package/components/atoms/table/dataGrid/DataGrid.vue +1718 -1718
  10. package/components/atoms/table/dataGrid/DataGridPagination.vue +97 -97
  11. package/components/atoms/table/dataGrid/lib/config/settingsTable.ts +94 -94
  12. package/components/atoms/table/dataGrid/lib/utils/export.ts +16 -16
  13. package/components/common/backup/storage/actions/add/lib/utils.ts +51 -51
  14. package/components/common/browse/blocks/contents/filesNew/Skeleton.vue +18 -18
  15. package/components/common/diagramMain/modals/lib/config/portModal.ts +251 -251
  16. package/components/common/diagramMain/modals/lib/config/vCenterModal.ts +48 -48
  17. package/components/common/diagramMain/port/Port.vue +580 -580
  18. package/components/common/layout/theHeader/helpMenu/About.vue +79 -79
  19. package/components/common/layout/theHeader/helpMenu/aboutOld/AboutOld.vue +79 -79
  20. package/components/common/pages/backups/DetailView.vue +52 -52
  21. package/components/common/pages/backups/lib/models/interfaces.ts +36 -36
  22. package/components/common/pages/backups/modals/Modals.vue +243 -243
  23. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  24. package/components/common/pages/backups/modals/createBackup/lib/config/readyToCompleteOptions.ts +69 -69
  25. package/components/common/pages/backups/modals/lib/config/restore.ts +115 -115
  26. package/components/common/pages/backups/modals/lib/models/interfaces.ts +186 -186
  27. package/components/common/pages/backups/modals/restore/name/lib/models/interfaces.ts +6 -6
  28. package/components/common/pages/home/lib/models/interfaces.ts +48 -48
  29. package/components/common/pages/home/widgets/hosts/Hosts.vue +27 -27
  30. package/components/common/pages/home/widgets/hosts/lib/config/items.ts +23 -23
  31. package/components/common/pages/home/widgets/vms/VmsOld.vue +35 -35
  32. package/components/common/pages/home/widgets/vms/lib/config/items.ts +19 -19
  33. package/components/common/pages/scheduledTasks/lib/utils/utils.ts +84 -84
  34. package/components/common/readyToComplete/ReadyToComplete.vue +17 -17
  35. package/components/common/select/radio/RadioGroup.vue +137 -137
  36. package/components/common/spiceConsole/Drawer.vue +420 -420
  37. package/components/common/spiceConsole/SpiceConsole.vue +184 -184
  38. package/components/common/spiceConsole/lib/models/interfaces.ts +5 -5
  39. package/components/common/tools/Actions.vue +207 -207
  40. package/components/common/treeView/TreeView.vue +52 -52
  41. package/components/common/vm/actions/common/customizeHardware/CustomizeHardwareNew.vue +325 -324
  42. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardwareNew.vue +1 -1
  43. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/Shares.vue +140 -140
  44. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/shares/lib/config/options.ts +28 -28
  45. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryNew.vue +158 -158
  46. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/MemoryOld.vue +155 -155
  47. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/location/Location.vue +154 -154
  48. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/macAddress/MacAddress.vue +119 -119
  49. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/dynamicDirectPathIo/DynamicDirectPathIo.vue +31 -31
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/other/Other.vue +16 -16
  51. package/components/common/vm/actions/common/customizeHardware/virtualHardware/videoCard/numberDisplays/NumberDisplays.vue +53 -53
  52. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/delay/Delay.vue +32 -32
  53. package/components/common/vm/actions/common/customizeHardware/vmoptions/bootOptions/firmware/Firmware.vue +60 -60
  54. package/components/common/vm/actions/common/customizeHardware/vmoptions/remoteConsoleOptions/usbRedirection/UsbRedirection.vue +28 -28
  55. package/components/common/vm/actions/common/select/compatibility/Old.vue +107 -107
  56. package/components/common/vm/actions/common/select/createType/CreateType.vue +38 -38
  57. package/components/common/vm/actions/common/select/createType/lib/models/interfaces.ts +5 -5
  58. package/components/common/vm/actions/common/select/os/New.vue +1 -1
  59. package/components/common/vm/actions/common/select/storage/Old.vue +125 -125
  60. package/components/common/vm/actions/common/select/storage/Storage.vue +178 -178
  61. package/components/common/vm/actions/common/select/storage/new/New.vue +311 -311
  62. package/components/common/vm/actions/common/select/storage/new/lib/models/interfaces.ts +5 -5
  63. package/components/common/vm/actions/common/select/storage/new/lib/utils/utils.ts +21 -21
  64. package/components/common/vm/actions/common/select/template/old/Old.vue +50 -50
  65. package/components/common/vm/actions/editSettings/new/Skeleton.vue +88 -88
  66. package/components/common/vm/actions/register/Register.vue +352 -352
  67. package/components/common/vm/actions/register/lib/config/steps.ts +86 -86
  68. package/components/common/wizards/common/compatibility/Compatibility.vue +35 -35
  69. package/components/common/wizards/common/compatibility/New.vue +99 -99
  70. package/components/common/wizards/common/compatibility/Old.vue +53 -53
  71. package/components/common/wizards/common/steps/computeResource/ComputeResource.vue +86 -86
  72. package/components/common/wizards/common/steps/computeResource/New.vue +93 -93
  73. package/components/common/wizards/common/steps/name/Name.vue +178 -178
  74. package/components/common/wizards/common/steps/name/New.vue +221 -221
  75. package/components/common/wizards/common/steps/name/Old.vue +121 -121
  76. package/components/common/wizards/common/steps/name/lib/models/interfaces.ts +4 -4
  77. package/components/common/wizards/common/steps/name/location/Location.vue +85 -85
  78. package/components/common/wizards/common/steps/name/location/New.vue +40 -40
  79. package/components/common/wizards/datastore/add/Add.vue +228 -228
  80. package/components/common/wizards/datastore/add/lib/utils.ts +85 -85
  81. package/components/common/wizards/datastore/add/steps/typeMode/lib/config/typeOptions.ts +43 -43
  82. package/components/common/wizards/vm/migrate/select/computeResource/ComputeResource.vue +205 -205
  83. package/components/common/wizards/vm/migrate/select/network/Network.vue +103 -103
  84. package/composables/useAppVersion.ts +21 -21
  85. package/composables/useLocal.ts +6 -6
  86. package/composables/useLocalCommon.ts +39 -39
  87. package/lib/models/store/host/interfaces.ts +32 -0
  88. package/package.json +1 -1
  89. package/plugins/console.ts +21 -21
  90. package/plugins/date.ts +233 -233
  91. package/plugins/mouse.ts +21 -21
  92. package/plugins/panelStates.ts +70 -70
  93. package/plugins/text.ts +59 -59
  94. package/public/spice-console/application/clientgui.js +854 -854
  95. package/public/spice-console/application/packetfactory.js +211 -211
  96. package/public/spice-console/application/virtualmouse.js +147 -147
  97. package/public/spice-console/lib/images/bitmap.js +203 -203
  98. package/public/spice-console/network/spicechannel.js +440 -440
  99. package/public/spice-console/process/cursorprocess.js +121 -121
  100. package/public/spice-console/process/inputprocess.js +227 -227
  101. package/public/spice-console/process/mainprocess.js +210 -210
  102. package/public/spice-console/run.js +210 -210
  103. package/store/main/mutations.ts +7 -7
  104. package/store/main/state.ts +7 -7
@@ -1,43 +1,43 @@
1
- import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- import type { UI_T_Project } from '~/lib/models/types'
3
- import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
4
-
5
- export const datastoreTypesFunc = (
6
- localization: UI_I_Localization,
7
- _project?: UI_T_Project
8
- ): UI_I_RadioOption[] => {
9
- return [
10
- {
11
- id: 'datastore-type-shared-storm',
12
- label: localization.common.stormSharedStorage,
13
- value: 2,
14
- disabled: false,
15
- description: localization.common.sharedStormDesc,
16
- isTooltip: false,
17
- tooltipContent: localization.common.stormSharedStorageHelpDesc,
18
- testId: 'datastore-type-shared-storm',
19
- },
20
- {
21
- id: 'datastore-type-nfs',
22
- label: localization.common.nfs,
23
- value: 4,
24
- disabled: false,
25
- description: localization.common.nfsDesc,
26
- isTooltip: false,
27
- tooltipContent: localization.common.nfsHelpDesc,
28
- testId: 'datastore-type-nfs',
29
- },
30
- ]
31
-
32
- // if (project === 'procurator') {
33
- // types.unshift({
34
- // label: localization.common.localStorage,
35
- // value: 1,
36
- // disabled: false,
37
- // description: localization.common.localDesc,
38
- // isTooltip: false,
39
- // tooltipContent: localization.common.localStorageHelpDesc,
40
- // testId: 'datastore-type-local',
41
- // })
42
- // }
43
- }
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+ import type { UI_T_Project } from '~/lib/models/types'
3
+ import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
4
+
5
+ export const datastoreTypesFunc = (
6
+ localization: UI_I_Localization,
7
+ _project?: UI_T_Project
8
+ ): UI_I_RadioOption[] => {
9
+ return [
10
+ {
11
+ id: 'datastore-type-shared-storm',
12
+ label: localization.common.stormSharedStorage,
13
+ value: 2,
14
+ disabled: false,
15
+ description: localization.common.sharedStormDesc,
16
+ isTooltip: false,
17
+ tooltipContent: localization.common.stormSharedStorageHelpDesc,
18
+ testId: 'datastore-type-shared-storm',
19
+ },
20
+ {
21
+ id: 'datastore-type-nfs',
22
+ label: localization.common.nfs,
23
+ value: 4,
24
+ disabled: false,
25
+ description: localization.common.nfsDesc,
26
+ isTooltip: false,
27
+ tooltipContent: localization.common.nfsHelpDesc,
28
+ testId: 'datastore-type-nfs',
29
+ },
30
+ ]
31
+
32
+ // if (project === 'procurator') {
33
+ // types.unshift({
34
+ // label: localization.common.localStorage,
35
+ // value: 1,
36
+ // disabled: false,
37
+ // description: localization.common.localDesc,
38
+ // isTooltip: false,
39
+ // tooltipContent: localization.common.localStorageHelpDesc,
40
+ // testId: 'datastore-type-local',
41
+ // })
42
+ // }
43
+ }
@@ -1,205 +1,205 @@
1
- <template>
2
- <div class="compute-resource">
3
- <atoms-alert
4
- v-show="props.alertMessages?.length"
5
- :items="props.alertMessages"
6
- test-id="compute-resource-alert"
7
- status="alert-danger"
8
- @remove="onHideAlert"
9
- />
10
-
11
- <div
12
- v-if="model.migrate_type === 'resource-storage'"
13
- class="tree-view-wrap mt-1"
14
- >
15
- <common-wizards-vm-common-compute-resource-tree-view
16
- v-model="model.resource.selectedNode"
17
- :compute-resource-tree="nodes"
18
- @show-compute-resource-tree="onShowComputeResourceTree"
19
- @select-compute-resource-tree="onSelectComputeResourceTree"
20
- />
21
- </div>
22
-
23
- <template v-else>
24
- <atoms-tabs
25
- v-model="activeTab"
26
- :items="selectStorageTabs"
27
- test-id="migrate-select-storage-tabs"
28
- size="small"
29
- class="compute-resource__tabs"
30
- />
31
-
32
- <common-wizards-vm-migrate-select-compute-resource-table-view
33
- v-model="selectedTableDataKeys[activeTab]"
34
- :type="activeTab"
35
- :data-table="props.computeResourceData?.items || []"
36
- :total-items="props.computeResourceData?.total_items || 0"
37
- :total-pages="props.computeResourceData?.total_pages || 1"
38
- :get-compute-resource-data="props.getComputeResourceData"
39
- />
40
- </template>
41
-
42
- <common-wizards-common-compatibility
43
- :loading="!model.resource.selectedNode"
44
- :status="compatibilityText[0]"
45
- :text="compatibilityText[1]"
46
- />
47
- </div>
48
- </template>
49
-
50
- <script lang="ts" setup>
51
- import type { UI_I_Localization } from '~/lib/models/interfaces'
52
- import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
53
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
54
- import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
55
- import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
56
- import type { UI_I_MigrateFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
57
- import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces'
58
- import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
59
- import { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/enums'
60
- import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel'
61
-
62
- const props = withDefaults(
63
- defineProps<{
64
- alertMessages: string[]
65
- getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
66
- computeResourceData: any
67
- computeResourceTree: UI_I_TreeNode | null
68
- vmState?: number
69
- }>(),
70
- {
71
- vmState: undefined,
72
- }
73
- )
74
- const model = defineModel<UI_I_MigrateFormLocal>({ required: true })
75
- const emits = defineEmits<{
76
- (event: 'hide-alert', value: number): void
77
- (event: 'next-step', value: any): void
78
- }>()
79
-
80
- const localization = computed<UI_I_Localization>(() => useLocal())
81
- const { $recursion }: any = useNuxtApp()
82
-
83
- const activeTab = ref<UI_T_SelectComputeResourceTabType>('host')
84
- const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
85
- vmMigrateComputeResourceTabsFunc(localization.value, props.vmState || -1)
86
- )
87
-
88
- const selectedTableDataKeys = ref<UI_I_SelectedTableDataKeys>({
89
- host: null,
90
- cluster: null,
91
- 'resource-pool': null,
92
- 'v-apps': null,
93
- })
94
- watch(
95
- selectedTableDataKeys,
96
- (newValue) => {
97
- if (!props.computeResourceData?.items.length) return
98
-
99
- const data = props.computeResourceData.items.find(
100
- (_: never, key: number) => newValue[activeTab.value] === key
101
- )
102
- if (data) {
103
- const dataKeys = UI_E_ComputeResourceTabKamelKeys[activeTab.value]
104
- model.value.resource[dataKeys] = data
105
- model.value.resource.selectedNode = data
106
- }
107
- },
108
- { immediate: true, deep: true }
109
- )
110
-
111
- const nodes = ref<UI_I_TreeNode[]>([])
112
- watch(
113
- props.computeResourceTree,
114
- (newValue) => {
115
- if (nodes.value.length) return
116
-
117
- nodes.value = useDeepCopy([newValue])
118
- },
119
- { immediate: true, deep: true }
120
- )
121
-
122
- const onShowComputeResourceTree = ({
123
- node,
124
- cb,
125
- }: {
126
- node: UI_I_TreeNode
127
- cb: () => void
128
- }): void => {
129
- $recursion.findAndShow(
130
- nodes.value,
131
- [node.id, node.type],
132
- ['id', 'type'],
133
- 'nodes'
134
- )
135
- cb()
136
- }
137
- const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
138
- $recursion.findAndActivate(
139
- nodes.value,
140
- [node.type, node.id],
141
- ['type', 'id'],
142
- 'nodes'
143
- )
144
- }
145
- const compatibilityText = computed<[UI_T_CompatibilityStatus, string]>(() => {
146
- const { selectedNode } = model.value.resource
147
-
148
- if (!selectedNode) return ['none', '']
149
-
150
- let res: [UI_T_CompatibilityStatus, string] = [
151
- 'success',
152
- localization.value.common.compatibilityChecksSucceeded,
153
- ]
154
-
155
- if (selectedNode.type === 'datacenter' || selectedNode.type === 'folder') {
156
- res = [
157
- 'error',
158
- localization.value.common.selectValidClusterOrHostDestination,
159
- ]
160
- }
161
- if (selectedNode.type === 'cluster') {
162
- const hasHost = !!selectedNode.nodes.length
163
- if (!hasHost) {
164
- res = ['error', localization.value.common.clusterNotContainAnyHosts]
165
- }
166
- }
167
-
168
- if (selectedNode.type === 'host') {
169
- if (selectedNode.state === 'Error') {
170
- // TODO check Maintenance Mode
171
- res = [
172
- 'error',
173
- localization.value.common.selectedHostDisconnectedMaintenanceMode,
174
- ]
175
- }
176
- }
177
-
178
- return res
179
- })
180
- const onHideAlert = (): void => {
181
- emits('hide-alert', 3)
182
- }
183
- </script>
184
-
185
- <style lang="scss" scoped>
186
- @import 'assets/scss/common/mixins';
187
- .compute-resource {
188
- @include flex($dir: column);
189
- height: inherit;
190
- .tree-view-wrap {
191
- max-height: 250px;
192
- min-height: 200px;
193
- position: relative;
194
- border: 1px solid #000;
195
- padding: 5px 0 0 5px;
196
- overflow: auto;
197
- }
198
- &__tabs {
199
- width: 100%;
200
- :deep(.nav) {
201
- margin-top: 0;
202
- }
203
- }
204
- }
205
- </style>
1
+ <template>
2
+ <div class="compute-resource">
3
+ <atoms-alert
4
+ v-show="props.alertMessages?.length"
5
+ :items="props.alertMessages"
6
+ test-id="compute-resource-alert"
7
+ status="alert-danger"
8
+ @remove="onHideAlert"
9
+ />
10
+
11
+ <div
12
+ v-if="model.migrate_type === 'resource-storage'"
13
+ class="tree-view-wrap mt-1"
14
+ >
15
+ <common-wizards-vm-common-compute-resource-tree-view
16
+ v-model="model.resource.selectedNode"
17
+ :compute-resource-tree="nodes"
18
+ @show-compute-resource-tree="onShowComputeResourceTree"
19
+ @select-compute-resource-tree="onSelectComputeResourceTree"
20
+ />
21
+ </div>
22
+
23
+ <template v-else>
24
+ <atoms-tabs
25
+ v-model="activeTab"
26
+ :items="selectStorageTabs"
27
+ test-id="migrate-select-storage-tabs"
28
+ size="small"
29
+ class="compute-resource__tabs"
30
+ />
31
+
32
+ <common-wizards-vm-migrate-select-compute-resource-table-view
33
+ v-model="selectedTableDataKeys[activeTab]"
34
+ :type="activeTab"
35
+ :data-table="props.computeResourceData?.items || []"
36
+ :total-items="props.computeResourceData?.total_items || 0"
37
+ :total-pages="props.computeResourceData?.total_pages || 1"
38
+ :get-compute-resource-data="props.getComputeResourceData"
39
+ />
40
+ </template>
41
+
42
+ <common-wizards-common-compatibility
43
+ :loading="!model.resource.selectedNode"
44
+ :status="compatibilityText[0]"
45
+ :text="compatibilityText[1]"
46
+ />
47
+ </div>
48
+ </template>
49
+
50
+ <script lang="ts" setup>
51
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
52
+ import type { UI_I_CollapseNavItem } from '~/components/atoms/collapse/lib/models/interfaces'
53
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
54
+ import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
55
+ import type { UI_T_SelectComputeResourceTabType } from '~/components/common/wizards/vm/migrate/select/storage/lib/models/types'
56
+ import type { UI_I_MigrateFormLocal } from '~/components/common/wizards/vm/migrate/lib/models/interfaces'
57
+ import type { UI_I_SelectedTableDataKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/interfaces'
58
+ import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
59
+ import { UI_E_ComputeResourceTabKamelKeys } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/models/enums'
60
+ import { vmMigrateComputeResourceTabsFunc } from '~/components/common/wizards/vm/migrate/select/computeResource/lib/config/tabsPannel'
61
+
62
+ const props = withDefaults(
63
+ defineProps<{
64
+ alertMessages: string[]
65
+ getComputeResourceData: (payload: UI_I_TablePayload) => Promise<void>
66
+ computeResourceData: any
67
+ computeResourceTree: UI_I_TreeNode | null
68
+ vmState?: number
69
+ }>(),
70
+ {
71
+ vmState: undefined,
72
+ }
73
+ )
74
+ const model = defineModel<UI_I_MigrateFormLocal>({ required: true })
75
+ const emits = defineEmits<{
76
+ (event: 'hide-alert', value: number): void
77
+ (event: 'next-step', value: any): void
78
+ }>()
79
+
80
+ const localization = computed<UI_I_Localization>(() => useLocal())
81
+ const { $recursion }: any = useNuxtApp()
82
+
83
+ const activeTab = ref<UI_T_SelectComputeResourceTabType>('host')
84
+ const selectStorageTabs = computed<UI_I_CollapseNavItem[]>(() =>
85
+ vmMigrateComputeResourceTabsFunc(localization.value, props.vmState || -1)
86
+ )
87
+
88
+ const selectedTableDataKeys = ref<UI_I_SelectedTableDataKeys>({
89
+ host: null,
90
+ cluster: null,
91
+ 'resource-pool': null,
92
+ 'v-apps': null,
93
+ })
94
+ watch(
95
+ selectedTableDataKeys,
96
+ (newValue) => {
97
+ if (!props.computeResourceData?.items.length) return
98
+
99
+ const data = props.computeResourceData.items.find(
100
+ (_: never, key: number) => newValue[activeTab.value] === key
101
+ )
102
+ if (data) {
103
+ const dataKeys = UI_E_ComputeResourceTabKamelKeys[activeTab.value]
104
+ model.value.resource[dataKeys] = data
105
+ model.value.resource.selectedNode = data
106
+ }
107
+ },
108
+ { immediate: true, deep: true }
109
+ )
110
+
111
+ const nodes = ref<UI_I_TreeNode[]>([])
112
+ watch(
113
+ props.computeResourceTree,
114
+ (newValue) => {
115
+ if (nodes.value.length) return
116
+
117
+ nodes.value = useDeepCopy([newValue])
118
+ },
119
+ { immediate: true, deep: true }
120
+ )
121
+
122
+ const onShowComputeResourceTree = ({
123
+ node,
124
+ cb,
125
+ }: {
126
+ node: UI_I_TreeNode
127
+ cb: () => void
128
+ }): void => {
129
+ $recursion.findAndShow(
130
+ nodes.value,
131
+ [node.id, node.type],
132
+ ['id', 'type'],
133
+ 'nodes'
134
+ )
135
+ cb()
136
+ }
137
+ const onSelectComputeResourceTree = (node: UI_I_TreeNode): void => {
138
+ $recursion.findAndActivate(
139
+ nodes.value,
140
+ [node.type, node.id],
141
+ ['type', 'id'],
142
+ 'nodes'
143
+ )
144
+ }
145
+ const compatibilityText = computed<[UI_T_CompatibilityStatus, string]>(() => {
146
+ const { selectedNode } = model.value.resource
147
+
148
+ if (!selectedNode) return ['none', '']
149
+
150
+ let res: [UI_T_CompatibilityStatus, string] = [
151
+ 'success',
152
+ localization.value.common.compatibilityChecksSucceeded,
153
+ ]
154
+
155
+ if (selectedNode.type === 'datacenter' || selectedNode.type === 'folder') {
156
+ res = [
157
+ 'error',
158
+ localization.value.common.selectValidClusterOrHostDestination,
159
+ ]
160
+ }
161
+ if (selectedNode.type === 'cluster') {
162
+ const hasHost = !!selectedNode.nodes.length
163
+ if (!hasHost) {
164
+ res = ['error', localization.value.common.clusterNotContainAnyHosts]
165
+ }
166
+ }
167
+
168
+ if (selectedNode.type === 'host') {
169
+ if (selectedNode.state === 'Error') {
170
+ // TODO check Maintenance Mode
171
+ res = [
172
+ 'error',
173
+ localization.value.common.selectedHostDisconnectedMaintenanceMode,
174
+ ]
175
+ }
176
+ }
177
+
178
+ return res
179
+ })
180
+ const onHideAlert = (): void => {
181
+ emits('hide-alert', 3)
182
+ }
183
+ </script>
184
+
185
+ <style lang="scss" scoped>
186
+ @import 'assets/scss/common/mixins';
187
+ .compute-resource {
188
+ @include flex($dir: column);
189
+ height: inherit;
190
+ .tree-view-wrap {
191
+ max-height: 250px;
192
+ min-height: 200px;
193
+ position: relative;
194
+ border: 1px solid #000;
195
+ padding: 5px 0 0 5px;
196
+ overflow: auto;
197
+ }
198
+ &__tabs {
199
+ width: 100%;
200
+ :deep(.nav) {
201
+ margin-top: 0;
202
+ }
203
+ }
204
+ }
205
+ </style>