bfg-common 1.3.337 → 1.3.338

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.
@@ -135,6 +135,7 @@ const datastoreForm = ref<UI_I_CreateDatastoreForm>({
135
135
  readonly: false,
136
136
  version: nfsVersion.value,
137
137
  type_code: 4,
138
+ hosts: []
138
139
  },
139
140
  })
140
141
 
@@ -187,8 +188,8 @@ const onHideModal = (): void => {
187
188
 
188
189
  const updateNfsVersion = (event: UI_T_NfsType): void => {
189
190
  nfsVersion.value = event
190
- const { name, server, folder } = datastoreForm.value.nfs
191
- saveChangesAndNextNfs({ name, server, folder }, false)
191
+ const { name, server, folder, hosts } = datastoreForm.value.nfs
192
+ saveChangesAndNextNfs({ name, server, folder, hosts }, false)
192
193
  }
193
194
 
194
195
  const localCreateNameSubmit = ref<number>(0)
@@ -280,6 +281,7 @@ const saveChangesAndNextNfs = (event: any, next = true): void => {
280
281
  nfs.name = event.name
281
282
  nfs.folder = event.folder
282
283
  nfs.server = event.server
284
+ nfs.hosts = event.hosts
283
285
 
284
286
  dataReadyView.value = constructDataReadyViewFunc(
285
287
  localization.value,
@@ -1,36 +1,38 @@
1
- import { UI_T_NfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
2
-
3
- export interface UI_I_NfsPoolNameForm<T = number> {
4
- server: string
5
- folder: string
6
- version: T
7
- readonly: boolean
8
- }
9
- export interface UI_I_CreateDatastoreBodyRequest {
10
- name: string
11
- pool_name: string
12
- type_code: number
13
- }
14
- interface I_NfsForm extends UI_I_NfsPoolNameForm<UI_T_NfsType>{
15
- name: string
16
- type_code: number
17
- }
18
- interface I_SharedStorm extends UI_I_CreateDatastoreBodyRequest {
19
- dev_names: string[]
20
- hosts: string[]
21
- }
22
-
23
- export interface UI_I_CreateDatastoreForm {
24
- local: {
25
- name: string
26
- hosts: string[]
27
- type_code: number
28
- }
29
- sharedStorm: I_SharedStorm
30
- nfs: I_NfsForm
31
- }
32
-
33
- export interface UI_I_CreateStorageUuid {
34
- code: number
35
- pool_name: string
36
- }
1
+ import { UI_T_NfsType } from '~/components/common/wizards/datastore/add/lib/models/types'
2
+
3
+ // TODO refactoring
4
+ export interface UI_I_NfsPoolNameForm<T = number> {
5
+ server: string
6
+ folder: string
7
+ version: T
8
+ readonly: boolean
9
+ hosts: string[]
10
+ }
11
+ export interface UI_I_CreateDatastoreBodyRequest {
12
+ name: string
13
+ pool_name: string
14
+ type_code: number
15
+ }
16
+ interface I_NfsForm extends UI_I_NfsPoolNameForm<UI_T_NfsType> {
17
+ name: string
18
+ type_code: number
19
+ }
20
+ interface I_SharedStorm extends UI_I_CreateDatastoreBodyRequest {
21
+ dev_names: string[]
22
+ hosts: string[]
23
+ }
24
+
25
+ export interface UI_I_CreateDatastoreForm {
26
+ local: {
27
+ name: string
28
+ hosts: string[]
29
+ type_code: number
30
+ }
31
+ sharedStorm: I_SharedStorm
32
+ nfs: I_NfsForm
33
+ }
34
+
35
+ export interface UI_I_CreateStorageUuid {
36
+ code: number
37
+ pool_name: string
38
+ }
@@ -13,7 +13,7 @@
13
13
  :nfs-version="nfsVersion"
14
14
  :nfs-configuration-submit="nfsConfigurationSubmit"
15
15
  @loading="(e) => emits('loading', e)"
16
- @next="applyChangesAndNext"
16
+ @next="onChangeConfiguration"
17
17
  />
18
18
 
19
19
  <!-- <templates-home-datastore-actions-add-nfs-kerberos-authentication-->
@@ -24,8 +24,8 @@
24
24
  <common-wizards-datastore-add-nfs-accessibility
25
25
  v-if="showHostAccessibility"
26
26
  :host-accessibility-submit="props.hostAccessibilitySubmit"
27
- :datacenter-hosts="props.hosts"
28
- @next="applyChangesAndNext"
27
+ :hosts="props.hosts"
28
+ @next="onChangeAccessibilityAndNext"
29
29
  />
30
30
  <!-- TODO Он будет когда будем делать групповое -->
31
31
  </div>
@@ -90,8 +90,19 @@ watch(nfsVersion, (newValue: UI_T_NfsType) => {
90
90
  emits('change-nfs-version', newValue)
91
91
  })
92
92
 
93
- const applyChangesAndNext = (event: UI_I_ConfigurationSendDataNfs): void => {
94
- emits('submit', event)
93
+ let configuration: any = null
94
+ const onChangeConfiguration = (event: UI_I_ConfigurationSendDataNfs): void => {
95
+ configuration = {
96
+ name: event.name,
97
+ folder: event.folder,
98
+ server: event.server
99
+ }
100
+ }
101
+ const onChangeAccessibilityAndNext = (hosts: string[]): void => {
102
+ emits('submit', {
103
+ ...configuration,
104
+ hosts
105
+ })
95
106
  }
96
107
  </script>
97
108
 
@@ -18,7 +18,7 @@
18
18
  </div>
19
19
  <div>
20
20
  <common-wizards-datastore-add-nfs-accessibility-tables-view
21
- v-model:selected-row="selectedHost"
21
+ v-model:selected-row="selectedHosts"
22
22
  :data-table="dataTable?.items || []"
23
23
  :total-items="dataTable?.total_items || 0"
24
24
  :total-pages="dataTable?.total_pages || 1"
@@ -45,7 +45,7 @@ const props = defineProps<{
45
45
  }>()
46
46
  const localization = computed<UI_I_Localization>(() => useLocal())
47
47
  const emits = defineEmits<{
48
- (event: 'next', value: string): void
48
+ (event: 'next', value: string[]): void
49
49
  }>()
50
50
 
51
51
  const activeTab = ref<T_HostsAccessibilityTab>('compatible-hosts')
@@ -53,8 +53,6 @@ const tabs = computed<UI_I_CollapseNavItem[]>(() =>
53
53
  hostAccessibilityTabsFunc(localization.value, ['5', '3'])
54
54
  )
55
55
 
56
- console.log(444444)
57
-
58
56
  // const dataTable = computed(() => hostsAccessibilityTablesFunc(activeTab.value))
59
57
  // TODO refactoring
60
58
  const dataTable = computed<any>(() => props.hosts)
@@ -65,7 +63,7 @@ const pagination = ref<UI_I_Pagination>({
65
63
  })
66
64
  const sort = ref<string | null>(null)
67
65
 
68
- const selectedHost = ref<number[]>([])
66
+ const selectedHosts = ref<string[]>([])
69
67
 
70
68
  const updatePagination = (event: UI_I_Pagination): void => {
71
69
  pagination.value = event
@@ -83,14 +81,14 @@ const removeValidationErrors = (): void => {
83
81
  errors.value = []
84
82
  }
85
83
  const submit = async () => {
86
- if (!selectedHost.value.length) {
84
+ if (!selectedHosts.value.length) {
87
85
  const text = localization.value.selectLeastEntityContinue
88
86
  showValidationErrors(text)
89
87
  return
90
88
  }
91
89
 
92
90
  removeValidationErrors()
93
- emits('next', '')
91
+ emits('next', selectedHosts.value)
94
92
  }
95
93
  watch(
96
94
  () => props.hostAccessibilitySubmit,
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.3.337",
4
+ "version": "1.3.338",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",