bfg-common 1.5.543 → 1.5.545

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.
@@ -2,6 +2,7 @@
2
2
  <common-pages-backups-modals-restore-new
3
3
  v-if="isNewView"
4
4
  v-model="model"
5
+ v-model:is-show-confirm="isShowConfirm"
5
6
  :wizard="wizard"
6
7
  :selected-scheme="selectedScheme"
7
8
  :alert-messages="alertMessages"
@@ -15,12 +16,14 @@
15
16
  @get-datastore="getDatastoreTableFunc"
16
17
  @get-networks="onGetNetworks"
17
18
  @change-steps="onChangeSteps"
19
+ @submit-confirm="onFinish"
18
20
  @hide="onHideModal"
19
- @submit="onRestore"
21
+ @submit-wizard="onSubmitWizard"
20
22
  />
21
23
  <common-pages-backups-modals-restore-old
22
24
  v-else
23
25
  v-model="model"
26
+ v-model:is-show-confirm="isShowConfirm"
24
27
  :wizard="wizard"
25
28
  :selected-scheme="selectedScheme"
26
29
  :ready-complete-data="readyToCompleteInfo"
@@ -35,8 +38,9 @@
35
38
  @get-datastore="getDatastoreTableFunc"
36
39
  @get-networks="onGetNetworks"
37
40
  @change-steps="onChangeSteps"
38
- @finish="onRestore"
41
+ @submit-confirm="onFinish"
39
42
  @hide="onHideModal"
43
+ @submit-wizard="onSubmitWizard"
40
44
  />
41
45
  </template>
42
46
 
@@ -271,17 +275,16 @@ const onHideModal = (): void => {
271
275
  emits('hide')
272
276
  }
273
277
 
274
- const onRestore = (): void => {
275
- // Этот проверка уже есть в RestoreOld
276
- // if (model.value.restore_code === restoreCodes.existing) {
277
- // isShowConfirm.value = true
278
- // } else {
278
+ const isShowConfirm = ref<boolean>(false)
279
+
280
+ const onSubmitWizard = (): void => {
281
+ if (model.value.restore_code === restoreCodes.existing) {
282
+ isShowConfirm.value = true
283
+ } else {
279
284
  onFinish()
280
- // }
285
+ }
281
286
  }
282
287
 
283
- const isShowConfirm = ref<boolean>(false)
284
-
285
288
  const onGetNetworks = (hostId: string): void => {
286
289
  emits('get-networks', hostId)
287
290
  }
@@ -10,7 +10,7 @@
10
10
  class="restore-wizard"
11
11
  @change-steps="onChangeSteps"
12
12
  @hide="onHideModal"
13
- @submit="onCreateDatastore"
13
+ @submit="emits('submit-wizard')"
14
14
  >
15
15
  <template #content="{ selectedStep }">
16
16
  <ui-wizard-block
@@ -161,6 +161,14 @@
161
161
  </ui-wizard-block>
162
162
  </template>
163
163
  </ui-wizard>
164
+
165
+ <common-modals-confirmation
166
+ v-if="isShowConfirm"
167
+ :headline="localization.common.attention"
168
+ :description="localization.common.restoreBackupConfirmDescription"
169
+ @hide-modal="isShowConfirm = false"
170
+ @confirm="emits('submit-confirm')"
171
+ />
164
172
  </template>
165
173
 
166
174
  <script setup lang="ts">
@@ -178,6 +186,7 @@ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interface
178
186
  import { dynamicSteps } from '~/components/common/pages/backups/modals/restore/lib/config/steps'
179
187
 
180
188
  const model = defineModel<UI_I_RestoreForm>({ required: true })
189
+ const isShowConfirm = defineModel<boolean>('is-show-confirm')
181
190
 
182
191
  const props = defineProps<{
183
192
  wizard: Wizard
@@ -195,8 +204,9 @@ const emits = defineEmits<{
195
204
  (event: 'change-storage', value: UI_I_DatastoreTableItem | null): void
196
205
  (event: 'get-datastore', value: string): void
197
206
  (event: 'get-networks', value: string): void
207
+ (event: 'submit-confirm'): void
198
208
  (event: 'hide'): void
199
- (event: 'submit'): void
209
+ (event: 'submit-wizard'): void
200
210
  }>()
201
211
 
202
212
  const localization = computed<UI_I_Localization>(() => useLocal())
@@ -250,7 +260,6 @@ const onGetNetworks = (hostId: string): void => {
250
260
  }
251
261
 
252
262
  const onHideModal = (): void => emits('hide')
253
- const onCreateDatastore = (): void => emits('submit')
254
263
  </script>
255
264
 
256
265
  <style scoped lang="scss">
@@ -9,7 +9,7 @@
9
9
  test-id="restore"
10
10
  @change-steps="onChangeSteps"
11
11
  @hide="onHideModal"
12
- @submit="onRestore"
12
+ @submit="emits('submit-wizard')"
13
13
  >
14
14
  <template #modalBody="{ selectedStep }">
15
15
  <div
@@ -79,7 +79,7 @@
79
79
  :headline="localization.common.attention"
80
80
  :description="localization.common.restoreBackupConfirmDescription"
81
81
  @hide-modal="isShowConfirm = false"
82
- @confirm="onFinish"
82
+ @confirm="emits('submit-confirm')"
83
83
  />
84
84
  </template>
85
85
 
@@ -93,15 +93,15 @@ import type { UI_I_NetworkTableItem } from '~/lib/models/store/network/interface
93
93
  import type { UI_I_NameCheck } from '~/components/common/pages/backups/modals/restore/name/lib/models/interfaces'
94
94
  import type { UI_I_RestoreForm } from '~/components/common/pages/backups/modals/lib/models/interfaces'
95
95
  import { dynamicSteps } from '~/components/common/pages/backups/modals/restore/lib/config/steps'
96
- import { restoreCodes } from '~/components/common/pages/backups/modals/restore/lib/config/restoreCodes'
97
96
 
98
97
  const model = defineModel<UI_I_RestoreForm>({ required: true })
98
+ const isShowConfirm = defineModel<boolean>('is-show-confirm')
99
99
 
100
100
  const props = defineProps<{
101
101
  wizard: Wizard
102
102
  selectedScheme: number[]
103
103
  readyCompleteData: UI_I_TableInfoItem[]
104
- nameFormSubmit: null | Function
104
+ // nameFormSubmit: null | Function
105
105
  storageSubmit: null | Function
106
106
  isLoading: boolean
107
107
  errors: string[]
@@ -116,7 +116,8 @@ const emits = defineEmits<{
116
116
  (event: 'get-networks', value: string): void
117
117
  (event: 'check-name', value: UI_I_NameCheck): void
118
118
  (event: 'change-steps', value: UI_I_WizardStep[]): void
119
- (event: 'finish'): void
119
+ (event: 'submit-confirm'): void
120
+ (event: 'submit-wizard'): void
120
121
  (event: 'hide'): void
121
122
  }>()
122
123
 
@@ -138,23 +139,10 @@ const onCheckName = async (data: UI_I_NameCheck): Promise<void> => {
138
139
  emits('check-name', data)
139
140
  }
140
141
 
141
- const onFinish = (): void => {
142
- emits('finish')
143
- }
144
142
  const onHideModal = (): void => {
145
143
  emits('hide')
146
144
  }
147
145
 
148
- const onRestore = (): void => {
149
- if (model.value.restore_code === restoreCodes.existing) {
150
- isShowConfirm.value = true
151
- } else {
152
- onFinish()
153
- }
154
- }
155
-
156
- const isShowConfirm = ref<boolean>(false)
157
-
158
146
  const onGetNetworks = (hostId: string): void => {
159
147
  emits('get-networks', hostId)
160
148
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.543",
4
+ "version": "1.5.545",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",