bfg-common 1.5.218 → 1.5.220

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 (55) hide show
  1. package/components/common/backup/storage/actions/add/Add.vue +1 -16
  2. package/components/common/backup/storage/actions/add/temp/Add.vue +34 -53
  3. package/components/common/backup/storage/actions/add/temp/lib/config/stepItems.ts +13 -46
  4. package/components/common/backup/storage/actions/add/temp/lib/utils.ts +5 -6
  5. package/components/common/backup/storage/actions/add/temp/local/Local.vue +31 -49
  6. package/components/common/backup/storage/actions/add/temp/local/createName/CreateName.vue +3 -5
  7. package/components/common/backup/storage/actions/add/temp/nfs/Nfs.vue +5 -5
  8. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/models/types.ts +2 -2
  9. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +27 -1
  10. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/tableKeys.ts +2 -2
  11. package/components/common/backup/storage/actions/add/temp/nfs/configuration/Configuration.vue +4 -4
  12. package/components/common/backup/storage/actions/add/temp/readyComplete/ReadyComplete.vue +1 -1
  13. package/components/common/backup/storage/actions/add/temp/readyComplete/lib/config/propertiesDetails.ts +7 -33
  14. package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/types.ts +2 -2
  15. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/tableKeys.ts +2 -2
  16. package/components/common/backup/storage/actions/add/temp/samba/configuration/Configuration.vue +1 -1
  17. package/components/common/backup/storage/actions/add/temp/sharedStorm/SharedStorm.vue +21 -47
  18. package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/CreateName.vue +156 -0
  19. package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/lib/config/defaultForm.ts +15 -0
  20. package/components/common/backup/storage/actions/add/temp/types/Types.vue +2 -3
  21. package/components/common/backup/storage/actions/add/temp/types/lib/config/typeOptions.ts +15 -25
  22. package/components/common/browse/blocks/lib/models/types.ts +1 -1
  23. package/components/common/browse/lib/models/interfaces.ts +5 -5
  24. package/components/common/diagramMain/adapter/AdapterItems.vue +61 -61
  25. package/components/common/diagramMain/lib/config/initial.ts +50 -50
  26. package/components/common/diagramMain/lib/models/types.ts +21 -21
  27. package/components/common/diagramMain/lib/utils/utils.ts +331 -331
  28. package/components/common/diagramMain/modals/editSettings/ConfirmTeamingSettingsModal.vue +40 -40
  29. package/components/common/diagramMain/modals/editSettings/tabs/NetworkProperties.vue +214 -214
  30. package/components/common/diagramMain/modals/editSettings/tabs/Security.vue +189 -189
  31. package/components/common/diagramMain/modals/editSettings/tabs/SwitchProperties.vue +163 -163
  32. package/components/common/diagramMain/modals/editSettings/tabs/TeamingFailover.vue +175 -175
  33. package/components/common/diagramMain/modals/editSettings/tabs/port/IpvFourSettings.vue +346 -346
  34. package/components/common/diagramMain/modals/lib/config/initial.ts +180 -180
  35. package/components/common/diagramMain/modals/lib/config/vmKernelAdapter.ts +90 -90
  36. package/components/common/diagramMain/modals/lib/mappers/mappers.ts +87 -87
  37. package/components/common/diagramMain/modals/lib/utils/index.ts +24 -24
  38. package/components/common/diagramMain/modals/migrateVmkernelAdapter/lib/config/steps.ts +114 -114
  39. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/ConnectionSettings.vue +169 -169
  40. package/components/common/diagramMain/modals/migrateVmkernelAdapter/steps/SelectVmkernelAdapter.vue +159 -159
  41. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/common.ts +14 -14
  42. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/connectionSettings.ts +137 -137
  43. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/selectVmkernelAdapter.ts +52 -52
  44. package/components/common/diagramMain/modals/migrateVmkernelAdapter/validations/validations.ts +19 -19
  45. package/components/common/diagramMain/port/Ports.vue +47 -47
  46. package/package.json +2 -2
  47. package/components/common/backup/storage/actions/add/temp/local/accessibility/Accessibility.vue +0 -104
  48. package/components/common/backup/storage/actions/add/temp/local/accessibility/lib/config/tabsPannel.ts +0 -25
  49. package/components/common/backup/storage/actions/add/temp/local/accessibility/lib/models/interfaces.ts +0 -9
  50. package/components/common/backup/storage/actions/add/temp/local/accessibility/lib/models/types.ts +0 -5
  51. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/TablesView.vue +0 -141
  52. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/compatibleTable.ts +0 -62
  53. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/hostsTableItems.ts +0 -27
  54. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/incompatibleTable.ts +0 -68
  55. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/tableKeys.ts +0 -15
@@ -7,7 +7,7 @@
7
7
  <common-details-item :has-children="true" open-by-default>
8
8
  <template #stackBlockKey>
9
9
  <span class="list__labels">{{
10
- item.label
10
+ localization.common.chosenDatastoreName
11
11
  }}</span>
12
12
  </template>
13
13
 
@@ -72,8 +72,7 @@ const localDetailsFunc = (
72
72
  items: [
73
73
  {
74
74
  label: localization.common.datastoreName,
75
- // value: isSphereWizard ? event.name : event,
76
- value: event.name || event,
75
+ value: isSphereWizard ? event.name : event,
77
76
  items: [],
78
77
  },
79
78
  ],
@@ -82,18 +81,10 @@ const localDetailsFunc = (
82
81
  ]
83
82
 
84
83
  if (isSphereWizard) {
85
- data.push({
86
- label: localization.common.hostsAccessibility,
87
- value: '',
88
- items: [
89
- {
90
- label: localization.common.hosts,
91
- value: '',
92
- data: event.hosts,
93
- items: [],
94
- },
95
- ],
96
- actions: [],
84
+ data[0].items.push({
85
+ label: localization.common.host,
86
+ value: event.host,
87
+ items: [],
97
88
  })
98
89
  }
99
90
  return data
@@ -102,9 +93,8 @@ const localDetailsFunc = (
102
93
  const sharedStormDetailsFunc = (
103
94
  localization: UI_I_Localization,
104
95
  event: any | string,
105
- isSphereWizard: boolean
106
96
  ): UI_I_DetailsItem[] => {
107
- const details: UI_I_DetailsItem[] = [
97
+ return [
108
98
  {
109
99
  label: localization.common.selectName,
110
100
  value: '',
@@ -122,7 +112,7 @@ const sharedStormDetailsFunc = (
122
112
  value: '',
123
113
  items: [
124
114
  {
125
- label: localization.datastoreWizard.storageName,
115
+ label: localization.common.storageName,
126
116
  value: event.storm_name,
127
117
  items: [],
128
118
  },
@@ -130,22 +120,6 @@ const sharedStormDetailsFunc = (
130
120
  actions: [],
131
121
  },
132
122
  ]
133
- if (isSphereWizard) {
134
- details.push({
135
- label: localization.common.hostsAccessibility,
136
- value: '',
137
- items: [
138
- {
139
- label: localization.common.hosts,
140
- value: '',
141
- data: event.hosts,
142
- items: [],
143
- },
144
- ],
145
- actions: [],
146
- })
147
- }
148
- return details
149
123
  }
150
124
 
151
125
  export const constructDataReadyViewFunc = <T>(
@@ -1,5 +1,5 @@
1
1
  export type T_HostsAccessibilityTab = 'compatible-hosts' | 'incompatible-hosts'
2
2
 
3
- export type T_CompatibleHostsTableKeys = 'name' | 'cluster'
3
+ export type T_CompatibleHostsTableKeys = 'host' | 'cluster'
4
4
 
5
- export type T_IncompatibleHostsTableKeys = 'name' | 'cluster' | 'host_incompatibility_reason'
5
+ export type T_IncompatibleHostsTableKeys = 'host' | 'cluster' | 'host_incompatibility_reason'
@@ -4,12 +4,12 @@ import type {
4
4
  } from '~/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/types'
5
5
 
6
6
  export const compatibleHostsTableKeys: T_CompatibleHostsTableKeys[] = [
7
- 'name',
7
+ 'host',
8
8
  'cluster',
9
9
  ]
10
10
 
11
11
  export const incompatibleHostsTableKeys: T_IncompatibleHostsTableKeys[] = [
12
- 'name',
12
+ 'host',
13
13
  'cluster',
14
14
  'host_incompatibility_reason',
15
15
  ]
@@ -350,7 +350,7 @@ const accessMode = ref<boolean>(false)
350
350
  // // if (nfsVersion === 'nfs-4.1') server.value = ''
351
351
  // }
352
352
 
353
- const alertInfo = ref<boolean>(true)
353
+ const alertInfo = ref<boolean>(props.mode === 'procurator')
354
354
 
355
355
  const resetValidation = (): void => {
356
356
  isInitNameValidation.value =
@@ -1,20 +1,12 @@
1
1
  <template>
2
2
  <div class="shared-storm-step h-full">
3
3
  <!-- TODO move to common-->
4
- <!-- <common-backup-storage-actions-add-temp-local-create-name-->
5
- <!-- v-show="props.stepPosition === 1"-->
6
- <!-- :local-create-name-submit="props.createNameSubmit"-->
7
- <!-- test-id="shared-storm"-->
8
- <!-- @loading="(e) => emits('loading', e)"-->
9
- <!-- @submit="onChangeName"-->
10
- <!-- />-->
11
4
  <common-backup-storage-actions-add-temp-local-create-name
12
5
  v-show="props.stepPosition === 1"
13
- :mode="props.mode"
14
6
  :local-create-name-submit="props.createNameSubmit"
15
7
  test-id="shared-storm"
16
8
  @loading="(e) => emits('loading', e)"
17
- @submit="onChangeName($event)"
9
+ @submit="onChangeName"
18
10
  />
19
11
 
20
12
  <common-backup-storage-actions-add-temp-shared-storm-storage
@@ -25,62 +17,47 @@
25
17
  :storage-submit="storageSubmitLocal"
26
18
  @change="onChangeStorage"
27
19
  />
28
-
29
- <templates-inventory-actions-backup-storage-add-temp-nfs-accessibility
30
- v-if="mode === 'sphere' && props.stepPosition === 3"
31
- :host-accessibility-submit="props.hostAccessibilitySubmit"
32
- :hosts="props.hosts"
33
- @next="onChangeAccessibilityAndNext"
34
- />
35
20
  </div>
36
21
  </template>
37
22
 
38
23
  <script lang="ts" setup>
39
24
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
40
25
  import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
41
- import type { UI_T_Project } from '~/lib/models/types'
42
26
  import type { I_SharedStormData } from '~/components/common/backup/storage/actions/add/temp/lib/models/interfaces'
43
27
 
44
28
  const props = defineProps<{
45
- mode: UI_T_Project
46
- hosts: any
47
29
  stepPosition: number
48
30
  createNameSubmit: number
49
31
  storageSubmit: number
50
- hostAccessibilitySubmit: number
51
- datastore: UI_I_DatastoreTableItem[]
52
- getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
53
32
  }>()
54
33
  const emits = defineEmits<{
55
34
  (event: 'loading', value: boolean): void
56
35
  (event: 'submit', value: I_SharedStormData): void
57
36
  }>()
58
37
 
59
- // const { $store }: any = useNuxtApp()
38
+ const { $store } = useNuxtApp()
60
39
 
61
40
  const storage = ref<UI_I_DatastoreTableItem | null>(null)
62
41
  const onChangeStorage = (data: UI_I_DatastoreTableItem | null): void => {
63
42
  storage.value = data
64
43
  }
65
- // const datastore = computed<UI_I_DatastoreTableItem[]>(
66
- // () => $store.getters['storage/getDatastoreTable'] || []
67
- // )
68
- // const getDatastoreTableFunc = async (
69
- // payload: UI_I_TablePayload
70
- // ): Promise<void> => {
71
- // await $store.dispatch('storage/A_GET_DATASTORE_TABLE', payload)
72
- // }
73
-
74
- const sendData: any = {
75
- name: '',
76
- storm_id: '',
77
- storm_name: '',
78
- hosts: []
44
+ const datastore = computed<UI_I_DatastoreTableItem[]>(
45
+ () => $store.getters['storage/getDatastoreTable'] || []
46
+ )
47
+ const getDatastoreTableFunc = async (
48
+ payload: UI_I_TablePayload
49
+ ): Promise<void> => {
50
+ await $store.dispatch('storage/A_GET_DATASTORE_TABLE', payload)
79
51
  }
80
52
 
53
+ const storageName = ref<string>('')
81
54
  const onChangeName = (name: string): void => {
82
- sendData.name = name
83
- emits('submit', sendData)
55
+ storageName.value = name
56
+ emits('submit', {
57
+ name: storageName.value,
58
+ storm_id: storage.value?.id,
59
+ storm_name: storage.value?.name,
60
+ })
84
61
  }
85
62
 
86
63
  const storageSubmitLocal = ref<Function | null>(null)
@@ -89,18 +66,15 @@ watch(
89
66
  () => {
90
67
  storageSubmitLocal.value = (isValid: boolean): void => {
91
68
  if (isValid) {
92
- sendData.storm_id = storage.value?.id
93
- sendData.storm_name = storage.value?.name
94
- emits('submit', sendData)
69
+ emits('submit', {
70
+ name: storageName.value,
71
+ storm_id: storage.value?.id,
72
+ storm_name: storage.value?.name,
73
+ })
95
74
  }
96
75
  }
97
76
  }
98
77
  )
99
-
100
- const onChangeAccessibilityAndNext = (hosts: string[]): void => {
101
- sendData.hosts = hosts
102
- emits('submit', sendData)
103
- }
104
78
  </script>
105
79
 
106
80
  <style lang="scss" scoped></style>
@@ -0,0 +1,156 @@
1
+ <template>
2
+ <div class="create-datastore-name">
3
+ <atoms-alert
4
+ v-show="errors.length"
5
+ test-id="datastore-creat-name"
6
+ status="alert-danger"
7
+ :items="errors"
8
+ @remove="onRemoveValidationErrors"
9
+ />
10
+
11
+ <div class="clr-form-control clr-row flex flex-row">
12
+ <label for="datastore-name" class="clr-control-label clr-col-md-2">{{
13
+ localization.common.datastoreName
14
+ }}</label>
15
+
16
+ <div class="clr-control-container" :class="nameErrorText && 'clr-error'">
17
+ <div class="flex-align-center">
18
+ <input
19
+ id="datastore-name"
20
+ v-model.trim="form.name.value"
21
+ data-id="shared-storm-backup-storage-name-input"
22
+ type="text"
23
+ class="clr-input"
24
+ @blur="onBlurInputName"
25
+ @input="onInputName"
26
+ />
27
+ <atoms-the-icon class="error-icon" name="info-circle" />
28
+ </div>
29
+
30
+ <div class="clr-subtext ng-star-inserted">
31
+ {{ nameErrorText }}
32
+ </div>
33
+ </div>
34
+ </div>
35
+ </div>
36
+ </template>
37
+
38
+ <script lang="ts" setup>
39
+ // TODO refactoring
40
+ import type { UI_I_ValidationTouchResult } from '~/lib/models/plugins/validation/interfaces'
41
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
42
+ import { defaultFormFunc } from '~/components/common/backup/storage/actions/add/temp/local/createName/lib/config/defaultForm'
43
+ import { checkValidityName } from '~/components/common/backup/storage/actions/add/temp/lib/utils'
44
+
45
+ const props = defineProps<{
46
+ localCreateNameSubmit: number
47
+ }>()
48
+ const emits = defineEmits<{
49
+ (event: 'loading', value: boolean): void
50
+ (event: 'submit', value: string): void
51
+ }>()
52
+
53
+ const localization = computed<UI_I_Localization>(() => useLocal())
54
+ const { $validation } = useNuxtApp()
55
+
56
+ const validation = $validation.call({})
57
+ const defaultForm: any = defaultFormFunc(localization.value)
58
+ const form = ref<any>(useDeepCopy(defaultForm))
59
+
60
+ const setForm = (): void => {
61
+ form.value = useDeepCopy(defaultForm)
62
+ validation.setForm(form)
63
+ }
64
+ setForm()
65
+
66
+ const validForm = ref<UI_I_ValidationTouchResult | null>(null)
67
+
68
+ /* Validation for Name input */
69
+ const isInitNameValidation = ref<boolean>(false)
70
+ const onBlurInputName = (): void => {
71
+ validForm.value = validation.touch()
72
+ isInitNameValidation.value = true
73
+ }
74
+ const onInputName = (): void => {
75
+ validForm.value = validation.touch()
76
+ }
77
+ const nameErrorText = computed<string>(() => {
78
+ if (!isInitNameValidation.value) return ''
79
+ return validForm.value?.errors?.name?.[0] || ''
80
+ })
81
+ /* Validation Name input end */
82
+
83
+ const errors = ref<string[]>([])
84
+ const showValidationErrors = (data: string[]): void => {
85
+ errors.value = data
86
+ }
87
+ const onRemoveValidationErrors = (): void => {
88
+ errors.value = []
89
+ }
90
+ const submit = async (): Promise<void> => {
91
+ const name = form.value.name.value
92
+
93
+ if (!name) {
94
+ validForm.value = validation.touch()
95
+ isInitNameValidation.value = true
96
+ if (nameErrorText.value) return
97
+ }
98
+
99
+ if (name) {
100
+ emits('loading', true)
101
+
102
+ const { valid, msg } = await checkValidityName(name)
103
+
104
+ emits('loading', false)
105
+
106
+ if (!valid) {
107
+ showValidationErrors([msg])
108
+ return
109
+ }
110
+ }
111
+
112
+ onRemoveValidationErrors()
113
+ emits('submit', name)
114
+ }
115
+ watch(
116
+ () => props.localCreateNameSubmit,
117
+ () => {
118
+ submit()
119
+ }
120
+ )
121
+ </script>
122
+
123
+ <style lang="scss" scoped>
124
+ .create-datastore-name {
125
+ &__alert-info {
126
+ :deep(.alert-text) {
127
+ font-size: 11px;
128
+ letter-spacing: normal;
129
+ }
130
+ }
131
+ .clr-form-control {
132
+
133
+ .clr-control-container {
134
+ min-height: 48px;
135
+ input {
136
+ width: 375px;
137
+ }
138
+ &.clr-error {
139
+ .clr-subtext,
140
+ .error-icon {
141
+ display: block;
142
+ }
143
+ }
144
+ .clr-subtext,
145
+ .error-icon {
146
+ display: none;
147
+ }
148
+ .error-icon {
149
+ fill: #db2100;
150
+ width: 24px;
151
+ height: 24px;
152
+ }
153
+ }
154
+ }
155
+ }
156
+ </style>
@@ -0,0 +1,15 @@
1
+ import type { UI_I_Localization } from '~/lib/models/interfaces'
2
+
3
+ export const defaultFormFunc = (localization: UI_I_Localization): any => {
4
+ return {
5
+ name: {
6
+ value: '',
7
+ validations: [
8
+ {
9
+ value: 'required',
10
+ errorText: localization.common.specifyDatastoreName,
11
+ },
12
+ ],
13
+ },
14
+ }
15
+ }
@@ -40,7 +40,7 @@ import type {
40
40
  import { datastoreTypesFunc } from '~/components/common/backup/storage/actions/add/temp/types/lib/config/typeOptions'
41
41
 
42
42
  const props = defineProps<{
43
- // project: UI_T_Project
43
+ project: UI_T_Project
44
44
  type: UI_T_DatastoreType
45
45
  }>()
46
46
  const emits = defineEmits<{
@@ -49,8 +49,7 @@ const emits = defineEmits<{
49
49
  const localization = computed<UI_I_Localization>(() => useLocal())
50
50
 
51
51
  const datastoreTypes = ref<UI_I_RadioOption[]>(
52
- datastoreTypesFunc(localization.value)
53
- // datastoreTypesFunc(localization.value, props.project)
52
+ datastoreTypesFunc(localization.value, props.project)
54
53
  )
55
54
 
56
55
  const selectedType = computed<UI_T_DatastoreType>({
@@ -1,22 +1,12 @@
1
1
  import type { UI_I_Localization } from '~/lib/models/interfaces'
2
- // import type { UI_T_Project } from '~/lib/models/types'
2
+ import type { UI_T_Project } from '~/lib/models/types'
3
3
  import type { UI_I_RadioOption } from '~/components/common/select/radio/lib/models/interfaces'
4
4
 
5
5
  export const datastoreTypesFunc = (
6
6
  localization: UI_I_Localization,
7
- // project: UI_T_Project
7
+ project: UI_T_Project
8
8
  ): UI_I_RadioOption[] => {
9
- // const types = [
10
- return [
11
- {
12
- label: localization.common.localStorage,
13
- value: 'local',
14
- disabled: false,
15
- description: localization.common.localDesc,
16
- isTooltip: false,
17
- tooltipContent: localization.common.localStorageHelpDesc,
18
- testId: 'datastore-type-local',
19
- },
9
+ const types = [
20
10
  {
21
11
  label: localization.common.nfs,
22
12
  value: 'nfs',
@@ -46,17 +36,17 @@ export const datastoreTypesFunc = (
46
36
  },
47
37
  ]
48
38
 
49
- // if (project === 'procurator') {
50
- // types.unshift({
51
- // label: localization.common.localStorage,
52
- // value: 'local',
53
- // disabled: false,
54
- // description: localization.common.localDesc,
55
- // isTooltip: false,
56
- // tooltipContent: localization.common.localStorageHelpDesc,
57
- // testId: 'datastore-type-local',
58
- // })
59
- // }
39
+ if (project === 'procurator') {
40
+ types.unshift({
41
+ label: localization.common.localStorage,
42
+ value: 'local',
43
+ disabled: false,
44
+ description: localization.common.localDesc,
45
+ isTooltip: false,
46
+ tooltipContent: localization.common.localStorageHelpDesc,
47
+ testId: 'datastore-type-local',
48
+ })
49
+ }
60
50
 
61
- // return types
51
+ return types
62
52
  }
@@ -1 +1 @@
1
- export type UI_T_BlocksWidth = [number, number, number]
1
+ export type UI_T_BlocksWidth = [number, number, number]
@@ -1,5 +1,5 @@
1
- export interface UI_I_FileInfo {
2
- type: string
3
- title: string
4
- value: string | number
5
- }
1
+ export interface UI_I_FileInfo {
2
+ type: string
3
+ title: string
4
+ value: string | number
5
+ }
@@ -1,61 +1,61 @@
1
- <template>
2
- <g data-title="adapter-items-group">
3
- <template v-if="props.adaptersWithPositions.toggle">
4
- <template
5
- v-for="(adapter, key) in props.adaptersWithPositions.adapters"
6
- :key="adapter.id"
7
- >
8
- <common-diagram-main-adapter-item
9
- :adapter="adapter"
10
- :selected-port="props.selectedPort"
11
- :selected-adapter="props.selectedAdapter"
12
- :networks-count="props.networksCount"
13
- :is-dark-mode="props.isDarkMode"
14
- :networks-with-positions="props.networksWithPositions"
15
- @select-adapter="onSelectAdapter"
16
- @show-modal="onShowModal"
17
- />
18
- </template>
19
- </template>
20
- </g>
21
- </template>
22
-
23
- <script setup lang="ts">
24
- import {
25
- UI_I_AdaptersWithPositions,
26
- UI_I_ModalsInitialData,
27
- UI_I_SelectedAdapter,
28
- UI_I_SelectedPort,
29
- UI_I_NetworksWithPositions,
30
- } from '~/components/common/diagramMain/lib/models/interfaces'
31
-
32
- const props = defineProps<{
33
- adaptersWithPositions: UI_I_AdaptersWithPositions
34
- networksWithPositions: UI_I_NetworksWithPositions[]
35
- selectedPort: UI_I_SelectedPort
36
- selectedAdapter: UI_I_SelectedAdapter
37
- networksCount: number
38
- isDarkMode: boolean
39
- }>()
40
-
41
- const emits = defineEmits<{
42
- (event: 'select-adapter', adapterId: string): void
43
- (
44
- event: 'show-modal',
45
- value: string,
46
- properties?: UI_I_ModalsInitialData
47
- ): void
48
- }>()
49
-
50
- const onSelectAdapter = (adapterId: string): void => {
51
- emits('select-adapter', adapterId)
52
- }
53
- const onShowModal = (
54
- value: string,
55
- properties?: UI_I_ModalsInitialData
56
- ): void => {
57
- emits('show-modal', value, properties)
58
- }
59
- </script>
60
-
61
- <style scoped lang="scss"></style>
1
+ <template>
2
+ <g data-title="adapter-items-group">
3
+ <template v-if="props.adaptersWithPositions.toggle">
4
+ <template
5
+ v-for="(adapter, key) in props.adaptersWithPositions.adapters"
6
+ :key="adapter.id"
7
+ >
8
+ <common-diagram-main-adapter-item
9
+ :adapter="adapter"
10
+ :selected-port="props.selectedPort"
11
+ :selected-adapter="props.selectedAdapter"
12
+ :networks-count="props.networksCount"
13
+ :is-dark-mode="props.isDarkMode"
14
+ :networks-with-positions="props.networksWithPositions"
15
+ @select-adapter="onSelectAdapter"
16
+ @show-modal="onShowModal"
17
+ />
18
+ </template>
19
+ </template>
20
+ </g>
21
+ </template>
22
+
23
+ <script setup lang="ts">
24
+ import {
25
+ UI_I_AdaptersWithPositions,
26
+ UI_I_ModalsInitialData,
27
+ UI_I_SelectedAdapter,
28
+ UI_I_SelectedPort,
29
+ UI_I_NetworksWithPositions,
30
+ } from '~/components/common/diagramMain/lib/models/interfaces'
31
+
32
+ const props = defineProps<{
33
+ adaptersWithPositions: UI_I_AdaptersWithPositions
34
+ networksWithPositions: UI_I_NetworksWithPositions[]
35
+ selectedPort: UI_I_SelectedPort
36
+ selectedAdapter: UI_I_SelectedAdapter
37
+ networksCount: number
38
+ isDarkMode: boolean
39
+ }>()
40
+
41
+ const emits = defineEmits<{
42
+ (event: 'select-adapter', adapterId: string): void
43
+ (
44
+ event: 'show-modal',
45
+ value: string,
46
+ properties?: UI_I_ModalsInitialData
47
+ ): void
48
+ }>()
49
+
50
+ const onSelectAdapter = (adapterId: string): void => {
51
+ emits('select-adapter', adapterId)
52
+ }
53
+ const onShowModal = (
54
+ value: string,
55
+ properties?: UI_I_ModalsInitialData
56
+ ): void => {
57
+ emits('show-modal', value, properties)
58
+ }
59
+ </script>
60
+
61
+ <style scoped lang="scss"></style>