bfg-common 1.5.752 → 1.5.754

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 (38) hide show
  1. package/assets/localization/local_be.json +17 -13
  2. package/assets/localization/local_en.json +17 -13
  3. package/assets/localization/local_hy.json +16 -12
  4. package/assets/localization/local_kk.json +16 -12
  5. package/assets/localization/local_ru.json +17 -13
  6. package/assets/localization/local_zh.json +17 -13
  7. package/components/common/diagramMain/Header.vue +4 -0
  8. package/components/common/layout/theHeader/feedback/new/email/Email.vue +2 -2
  9. package/components/common/layout/theHeader/userMenu/modals/changePassword/lib/utils.ts +2 -2
  10. package/components/common/pages/backups/backupsNew/BackupsNew.vue +110 -19
  11. package/components/common/pages/backups/backupsNew/Skeleton.vue +112 -0
  12. package/components/common/pages/backups/backupsNew/contextMenuView/ContextMenuView.vue +16 -10
  13. package/components/common/pages/backups/modals/createBackup/configuration/backupWindow/BackupWindow.vue +29 -29
  14. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +69 -69
  15. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  16. package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +38 -38
  17. package/components/common/pages/backups/modals/createBackup/lib/models/interfaces.ts +8 -8
  18. package/components/common/vm/actions/common/customizeHardware/virtualHardware/New.vue +1 -1
  19. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +1 -0
  20. package/components/common/vm/actions/common/customizeHardware/vmoptions/New.vue +2 -2
  21. package/components/common/vm/snapshots/modals/confirm/New.vue +5 -0
  22. package/components/common/vm/snapshots/modals/confirm/lib/models/enums.ts +2 -2
  23. package/components/common/vm/snapshots/modals/takeOrEdit/new/New.vue +23 -7
  24. package/components/common/vm/snapshots/new/New.vue +99 -13
  25. package/components/common/vm/snapshots/new/Skeleton.vue +112 -0
  26. package/components/common/vm/snapshots/new/contextMenuView/ContextMenuView.vue +17 -10
  27. package/components/common/vm/snapshots/new/lib/utils/details.ts +1 -1
  28. package/components/common/wizards/network/add/Add.vue +25 -5
  29. package/components/common/wizards/network/add/lib/config/config.ts +1 -1
  30. package/components/common/wizards/network/add/lib/config/initialData.ts +5 -3
  31. package/components/common/wizards/network/add/lib/config/selectConnectionTypeStep.ts +1 -0
  32. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +2 -1
  33. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceOld.vue +18 -6
  34. package/components/common/wizards/vm/migrate/steps/computeResource/tableView/old/lib/config/hostTable.ts +1 -1
  35. package/components/common/wizards/vm/migrate/steps/selectStorage/configure/disk/table/old/lib/config/diskTable.ts +11 -1
  36. package/lib/config/regExp.ts +1 -1
  37. package/package.json +2 -2
  38. package/plugins/validation.ts +6 -6
@@ -1,12 +1,14 @@
1
1
  <template>
2
+ <common-pages-backups-backups-new-skeleton v-if="props.backupsLoading" />
2
3
  <div
4
+ v-else
3
5
  :class="[
4
6
  'backups-page grid h-inherit p-4 overflow-hidden ',
5
7
  { 'selected gap-3': props.detailData },
6
8
  ]"
7
9
  >
8
- <div class="left-content grid p-4">
9
- <div class="flex justify-between">
10
+ <div class="left-content overflow-auto grid p-4">
11
+ <div class="flex justify-between gap-4 flex-wrap">
10
12
  <h3 class="title-block font-[500] text-[16px]">
11
13
  {{ localization.inventoryTabs.backups }} ({{
12
14
  props.backupsTree.length
@@ -17,10 +19,11 @@
17
19
  v-permission="props.createBackupPermission"
18
20
  test-id="take-backup-btn"
19
21
  size="md"
22
+ class="create-backup-button"
20
23
  @click="emits('set-action', 'createBackup')"
21
24
  >
22
- <ui-icon name="plus" width="20" height="20" class="mr-2" />
23
- {{ localization.common.createBackup }}...
25
+ <ui-icon name="plus" width="20" height="20" class="mr-2 icon" />
26
+ {{ localization.common.createBackup }}
24
27
  </ui-button>
25
28
  </div>
26
29
  <div
@@ -28,16 +31,17 @@
28
31
  class="backups-tree-content overflow-y-auto my-4 px-2 pb-2"
29
32
  >
30
33
  <ui-tree
31
- :is-loading="props.backupsLoading"
32
34
  :nodes="props.backupsTree"
33
35
  @select-node="emits('select-node', $event)"
34
36
  @toggle-node="emits('show-nodes', $event.id)"
35
37
  @show-context-menu="showContextMenu"
36
38
  >
37
39
  <template #content="{ node }">
38
- <div class="flex-align-center">
40
+ <div class="flex-align-center gap-2">
39
41
  <span :class="['node-icon', node.iconClassName]"></span>
40
- <span class="node-name text-ellipsis">{{ node.name }}</span>
42
+ <span class="node-name text-ellipsis text-3">{{
43
+ node.name
44
+ }}</span>
41
45
  </div>
42
46
  </template>
43
47
  </ui-tree>
@@ -52,7 +56,7 @@
52
56
  <p class="title-block font-[400] text-[16px] mt-2">
53
57
  {{ localization.common.noBackupsAvailable }}
54
58
  </p>
55
- <p class="description-block mt-[6px] text-[13px]">
59
+ <p class="description-block mt-[6px] text-[13px] text-center">
56
60
  {{ localization.common.noBackupsAvailableDesc }}
57
61
  </p>
58
62
  </div>
@@ -78,7 +82,7 @@
78
82
  v-if="props.detailData"
79
83
  class="backups-details overflow-hidden flex-direction-column p-4"
80
84
  >
81
- <div class="flex justify-between mb-6">
85
+ <div class="flex justify-between mb-6 gap-4 pr-4 flex-wrap">
82
86
  <h3 class="title-block font-[500] text-[16px]">
83
87
  {{ localization.common.backupDetails }}
84
88
  </h3>
@@ -142,7 +146,13 @@
142
146
  </ui-tooltip>
143
147
  </div>
144
148
  </div>
145
- <div class="grid row-gap-3 overflow-y-auto">
149
+ <div
150
+ ref="detailsScrollBlock"
151
+ :class="[
152
+ 'grid row-gap-3 pr-4 overflow-y-auto details-scroll-block',
153
+ { 'has-scroll': hasScroll },
154
+ ]"
155
+ >
146
156
  <ui-info-block
147
157
  v-for="(item, index) in currentDetailsData"
148
158
  :key="index"
@@ -153,9 +163,12 @@
153
163
  <ui-icon
154
164
  v-if="item.labelIcon"
155
165
  :name="item.labelIcon"
166
+ :class="[
167
+ 'info-label-icon mr-[10px]',
168
+ `icon-name-${item.labelIcon}`,
169
+ ]"
156
170
  width="20"
157
171
  height="20"
158
- class="info-label-icon mr-[10px]"
159
172
  />
160
173
  <span class="info-label">{{ item.label }}</span>
161
174
  </div>
@@ -183,6 +196,7 @@
183
196
  </template>
184
197
 
185
198
  <script setup lang="ts">
199
+ import { useElementSize } from '@vueuse/core'
186
200
  import type { UI_I_InfoBlock } from '~/node_modules/bfg-uikit/components/ui/infoBlock/models/interfaces'
187
201
  import type { UI_I_Localization } from '~/lib/models/interfaces'
188
202
  import type { UI_I_BackupsTreeNode } from '~/components/common/pages/backups/lib/models/interfaces'
@@ -221,6 +235,20 @@ const onSelectContextMenuItem = (actionType: UI_T_BackupActionType): void => {
221
235
  const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
222
236
  constructDetails(localization.value, props.detailData)
223
237
  )
238
+
239
+ const detailsScrollBlock = ref<HTMLElement | null>(null)
240
+ const { height } = useElementSize(detailsScrollBlock)
241
+ const hasScroll = ref<boolean>(false)
242
+ const checkScroll = (): void => {
243
+ const element = detailsScrollBlock.value
244
+ if (element) {
245
+ hasScroll.value = element.scrollHeight > element.clientHeight
246
+ }
247
+ }
248
+
249
+ watch(height, () => {
250
+ checkScroll()
251
+ })
224
252
  </script>
225
253
 
226
254
  <style>
@@ -228,7 +256,9 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
228
256
  --backups-page-inner-block-bg: #ffffff;
229
257
  --backups-page-title-color: #4d5d69;
230
258
  --backups-page-tree-border-color: #e9ebed;
259
+ --backups-page-tree-block-bg-color: #ffffff;
231
260
  --backups-page-details-action-color: #4d5d69;
261
+ --backups-page-details-action-line-color: #e9ebeda3;
232
262
  --backups-page-details-action-hover-color: #213444;
233
263
  --backups-page-info-block-label-color: #4d5d69;
234
264
  --backups-page-info-block-value-color: #182531;
@@ -237,7 +267,9 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
237
267
  --backups-page-inner-block-bg: #334453;
238
268
  --backups-page-title-color: #e9eaec;
239
269
  --backups-page-tree-border-color: #e9ebed1f;
270
+ --backups-page-tree-block-bg-color: #1b2a371f;
240
271
  --backups-page-details-action-color: #e9eaec;
272
+ --backups-page-details-action-line-color: #e9ebed1f;
241
273
  --backups-page-details-action-hover-color: #ffffff;
242
274
  --backups-page-info-block-label-color: #e9eaec;
243
275
  --backups-page-info-block-value-color: #e9eaec;
@@ -253,6 +285,13 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
253
285
  .title-block {
254
286
  color: var(--backups-page-title-color);
255
287
  }
288
+ .create-backup-button {
289
+ white-space: nowrap;
290
+
291
+ .icon {
292
+ min-width: 20px;
293
+ }
294
+ }
256
295
 
257
296
  .left-content {
258
297
  background-color: var(--backups-page-inner-block-bg);
@@ -263,15 +302,24 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
263
302
  .backups-tree-content {
264
303
  border: 1px solid var(--backups-page-tree-border-color);
265
304
  border-radius: 8px;
305
+ background-color: var(--backups-page-tree-block-bg-color);
306
+
307
+ :deep(.tree-container) {
308
+ width: max-content;
309
+ min-width: 100%;
266
310
 
267
- :deep(.tree-content) {
268
- padding-right: 8px;
311
+ .tree-content {
312
+ //padding-right: 8px;
269
313
 
270
- .node-wrapper {
271
- border-radius: 4px;
314
+ .node-wrapper {
315
+ border-radius: 4px;
272
316
 
273
- .node-element {
274
- line-height: 20px;
317
+ .toggle-button-empty {
318
+ display: none;
319
+ }
320
+ .node-element {
321
+ line-height: 20px;
322
+ }
275
323
  }
276
324
  }
277
325
  }
@@ -283,6 +331,10 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
283
331
  }
284
332
  }
285
333
  .delete-all {
334
+ &.disabled {
335
+ color: #bdc3c7;
336
+ }
337
+
286
338
  &:not(.disabled) {
287
339
  color: #ea3223;
288
340
  }
@@ -292,12 +344,18 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
292
344
  background-color: var(--backups-page-inner-block-bg);
293
345
  box-shadow: 0 1px 4px 0 #00000014;
294
346
  border-radius: 8px;
347
+ padding-right: 0;
295
348
 
296
349
  .details-actions-block {
297
350
  .border-line {
298
351
  width: 1px;
299
352
  height: 20px;
300
- background-color: #e9ebeda3;
353
+ background-color: var(--backups-page-details-action-line-color);
354
+ }
355
+ .restore-backups-btn {
356
+ :deep(path) {
357
+ stroke-width: 1.7;
358
+ }
301
359
  }
302
360
  .restore-backups-btn,
303
361
  .edit-backups-btn {
@@ -311,18 +369,38 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
311
369
  color: #ea3223;
312
370
  }
313
371
  }
372
+ .details-scroll-block {
373
+ padding-right: 0;
374
+
375
+ &:not(.has-scroll) {
376
+ padding-right: 16px;
377
+ }
378
+ }
314
379
  .info-block-label-content {
315
380
  .info-label-icon {
316
381
  color: #9da6ad;
317
382
  min-width: 20px;
383
+
384
+ &.icon-name-vsphere-icon-storage-system-refresh {
385
+ :deep(path) {
386
+ stroke-width: 1.4;
387
+ }
388
+ }
318
389
  }
319
390
  .info-label {
320
- margin-top: 2.5px;
391
+ margin-top: 1px;
392
+ line-height: 18px;
321
393
  color: var(--backups-page-info-block-label-color);
322
394
  }
323
395
  }
324
396
  .empty-description {
325
397
  color: #9da6ad;
398
+ margin-top: 1px;
399
+ line-height: 18px;
400
+ text-align: right;
401
+ }
402
+ :deep(.ui-main-info-block-item) {
403
+ grid-column-gap: 10px;
326
404
  }
327
405
  :deep(.ui-main-info-block-item-right) {
328
406
  white-space: unset !important;
@@ -333,12 +411,25 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
333
411
  }
334
412
  :deep(.ui-main-info-block-item-right-value) {
335
413
  color: var(--backups-page-info-block-value-color);
414
+ font-size: 13px;
415
+ font-weight: 400;
416
+ line-height: 18px;
417
+ margin-top: 1px;
336
418
  }
337
419
  :deep(.ui-main-info-block-item-right-open) {
338
420
  display: none;
339
421
  }
340
422
  }
341
423
  }
424
+ :root.dark-theme {
425
+ .left-content {
426
+ .delete-all {
427
+ &.disabled {
428
+ opacity: 0.44;
429
+ }
430
+ }
431
+ }
432
+ }
342
433
 
343
434
  @media (max-width: 1200px) {
344
435
  .backups-page {
@@ -0,0 +1,112 @@
1
+ <template>
2
+ <div class="skeleton-page grid gap-3 p-4 h-inherit overflow-hidden">
3
+ <div class="left-content grid p-4">
4
+ <div class="flex justify-between gap-4 flex-wrap">
5
+ <ui-skeleton-item width="80" height="20" />
6
+ <ui-skeleton-item width="160" height="36" />
7
+ </div>
8
+ <div class="border-block flex flex-col py-3 px-4 my-4">
9
+ <ui-skeleton-item width="100%" height="20" />
10
+ <ui-skeleton-item width="50%" height="20" />
11
+ <ui-skeleton-item width="30%" height="20" />
12
+ <ui-skeleton-item width="70%" height="20" />
13
+ <ui-skeleton-item width="20%" height="20" />
14
+ <ui-skeleton-item width="50%" height="20" />
15
+ <ui-skeleton-item width="80%" height="20" />
16
+ <ui-skeleton-item width="70%" height="20" />
17
+ <ui-skeleton-item width="20%" height="20" />
18
+ </div>
19
+ <ui-skeleton-item width="96" height="20" class="ml-auto" />
20
+ </div>
21
+ <div class="right-content grid p-4">
22
+ <div class="flex justify-between gap-4 flex-wrap top-container">
23
+ <ui-skeleton-item width="80" height="20" />
24
+ <div class="actions-block flex">
25
+ <ui-skeleton-item width="20" height="20" />
26
+ <div class="line-border"></div>
27
+ <ui-skeleton-item width="20" height="20" />
28
+ <div class="line-border"></div>
29
+ <ui-skeleton-item width="20" height="20" />
30
+ </div>
31
+ </div>
32
+ <div class="details-block flex flex-col my-6">
33
+ <div
34
+ v-for="index in detailsItemsCount"
35
+ :key="index"
36
+ class="details-block-item flex p-3"
37
+ >
38
+ <ui-skeleton-item width="20" height="20" class="mr-[10px]" />
39
+ <ui-skeleton-item width="144" height="20" />
40
+ <ui-skeleton-item width="144" height="20" class="ml-auto" />
41
+ </div>
42
+ </div>
43
+ </div>
44
+ </div>
45
+ </template>
46
+
47
+ <script setup lang="ts">
48
+ const detailsItemsCount = ref<number>(3)
49
+ </script>
50
+
51
+ <style>
52
+ :root {
53
+ --backups-left-skeleton-border-color: #e9ebed;
54
+ --backups-right-skeleton-action-line-border-color: #e9ebeda3;
55
+ --backups-right-skeleton-item-bg-color: #e9ebed66;
56
+ }
57
+ :root.dark-theme {
58
+ --backups-left-skeleton-border-color: #e9ebed1f;
59
+ --backups-right-skeleton-action-line-border-color: #e9ebed1f;
60
+ --backups-right-skeleton-item-bg-color: #e9ebed0f;
61
+ }
62
+ </style>
63
+
64
+ <style scoped lang="scss">
65
+ .skeleton-page {
66
+ grid-template-columns: repeat(2, calc(50% - 6px));
67
+
68
+ .left-content,
69
+ .right-content {
70
+ background-color: var(--backups-page-inner-block-bg);
71
+ box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.0784313725);
72
+ border-radius: 8px;
73
+ grid-template-rows: max-content 1fr max-content;
74
+ overflow: hidden;
75
+ }
76
+ .border-block {
77
+ border: 1px solid var(--backups-left-skeleton-border-color);
78
+ border-radius: 8px;
79
+ grid-row-gap: 10px;
80
+ overflow: auto;
81
+
82
+ :deep(.skeleton-item) {
83
+ min-height: 20px;
84
+ }
85
+ }
86
+ .right-content {
87
+ .top-container {
88
+ .actions-block {
89
+ grid-column-gap: 10px;
90
+
91
+ .line-border {
92
+ border: 1px solid
93
+ var(--backups-right-skeleton-action-line-border-color);
94
+ }
95
+ }
96
+ }
97
+ .details-block {
98
+ grid-row-gap: 10px;
99
+ overflow: auto;
100
+
101
+ .details-block-item {
102
+ background-color: var(--backups-right-skeleton-item-bg-color);
103
+ border-radius: 6px;
104
+ }
105
+
106
+ :deep(.skeleton-item) {
107
+ min-height: 20px;
108
+ }
109
+ }
110
+ }
111
+ }
112
+ </style>
@@ -80,20 +80,26 @@ const onSelectContextMenuItem = (item: UI_I_ContextMenuItem): void => {
80
80
 
81
81
  <style scoped lang="scss">
82
82
  .backups-context-menu-view {
83
- :deep(.menu-item) {
84
- .context-icon {
85
- display: none;
86
- }
83
+ :deep(.context-wrap) {
84
+ min-width: 112px;
87
85
 
88
- .item-ui-icon {
89
- margin-right: 8px;
90
- }
86
+ .menu-item {
87
+ .context-icon {
88
+ display: none;
89
+ }
91
90
 
92
- &:last-child {
93
- color: #ea3223;
91
+ .item-ui-icon {
92
+ margin-right: 8px;
93
+ width: 16px;
94
+ height: 16px;
95
+ }
94
96
 
95
- .context-link:hover {
97
+ &:last-child {
96
98
  color: #ea3223;
99
+
100
+ .context-link:hover {
101
+ color: #ea3223;
102
+ }
97
103
  }
98
104
  }
99
105
  }
@@ -1,29 +1,29 @@
1
- <template>
2
- <atoms-stack-block
3
- :has-children="false"
4
- test-id="backup-window-stack-block"
5
- >
6
- <template #stackBlockKey>
7
- <span>{{ localization.common.backupWindow }}</span>
8
- </template>
9
- <template #stackBlockContent>
10
- <input
11
- v-model="model.start_window_min"
12
- data-id="hours-input"
13
- type="number"
14
- class="hrs"
15
- />
16
- </template>
17
- </atoms-stack-block>
18
- </template>
19
-
20
- <script lang="ts" setup>
21
- import type { UI_I_Localization } from '~/lib/models/interfaces'
22
- import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
23
-
24
- const model = defineModel<UI_I_CreateBackupForm>({ required: true })
25
-
26
- const localization = computed<UI_I_Localization>(() => useLocal())
27
- </script>
28
-
29
- <style lang="scss" scoped></style>
1
+ <template>
2
+ <atoms-stack-block
3
+ :has-children="false"
4
+ test-id="backup-window-stack-block"
5
+ >
6
+ <template #stackBlockKey>
7
+ <span>{{ localization.common.backupWindow }}</span>
8
+ </template>
9
+ <template #stackBlockContent>
10
+ <input
11
+ v-model="model.start_window_min"
12
+ data-id="hours-input"
13
+ type="number"
14
+ class="hrs"
15
+ />
16
+ </template>
17
+ </atoms-stack-block>
18
+ </template>
19
+
20
+ <script lang="ts" setup>
21
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
22
+ import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
23
+
24
+ const model = defineModel<UI_I_CreateBackupForm>({ required: true })
25
+
26
+ const localization = computed<UI_I_Localization>(() => useLocal())
27
+ </script>
28
+
29
+ <style lang="scss" scoped></style>
@@ -1,69 +1,69 @@
1
- <template>
2
- <atoms-stack-block
3
- :has-children="false"
4
- test-id="backup-max-bandwidth-stack-block"
5
- >
6
- <template #stackBlockKey>
7
- <span>{{ localization.common.maxBandwidth }}</span>
8
- </template>
9
- <template #stackBlockContent>
10
- <div class="flex-align-center">
11
- <input
12
- v-model="maxBindwidthLocal"
13
- data-id="mbps-input"
14
- type="number"
15
- class="mbps"
16
- />
17
-
18
- <common-select-input
19
- v-model="selectedType"
20
- :data="maxBandwidthOptionsLocal"
21
- test-id="backup-max-bandwidth-type"
22
- class="ml-1"
23
- />
24
- </div>
25
- </template>
26
- </atoms-stack-block>
27
- </template>
28
-
29
- <script lang="ts" setup>
30
- import type { UI_I_Localization } from '~/lib/models/interfaces'
31
- import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
32
- import type { UI_T_BandwidthOption } from '~/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/models/types'
33
- import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
34
- import { maxBandwidthOptions } from '~/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options'
35
-
36
- const model = defineModel<UI_I_CreateBackupForm>({ required: true })
37
-
38
- const localization = computed<UI_I_Localization>(() => useLocal())
39
- const { $binary }: any = useNuxtApp()
40
-
41
- const maxBandwidthOptionsLocal =
42
- ref<UI_I_SelectInputItem[]>(maxBandwidthOptions)
43
-
44
- const maxBindwidthLocal = computed<number>({
45
- get() {
46
- return selectedType.value === 1
47
- ? $binary.bToGb(model.value.bandwidth_limit)
48
- : $binary.bToMb(model.value.bandwidth_limit)
49
- },
50
- set(newValue: number) {
51
- model.value.bandwidth_limit =
52
- selectedType.value === 1
53
- ? $binary.gbToB(newValue)
54
- : $binary.mbToB(newValue)
55
- },
56
- })
57
-
58
- const selectedType = ref<UI_T_BandwidthOption>(0)
59
- watch(selectedType, (newValue) => {
60
- if (newValue === 1) model.value.bandwidth_limit *= 1_024
61
- else model.value.bandwidth_limit /= 1_024
62
- })
63
- </script>
64
-
65
- <style lang="scss" scoped>
66
- #backup-transaction-logs {
67
- margin: 4px 4px 0 0;
68
- }
69
- </style>
1
+ <template>
2
+ <atoms-stack-block
3
+ :has-children="false"
4
+ test-id="backup-max-bandwidth-stack-block"
5
+ >
6
+ <template #stackBlockKey>
7
+ <span>{{ localization.common.maxBandwidth }}</span>
8
+ </template>
9
+ <template #stackBlockContent>
10
+ <div class="flex-align-center">
11
+ <input
12
+ v-model="maxBindwidthLocal"
13
+ data-id="mbps-input"
14
+ type="number"
15
+ class="mbps"
16
+ />
17
+
18
+ <common-select-input
19
+ v-model="selectedType"
20
+ :data="maxBandwidthOptionsLocal"
21
+ test-id="backup-max-bandwidth-type"
22
+ class="ml-1"
23
+ />
24
+ </div>
25
+ </template>
26
+ </atoms-stack-block>
27
+ </template>
28
+
29
+ <script lang="ts" setup>
30
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
31
+ import type { UI_I_CreateBackupForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
32
+ import type { UI_T_BandwidthOption } from '~/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/models/types'
33
+ import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
34
+ import { maxBandwidthOptions } from '~/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options'
35
+
36
+ const model = defineModel<UI_I_CreateBackupForm>({ required: true })
37
+
38
+ const localization = computed<UI_I_Localization>(() => useLocal())
39
+ const { $binary }: any = useNuxtApp()
40
+
41
+ const maxBandwidthOptionsLocal =
42
+ ref<UI_I_SelectInputItem[]>(maxBandwidthOptions)
43
+
44
+ const maxBindwidthLocal = computed<number>({
45
+ get() {
46
+ return selectedType.value === 1
47
+ ? $binary.bToGb(model.value.bandwidth_limit)
48
+ : $binary.bToMb(model.value.bandwidth_limit)
49
+ },
50
+ set(newValue: number) {
51
+ model.value.bandwidth_limit =
52
+ selectedType.value === 1
53
+ ? $binary.gbToB(newValue)
54
+ : $binary.mbToB(newValue)
55
+ },
56
+ })
57
+
58
+ const selectedType = ref<UI_T_BandwidthOption>(0)
59
+ watch(selectedType, (newValue) => {
60
+ if (newValue === 1) model.value.bandwidth_limit *= 1_024
61
+ else model.value.bandwidth_limit /= 1_024
62
+ })
63
+ </script>
64
+
65
+ <style lang="scss" scoped>
66
+ #backup-transaction-logs {
67
+ margin: 4px 4px 0 0;
68
+ }
69
+ </style>
@@ -1,6 +1,6 @@
1
- import type {UI_I_SelectInputItem} from "~/components/common/select/input/lib/models/interfaces";
2
-
3
- export const maxBandwidthOptions: UI_I_SelectInputItem[] = [
4
- { label: 'Mbps', value: 0 },
5
- { label: 'Gbps', value: 1 },
6
- ]
1
+ import type {UI_I_SelectInputItem} from "~/components/common/select/input/lib/models/interfaces";
2
+
3
+ export const maxBandwidthOptions: UI_I_SelectInputItem[] = [
4
+ { label: 'Mbps', value: 0 },
5
+ { label: 'Gbps', value: 1 },
6
+ ]