bfg-common 1.5.442 → 1.5.443

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 (115) hide show
  1. package/assets/localization/local_be.json +9 -3
  2. package/assets/localization/local_en.json +17 -11
  3. package/assets/localization/local_hy.json +9 -3
  4. package/assets/localization/local_kk.json +9 -3
  5. package/assets/localization/local_ru.json +9 -3
  6. package/assets/localization/local_zh.json +9 -3
  7. package/components/atoms/wizard/Wizard.vue +2 -2
  8. package/components/atoms/wizard/step/Step.vue +1 -1
  9. package/components/common/backup/storage/actions/add/Add.vue +5 -5
  10. package/components/common/backup/storage/actions/add/Old.vue +1 -1
  11. package/components/common/backup/storage/actions/add/lib/config/steps.ts +2 -2
  12. package/components/common/backup/storage/actions/add/lib/validations.ts +4 -4
  13. package/components/common/backup/storage/actions/add/steps/name/Name.vue +1 -1
  14. package/components/common/backup/storage/actions/add/steps/name/New.vue +1 -1
  15. package/components/common/backup/storage/actions/add/steps/name/Old.vue +1 -1
  16. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigure.vue +1 -1
  17. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureNew.vue +1 -1
  18. package/components/common/backup/storage/actions/add/steps/nameAndConfigure/NameAndConfigureOld.vue +1 -1
  19. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  20. package/components/common/browse/lib/models/interfaces.ts +5 -5
  21. package/components/common/countdownTimer/CountdownTimer.vue +26 -15
  22. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  23. package/components/common/diagramMain/lib/models/types.ts +21 -21
  24. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  25. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  26. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  27. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  28. package/components/common/diagramMain/modals/migrateVmkernelAdapter/MigrateVmkernelAdapter.vue +5 -5
  29. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +2 -2
  30. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +2 -2
  31. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  32. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +5 -5
  33. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +2 -2
  34. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  35. package/components/common/diagramMain/port/Ports.vue +47 -47
  36. package/components/common/layout/theHeader/modals/{reconnect/Reconnect.vue → Reconnect.vue} +56 -43
  37. package/components/common/pages/backups/modals/Modals.vue +1 -1
  38. package/components/common/pages/backups/modals/createBackup/CreateBackup.vue +5 -2
  39. package/components/common/pages/backups/modals/createBackup/lib/config/steps.ts +2 -2
  40. package/components/common/pages/backups/modals/restore/Restore.vue +3 -3
  41. package/components/common/pages/backups/modals/restore/lib/config/steps.ts +2 -2
  42. package/components/common/vm/actions/add/Add.vue +5 -5
  43. package/components/common/vm/actions/add/New.vue +2 -2
  44. package/components/common/vm/actions/add/Old.vue +2 -2
  45. package/components/common/vm/actions/add/lib/config/steps.ts +2 -2
  46. package/components/common/vm/actions/clone/Clone.vue +5 -5
  47. package/components/common/vm/actions/clone/lib/config/steps.ts +2 -2
  48. package/components/common/vm/actions/clone/toTemplate/ToTemplate.vue +5 -5
  49. package/components/common/vm/actions/clone/toTemplate/lib/config/steps.ts +2 -2
  50. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/maximumSize/MaximumSize.vue +23 -23
  51. package/components/common/vmt/actions/add/Add.vue +5 -5
  52. package/components/common/vmt/actions/add/New.vue +2 -3
  53. package/components/common/vmt/actions/add/Old.vue +2 -2
  54. package/components/common/vmt/actions/add/lib/config/steps.ts +2 -2
  55. package/components/common/wizards/datastore/add/Add.vue +2 -2
  56. package/components/common/wizards/datastore/add/Old.vue +2 -2
  57. package/components/common/wizards/datastore/add/lib/config/steps.ts +2 -2
  58. package/components/common/wizards/datastore/add/lib/utils.ts +1 -1
  59. package/components/common/wizards/datastore/add/lib/validations.ts +3 -3
  60. package/components/common/wizards/datastore/add/steps/_local/Local.vue +1 -1
  61. package/components/common/wizards/datastore/add/steps/_local/createName/CreateName.vue +1 -1
  62. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigure.vue +2 -1
  63. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureNew.vue +1 -1
  64. package/components/common/wizards/datastore/add/steps/nameAndConfigure/NameAndConfigureOld.vue +1 -1
  65. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDevice.vue +1 -1
  66. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceNew.vue +1 -1
  67. package/components/common/wizards/datastore/add/steps/nameAndDevice/NameAndDeviceOld.vue +1 -1
  68. package/components/common/wizards/network/add/Add.vue +109 -333
  69. package/components/common/wizards/network/add/AddNew.vue +514 -0
  70. package/components/common/wizards/network/add/AddOld.vue +457 -0
  71. package/components/common/wizards/network/add/lib/config/config.ts +11 -1
  72. package/components/common/wizards/network/add/lib/config/selectConnectionTypeStep.ts +31 -0
  73. package/components/common/wizards/network/add/lib/config/selectSwitch.ts +217 -0
  74. package/components/common/wizards/network/add/lib/config/steps.ts +5 -5
  75. package/components/common/wizards/network/add/lib/models/interfaces.ts +9 -0
  76. package/components/common/wizards/network/add/steps/ConnectionSettings.vue +2 -2
  77. package/components/common/wizards/network/add/steps/IpFourSettings.vue +2 -2
  78. package/components/common/wizards/network/add/steps/PortProperties.vue +2 -2
  79. package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionType.vue +35 -0
  80. package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionTypeNew.vue +104 -0
  81. package/components/common/wizards/network/add/steps/selectConnectionType/SelectConnectionTypeOld.vue +80 -0
  82. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDevice.vue +183 -0
  83. package/components/common/wizards/network/add/steps/selectTargetDevice/SelectTargetDeviceNew.vue +393 -0
  84. package/components/common/wizards/network/add/steps/{SelectedTargetDevice.vue → selectTargetDevice/SelectTargetDeviceOld.vue} +42 -139
  85. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/Modals.vue +55 -0
  86. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectNetwork.vue +64 -0
  87. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectStandardSwitch.vue +64 -0
  88. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/SelectSwitch.vue +64 -0
  89. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectNetwork.vue +163 -0
  90. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectStandardSwitch.vue +163 -0
  91. package/components/common/wizards/network/add/steps/selectTargetDevice/modals/new/SelectSwitch.vue +163 -0
  92. package/components/common/wizards/network/add/{modals → steps/selectTargetDevice/modals/old}/SelectNetwork.vue +53 -56
  93. package/components/common/wizards/network/add/{modals → steps/selectTargetDevice/modals/old}/SelectStandardSwitch.vue +37 -52
  94. package/components/common/wizards/network/add/{modals → steps/selectTargetDevice/modals/old}/SelectSwitch.vue +38 -42
  95. package/components/common/wizards/network/add/validations/connectionSettings.ts +5 -5
  96. package/components/common/wizards/network/add/validations/createStandardSwitch.ts +4 -4
  97. package/components/common/wizards/network/add/validations/ipFourSettings.ts +5 -5
  98. package/components/common/wizards/network/add/validations/networkValidation.ts +4 -4
  99. package/components/common/wizards/network/add/validations/physicalAdapter.ts +4 -4
  100. package/components/common/wizards/network/add/validations/portProperties.ts +2 -2
  101. package/components/common/wizards/network/add/validations/targetDevice.ts +11 -10
  102. package/components/common/wizards/vm/migrate/Migrate.vue +2 -2
  103. package/components/common/wizards/vm/migrate/lib/config/steps.ts +2 -2
  104. package/components/common/wizards/vm/migrate/lib/validations.ts +3 -3
  105. package/components/common/wizards/vm/migrate/select/targetServer/new/New.vue +1 -1
  106. package/components/common/wizards/vm/migrate/select/targetServer/targetServer.vue +1 -1
  107. package/package.json +2 -2
  108. package/components/atoms/wizard/lib/models/enums.ts +0 -8
  109. package/components/atoms/wizard/lib/models/interfaces.ts +0 -59
  110. package/components/atoms/wizard/lib/utils/utils.ts +0 -954
  111. package/components/common/countdownTimer/CountdownTimerNew.vue +0 -53
  112. package/components/common/countdownTimer/CountdownTimerOld.vue +0 -33
  113. package/components/common/layout/theHeader/modals/reconnect/ReconnectNew.vue +0 -74
  114. package/components/common/layout/theHeader/modals/reconnect/ReconnectOld.vue +0 -67
  115. package/components/common/wizards/network/add/steps/SelectConnectionType.vue +0 -112
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <div class="select-table-modal">
3
+ <ui-modal
4
+ v-if="props.show"
5
+ :title="localization.common.selectNetwork"
6
+ test-id="select-network-modal"
7
+ size="sm"
8
+ width="656px"
9
+ :texts="texts"
10
+ :is-disabled-accept="!selectedRowData?.length"
11
+ @hide="emits('hide')"
12
+ @submit="onSelectNetwork"
13
+ >
14
+ <template #content>
15
+ <div class="table-top-margin-container">
16
+ <ui-data-table
17
+ test-id="data-table-main"
18
+ :data="data"
19
+ :options="tableNetworkOptionsNew"
20
+ size="sm"
21
+ :default-layout="false"
22
+ @select-row="onSelectRow"
23
+ >
24
+ <template #icon="{ item }">
25
+ <span class="row-container">
26
+ <span :class="item.icon"></span>
27
+ <span>{{ item.text }}</span>
28
+ </span>
29
+ </template>
30
+ </ui-data-table>
31
+ <p class="footer-info">
32
+ {{ footerText }}
33
+ </p>
34
+ </div>
35
+ </template>
36
+ <template #footerLeftContent>
37
+ <span></span>
38
+ </template>
39
+ </ui-modal>
40
+ </div>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import type {
45
+ UI_I_DataTable,
46
+ UI_I_DataTableHeader,
47
+ UI_I_DataTableBody,
48
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/lib/models/interfaces'
49
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
50
+ import type {
51
+ UI_I_NetworkForAdding,
52
+ UI_I_SelectedNetwork,
53
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
54
+ import {
55
+ selectNetworkTableHeadNewFunc,
56
+ selectNetworkTableBodyNewFunc,
57
+ tableNetworkOptionsNew,
58
+ } from '~/components/common/wizards/network/add/lib/config/config'
59
+
60
+ const props = defineProps<{
61
+ show: boolean
62
+ data: UI_I_NetworkForAdding[]
63
+ }>()
64
+
65
+ const emits = defineEmits<{
66
+ (event: 'hide'): void
67
+ (event: 'select-network', networkId: string): void
68
+ }>()
69
+
70
+ const localization = computed<UI_I_Localization>(() => useLocal())
71
+
72
+ const texts = computed(() => ({
73
+ button1: localization.value.common.cancel,
74
+ button2: localization.value.common.select,
75
+ }))
76
+
77
+ const selectedRowData = ref<UI_I_SelectedNetwork[]>([])
78
+
79
+ const headItems = computed<UI_I_DataTableHeader[]>(() =>
80
+ selectNetworkTableHeadNewFunc(localization.value)
81
+ )
82
+
83
+ const bodyItems = ref<UI_I_DataTableBody[]>([])
84
+
85
+ watch(
86
+ () => props.data,
87
+ (newValue) => {
88
+ if (!newValue?.length) {
89
+ bodyItems.value = []
90
+ return
91
+ }
92
+
93
+ bodyItems.value = selectNetworkTableBodyNewFunc(newValue)
94
+ },
95
+ { deep: true, immediate: true }
96
+ )
97
+
98
+ const data = computed<UI_I_DataTable>(() => ({
99
+ id: 'select-network-table',
100
+ header: headItems.value,
101
+ body: bodyItems.value,
102
+ }))
103
+
104
+ const footerText = computed<string>(
105
+ () => `${data.value.body.length} ${localization.value.common.networkS}`
106
+ )
107
+
108
+ const onSelectRow = (item: UI_I_DataTableBody[]): void => {
109
+ selectedRowData.value = [
110
+ {
111
+ editable: false,
112
+ id: item[0].data[0].text,
113
+ isEdit: false,
114
+ text: item[0].data[0].text,
115
+ },
116
+ ]
117
+ }
118
+
119
+ const onSelectNetwork = (): void => {
120
+ const selectedNetworkId =
121
+ selectedRowData.value &&
122
+ selectedRowData.value[0] &&
123
+ selectedRowData.value[0].id
124
+
125
+ emits('select-network', selectedNetworkId)
126
+ selectedRowData.value = []
127
+ }
128
+ </script>
129
+
130
+ <style scoped lang="scss">
131
+ :deep(.table-container) {
132
+ padding: 8px 32px !important;
133
+ }
134
+
135
+ .row-container {
136
+ display: flex;
137
+ align-items: center;
138
+ column-gap: 4px;
139
+
140
+ span:first-of-type {
141
+ width: 18px;
142
+ height: 18px;
143
+ }
144
+
145
+ span:last-of-type {
146
+ font-weight: 400;
147
+ font-size: 12px;
148
+ line-height: 16px;
149
+ vertical-align: middle;
150
+ }
151
+ }
152
+
153
+ .footer-info {
154
+ padding-right: 32px;
155
+ padding-bottom: 8px;
156
+ font-weight: 400;
157
+ font-size: 12px;
158
+ line-height: 15px;
159
+ text-align: right;
160
+ vertical-align: middle;
161
+ color: #9da6ad;
162
+ }
163
+ </style>
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <div class="select-table-modal">
3
+ <ui-modal
4
+ v-if="props.show"
5
+ :title="localization.common.selectSwitch"
6
+ test-id="select-standard-switch-modal"
7
+ size="sm"
8
+ width="560px"
9
+ :texts="texts"
10
+ :is-disabled-accept="!selectedRowData?.length"
11
+ @hide="emits('hide')"
12
+ @submit="onSelectSwitch"
13
+ >
14
+ <template #content>
15
+ <div class="table-top-margin-container">
16
+ <ui-data-table
17
+ test-id="data-table-main"
18
+ :data="data"
19
+ :options="tableOptionsNew"
20
+ size="sm"
21
+ :default-layout="false"
22
+ @select-row="onSelectRow"
23
+ >
24
+ <template #icon="{ item }">
25
+ <span class="row-container">
26
+ <span :class="item.icon"></span>
27
+ <span>{{ item.text }}</span>
28
+ </span>
29
+ </template>
30
+ </ui-data-table>
31
+ <p class="footer-info">
32
+ {{ footerText }}
33
+ </p>
34
+ </div>
35
+ </template>
36
+ <template #footerLeftContent>
37
+ <span></span>
38
+ </template>
39
+ </ui-modal>
40
+ </div>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import type {
45
+ UI_I_DataTable,
46
+ UI_I_DataTableHeader,
47
+ UI_I_DataTableBody,
48
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/lib/models/interfaces'
49
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
50
+ import type {
51
+ UI_I_Switch,
52
+ UI_I_SelectedSwitch,
53
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
54
+ import {
55
+ selectStandardSwitchTableHeadNewFunc,
56
+ selectStandardSwitchTableBodyNewFunc,
57
+ tableOptionsNew,
58
+ } from '~/components/common/wizards/network/add/lib/config/config'
59
+
60
+ const props = defineProps<{
61
+ show: boolean
62
+ data: UI_I_Switch[]
63
+ }>()
64
+
65
+ const emits = defineEmits<{
66
+ (event: 'hide'): void
67
+ (event: 'select-standard-switch', switchId: string): void
68
+ }>()
69
+
70
+ const localization = computed<UI_I_Localization>(() => useLocal())
71
+
72
+ const texts = computed(() => ({
73
+ button1: localization.value.common.cancel,
74
+ button2: localization.value.common.select,
75
+ }))
76
+
77
+ const selectedRowData = ref<UI_I_SelectedSwitch[]>([])
78
+
79
+ const headItems = computed<UI_I_DataTableHeader[]>(() =>
80
+ selectStandardSwitchTableHeadNewFunc(localization.value)
81
+ )
82
+
83
+ const bodyItems = ref<UI_I_DataTableBody[]>([])
84
+
85
+ watch(
86
+ () => props.data,
87
+ (newValue) => {
88
+ if (!newValue?.length) {
89
+ bodyItems.value = []
90
+ return
91
+ }
92
+
93
+ bodyItems.value = selectStandardSwitchTableBodyNewFunc(newValue)
94
+ },
95
+ { deep: true, immediate: true }
96
+ )
97
+
98
+ const data = computed<UI_I_DataTable>(() => ({
99
+ id: 'select-standard-switch-table',
100
+ header: headItems.value,
101
+ body: bodyItems.value,
102
+ }))
103
+
104
+ const footerText = computed<string>(
105
+ () => `${data.value.body.length} ${localization.value.common.switchEs}`
106
+ )
107
+
108
+ const onSelectRow = (item: UI_I_DataTableBody[]): void => {
109
+ selectedRowData.value = [
110
+ {
111
+ editable: false,
112
+ id: item[0].data[0].text,
113
+ isEdit: false,
114
+ text: item[0].data[0].text,
115
+ },
116
+ ]
117
+ }
118
+
119
+ const onSelectSwitch = (): void => {
120
+ const selectedSwitchId =
121
+ selectedRowData.value &&
122
+ selectedRowData.value[0] &&
123
+ selectedRowData.value[0].id
124
+
125
+ emits('select-standard-switch', selectedSwitchId)
126
+ selectedRowData.value = []
127
+ }
128
+ </script>
129
+
130
+ <style scoped lang="scss">
131
+ :deep(.table-container) {
132
+ padding: 8px 32px !important;
133
+ }
134
+
135
+ .row-container {
136
+ display: flex;
137
+ align-items: center;
138
+ column-gap: 4px;
139
+
140
+ span:first-of-type {
141
+ width: 18px;
142
+ height: 18px;
143
+ }
144
+
145
+ span:last-of-type {
146
+ font-weight: 400;
147
+ font-size: 12px;
148
+ line-height: 16px;
149
+ vertical-align: middle;
150
+ }
151
+ }
152
+
153
+ .footer-info {
154
+ padding-right: 32px;
155
+ padding-bottom: 8px;
156
+ font-weight: 400;
157
+ font-size: 12px;
158
+ line-height: 15px;
159
+ text-align: right;
160
+ vertical-align: middle;
161
+ color: #9da6ad;
162
+ }
163
+ </style>
@@ -0,0 +1,163 @@
1
+ <template>
2
+ <div class="select-table-modal">
3
+ <ui-modal
4
+ v-if="props.show"
5
+ :title="localization.common.selectSwitch"
6
+ test-id="select-switch-modal"
7
+ size="sm"
8
+ width="560px"
9
+ :texts="texts"
10
+ :is-disabled-accept="!selectedRowData?.length"
11
+ @hide="emits('hide')"
12
+ @submit="onSelectSwitch"
13
+ >
14
+ <template #content>
15
+ <div class="table-top-margin-container">
16
+ <ui-data-table
17
+ test-id="data-table-main"
18
+ :data="data"
19
+ :options="tableOptionsNew"
20
+ size="sm"
21
+ :default-layout="false"
22
+ @select-row="onSelectRow"
23
+ >
24
+ <template #icon="{ item }">
25
+ <span class="row-container">
26
+ <span :class="item.icon"></span>
27
+ <span>{{ item.text }}</span>
28
+ </span>
29
+ </template>
30
+ </ui-data-table>
31
+ <p class="footer-info">
32
+ {{ footerText }}
33
+ </p>
34
+ </div>
35
+ </template>
36
+ <template #footerLeftContent>
37
+ <span></span>
38
+ </template>
39
+ </ui-modal>
40
+ </div>
41
+ </template>
42
+
43
+ <script setup lang="ts">
44
+ import type {
45
+ UI_I_DataTable,
46
+ UI_I_DataTableHeader,
47
+ UI_I_DataTableBody,
48
+ } from '~/node_modules/bfg-uikit/components/ui/dataTable/lib/models/interfaces'
49
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
50
+ import type {
51
+ UI_I_Switch,
52
+ UI_I_SelectedSwitch,
53
+ } from '~/components/common/wizards/network/add/lib/models/interfaces'
54
+ import {
55
+ selectSwitchTableHeadNewFunc,
56
+ selectSwitchTableBodyNewFunc,
57
+ tableOptionsNew,
58
+ } from '~/components/common/wizards/network/add/lib/config/config'
59
+
60
+ const props = defineProps<{
61
+ show: boolean
62
+ data: UI_I_Switch[]
63
+ }>()
64
+
65
+ const emits = defineEmits<{
66
+ (event: 'hide'): void
67
+ (event: 'select-switch', switchId: string): void
68
+ }>()
69
+
70
+ const localization = computed<UI_I_Localization>(() => useLocal())
71
+
72
+ const texts = computed(() => ({
73
+ button1: localization.value.common.cancel,
74
+ button2: localization.value.common.select,
75
+ }))
76
+
77
+ const selectedRowData = ref<UI_I_SelectedSwitch[]>([])
78
+
79
+ const headItems = computed<UI_I_DataTableHeader[]>(() =>
80
+ selectSwitchTableHeadNewFunc(localization.value)
81
+ )
82
+
83
+ const bodyItems = ref<UI_I_DataTableBody[]>([])
84
+
85
+ watch(
86
+ () => props.data,
87
+ (newValue) => {
88
+ if (!newValue?.length) {
89
+ bodyItems.value = []
90
+ return
91
+ }
92
+
93
+ bodyItems.value = selectSwitchTableBodyNewFunc(newValue)
94
+ },
95
+ { deep: true, immediate: true }
96
+ )
97
+
98
+ const data = computed<UI_I_DataTable>(() => ({
99
+ id: 'select-switch-table',
100
+ header: headItems.value,
101
+ body: bodyItems.value,
102
+ }))
103
+
104
+ const footerText = computed<string>(
105
+ () => `${data.value.body.length} ${localization.value.common.switchEs}`
106
+ )
107
+
108
+ const onSelectRow = (item: UI_I_DataTableBody[]): void => {
109
+ selectedRowData.value = [
110
+ {
111
+ editable: false,
112
+ id: item[0].data[0].text,
113
+ isEdit: false,
114
+ text: item[0].data[0].text,
115
+ },
116
+ ]
117
+ }
118
+
119
+ const onSelectSwitch = (): void => {
120
+ const selectedSwitchId =
121
+ selectedRowData.value &&
122
+ selectedRowData.value[0] &&
123
+ selectedRowData.value[0].id
124
+
125
+ emits('select-switch', selectedSwitchId)
126
+ selectedRowData.value = []
127
+ }
128
+ </script>
129
+
130
+ <style scoped lang="scss">
131
+ :deep(.table-container) {
132
+ padding: 8px 32px !important;
133
+ }
134
+
135
+ .row-container {
136
+ display: flex;
137
+ align-items: center;
138
+ column-gap: 4px;
139
+
140
+ span:first-of-type {
141
+ width: 18px;
142
+ height: 18px;
143
+ }
144
+
145
+ span:last-of-type {
146
+ font-weight: 400;
147
+ font-size: 12px;
148
+ line-height: 16px;
149
+ vertical-align: middle;
150
+ }
151
+ }
152
+
153
+ .footer-info {
154
+ padding-right: 32px;
155
+ padding-bottom: 8px;
156
+ font-weight: 400;
157
+ font-size: 12px;
158
+ line-height: 15px;
159
+ text-align: right;
160
+ vertical-align: middle;
161
+ color: #9da6ad;
162
+ }
163
+ </style>
@@ -1,22 +1,19 @@
1
1
  <template>
2
2
  <div class="select-table-modal">
3
3
  <atoms-modal
4
- :width="props.width"
5
- :height="props.height"
4
+ width="576px"
5
+ height="468px"
6
6
  :show="props.show"
7
- :title="props.title"
8
- test-id="select-modal"
9
- @hide="onHideModal"
7
+ :title="localization.common.selectNetwork"
8
+ @hide="emits('hide')"
10
9
  >
11
10
  <template #modalBody>
12
11
  <atoms-alert
13
- v-if="isShowErrorMessageAlert"
14
- :items="[
15
- localization.common.noSwitchIsSelectedSelectSwitchToContinue,
16
- ]"
12
+ v-if="props.isShowAlert"
13
+ :items="[localization.common.noNetworkSelected]"
17
14
  status="alert-danger"
18
15
  test-id="select-network-alert"
19
- @remove="onHideErrorMessageAlert"
16
+ @remove="emits('hide-alert')"
20
17
  />
21
18
  <div class="network-select-dialog-content">
22
19
  <div class="filter-input pull-right flex">
@@ -34,19 +31,28 @@
34
31
  data-id="select-network-filter-input"
35
32
  />
36
33
  </div>
37
- <atoms-table-simple-table
38
- :head-items="headItems"
39
- :body-items="bodyItems"
40
- editable
41
- @select="onSelectRow"
42
- />
34
+ <div
35
+ :class="[
36
+ 'table-top-margin-container',
37
+ {
38
+ 'with-alert': props.isShowAlert,
39
+ },
40
+ ]"
41
+ >
42
+ <atoms-table-simple-table
43
+ :head-items="headItems"
44
+ :body-items="bodyItems"
45
+ editable
46
+ @select="onSelectRow"
47
+ />
48
+ </div>
43
49
  </div>
44
50
  </template>
45
51
  <template #modalFooter>
46
52
  <button
47
53
  data-id="select-network-hide-button"
48
54
  class="btn btn-outline"
49
- @click="onHideModal"
55
+ @click="emits('hide')"
50
56
  >
51
57
  {{ localization.common.cancel }}
52
58
  </button>
@@ -69,38 +75,28 @@ import type {
69
75
  UI_I_NetworkForAdding,
70
76
  UI_I_SelectedNetwork,
71
77
  } from '~/components/common/wizards/network/add/lib/models/interfaces'
72
- import { selectStandardSwitchTableHeadFunc } from '~/components/common/wizards/network/add/lib/config/config'
73
-
74
- const props = withDefaults(
75
- defineProps<{
76
- show: boolean
77
- modalName: string
78
- data: UI_I_NetworkForAdding[]
79
- title?: string
80
- width?: string
81
- height?: string
82
- withCollapse?: boolean
83
- }>(),
84
- {
85
- width: '576px',
86
- height: '420px',
87
- title: '--',
88
- withCollapse: undefined,
89
- }
90
- )
78
+ import { selectNetworkTableHeadFunc } from '~/components/common/wizards/network/add/lib/config/config'
79
+
80
+ const props = defineProps<{
81
+ show: boolean
82
+ data: UI_I_NetworkForAdding[]
83
+ isShowAlert: boolean
84
+ }>()
91
85
 
92
86
  const emits = defineEmits<{
93
87
  (event: 'hide'): void
88
+ (event: 'hide-alert'): void
89
+ (event: 'show-alert'): void
94
90
  (event: 'select-network', networkId: string): void
95
91
  }>()
96
92
 
97
93
  // UI_I_Localization
98
94
  const localization = computed<UI_I_Localization>(() => useLocal())
99
95
 
100
- const selectedRowData = ref<UI_I_SelectedNetwork[]>()
96
+ const selectedRowData = ref<UI_I_SelectedNetwork[]>([])
101
97
  const filter = ref<string>('')
102
98
 
103
- const headItems = selectStandardSwitchTableHeadFunc(localization.value)
99
+ const headItems = selectNetworkTableHeadFunc(localization.value)
104
100
 
105
101
  const bodyItems = computed<UI_I_BodyItems[][]>(() =>
106
102
  props.data.map((networkData: UI_I_NetworkForAdding) => [
@@ -120,14 +116,8 @@ const bodyItems = computed<UI_I_BodyItems[][]>(() =>
120
116
  ])
121
117
  )
122
118
 
123
- const isShowErrorMessageAlert = ref<boolean>(false)
124
- const onHideErrorMessageAlert = (): void => {
125
- selectedRowData.value = []
126
- isShowErrorMessageAlert.value = false
127
- }
128
-
129
- const onSelectRow = (index: number): void => {
130
- selectedRowData.value = bodyItems.value[index]
119
+ const onSelectRow = (_index: number, item: UI_I_SelectedNetwork[]): void => {
120
+ selectedRowData.value = item
131
121
  }
132
122
 
133
123
  const onSelectNetwork = (): void => {
@@ -135,28 +125,35 @@ const onSelectNetwork = (): void => {
135
125
  selectedRowData.value &&
136
126
  selectedRowData.value[0] &&
137
127
  selectedRowData.value[0].id
128
+
129
+ console.log(555, selectedNetworkId)
138
130
  if (!selectedNetworkId) {
139
- isShowErrorMessageAlert.value = true
131
+ emits('show-alert')
140
132
  return
141
133
  }
142
- emits('select-network', selectedNetworkId)
143
- onHideErrorMessageAlert()
144
- emits('hide')
145
- }
146
134
 
147
- const onHideModal = (): void => {
148
- onHideErrorMessageAlert()
149
- emits('hide')
135
+ emits('select-network', selectedNetworkId)
136
+ selectedRowData.value = []
150
137
  }
151
138
  </script>
152
139
 
153
140
  <style scoped lang="scss">
154
141
  .network-select-dialog-content {
155
- min-height: 264px;
142
+ min-height: 260px;
156
143
  margin-top: 10px;
157
144
 
158
145
  .table-wrap {
159
- height: 272px;
146
+ height: 264px;
147
+ }
148
+
149
+ .with-alert {
150
+ :deep(.table-wrap) {
151
+ height: 226px;
152
+ }
153
+ }
154
+
155
+ .table-top-margin-container {
156
+ margin-top: 8px;
160
157
  }
161
158
 
162
159
  .pull-right {