bfg-common 1.3.216 → 1.3.218

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 (49) hide show
  1. package/assets/localization/local_be.json +2 -1
  2. package/assets/localization/local_en.json +4 -1
  3. package/assets/localization/local_hy.json +2 -1
  4. package/assets/localization/local_kk.json +2 -1
  5. package/assets/localization/local_ru.json +2 -1
  6. package/assets/localization/local_zh.json +2 -1
  7. package/components/atoms/alert/Alert.vue +95 -95
  8. package/components/atoms/alert/Notification.vue +170 -170
  9. package/components/atoms/switch/Switch.vue +111 -111
  10. package/components/atoms/table/compact/Compact.vue +526 -526
  11. package/components/atoms/tooltip/Signpost.vue +225 -225
  12. package/components/common/diagramMain/lib/models/interfaces.ts +6 -11
  13. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +8 -11
  14. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +2 -9
  15. package/components/common/diagramMain/modals/editSettings/tabs/TrafficShaping.vue +6 -139
  16. package/components/common/diagramMain/modals/lib/config/index.ts +0 -4
  17. package/components/common/diagramMain/modals/lib/config/initial.ts +0 -154
  18. package/components/common/diagramMain/modals/lib/config/networkModal.ts +92 -165
  19. package/components/common/pages/Tasks.vue +120 -120
  20. package/components/common/recursionTree/RecursionTree.vue +203 -203
  21. package/components/common/vm/actions/add/Add.vue +575 -575
  22. package/components/common/vm/actions/clone/Clone.vue +518 -518
  23. package/components/common/vm/actions/common/customizeHardware/CustomizeHardware.vue +269 -269
  24. package/components/common/vm/actions/common/customizeHardware/virtualHardware/VirtualHardware.vue +693 -693
  25. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/CpuModel.vue +220 -220
  26. package/components/common/vm/actions/common/customizeHardware/virtualHardware/lib/config/dropdownItems.ts +59 -59
  27. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newNetwork/NewNetwork.vue +294 -294
  28. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newPciDevice/NewPciDevice.vue +165 -165
  29. package/components/common/vm/actions/common/select/storage/lib/config/config.ts +166 -166
  30. package/components/common/vm/actions/editSettings/EditSettings.vue +313 -313
  31. package/components/common/weekSelect/WeekSelect.vue +112 -112
  32. package/components/common/weekSelect/lib/config/options.ts +10 -10
  33. package/components/common/wizards/network/add/Add.vue +17 -1
  34. package/components/common/wizards/network/add/validations/physicalAdapter.ts +70 -0
  35. package/composables/productNameLocal.ts +22 -22
  36. package/composables/useAppVersion.ts +21 -21
  37. package/composables/useEnvLanguage.ts +20 -20
  38. package/lib/utils/sendTask.ts +72 -72
  39. package/minify.js +146 -146
  40. package/package.json +1 -1
  41. package/public/spice-console/application/codec.js +257 -257
  42. package/public/spice-console/lib/rasterEngine.js +907 -907
  43. package/public/spice-console/network/spicechannel.js +369 -369
  44. package/store/main/lib/interfaces.ts +9 -9
  45. package/store/tasks/actions.ts +133 -133
  46. package/store/tasks/getters.ts +25 -25
  47. package/store/tasks/lib/models/interfaces.ts +18 -18
  48. package/store/tasks/mutations.ts +58 -58
  49. package/store/tasks/state.ts +16 -16
@@ -5,6 +5,11 @@ import {
5
5
  UI_I_OverrideValue,
6
6
  UI_I_TeamingAndFailoverTemplate,
7
7
  } from '~/components/common/diagramMain/lib/models/interfaces'
8
+ import {
9
+ UI_E_IYNOption,
10
+ UI_E_IBSTLoadBalancingMode,
11
+ UI_E_ICBLinkDetectionMode,
12
+ } from '~/components/common/diagramMain/lib/models/enums'
8
13
 
9
14
  export const networkViewSettingsModalTabsFunc = (
10
15
  localization: UI_I_Localization
@@ -35,106 +40,30 @@ export const networkViewSettingsFunc = (
35
40
  localization: UI_I_Localization,
36
41
  initialData: UI_I_ModalsInitialData
37
42
  ) => {
38
- const linkDetect: UI_I_OverrideValue = findInitialValue(
39
- initialData.nicTeamingPolicy,
40
- 'link_detect'
41
- )
42
-
43
- const failback: UI_I_OverrideValue = findInitialValue(
44
- initialData.nicTeamingPolicy,
45
- 'failback'
46
- )
47
-
48
- const loadBalancing: UI_I_OverrideValue = findInitialValue(
49
- initialData.nicTeamingPolicy,
50
- 'mode'
51
- )
52
-
53
- const notifySwitches: UI_I_OverrideValue = findInitialValue(
54
- initialData.nicTeamingPolicy,
55
- 'notify_switches'
56
- )
57
-
58
- const promiscuousMode: UI_I_OverrideValue = findInitialValue(
59
- initialData.securityPolicy,
60
- 'promiscuous_mode'
61
- )
62
-
63
- const macAddressChanges: UI_I_OverrideValue = findInitialValue(
64
- initialData.securityPolicy,
65
- 'mac_change'
66
- )
67
-
68
- const forgedTransmits: UI_I_OverrideValue = findInitialValue(
69
- initialData.securityPolicy,
70
- 'forged_transmits'
71
- )
72
-
73
- const promiscuousModeValue: string =
74
- promiscuousMode && promiscuousMode.value
75
- ? promiscuousMode.value === 'yes'
76
- ? localization.accept
77
- : localization.reject
78
- : '--'
43
+ const loadBalancing =
44
+ (
45
+ initialData.nicTeamingPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_IBSTLoadBalancingMode>[]
46
+ )?.find(
47
+ (
48
+ teaming: UI_I_NetworkSummaryPortletListItem<UI_E_IBSTLoadBalancingMode>
49
+ ) => teaming.id === 'mode'
50
+ )?.value || UI_E_IBSTLoadBalancingMode.BACKUP
79
51
 
80
- const macAddressChangesValue: string =
81
- macAddressChanges && macAddressChanges.value
82
- ? macAddressChanges.value === 'yes'
83
- ? localization.accept
84
- : localization.reject
85
- : '--'
52
+ let loadBalancingValue: string
86
53
 
87
- const forgedTransmitsValue: string =
88
- forgedTransmits && forgedTransmits.value
89
- ? forgedTransmits.value === 'yes'
90
- ? localization.accept
91
- : localization.reject
92
- : '--'
93
-
94
- const averageBandwidthValue: string = initialData.shapingPolicy?.[0]
95
- .initialValue.value
96
- ? `${initialData.average_bw} ${localization.kbitS}`
97
- : '--'
98
-
99
- const peakBandwidthValue: string = initialData.shapingPolicy?.[0].initialValue
100
- .value
101
- ? `${initialData.peak_bw} ${localization.kbitS}`
102
- : '--'
103
-
104
- const burstSizeValue: string = initialData.shapingPolicy?.[0].initialValue
105
- .value
106
- ? `${initialData.burst_size} ${localization.kb}`
107
- : '--'
108
-
109
- const loadBalancingValue: string = loadBalancing
110
- ? (loadBalancing.value === 'balance-tcp' &&
111
- localization.routeBasedIpHash) ||
112
- (loadBalancing.value === 'balance-slb' &&
113
- localization.routeBasedSourceMacHash) ||
114
- (loadBalancing.value === 'active-backup' &&
115
- localization.useExplicitFailoverOrder) ||
116
- '--'
117
- : '--'
118
-
119
- const networkFailureDetectionValue: string =
120
- (linkDetect &&
121
- linkDetect.value &&
122
- localization[linkDetect.value.toString()]) ||
123
- '--'
124
-
125
- const notifySwitchesValue: string =
126
- notifySwitches && notifySwitches.value
127
- ? notifySwitches.value === 'yes'
128
- ? localization.yes
129
- : localization.no
130
- : '--'
131
-
132
- const failbackValue: string =
133
- failback && failback.value
134
- ? failback.value === 'yes'
135
- ? localization.yes
136
- : localization.no
137
- : '--'
54
+ switch (loadBalancing) {
55
+ case UI_E_IBSTLoadBalancingMode.BACKUP:
56
+ loadBalancingValue = localization.useExplicitFailoverOrder
57
+ break
58
+ case UI_E_IBSTLoadBalancingMode.SLB:
59
+ loadBalancingValue = localization.routeBasedSourceMacHash
60
+ break
61
+ case UI_E_IBSTLoadBalancingMode.TCP:
62
+ loadBalancingValue = localization.routeBasedIpHash
63
+ break
64
+ default:
65
+ loadBalancingValue = '--'
66
+ }
138
67
 
139
68
  return [
140
69
  {
@@ -159,15 +88,39 @@ export const networkViewSettingsFunc = (
159
88
  rows: [
160
89
  {
161
90
  name: localization.promiscuousMode,
162
- value: promiscuousModeValue,
91
+ value:
92
+ (
93
+ initialData.securityPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>[]
94
+ )?.find(
95
+ (sec: UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>) =>
96
+ sec.id === 'promiscuous_mode'
97
+ )?.initialValue?.value === UI_E_IYNOption.YES
98
+ ? localization.accept
99
+ : localization.reject,
163
100
  },
164
101
  {
165
102
  name: localization.macAddressChanges,
166
- value: macAddressChangesValue,
103
+ value:
104
+ (
105
+ initialData.securityPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>[]
106
+ )?.find(
107
+ (sec: UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>) =>
108
+ sec.id === 'mac_change'
109
+ )?.initialValue?.value === UI_E_IYNOption.YES
110
+ ? localization.accept
111
+ : localization.reject,
167
112
  },
168
113
  {
169
114
  name: localization.forgedTransmits,
170
- value: forgedTransmitsValue,
115
+ value:
116
+ (
117
+ initialData.securityPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>[]
118
+ )?.find(
119
+ (sec: UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>) =>
120
+ sec.id === 'forged_transmits'
121
+ )?.initialValue?.value === UI_E_IYNOption.YES
122
+ ? localization.accept
123
+ : localization.reject,
171
124
  },
172
125
  ],
173
126
  },
@@ -178,15 +131,21 @@ export const networkViewSettingsFunc = (
178
131
  rows: [
179
132
  {
180
133
  name: localization.averageBandwidth,
181
- value: averageBandwidthValue,
134
+ value: initialData.shapingPolicy?.[0].initialValue.value
135
+ ? `${initialData.average_bw} ${localization.kbitS}`
136
+ : '--',
182
137
  },
183
138
  {
184
139
  name: localization.peakBandwidth,
185
- value: peakBandwidthValue,
140
+ value: initialData.shapingPolicy?.[0].initialValue.value
141
+ ? `${initialData.peak_bw} ${localization.kbitS}`
142
+ : '--',
186
143
  },
187
144
  {
188
145
  name: localization.burstSize,
189
- value: burstSizeValue,
146
+ value: initialData.shapingPolicy?.[0].initialValue.value
147
+ ? `${initialData.burst_size} ${localization.kb}`
148
+ : '--',
190
149
  },
191
150
  ],
192
151
  },
@@ -201,15 +160,40 @@ export const networkViewSettingsFunc = (
201
160
  },
202
161
  {
203
162
  name: localization.networkFailureDetection,
204
- value: networkFailureDetectionValue,
163
+ value:
164
+ (
165
+ initialData.nicTeamingPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_ICBLinkDetectionMode>[]
166
+ )?.find(
167
+ (
168
+ teaming: UI_I_NetworkSummaryPortletListItem<UI_E_ICBLinkDetectionMode>
169
+ ) => teaming.id === 'link_detect'
170
+ )?.value === 1
171
+ ? localization.linkStatusOnly
172
+ : localization.beaconProbing,
205
173
  },
206
174
  {
207
175
  name: localization.notifySwitches,
208
- value: notifySwitchesValue,
176
+ value:
177
+ (
178
+ initialData.nicTeamingPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>[]
179
+ )?.find(
180
+ (teaming: UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>) =>
181
+ teaming.id === 'notify_switches'
182
+ )?.value === UI_E_IYNOption.YES
183
+ ? localization.yes
184
+ : localization.no,
209
185
  },
210
186
  {
211
187
  name: localization.failback,
212
- value: failbackValue,
188
+ value:
189
+ (
190
+ initialData.nicTeamingPolicy as UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>[]
191
+ )?.find(
192
+ (teaming: UI_I_NetworkSummaryPortletListItem<UI_E_IYNOption>) =>
193
+ teaming.id === 'failback'
194
+ )?.value === UI_E_IYNOption.YES
195
+ ? localization.yes
196
+ : localization.no,
213
197
  },
214
198
  {
215
199
  name: localization.activeAdapters,
@@ -342,61 +326,4 @@ export const teamingAndFailoverTemplateMakerFunc = (
342
326
  },
343
327
  ],
344
328
  },
345
- ]
346
-
347
- export const teamingAndFailoverNetworkTemplateMakerFunc = (
348
- localization: UI_I_Localization
349
- ): UI_I_TeamingAndFailoverTemplate[] => [
350
- {
351
- key: 'loadBalancing',
352
- options: [
353
- {
354
- value: 'balance-tcp',
355
- text: localization.routeBasedIpHash,
356
- },
357
- {
358
- value: 'balance-slb',
359
- text: localization.routeBasedSourceMacHash,
360
- },
361
- {
362
- value: 'active-backup',
363
- text: localization.useExplicitFailoverOrder,
364
- },
365
- ],
366
- },
367
- {
368
- key: 'networkFailureDetection',
369
- options: [
370
- {
371
- value: 'carier',
372
- text: localization.linkStatusOnly,
373
- },
374
- ],
375
- },
376
- {
377
- key: 'notifySwitches',
378
- options: [
379
- {
380
- value: 'no',
381
- text: localization.no,
382
- },
383
- {
384
- value: 'yes',
385
- text: localization.yes,
386
- },
387
- ],
388
- },
389
- {
390
- key: 'failback',
391
- options: [
392
- {
393
- value: 'no',
394
- text: localization.no,
395
- },
396
- {
397
- value: 'yes',
398
- text: localization.yes,
399
- },
400
- ],
401
- },
402
- ]
329
+ ]
@@ -1,120 +1,120 @@
1
- <template>
2
- <div class="tasks">
3
- <common-headline
4
- :headline="localization.taskConsole"
5
- class="tasks__headline"
6
- />
7
-
8
- <div class="btn-group">
9
- <button
10
- id="task-previous-button"
11
- class="btn btn-sm btn-link nav-link"
12
- :disabled="pagination.page === 1"
13
- @click="onClickButton('previous')"
14
- >
15
- {{ localization.previous }}
16
- </button>
17
-
18
- <button
19
- id="task-next-button"
20
- class="btn btn-sm btn-link nav-link"
21
- :disabled="pagination.page === tasksList?.total_pages"
22
- @click="onClickButton('next')"
23
- >
24
- {{ localization.next }}
25
- </button>
26
- </div>
27
-
28
- <templates-tasks-table-view
29
- :data-table="tasksList?.items || []"
30
- :total-items="tasksList?.total_items || 0"
31
- :total-pages="tasksList?.total_pages || 1"
32
- :pagination="pagination"
33
- :loading="isLoading"
34
- @pagination="onUpdatePagination"
35
- @sort="onSortTable"
36
- />
37
- </div>
38
- </template>
39
-
40
- <script lang="ts" setup>
41
- import type {
42
- UI_I_Localization,
43
- } from '~/lib/models/interfaces'
44
- import type {
45
- UI_I_Pagination,
46
- UI_I_DataTableQuery,
47
- } from '~/lib/models/table/interfaces'
48
- import type { UI_I_Task } from '~/lib/models/store/tasks/interfaces'
49
-
50
- definePageMeta({
51
- middleware: ['auth'],
52
- })
53
-
54
- const localization = computed<UI_I_Localization>(() => useLocal())
55
- const { $store }: any = useNuxtApp()
56
-
57
- const pagination = ref<UI_I_Pagination>({
58
- page: 1,
59
- pageSize: 100,
60
- })
61
- const sort = ref<string | null>(null)
62
-
63
- const tasksList = computed<UI_I_Task>(() => $store.getters['tasks/getTaskList'])
64
-
65
- const onClickButton = (status: string): void => {
66
- if (status === 'next') {
67
- pagination.value.page += 1
68
- return
69
- }
70
-
71
- pagination.value.page -= 1
72
- }
73
-
74
- const getTasks = async (): Promise<void> => {
75
- pauseGlobalRefresh()
76
-
77
- const payload: UI_I_DataTableQuery = {
78
- ...pagination.value,
79
- sortBy: sort.value || '',
80
- }
81
- await $store.dispatch('tasks/A_GET_TASKS', payload)
82
- }
83
-
84
- const onUpdatePagination = (event: UI_I_Pagination): void => {
85
- pagination.value = event
86
- getTasks()
87
- }
88
-
89
- const onSortTable = (event: string): void => {
90
- sort.value = event
91
- getTasks()
92
- }
93
-
94
- const isLoading = computed<boolean>(() =>
95
- $store.getters['tasks/getLoading']('tasks')
96
- )
97
- const pauseGlobalRefresh = (): void => {
98
- const tasksLastRequestType = $store.getters['tasks/getTasksLastRequestType']
99
- $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', tasksLastRequestType)
100
- }
101
- onUnmounted(() => {
102
- pauseGlobalRefresh()
103
- })
104
- </script>
105
-
106
- <style lang="scss">
107
- @import '~/node_modules/bfg-common/assets/scss/common/mixins';
108
- .tasks {
109
- @include flex($dir: column);
110
- height: 100%;
111
- padding-left: 10px;
112
- &__headline {
113
- padding-left: 10px;
114
- margin-bottom: 0.6rem;
115
- }
116
- .btn {
117
- text-transform: uppercase;
118
- }
119
- }
120
- </style>
1
+ <template>
2
+ <div class="tasks">
3
+ <common-headline
4
+ :headline="localization.taskConsole"
5
+ class="tasks__headline"
6
+ />
7
+
8
+ <div class="btn-group">
9
+ <button
10
+ id="task-previous-button"
11
+ class="btn btn-sm btn-link nav-link"
12
+ :disabled="pagination.page === 1"
13
+ @click="onClickButton('previous')"
14
+ >
15
+ {{ localization.previous }}
16
+ </button>
17
+
18
+ <button
19
+ id="task-next-button"
20
+ class="btn btn-sm btn-link nav-link"
21
+ :disabled="pagination.page === tasksList?.total_pages"
22
+ @click="onClickButton('next')"
23
+ >
24
+ {{ localization.next }}
25
+ </button>
26
+ </div>
27
+
28
+ <templates-tasks-table-view
29
+ :data-table="tasksList?.items || []"
30
+ :total-items="tasksList?.total_items || 0"
31
+ :total-pages="tasksList?.total_pages || 1"
32
+ :pagination="pagination"
33
+ :loading="isLoading"
34
+ @pagination="onUpdatePagination"
35
+ @sort="onSortTable"
36
+ />
37
+ </div>
38
+ </template>
39
+
40
+ <script lang="ts" setup>
41
+ import type {
42
+ UI_I_Localization,
43
+ } from '~/lib/models/interfaces'
44
+ import type {
45
+ UI_I_Pagination,
46
+ UI_I_DataTableQuery,
47
+ } from '~/lib/models/table/interfaces'
48
+ import type { UI_I_Task } from '~/lib/models/store/tasks/interfaces'
49
+
50
+ definePageMeta({
51
+ middleware: ['auth'],
52
+ })
53
+
54
+ const localization = computed<UI_I_Localization>(() => useLocal())
55
+ const { $store }: any = useNuxtApp()
56
+
57
+ const pagination = ref<UI_I_Pagination>({
58
+ page: 1,
59
+ pageSize: 100,
60
+ })
61
+ const sort = ref<string | null>(null)
62
+
63
+ const tasksList = computed<UI_I_Task>(() => $store.getters['tasks/getTaskList'])
64
+
65
+ const onClickButton = (status: string): void => {
66
+ if (status === 'next') {
67
+ pagination.value.page += 1
68
+ return
69
+ }
70
+
71
+ pagination.value.page -= 1
72
+ }
73
+
74
+ const getTasks = async (): Promise<void> => {
75
+ pauseGlobalRefresh()
76
+
77
+ const payload: UI_I_DataTableQuery = {
78
+ ...pagination.value,
79
+ sortBy: sort.value || '',
80
+ }
81
+ await $store.dispatch('tasks/A_GET_TASKS', payload)
82
+ }
83
+
84
+ const onUpdatePagination = (event: UI_I_Pagination): void => {
85
+ pagination.value = event
86
+ getTasks()
87
+ }
88
+
89
+ const onSortTable = (event: string): void => {
90
+ sort.value = event
91
+ getTasks()
92
+ }
93
+
94
+ const isLoading = computed<boolean>(() =>
95
+ $store.getters['tasks/getLoading']('tasks')
96
+ )
97
+ const pauseGlobalRefresh = (): void => {
98
+ const tasksLastRequestType = $store.getters['tasks/getTasksLastRequestType']
99
+ $store.dispatch('main/A_PAUSE_GLOBAL_REFRESH', tasksLastRequestType)
100
+ }
101
+ onUnmounted(() => {
102
+ pauseGlobalRefresh()
103
+ })
104
+ </script>
105
+
106
+ <style lang="scss">
107
+ @import '~/node_modules/bfg-common/assets/scss/common/mixins';
108
+ .tasks {
109
+ @include flex($dir: column);
110
+ height: 100%;
111
+ padding-left: 10px;
112
+ &__headline {
113
+ padding-left: 10px;
114
+ margin-bottom: 0.6rem;
115
+ }
116
+ .btn {
117
+ text-transform: uppercase;
118
+ }
119
+ }
120
+ </style>