bfg-common 1.6.9 → 1.6.11

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.
@@ -3492,7 +3492,8 @@
3492
3492
  "takeSnapshot": "Зрабіце здымак",
3493
3493
  "newSnapshot": "Новы здымак",
3494
3494
  "editSnapshot": "Рэдагаваць здымак",
3495
- "revertLatestSnapshot": "Вярнуцца да апошняга здымка"
3495
+ "revertLatestSnapshot": "Вярнуцца да апошняга здымка",
3496
+ "consolidateSnapshots": "Кансолідаваць здымкі"
3496
3497
  },
3497
3498
  "importVms": {
3498
3499
  "selectSourceTooltipDesc": "Правы карыстальніка esxi павінны адпавядаць ролях Administrator, крэдыт прымаюцца ад esxi і vSphere",
@@ -3496,7 +3496,8 @@
3496
3496
  "takeSnapshot": "Take Snapshot",
3497
3497
  "newSnapshot": "New Snapshot",
3498
3498
  "editSnapshot": "Edit snapshot",
3499
- "revertLatestSnapshot": "Revert to Latest Snapshot"
3499
+ "revertLatestSnapshot": "Revert to Latest Snapshot",
3500
+ "consolidateSnapshots": "Consolidate Snapshots"
3500
3501
  },
3501
3502
  "importVms": {
3502
3503
  "selectSourceTooltipDesc": "No Trusted infrastructure Administrator, credits are accepted from esxi and vSphere",
@@ -3496,7 +3496,8 @@
3496
3496
  "takeSnapshot": "Ակնթարթ նկար",
3497
3497
  "newSnapshot": "Նոր սքրինշոթ",
3498
3498
  "editSnapshot": "Խմբագրել սքրինշոթը",
3499
- "revertLatestSnapshot": "Վերադառնալ վերջին նկարին"
3499
+ "revertLatestSnapshot": "Վերադառնալ վերջին նկարին",
3500
+ "consolidateSnapshots": "Միավորել լուսանկարները"
3500
3501
  },
3501
3502
  "importVms": {
3502
3503
  "selectSourceTooltipDesc": "Esxi օգտագործողի իրավունքները պետք է համապատասխանեն Administrator-ի դերերին, կրեդիտներն ընդունվում են esxi-ից և vSphere-ից",
@@ -3495,7 +3495,8 @@
3495
3495
  "takeSnapshot": "сурет",
3496
3496
  "newSnapshot": "Жаңа снимок",
3497
3497
  "editSnapshot": "Снимокты өңдеу",
3498
- "revertLatestSnapshot": "Варнузза және түтіннің тұманы"
3498
+ "revertLatestSnapshot": "Варнузза және түтіннің тұманы",
3499
+ "consolidateSnapshots": "Суреттерді біріктіру"
3499
3500
  },
3500
3501
  "importVms": {
3501
3502
  "selectSourceTooltipDesc": "Esxi пайдаланушы құқықтары әкімші рөлдеріне сәйкес келуі керек, несиелер esxi және vSphere - ден алынады",
@@ -3495,7 +3495,8 @@
3495
3495
  "takeSnapshot": "Сделать снимок",
3496
3496
  "newSnapshot": "Новый снимок",
3497
3497
  "editSnapshot": "Редактировать снимок",
3498
- "revertLatestSnapshot": "Вернуться к последнему снимку"
3498
+ "revertLatestSnapshot": "Вернуться к последнему снимку",
3499
+ "consolidateSnapshots": "Консолидация снимков"
3499
3500
  },
3500
3501
  "importVms": {
3501
3502
  "selectSourceTooltipDesc": "Права пользователя vmware дожны соответствовать ролям Administrator, креды принимаются от esxi и vSphere",
@@ -4087,7 +4088,7 @@
4087
4088
  "makeSureSelectHeartbeatDatastoreSeeDetails": "Убедитесь, что выбрали datastore для heartbeat, чтобы увидеть подробности."
4088
4089
  },
4089
4090
  "registerVm": {
4090
- "register": "Зарегистрироваться",
4091
+ "register": "Зарегистрировать",
4091
4092
  "lastCreateSubtitle": "Проверьте данные перед регистрацией виртуальной машины.",
4092
4093
  "registerVmSelectFile": "Зарегистрировать ВМ — Выбор файла",
4093
4094
  "nameAlreadyExistsDescription": "Запись с таким именем уже существует."
@@ -3493,7 +3493,8 @@
3493
3493
  "takeSnapshot": "快照",
3494
3494
  "newSnapshot": "新快照",
3495
3495
  "editSnapshot": "编辑快照",
3496
- "revertLatestSnapshot": "回到上一张照片"
3496
+ "revertLatestSnapshot": "回到上一张照片",
3497
+ "consolidateSnapshots": "合并快照"
3497
3498
  },
3498
3499
  "importVms": {
3499
3500
  "selectSourceTooltipDesc": "Esxi用户权限必须对应于管理员角色. esxi和vSphere接受积分",
@@ -1,6 +1,6 @@
1
1
  <template>
2
2
  <common-modals-confirmation
3
- :headline="localization.common.consolidateConfirmation"
3
+ :headline="localization.snapshots.consolidateSnapshots"
4
4
  :description="localization.common.consolidateConfirmationDesc"
5
5
  :modal-texts="modalTexts"
6
6
  @hide-modal="emits('hide-modal')"
@@ -1,7 +1,7 @@
1
1
  <template>
2
2
  <common-modals-confirmation
3
- :headline="localization.common.consolidate"
4
- :description="localization.common.consolidateConfirmationDescOld"
3
+ :headline="localization.snapshots.consolidateSnapshots"
4
+ :description="localization.common.consolidateConfirmationDesc"
5
5
  @hide-modal="emits('hide-modal')"
6
6
  @confirm="emits('confirm')"
7
7
  />
@@ -21,12 +21,14 @@
21
21
  :sub-title-height="heightName"
22
22
  >
23
23
  <template #subTitle>
24
- <div ref="subTitleBlockName" class="subtitle-block">
25
- <div
26
- id="name-alert-wrapper"
27
- :class="[{ 'mb-4': !isNameAlertWrapperEmpty }]"
28
- ></div>
29
- <ui-wizard-subtitle :sub-title="currentSubtitleSelectNameBlock" />
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>
30
32
  </div>
31
33
  </template>
32
34
  <template #content>
@@ -51,7 +53,7 @@
51
53
  "
52
54
  :test-ids="props.nameTestIds"
53
55
  :has-location="props.isSphere"
54
- :location-nodes="props.locationNodes"
56
+ :location-nodes="localLocationNodes"
55
57
  :allowed-location-kinds="props.allowedLocationKinds"
56
58
  :location-description="props.locationDescription"
57
59
  @submit="emits('change-name', $event)"
@@ -68,21 +70,23 @@
68
70
  :sub-title-height="heightComputeResource"
69
71
  >
70
72
  <template #subTitle>
71
- <div ref="computeResource" class="subtitle-block">
72
- <ui-alert
73
- v-if="props.computeResourceAlert.length"
74
- :messages="props.computeResourceAlert"
75
- test-id="computed-resource-alert"
76
- type="error"
77
- size="md"
78
- class="subtitle-block__alert mb-4"
79
- />
80
- <ui-wizard-subtitle
81
- :sub-title="
82
- localization.vmWizard
83
- .selectDestinationComputeResourceForThisOperation
84
- "
85
- />
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>
86
90
  </div>
87
91
  </template>
88
92
  <template #content>
@@ -115,10 +119,12 @@
115
119
  </div>
116
120
  </template>
117
121
  <template #content>
118
- <common-ready-to-complete
119
- v-if="selectedStep.id === props.dynamicSteps.readyComplete"
120
- :data="props.readyCompleteTableInfo"
121
- />
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>
122
128
  </template>
123
129
  </ui-wizard-block>
124
130
  </template>
@@ -213,6 +219,15 @@ const currentSubtitleSelectNameBlock = ref<string>(
213
219
 
214
220
  const initialCompare = compare(vmForm)
215
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
+ })
216
231
  </script>
217
232
 
218
233
  <style>
@@ -234,10 +249,23 @@ const hasChanges = computed<boolean>(() => initialCompare.getDiff(vmForm.value))
234
249
  border-color: var(--select-name-border-color);
235
250
  }
236
251
  .compute-resource-container {
237
- padding-bottom: 40px;
252
+ padding-bottom: 16px;
238
253
 
254
+ :deep(.tree-content) {
255
+ padding: 8px !important;
256
+ }
239
257
  :deep(.compatibility-wrap) {
240
258
  margin-top: 24px;
241
259
  }
242
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
+ }
243
271
  </style>
@@ -72,7 +72,7 @@ export const stepsFunc = (
72
72
  {
73
73
  id: dynamicSteps.readyComplete,
74
74
  stepName: '',
75
- title: localization.vmWizard.readyComplete,
75
+ title: localization.common.readyComplete,
76
76
  subTitle: localization.vmWizard.lastCreateSubtitle,
77
77
  status: UI_E_WIZARD_STATUS.INACTIVE,
78
78
  isValid: true,
@@ -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',
@@ -18,6 +18,7 @@ export const modalTexts = (
18
18
  groupTake: localization.common.create,
19
19
  edit: localization.common.save,
20
20
  revert: localization.common.revert,
21
+ revertLast: localization.common.revert,
21
22
  delete: localization.common.delete,
22
23
  delete_all: localization.common.deleteAll,
23
24
  group_delete_all: localization.common.deleteAll,
@@ -16,7 +16,7 @@
16
16
 
17
17
  <div class="name-field">
18
18
  <div class="flex-1 flex-align-center">
19
- <ui-skeleton-item v-if="isLoading" width="112px" height="20px"/>
19
+ <ui-skeleton-item v-if="isLoading" width="112px" height="20px" />
20
20
  <label v-else :for="`${props.testIds.name}-name`" class="name-label">{{
21
21
  localization.common.name
22
22
  }}</label>
@@ -33,33 +33,42 @@
33
33
  </div>
34
34
 
35
35
  <div class="flex-2">
36
- <ui-skeleton-item v-if="isLoading" width="480px" height="36px" border-radius="8px"/>
36
+ <ui-skeleton-item
37
+ v-if="isLoading"
38
+ width="480px"
39
+ height="36px"
40
+ border-radius="8px"
41
+ />
37
42
 
38
43
  <!-- ToDo при возможности придумать способ выделить тултип в компонент инпута-->
39
44
  <ui-tooltip
40
- v-else
41
- id="vm-name-tooltip"
42
- test-id="vm-name-tooltip"
43
- size="md"
44
- width="240"
45
- position="bottom"
46
- show-type="variant-1"
47
- timing="500"
45
+ v-else
46
+ id="vm-name-tooltip"
47
+ test-id="vm-name-tooltip"
48
+ size="md"
49
+ width="240"
50
+ position="bottom"
51
+ show-type="variant-1"
52
+ timing="500"
48
53
  >
49
54
  <template #target>
50
55
  <ui-input
51
- v-model="name"
52
- id="vm-name-tooltip"
53
- :placeholder="`${localization.common.name} (${localization.common.optional})`"
54
- type="text"
55
- maxlength="54"
56
- :error="props.nameErrorText"
57
- :test-id="props.testIds.name"
58
- :disabled="props.isDisabledField"
56
+ v-model="name"
57
+ id="vm-name-tooltip"
58
+ :placeholder="`${localization.common.name} (${localization.common.optional})`"
59
+ type="text"
60
+ maxlength="54"
61
+ :error="props.nameErrorText"
62
+ :test-id="props.testIds.name"
63
+ :disabled="props.isDisabledField"
59
64
  />
60
65
  </template>
61
- <template v-if="props.errors.length" #content >
62
- <p v-for="(error, index) in props.errors" :key="index" class="name-tooltip-text">
66
+ <template v-if="props.errors.length" #content>
67
+ <p
68
+ v-for="(error, index) in props.errors"
69
+ :key="index"
70
+ class="name-tooltip-text"
71
+ >
63
72
  {{ error }}
64
73
  </p>
65
74
  </template>
@@ -70,11 +79,19 @@
70
79
  <template v-if="props.hasLocation">
71
80
  <div class="location">
72
81
  <div class="flex-1">
73
- <span v-if="location" class="location-label">{{ localization.common.location }}</span>
74
- <ui-skeleton-item v-else width="144px" height="20px"/>
82
+ <span v-if="location" class="location-label">{{
83
+ localization.common.location
84
+ }}</span>
85
+ <ui-skeleton-item v-else width="144px" height="20px" />
75
86
  </div>
76
87
 
77
- <div v-if="location" :class="['selected-location flex-2', { disabled: props.isDisabledField }]">
88
+ <div
89
+ v-if="location"
90
+ :class="[
91
+ 'selected-location flex-2',
92
+ { disabled: props.isDisabledField },
93
+ ]"
94
+ >
78
95
  <span :class="['node-icon', location.iconClassName]" />
79
96
  <span :class="['text', isShowAlert && 'error']">
80
97
  {{ location.name }}
@@ -82,10 +99,10 @@
82
99
  </div>
83
100
  <ui-skeleton-item v-else width="160px" height="20px" />
84
101
  </div>
85
- <div :class="['tree-view-wrap', { 'disabled': props.isDisabledField }]">
102
+ <div :class="['tree-view-wrap', { disabled: props.isDisabledField }]">
86
103
  <common-wizards-common-steps-name-location
87
- v-model:location="location"
88
- :nodes="props.locationNodes"
104
+ v-model:location="location"
105
+ :nodes="props.locationNodes"
89
106
  />
90
107
  </div>
91
108
  </template>
@@ -123,7 +140,7 @@ const isShowAlert = computed<boolean>(() =>
123
140
  const isLoading = ref(true)
124
141
 
125
142
  onMounted(() => {
126
- setTimeout(() => isLoading.value = false, 0)
143
+ setTimeout(() => (isLoading.value = false), 0)
127
144
  })
128
145
  </script>
129
146
 
@@ -134,9 +151,10 @@ onMounted(() => {
134
151
  --select-name-help-icon-active-color: #008fd6;
135
152
  --select-name-help-hide-icon-color: #213444;
136
153
  --select-name-border-color: #e9ebeda3;
154
+ --select-wizard-step-name-top-border-color: #e9ebeda3;
137
155
  --select-name-location-node-color: #182531;
138
156
  --select-name-location-bg-color: #ffffff;
139
- --select-name-tooltip-bg: #EA3223E0;
157
+ --select-name-tooltip-bg: #ea3223e0;
140
158
  }
141
159
  :root.dark-theme {
142
160
  --select-name-text-color: #e9eaec;
@@ -144,9 +162,10 @@ onMounted(() => {
144
162
  --select-name-help-icon-active-color: #2ba2de;
145
163
  --select-name-help-hide-icon-color: #e9eaec;
146
164
  --select-name-border-color: #e9ebed1f;
165
+ --select-wizard-step-name-top-border-color: #e9ebed1f;
147
166
  --select-name-location-node-color: #e9eaec;
148
167
  --select-name-location-bg-color: #1b2a371f;
149
- --select-name-tooltip-bg: #EA3223B8;
168
+ --select-name-tooltip-bg: #ea3223b8;
150
169
  }
151
170
  </style>
152
171
  <style scoped lang="scss">
@@ -170,7 +189,7 @@ onMounted(() => {
170
189
 
171
190
  .name-tooltip-text {
172
191
  font-size: 12px;
173
- color: #E9EAEC;
192
+ color: #e9eaec;
174
193
  }
175
194
 
176
195
  .name-label {
@@ -200,7 +219,7 @@ onMounted(() => {
200
219
  display: flex;
201
220
  margin-top: 16px;
202
221
  padding: 22px 0;
203
- border-top: 1px solid var(--select-name-border-color);
222
+ border-top: 1px solid var(--select-wizard-step-name-top-border-color);
204
223
  column-gap: 16px;
205
224
  align-items: flex-start;
206
225
 
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.6.9",
4
+ "version": "1.6.11",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",