bfg-common 1.5.759 → 1.5.761

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 (34) hide show
  1. package/assets/localization/local_be.json +13 -3
  2. package/assets/localization/local_en.json +13 -3
  3. package/assets/localization/local_hy.json +13 -3
  4. package/assets/localization/local_kk.json +13 -3
  5. package/assets/localization/local_ru.json +13 -3
  6. package/assets/localization/local_zh.json +14 -4
  7. package/components/common/layout/theHeader/New.vue +2 -0
  8. package/components/common/layout/theHeader/Old.vue +2 -0
  9. package/components/common/layout/theHeader/TheHeader.vue +2 -0
  10. package/components/common/layout/theHeader/modals/reconnect/New.vue +1 -1
  11. package/components/common/layout/theHeader/modals/reconnect/Reconnect.vue +3 -1
  12. package/components/common/layout/theHeader/userMenu/UserMenu.vue +2 -0
  13. package/components/common/layout/theHeader/userMenu/modals/preferences/New.vue +2 -0
  14. package/components/common/layout/theHeader/userMenu/modals/preferences/Old.vue +2 -0
  15. package/components/common/layout/theHeader/userMenu/modals/preferences/Preferences.vue +2 -0
  16. package/components/common/layout/theHeader/userMenu/modals/preferences/view/New.vue +17 -0
  17. package/components/common/layout/theHeader/userMenu/modals/preferences/view/Old.vue +19 -0
  18. package/components/common/layout/theHeader/userMenu/modals/preferences/view/View.vue +3 -0
  19. package/components/common/pages/backups/backupsNew/BackupsNew.vue +107 -19
  20. package/components/common/pages/backups/backupsNew/Skeleton.vue +136 -0
  21. package/components/common/pages/backups/backupsNew/contextMenuView/ContextMenuView.vue +16 -10
  22. package/components/common/pages/backups/modals/createBackup/configuration/backupWindow/BackupWindow.vue +29 -29
  23. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/MaxBandwidth.vue +69 -69
  24. package/components/common/pages/backups/modals/createBackup/configuration/maxBandwidth/lib/config/options.ts +6 -6
  25. package/components/common/pages/backups/modals/createBackup/configuration/strategy/Strategy.vue +38 -38
  26. package/components/common/pages/backups/modals/createBackup/datastores/tableView/new/lib/config/table.ts +1 -1
  27. package/components/common/pages/backups/modals/createBackup/lib/config/strategyOptions.ts +8 -11
  28. package/components/common/pages/backups/modals/createBackup/lib/models/interfaces.ts +8 -8
  29. package/components/common/vm/snapshots/new/New.vue +11 -12
  30. package/components/common/vm/snapshots/new/Skeleton.vue +26 -2
  31. package/components/common/wizards/network/add/Add.vue +9 -6
  32. package/components/common/wizards/network/add/lib/config/initialData.ts +2 -1
  33. package/lib/models/interfaces.ts +1 -0
  34. package/package.json +1 -1
@@ -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,8 @@
183
196
  </template>
184
197
 
185
198
  <script setup lang="ts">
199
+ import { useTemplateRef } from 'vue'
200
+ import { useElementSize } from '@vueuse/core'
186
201
  import type { UI_I_InfoBlock } from '~/node_modules/bfg-uikit/components/ui/infoBlock/models/interfaces'
187
202
  import type { UI_I_Localization } from '~/lib/models/interfaces'
188
203
  import type { UI_I_BackupsTreeNode } from '~/components/common/pages/backups/lib/models/interfaces'
@@ -221,6 +236,15 @@ const onSelectContextMenuItem = (actionType: UI_T_BackupActionType): void => {
221
236
  const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
222
237
  constructDetails(localization.value, props.detailData)
223
238
  )
239
+
240
+ const detailsElement = useTemplateRef<HTMLDivElement>('detailsScrollBlock')
241
+ const { height } = useElementSize(detailsElement)
242
+
243
+ const hasScroll = computed<boolean>(
244
+ () =>
245
+ height.value &&
246
+ detailsElement.value?.scrollHeight > detailsElement.value?.clientHeight
247
+ )
224
248
  </script>
225
249
 
226
250
  <style>
@@ -228,7 +252,9 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
228
252
  --backups-page-inner-block-bg: #ffffff;
229
253
  --backups-page-title-color: #4d5d69;
230
254
  --backups-page-tree-border-color: #e9ebed;
255
+ --backups-page-tree-block-bg-color: #ffffff;
231
256
  --backups-page-details-action-color: #4d5d69;
257
+ --backups-page-details-action-line-color: #e9ebeda3;
232
258
  --backups-page-details-action-hover-color: #213444;
233
259
  --backups-page-info-block-label-color: #4d5d69;
234
260
  --backups-page-info-block-value-color: #182531;
@@ -237,7 +263,9 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
237
263
  --backups-page-inner-block-bg: #334453;
238
264
  --backups-page-title-color: #e9eaec;
239
265
  --backups-page-tree-border-color: #e9ebed1f;
266
+ --backups-page-tree-block-bg-color: #1b2a371f;
240
267
  --backups-page-details-action-color: #e9eaec;
268
+ --backups-page-details-action-line-color: #e9ebed1f;
241
269
  --backups-page-details-action-hover-color: #ffffff;
242
270
  --backups-page-info-block-label-color: #e9eaec;
243
271
  --backups-page-info-block-value-color: #e9eaec;
@@ -253,6 +281,13 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
253
281
  .title-block {
254
282
  color: var(--backups-page-title-color);
255
283
  }
284
+ .create-backup-button {
285
+ white-space: nowrap;
286
+
287
+ .icon {
288
+ min-width: 20px;
289
+ }
290
+ }
256
291
 
257
292
  .left-content {
258
293
  background-color: var(--backups-page-inner-block-bg);
@@ -263,15 +298,24 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
263
298
  .backups-tree-content {
264
299
  border: 1px solid var(--backups-page-tree-border-color);
265
300
  border-radius: 8px;
301
+ background-color: var(--backups-page-tree-block-bg-color);
266
302
 
267
- :deep(.tree-content) {
268
- padding-right: 8px;
303
+ :deep(.tree-container) {
304
+ width: max-content;
305
+ min-width: 100%;
269
306
 
270
- .node-wrapper {
271
- border-radius: 4px;
307
+ .tree-content {
308
+ //padding-right: 8px;
272
309
 
273
- .node-element {
274
- line-height: 20px;
310
+ .node-wrapper {
311
+ border-radius: 4px;
312
+
313
+ .toggle-button-empty {
314
+ display: none;
315
+ }
316
+ .node-element {
317
+ line-height: 20px;
318
+ }
275
319
  }
276
320
  }
277
321
  }
@@ -283,6 +327,10 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
283
327
  }
284
328
  }
285
329
  .delete-all {
330
+ &.disabled {
331
+ color: #bdc3c7;
332
+ }
333
+
286
334
  &:not(.disabled) {
287
335
  color: #ea3223;
288
336
  }
@@ -292,12 +340,18 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
292
340
  background-color: var(--backups-page-inner-block-bg);
293
341
  box-shadow: 0 1px 4px 0 #00000014;
294
342
  border-radius: 8px;
343
+ padding-right: 0;
295
344
 
296
345
  .details-actions-block {
297
346
  .border-line {
298
347
  width: 1px;
299
348
  height: 20px;
300
- background-color: #e9ebeda3;
349
+ background-color: var(--backups-page-details-action-line-color);
350
+ }
351
+ .restore-backups-btn {
352
+ :deep(path) {
353
+ stroke-width: 1.7;
354
+ }
301
355
  }
302
356
  .restore-backups-btn,
303
357
  .edit-backups-btn {
@@ -311,18 +365,38 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
311
365
  color: #ea3223;
312
366
  }
313
367
  }
368
+ .details-scroll-block {
369
+ padding-right: 0;
370
+
371
+ &:not(.has-scroll) {
372
+ padding-right: 16px;
373
+ }
374
+ }
314
375
  .info-block-label-content {
315
376
  .info-label-icon {
316
377
  color: #9da6ad;
317
378
  min-width: 20px;
379
+
380
+ &.icon-name-vsphere-icon-storage-system-refresh {
381
+ :deep(path) {
382
+ stroke-width: 1.4;
383
+ }
384
+ }
318
385
  }
319
386
  .info-label {
320
- margin-top: 2.5px;
387
+ margin-top: 1px;
388
+ line-height: 18px;
321
389
  color: var(--backups-page-info-block-label-color);
322
390
  }
323
391
  }
324
392
  .empty-description {
325
393
  color: #9da6ad;
394
+ margin-top: 1px;
395
+ line-height: 18px;
396
+ text-align: right;
397
+ }
398
+ :deep(.ui-main-info-block-item) {
399
+ grid-column-gap: 10px;
326
400
  }
327
401
  :deep(.ui-main-info-block-item-right) {
328
402
  white-space: unset !important;
@@ -333,12 +407,25 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
333
407
  }
334
408
  :deep(.ui-main-info-block-item-right-value) {
335
409
  color: var(--backups-page-info-block-value-color);
410
+ font-size: 13px;
411
+ font-weight: 400;
412
+ line-height: 18px;
413
+ margin-top: 1px;
336
414
  }
337
415
  :deep(.ui-main-info-block-item-right-open) {
338
416
  display: none;
339
417
  }
340
418
  }
341
419
  }
420
+ :root.dark-theme {
421
+ .left-content {
422
+ .delete-all {
423
+ &.disabled {
424
+ opacity: 0.44;
425
+ }
426
+ }
427
+ }
428
+ }
342
429
 
343
430
  @media (max-width: 1200px) {
344
431
  .backups-page {
@@ -346,6 +433,7 @@ const currentDetailsData = computed<UI_I_InfoBlock[]>(() =>
346
433
 
347
434
  &.selected {
348
435
  grid-template-columns: 1fr;
436
+ grid-template-rows: minmax(189px, 1fr) 1fr;
349
437
  }
350
438
 
351
439
  .backups-details {
@@ -0,0 +1,136 @@
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 pr-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
33
+ ref="detailsScrollBlock"
34
+ :class="[
35
+ 'details-block flex flex-col my-6',
36
+ { 'has-scroll': hasScroll },
37
+ ]"
38
+ >
39
+ <div
40
+ v-for="index in detailsItemsCount"
41
+ :key="index"
42
+ class="details-block-item flex p-3"
43
+ >
44
+ <ui-skeleton-item width="20" height="20" class="mr-[10px]" />
45
+ <ui-skeleton-item width="144" height="20" />
46
+ <ui-skeleton-item width="144" height="20" class="ml-auto" />
47
+ </div>
48
+ </div>
49
+ </div>
50
+ </div>
51
+ </template>
52
+
53
+ <script setup lang="ts">
54
+ import { useTemplateRef } from 'vue'
55
+ import { useElementSize } from '@vueuse/core'
56
+
57
+ const detailsItemsCount = ref<number>(3)
58
+
59
+ const detailsElement = useTemplateRef<HTMLDivElement>('detailsScrollBlock')
60
+ const { height } = useElementSize(detailsElement)
61
+
62
+ const hasScroll = computed<boolean>(
63
+ () =>
64
+ height.value &&
65
+ detailsElement.value?.scrollHeight > detailsElement.value?.clientHeight
66
+ )
67
+ </script>
68
+
69
+ <style>
70
+ :root {
71
+ --backups-left-skeleton-border-color: #e9ebed;
72
+ --backups-right-skeleton-action-line-border-color: #e9ebeda3;
73
+ --backups-right-skeleton-item-bg-color: #e9ebed66;
74
+ }
75
+ :root.dark-theme {
76
+ --backups-left-skeleton-border-color: #e9ebed1f;
77
+ --backups-right-skeleton-action-line-border-color: #e9ebed1f;
78
+ --backups-right-skeleton-item-bg-color: #e9ebed0f;
79
+ }
80
+ </style>
81
+
82
+ <style scoped lang="scss">
83
+ .skeleton-page {
84
+ grid-template-columns: repeat(2, calc(50% - 6px));
85
+
86
+ .left-content,
87
+ .right-content {
88
+ background-color: var(--backups-page-inner-block-bg);
89
+ box-shadow: 0 1px 4px 0 rgba(0, 0, 0, 0.0784313725);
90
+ border-radius: 8px;
91
+ grid-template-rows: max-content 1fr max-content;
92
+ overflow: hidden;
93
+ }
94
+ .border-block {
95
+ border: 1px solid var(--backups-left-skeleton-border-color);
96
+ border-radius: 8px;
97
+ grid-row-gap: 10px;
98
+ overflow: auto;
99
+
100
+ :deep(.skeleton-item) {
101
+ min-height: 20px;
102
+ }
103
+ }
104
+ .right-content {
105
+ padding-right: 0;
106
+
107
+ .top-container {
108
+ .actions-block {
109
+ grid-column-gap: 10px;
110
+
111
+ .line-border {
112
+ border: 1px solid
113
+ var(--backups-right-skeleton-action-line-border-color);
114
+ }
115
+ }
116
+ }
117
+ .details-block {
118
+ grid-row-gap: 10px;
119
+ overflow: auto;
120
+
121
+ &:not(.has-scroll) {
122
+ padding-right: 16px;
123
+ }
124
+
125
+ .details-block-item {
126
+ background-color: var(--backups-right-skeleton-item-bg-color);
127
+ border-radius: 6px;
128
+ }
129
+
130
+ :deep(.skeleton-item) {
131
+ min-height: 20px;
132
+ }
133
+ }
134
+ }
135
+ }
136
+ </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
+ ]