bfg-common 1.5.220 → 1.5.221

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 (32) hide show
  1. package/components/common/backup/storage/actions/add/Add.vue +16 -1
  2. package/components/common/backup/storage/actions/add/temp/Add.vue +53 -34
  3. package/components/common/backup/storage/actions/add/temp/lib/config/stepItems.ts +46 -13
  4. package/components/common/backup/storage/actions/add/temp/lib/utils.ts +6 -5
  5. package/components/common/backup/storage/actions/add/temp/local/Local.vue +49 -31
  6. package/components/common/backup/storage/actions/add/temp/local/accessibility/Accessibility.vue +104 -0
  7. package/components/common/backup/storage/actions/add/temp/local/accessibility/lib/config/tabsPannel.ts +25 -0
  8. package/components/common/backup/storage/actions/add/temp/local/accessibility/lib/models/interfaces.ts +9 -0
  9. package/components/common/backup/storage/actions/add/temp/local/accessibility/lib/models/types.ts +5 -0
  10. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/TablesView.vue +141 -0
  11. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/compatibleTable.ts +62 -0
  12. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/hostsTableItems.ts +27 -0
  13. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/incompatibleTable.ts +68 -0
  14. package/components/common/backup/storage/actions/add/temp/local/accessibility/tablesView/lib/config/tableKeys.ts +15 -0
  15. package/components/common/backup/storage/actions/add/temp/local/createName/CreateName.vue +5 -3
  16. package/components/common/backup/storage/actions/add/temp/nfs/Nfs.vue +5 -5
  17. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/lib/models/types.ts +2 -2
  18. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/hostsTableItems.ts +1 -27
  19. package/components/common/backup/storage/actions/add/temp/nfs/accessibility/tablesView/lib/config/tableKeys.ts +2 -2
  20. package/components/common/backup/storage/actions/add/temp/nfs/configuration/Configuration.vue +4 -4
  21. package/components/common/backup/storage/actions/add/temp/readyComplete/ReadyComplete.vue +1 -1
  22. package/components/common/backup/storage/actions/add/temp/readyComplete/lib/config/propertiesDetails.ts +33 -7
  23. package/components/common/backup/storage/actions/add/temp/samba/accessibility/lib/models/types.ts +2 -2
  24. package/components/common/backup/storage/actions/add/temp/samba/accessibility/tablesView/lib/config/tableKeys.ts +2 -2
  25. package/components/common/backup/storage/actions/add/temp/samba/configuration/Configuration.vue +1 -1
  26. package/components/common/backup/storage/actions/add/temp/sharedStorm/SharedStorm.vue +47 -21
  27. package/components/common/backup/storage/actions/add/temp/types/Types.vue +3 -2
  28. package/components/common/backup/storage/actions/add/temp/types/lib/config/typeOptions.ts +25 -15
  29. package/components/common/vm/actions/clone/Clone.vue +7 -0
  30. package/package.json +2 -2
  31. package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/CreateName.vue +0 -156
  32. package/components/common/backup/storage/actions/add/temp/sharedStorm/createName/lib/config/defaultForm.ts +0 -15
@@ -1,12 +1,20 @@
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
+ <!-- />-->
4
11
  <common-backup-storage-actions-add-temp-local-create-name
5
12
  v-show="props.stepPosition === 1"
13
+ :mode="props.mode"
6
14
  :local-create-name-submit="props.createNameSubmit"
7
15
  test-id="shared-storm"
8
16
  @loading="(e) => emits('loading', e)"
9
- @submit="onChangeName"
17
+ @submit="onChangeName($event)"
10
18
  />
11
19
 
12
20
  <common-backup-storage-actions-add-temp-shared-storm-storage
@@ -17,47 +25,62 @@
17
25
  :storage-submit="storageSubmitLocal"
18
26
  @change="onChangeStorage"
19
27
  />
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
+ />
20
35
  </div>
21
36
  </template>
22
37
 
23
38
  <script lang="ts" setup>
24
39
  import type { UI_I_TablePayload } from '~/lib/models/table/interfaces'
25
40
  import type { UI_I_DatastoreTableItem } from '~/lib/models/store/storage/interfaces'
41
+ import type { UI_T_Project } from '~/lib/models/types'
26
42
  import type { I_SharedStormData } from '~/components/common/backup/storage/actions/add/temp/lib/models/interfaces'
27
43
 
28
44
  const props = defineProps<{
45
+ mode: UI_T_Project
46
+ hosts: any
29
47
  stepPosition: number
30
48
  createNameSubmit: number
31
49
  storageSubmit: number
50
+ hostAccessibilitySubmit: number
51
+ datastore: UI_I_DatastoreTableItem[]
52
+ getDatastoreTableFunc: (payload: UI_I_TablePayload) => Promise<void>
32
53
  }>()
33
54
  const emits = defineEmits<{
34
55
  (event: 'loading', value: boolean): void
35
56
  (event: 'submit', value: I_SharedStormData): void
36
57
  }>()
37
58
 
38
- const { $store } = useNuxtApp()
59
+ // const { $store }: any = useNuxtApp()
39
60
 
40
61
  const storage = ref<UI_I_DatastoreTableItem | null>(null)
41
62
  const onChangeStorage = (data: UI_I_DatastoreTableItem | null): void => {
42
63
  storage.value = data
43
64
  }
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)
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: []
51
79
  }
52
80
 
53
- const storageName = ref<string>('')
54
81
  const onChangeName = (name: string): void => {
55
- storageName.value = name
56
- emits('submit', {
57
- name: storageName.value,
58
- storm_id: storage.value?.id,
59
- storm_name: storage.value?.name,
60
- })
82
+ sendData.name = name
83
+ emits('submit', sendData)
61
84
  }
62
85
 
63
86
  const storageSubmitLocal = ref<Function | null>(null)
@@ -66,15 +89,18 @@ watch(
66
89
  () => {
67
90
  storageSubmitLocal.value = (isValid: boolean): void => {
68
91
  if (isValid) {
69
- emits('submit', {
70
- name: storageName.value,
71
- storm_id: storage.value?.id,
72
- storm_name: storage.value?.name,
73
- })
92
+ sendData.storm_id = storage.value?.id
93
+ sendData.storm_name = storage.value?.name
94
+ emits('submit', sendData)
74
95
  }
75
96
  }
76
97
  }
77
98
  )
99
+
100
+ const onChangeAccessibilityAndNext = (hosts: string[]): void => {
101
+ sendData.hosts = hosts
102
+ emits('submit', sendData)
103
+ }
78
104
  </script>
79
105
 
80
106
  <style lang="scss" scoped></style>
@@ -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,7 +49,8 @@ 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, props.project)
52
+ datastoreTypesFunc(localization.value)
53
+ // datastoreTypesFunc(localization.value, props.project)
53
54
  )
54
55
 
55
56
  const selectedType = computed<UI_T_DatastoreType>({
@@ -1,12 +1,22 @@
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 = [
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
+ },
10
20
  {
11
21
  label: localization.common.nfs,
12
22
  value: 'nfs',
@@ -36,17 +46,17 @@ export const datastoreTypesFunc = (
36
46
  },
37
47
  ]
38
48
 
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
- }
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
+ // }
50
60
 
51
- return types
61
+ // return types
52
62
  }
@@ -707,6 +707,13 @@ const onHideModal = (): void => {
707
707
  </script>
708
708
 
709
709
  <style scoped lang="scss">
710
+ .clone-vm {
711
+ :deep(.table) {
712
+ .vm-name-label::first-letter {
713
+ text-transform: uppercase;
714
+ }
715
+ }
716
+ }
710
717
  :deep(.has-solid.close-icon.clr-icon) {
711
718
  width: 20px;
712
719
  top: 0;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.220",
4
+ "version": "1.5.221",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -35,7 +35,7 @@
35
35
  "@vueuse/components": "^10.1.2",
36
36
  "date-fns": "^2.29.3",
37
37
  "bfg-nuxt-3-graph": "1.0.26",
38
- "bfg-uikit": "1.0.434",
38
+ "bfg-uikit": "1.0.435",
39
39
  "html2canvas": "^1.4.1",
40
40
  "prettier-eslint": "^15.0.1"
41
41
  }
@@ -1,156 +0,0 @@
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>
@@ -1,15 +0,0 @@
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
- }