bfg-common 1.6.10 → 1.6.12

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 (33) hide show
  1. package/assets/localization/local_be.json +3 -1
  2. package/assets/localization/local_en.json +3 -1
  3. package/assets/localization/local_hy.json +3 -1
  4. package/assets/localization/local_kk.json +3 -1
  5. package/assets/localization/local_ru.json +3 -1
  6. package/assets/localization/local_zh.json +3 -1
  7. package/components/common/monitor/lib/utils/local_be.json +3 -1
  8. package/components/common/monitor/lib/utils/local_en.json +3 -1
  9. package/components/common/monitor/lib/utils/local_hy.json +3 -1
  10. package/components/common/monitor/lib/utils/local_kk.json +3 -1
  11. package/components/common/monitor/lib/utils/local_ru.json +3 -1
  12. package/components/common/monitor/lib/utils/local_zh.json +3 -1
  13. package/components/common/monitor/utilization/New.vue +5 -0
  14. package/components/common/monitor/utilization/Old.vue +79 -0
  15. package/components/common/monitor/utilization/Utilization.vue +51 -0
  16. package/components/common/monitor/utilization/infoBlock/InfoBlock.vue +23 -0
  17. package/components/common/monitor/utilization/infoBlock/New.vue +5 -0
  18. package/components/common/monitor/utilization/infoBlock/Old.vue +185 -0
  19. package/components/common/monitor/utilization/lib/models/enums.ts +4 -0
  20. package/components/common/monitor/utilization/lib/models/interfaces.ts +25 -0
  21. package/components/common/monitor/utilization/lib/utils/index.ts +31 -0
  22. package/components/common/vm/actions/consolidate/New.vue +1 -1
  23. package/components/common/vm/actions/consolidate/Old.vue +2 -2
  24. package/components/common/vm/actions/register/New.vue +271 -271
  25. package/components/common/vm/actions/rename/New.vue +11 -1
  26. package/components/common/vm/actions/rename/Rename.vue +6 -0
  27. package/components/common/vm/snapshots/lib/models/types.ts +1 -0
  28. package/components/common/vm/snapshots/modals/confirm/New.vue +2 -1
  29. package/components/common/vm/snapshots/modals/confirm/Old.vue +1 -1
  30. package/components/common/vm/snapshots/modals/confirm/lib/models/enums.ts +2 -0
  31. package/components/common/vm/snapshots/modals/lib/config/modalTexts.ts +1 -0
  32. package/components/common/wizards/common/steps/name/New.vue +302 -302
  33. package/package.json +1 -1
@@ -1,271 +1,271 @@
1
- <template>
2
- <ui-wizard
3
- :steps="props.wizard.steps"
4
- :selected-scheme="props.selectedScheme"
5
- :is-loading="props.wizard.wizardLoader.status"
6
- :title="localization.common.registerVm"
7
- :texts="texts"
8
- :has-changes="hasChanges"
9
- test-id="register-wizard"
10
- show
11
- @change-steps="emits('change-steps', $event)"
12
- @hide="emits('hide')"
13
- @submit="emits('finish')"
14
- >
15
- <template #content="{ selectedStep }">
16
- <ui-wizard-block
17
- v-if="
18
- selectedStep.id === props.dynamicSteps.selectName ||
19
- selectedStep.id === props.dynamicSteps.selectNameFolder
20
- "
21
- :sub-title-height="heightName"
22
- >
23
- <template #subTitle>
24
- <div ref="subTitleBlockName">
25
- <div class="subtitle-block">
26
- <div
27
- id="name-alert-wrapper"
28
- :class="[{ 'mb-4': !isNameAlertWrapperEmpty }]"
29
- ></div>
30
- <ui-wizard-subtitle :sub-title="currentSubtitleSelectNameBlock" />
31
- </div>
32
- </div>
33
- </template>
34
- <template #content>
35
- <common-wizards-common-steps-name
36
- v-show="
37
- selectedStep.id === props.dynamicSteps.selectName ||
38
- selectedStep.id === props.dynamicSteps.selectNameFolder
39
- "
40
- v-model:name="vmForm.name"
41
- v-model:location="location"
42
- :show="
43
- selectedStep.id === props.dynamicSteps.selectName ||
44
- selectedStep.id === props.dynamicSteps.selectNameFolder
45
- "
46
- :name-form-submit="props.nameFormSubmit"
47
- :name-request-url="props.nameRequestUrl"
48
- :validation-description="
49
- localization.common.enterValidLocationVirtualMachine
50
- "
51
- :name-exist-validation-description="
52
- localization.registerVm.nameAlreadyExistsDescription
53
- "
54
- :test-ids="props.nameTestIds"
55
- :has-location="props.isSphere"
56
- :location-nodes="localLocationNodes"
57
- :allowed-location-kinds="props.allowedLocationKinds"
58
- :location-description="props.locationDescription"
59
- @submit="emits('change-name', $event)"
60
- @has-errors="isNameAlertWrapperEmpty = $event"
61
- />
62
- </template>
63
- </ui-wizard-block>
64
-
65
- <ui-wizard-block
66
- v-if="
67
- props.isSphere &&
68
- selectedStep.id === props.dynamicSteps.selectComputeResource
69
- "
70
- :sub-title-height="heightComputeResource"
71
- >
72
- <template #subTitle>
73
- <div ref="computeResource">
74
- <div class="subtitle-block">
75
- <ui-alert
76
- v-if="props.computeResourceAlert.length"
77
- :messages="props.computeResourceAlert"
78
- test-id="computed-resource-alert"
79
- type="error"
80
- size="md"
81
- class="subtitle-block__alert mb-4"
82
- />
83
- <ui-wizard-subtitle
84
- :sub-title="
85
- localization.vmWizard
86
- .selectDestinationComputeResourceForThisOperation
87
- "
88
- />
89
- </div>
90
- </div>
91
- </template>
92
- <template #content>
93
- <div class="mt-4 compute-resource-container">
94
- <common-wizards-common-steps-compute-resource
95
- v-show="
96
- selectedStep.id === props.dynamicSteps.selectComputeResource
97
- "
98
- v-model="vmForm.computeResource"
99
- :nodes="props.computeResourceTreeLocal"
100
- :alert-messages="props.computeResourceAlert"
101
- :is-loading="props.isLoadingComputeTree"
102
- :compatibility-text="props.compatibilityText"
103
- />
104
- </div>
105
- </template>
106
- </ui-wizard-block>
107
-
108
- <ui-wizard-block
109
- v-if="selectedStep.id === props.dynamicSteps.readyComplete"
110
- :sub-title-height="heightReadyComplete"
111
- >
112
- <template #subTitle>
113
- <div ref="subTitleBlockReadyComplete">
114
- <div class="subtitle-block">
115
- <ui-wizard-subtitle
116
- :sub-title="localization.registerVm.lastCreateSubtitle"
117
- />
118
- </div>
119
- </div>
120
- </template>
121
- <template #content>
122
- <div class="register-vm-ready-to-complete-container">
123
- <common-ready-to-complete
124
- v-if="selectedStep.id === props.dynamicSteps.readyComplete"
125
- :data="props.readyCompleteTableInfo"
126
- />
127
- </div>
128
- </template>
129
- </ui-wizard-block>
130
- </template>
131
- </ui-wizard>
132
- </template>
133
-
134
- <script setup lang="ts">
135
- import { useElementSize } from '@vueuse/core'
136
- import type {
137
- UI_I_WizardStep,
138
- UI_I_WizardTexts,
139
- } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
140
- import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
141
- import { compare } from '~/node_modules/bfg-uikit/lib/utils/compare'
142
- import type { UI_I_Localization } from '~/lib/models/interfaces'
143
- import type { UI_T_Project } from '~/lib/models/types'
144
- import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
145
- import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
146
- import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
147
- import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
148
-
149
- const vmForm = defineModel<any>({ required: true })
150
- const location = defineModel<UI_I_TreeNode | null>('location')
151
-
152
- const props = withDefaults(
153
- defineProps<{
154
- project: UI_T_Project
155
- readyCompleteTableInfo: UI_I_TableInfoItem[]
156
- nameRequestUrl: string
157
- wizard: Wizard
158
- selectedScheme: number[]
159
- dynamicSteps: any
160
- nameFormSubmit: null | Function
161
- nameTestIds: UI_I_NameTestIds
162
- allowedLocationKinds: number[]
163
- locationDescription: string
164
- isSphere: boolean
165
- computeResourceTreeLocal: UI_I_TreeNode | null
166
- compatibilityText: [UI_T_CompatibilityStatus, string]
167
- isLoadingComputeTree?: boolean // для сферы
168
- computeResourceAlert?: string[] // для сферы
169
- locationNodes?: UI_I_TreeNode[] // для сферы
170
- }>(),
171
- {
172
- isLoadingComputeTree: false,
173
- computeResourceAlert: () => [],
174
- locationNodes: () => [],
175
- }
176
- )
177
-
178
- const emits = defineEmits<{
179
- (event: 'finish'): void
180
- (event: 'hide'): void
181
- (event: 'change-steps', value: UI_I_WizardStep[]): void
182
- (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
183
- }>()
184
-
185
- const localization = computed<UI_I_Localization>(() => useLocal())
186
-
187
- const texts = computed<UI_I_WizardTexts>(() => ({
188
- cancel: localization.value.common.cancel,
189
- back: localization.value.common.backCap,
190
- processing: localization.value.common.processing,
191
- next: localization.value.common.next,
192
- finish: localization.value.registerVm.register,
193
- incompleteTitle: localization.value.common.incompleteProcess,
194
- incompleteMessage: localization.value.common.incompleteProcessMessage,
195
- incompleteCancel: localization.value.common.cancel,
196
- incompleteLeave: localization.value.common.leave,
197
- step: localization.value.common.step,
198
- of: localization.value.common.of2,
199
- }))
200
-
201
- const isNameAlertWrapperEmpty = ref<boolean>(false)
202
-
203
- const subTitleBlockName = ref<HTMLElement | null>(null)
204
- const { height: heightName } = useElementSize(subTitleBlockName)
205
-
206
- const computeResource = ref<HTMLElement | null>(null)
207
- const { height: heightComputeResource } = useElementSize(computeResource)
208
-
209
- const subTitleBlockReadyComplete = ref<HTMLElement | null>(null)
210
- const { height: heightReadyComplete } = useElementSize(
211
- subTitleBlockReadyComplete
212
- )
213
-
214
- const currentSubtitleSelectNameBlock = ref<string>(
215
- props.isSphere
216
- ? localization.value.vmWizard.specifyUniqueNameAndTargetLocationForVm
217
- : localization.value.common.specifyUniqueNameForVm
218
- )
219
-
220
- const initialCompare = compare(vmForm)
221
- const hasChanges = computed<boolean>(() => initialCompare.getDiff(vmForm.value))
222
-
223
- const localLocationNodes = computed<UI_I_TreeNode[]>(() => {
224
- const copyData = useDeepCopy(props.locationNodes)
225
- if (copyData[0] && !copyData[0]?.nodes.length) {
226
- copyData[0].hasNodes = true
227
- }
228
-
229
- return copyData
230
- })
231
- </script>
232
-
233
- <style>
234
- :root {
235
- --select-name-border-color: #e9ebed;
236
- }
237
- :root.dark-theme {
238
- --select-name-border-color: #e9ebed1f;
239
- }
240
- </style>
241
- <style scoped lang="scss">
242
- .subtitle-block {
243
- display: flex;
244
- flex-direction: column;
245
- border-bottom: 1px solid var(--wizard-line);
246
- padding-bottom: 12px;
247
- }
248
- :deep(.select-name .tree-view-wrap) {
249
- border-color: var(--select-name-border-color);
250
- }
251
- .compute-resource-container {
252
- padding-bottom: 16px;
253
-
254
- :deep(.tree-content) {
255
- padding: 8px !important;
256
- }
257
- :deep(.compatibility-wrap) {
258
- margin-top: 24px;
259
- }
260
- }
261
- .register-vm-ready-to-complete-container {
262
- padding-bottom: 16px;
263
-
264
- :deep(.details-list__col-right) {
265
- align-items: flex-start;
266
- }
267
- :deep(.details-item-value) {
268
- white-space: normal;
269
- }
270
- }
271
- </style>
1
+ <template>
2
+ <ui-wizard
3
+ :steps="props.wizard.steps"
4
+ :selected-scheme="props.selectedScheme"
5
+ :is-loading="props.wizard.wizardLoader.status"
6
+ :title="localization.common.registerVm"
7
+ :texts="texts"
8
+ :has-changes="hasChanges"
9
+ test-id="register-wizard"
10
+ show
11
+ @change-steps="emits('change-steps', $event)"
12
+ @hide="emits('hide')"
13
+ @submit="emits('finish')"
14
+ >
15
+ <template #content="{ selectedStep }">
16
+ <ui-wizard-block
17
+ v-if="
18
+ selectedStep.id === props.dynamicSteps.selectName ||
19
+ selectedStep.id === props.dynamicSteps.selectNameFolder
20
+ "
21
+ :sub-title-height="heightName"
22
+ >
23
+ <template #subTitle>
24
+ <div ref="subTitleBlockName">
25
+ <div class="subtitle-block">
26
+ <div
27
+ id="name-alert-wrapper"
28
+ :class="[{ 'mb-4': !isNameAlertWrapperEmpty }]"
29
+ ></div>
30
+ <ui-wizard-subtitle :sub-title="currentSubtitleSelectNameBlock" />
31
+ </div>
32
+ </div>
33
+ </template>
34
+ <template #content>
35
+ <common-wizards-common-steps-name
36
+ v-show="
37
+ selectedStep.id === props.dynamicSteps.selectName ||
38
+ selectedStep.id === props.dynamicSteps.selectNameFolder
39
+ "
40
+ v-model:name="vmForm.name"
41
+ v-model:location="location"
42
+ :show="
43
+ selectedStep.id === props.dynamicSteps.selectName ||
44
+ selectedStep.id === props.dynamicSteps.selectNameFolder
45
+ "
46
+ :name-form-submit="props.nameFormSubmit"
47
+ :name-request-url="props.nameRequestUrl"
48
+ :validation-description="
49
+ localization.common.enterValidLocationVirtualMachine
50
+ "
51
+ :name-exist-validation-description="
52
+ localization.registerVm.nameAlreadyExistsDescription
53
+ "
54
+ :test-ids="props.nameTestIds"
55
+ :has-location="props.isSphere"
56
+ :location-nodes="localLocationNodes"
57
+ :allowed-location-kinds="props.allowedLocationKinds"
58
+ :location-description="props.locationDescription"
59
+ @submit="emits('change-name', $event)"
60
+ @has-errors="isNameAlertWrapperEmpty = $event"
61
+ />
62
+ </template>
63
+ </ui-wizard-block>
64
+
65
+ <ui-wizard-block
66
+ v-if="
67
+ props.isSphere &&
68
+ selectedStep.id === props.dynamicSteps.selectComputeResource
69
+ "
70
+ :sub-title-height="heightComputeResource"
71
+ >
72
+ <template #subTitle>
73
+ <div ref="computeResource">
74
+ <div class="subtitle-block">
75
+ <ui-alert
76
+ v-if="props.computeResourceAlert.length"
77
+ :messages="props.computeResourceAlert"
78
+ test-id="computed-resource-alert"
79
+ type="error"
80
+ size="md"
81
+ class="subtitle-block__alert mb-4"
82
+ />
83
+ <ui-wizard-subtitle
84
+ :sub-title="
85
+ localization.vmWizard
86
+ .selectDestinationComputeResourceForThisOperation
87
+ "
88
+ />
89
+ </div>
90
+ </div>
91
+ </template>
92
+ <template #content>
93
+ <div class="mt-4 compute-resource-container">
94
+ <common-wizards-common-steps-compute-resource
95
+ v-show="
96
+ selectedStep.id === props.dynamicSteps.selectComputeResource
97
+ "
98
+ v-model="vmForm.computeResource"
99
+ :nodes="props.computeResourceTreeLocal"
100
+ :alert-messages="props.computeResourceAlert"
101
+ :is-loading="props.isLoadingComputeTree"
102
+ :compatibility-text="props.compatibilityText"
103
+ />
104
+ </div>
105
+ </template>
106
+ </ui-wizard-block>
107
+
108
+ <ui-wizard-block
109
+ v-if="selectedStep.id === props.dynamicSteps.readyComplete"
110
+ :sub-title-height="heightReadyComplete"
111
+ >
112
+ <template #subTitle>
113
+ <div ref="subTitleBlockReadyComplete">
114
+ <div class="subtitle-block">
115
+ <ui-wizard-subtitle
116
+ :sub-title="localization.registerVm.lastCreateSubtitle"
117
+ />
118
+ </div>
119
+ </div>
120
+ </template>
121
+ <template #content>
122
+ <div class="register-vm-ready-to-complete-container">
123
+ <common-ready-to-complete
124
+ v-if="selectedStep.id === props.dynamicSteps.readyComplete"
125
+ :data="props.readyCompleteTableInfo"
126
+ />
127
+ </div>
128
+ </template>
129
+ </ui-wizard-block>
130
+ </template>
131
+ </ui-wizard>
132
+ </template>
133
+
134
+ <script setup lang="ts">
135
+ import { useElementSize } from '@vueuse/core'
136
+ import type {
137
+ UI_I_WizardStep,
138
+ UI_I_WizardTexts,
139
+ } from '~/node_modules/bfg-uikit/components/ui/wizard/lib/models/interfaces'
140
+ import Wizard from '~/node_modules/bfg-uikit/components/ui/wizard/lib/utils/utils'
141
+ import { compare } from '~/node_modules/bfg-uikit/lib/utils/compare'
142
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
143
+ import type { UI_T_Project } from '~/lib/models/types'
144
+ import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
145
+ import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
146
+ import type { UI_I_NameTestIds } from '~/components/common/wizards/common/steps/name/lib/models/interfaces'
147
+ import type { UI_T_CompatibilityStatus } from '~/components/common/wizards/common/compatibility/lib/models/types'
148
+
149
+ const vmForm = defineModel<any>({ required: true })
150
+ const location = defineModel<UI_I_TreeNode | null>('location')
151
+
152
+ const props = withDefaults(
153
+ defineProps<{
154
+ project: UI_T_Project
155
+ readyCompleteTableInfo: UI_I_TableInfoItem[]
156
+ nameRequestUrl: string
157
+ wizard: Wizard
158
+ selectedScheme: number[]
159
+ dynamicSteps: any
160
+ nameFormSubmit: null | Function
161
+ nameTestIds: UI_I_NameTestIds
162
+ allowedLocationKinds: number[]
163
+ locationDescription: string
164
+ isSphere: boolean
165
+ computeResourceTreeLocal: UI_I_TreeNode | null
166
+ compatibilityText: [UI_T_CompatibilityStatus, string]
167
+ isLoadingComputeTree?: boolean // для сферы
168
+ computeResourceAlert?: string[] // для сферы
169
+ locationNodes?: UI_I_TreeNode[] // для сферы
170
+ }>(),
171
+ {
172
+ isLoadingComputeTree: false,
173
+ computeResourceAlert: () => [],
174
+ locationNodes: () => [],
175
+ }
176
+ )
177
+
178
+ const emits = defineEmits<{
179
+ (event: 'finish'): void
180
+ (event: 'hide'): void
181
+ (event: 'change-steps', value: UI_I_WizardStep[]): void
182
+ (event: 'change-name', value: [string, UI_I_TreeNode | null]): void
183
+ }>()
184
+
185
+ const localization = computed<UI_I_Localization>(() => useLocal())
186
+
187
+ const texts = computed<UI_I_WizardTexts>(() => ({
188
+ cancel: localization.value.common.cancel,
189
+ back: localization.value.common.backCap,
190
+ processing: localization.value.common.processing,
191
+ next: localization.value.common.next,
192
+ finish: localization.value.registerVm.register,
193
+ incompleteTitle: localization.value.common.incompleteProcess,
194
+ incompleteMessage: localization.value.common.incompleteProcessMessage,
195
+ incompleteCancel: localization.value.common.cancel,
196
+ incompleteLeave: localization.value.common.leave,
197
+ step: localization.value.common.step,
198
+ of: localization.value.common.of2,
199
+ }))
200
+
201
+ const isNameAlertWrapperEmpty = ref<boolean>(false)
202
+
203
+ const subTitleBlockName = ref<HTMLElement | null>(null)
204
+ const { height: heightName } = useElementSize(subTitleBlockName)
205
+
206
+ const computeResource = ref<HTMLElement | null>(null)
207
+ const { height: heightComputeResource } = useElementSize(computeResource)
208
+
209
+ const subTitleBlockReadyComplete = ref<HTMLElement | null>(null)
210
+ const { height: heightReadyComplete } = useElementSize(
211
+ subTitleBlockReadyComplete
212
+ )
213
+
214
+ const currentSubtitleSelectNameBlock = ref<string>(
215
+ props.isSphere
216
+ ? localization.value.vmWizard.specifyUniqueNameAndTargetLocationForVm
217
+ : localization.value.common.specifyUniqueNameForVm
218
+ )
219
+
220
+ const initialCompare = compare(vmForm)
221
+ const hasChanges = computed<boolean>(() => initialCompare.getDiff(vmForm.value))
222
+
223
+ const localLocationNodes = computed<UI_I_TreeNode[]>(() => {
224
+ const copyData = useDeepCopy(props.locationNodes)
225
+ if (copyData[0] && !copyData[0]?.nodes.length) {
226
+ copyData[0].hasNodes = true
227
+ }
228
+
229
+ return copyData
230
+ })
231
+ </script>
232
+
233
+ <style>
234
+ :root {
235
+ --select-name-border-color: #e9ebed;
236
+ }
237
+ :root.dark-theme {
238
+ --select-name-border-color: #e9ebed1f;
239
+ }
240
+ </style>
241
+ <style scoped lang="scss">
242
+ .subtitle-block {
243
+ display: flex;
244
+ flex-direction: column;
245
+ border-bottom: 1px solid var(--wizard-line);
246
+ padding-bottom: 12px;
247
+ }
248
+ :deep(.select-name .tree-view-wrap) {
249
+ border-color: var(--select-name-border-color);
250
+ }
251
+ .compute-resource-container {
252
+ padding-bottom: 16px;
253
+
254
+ :deep(.tree-content) {
255
+ padding: 8px !important;
256
+ }
257
+ :deep(.compatibility-wrap) {
258
+ margin-top: 24px;
259
+ }
260
+ }
261
+ .register-vm-ready-to-complete-container {
262
+ padding-bottom: 16px;
263
+
264
+ :deep(.details-list__col-right) {
265
+ align-items: flex-start;
266
+ }
267
+ :deep(.details-item-value) {
268
+ white-space: normal;
269
+ }
270
+ }
271
+ </style>
@@ -11,12 +11,21 @@
11
11
  @hide="emits('hide')"
12
12
  >
13
13
  <template #content>
14
+ <ui-alert
15
+ v-if="props.errors.length"
16
+ :messages="props.errors.length && !isEmptyName ? props.errors : []"
17
+ test-id="vm-rename-error-alert"
18
+ type="error"
19
+ class="mb-2 mx-8"
20
+ size="md"
21
+ hide-close-button
22
+ />
14
23
  <div class="content">
15
24
  <form @submit.prevent="onRename">
16
25
  <ui-input
17
26
  id="name"
18
27
  v-model="nameLocal"
19
- :error="props.errors[0]"
28
+ :error="props.isEmptyName ? localization.common.fieldRequired : ''"
20
29
  :label="localization.common.name"
21
30
  test-id="rename-vm-name-input"
22
31
  type="text"
@@ -37,6 +46,7 @@ const props = defineProps<{
37
46
  vmName: string
38
47
  isLoading: boolean
39
48
  errors: string[]
49
+ isEmptyName: boolean
40
50
  }>()
41
51
  const emits = defineEmits<{
42
52
  (event: 'hide'): void
@@ -4,6 +4,7 @@
4
4
  :vm-name="props.vmName"
5
5
  :is-loading="isLoading"
6
6
  :errors="errors"
7
+ :is-empty-name="isEmptyName"
7
8
  @hide="onHide"
8
9
  @change-name="onChangeName"
9
10
  @remove-validation-errors="onRemoveValidationErrors"
@@ -64,6 +65,7 @@ const onChangeName = async (name: string): Promise<void> => {
64
65
  onHide()
65
66
  }
66
67
 
68
+ const isEmptyName = ref<boolean>(false)
67
69
  const errors = ref<string[]>([])
68
70
  const showValidationErrors = (data: string[]): void => {
69
71
  errors.value = data
@@ -74,6 +76,8 @@ const onRemoveValidationErrors = (): void => {
74
76
 
75
77
  const onCheckName = async (name: string): Promise<boolean> => {
76
78
  let result = true
79
+ isEmptyName.value = false
80
+ errors.value = []
77
81
 
78
82
  const url = props.nameRequestUrl.replace('{name}', encodeURIComponent(name))
79
83
  const { error } = await useMyFetch<null, API_UI_I_Error>(url, {
@@ -83,9 +87,11 @@ const onCheckName = async (name: string): Promise<boolean> => {
83
87
  const status = error.value?.statusCode || 200
84
88
  switch (status) {
85
89
  case 400: // Empty name
90
+ case 404: // 404 получаем в Сфере
86
91
  showValidationErrors([
87
92
  localization.value.common.emptyNameValidationDescription,
88
93
  ])
94
+ isEmptyName.value = true
89
95
  result = false
90
96
  break
91
97
  case 405: // Invalid kind
@@ -2,6 +2,7 @@ export type UI_T_SnapshotActionType =
2
2
  | 'take'
3
3
  | 'edit'
4
4
  | 'revert'
5
+ | 'revertLast'
5
6
  | 'delete'
6
7
  | 'delete_all'
7
8
  | 'group_take'
@@ -10,7 +10,7 @@
10
10
  @hide-modal="emits('hide')"
11
11
  @confirm="emits('submit')"
12
12
  >
13
- <template v-if="props.type === 'revert'" #otherContent>
13
+ <template v-if="props.type === 'revert' || props.type === 'revertLast'" #otherContent>
14
14
  <div class="confirm-modal-checkbox-content mt-4 p-3">
15
15
  <ui-checkbox
16
16
  v-model="suspendOnRevert"
@@ -79,6 +79,7 @@ const descriptionText = computed<string>(() => {
79
79
  break
80
80
 
81
81
  case 'revert':
82
+ case 'revertLast':
82
83
  description =
83
84
  localization.value.snapshots.revertToSnapshotDescription.replace(
84
85
  '{0}',
@@ -8,7 +8,7 @@
8
8
  @submit="onConfirm"
9
9
  >
10
10
  <template #modalBody>
11
- <div v-if="props.type === 'revert'">
11
+ <div v-if="props.type === 'revert' || props.type === 'revertLast'">
12
12
  <p class="description-text" data-id="description-revert-content">
13
13
  {{ descriptionRevertContent }}
14
14
  </p>
@@ -2,6 +2,7 @@ export enum UI_E_TitleConfirmModal {
2
2
  'take' = '',
3
3
  'edit' = 'edit',
4
4
  'revert' = 'revert',
5
+ 'revertLast' = 'revert',
5
6
  'delete' = 'delete',
6
7
  'delete_all' = 'deleteAll',
7
8
  'group_delete_all' = 'deleteAll',
@@ -12,6 +13,7 @@ export enum UI_E_TitleModal {
12
13
  'take' = '',
13
14
  'edit' = '',
14
15
  'revert' = 'revertToSnapshot',
16
+ 'revertLast' = 'revertLatestSnapshot',
15
17
  'delete' = 'deleteSnapshot',
16
18
  'delete_all' = 'deleteAllSnapshots',
17
19
  'group_delete_all' = 'deleteAllSnapshots',