bfg-common 1.4.232 → 1.4.234

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.
@@ -0,0 +1,18 @@
1
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
2
+
3
+ export const scheduledTaskDefaultFormFunc = (): UI_I_ScheduleNewTasksForm => {
4
+ return {
5
+ task_name: '',
6
+ description: '',
7
+ frequency: '',
8
+ frg_after_startup: 0,
9
+ frg_interval: 1,
10
+ frg_end_time: null,
11
+ frg_start_on_time: null,
12
+ frg_monthly_day: 0,
13
+ frq_week_day: '',
14
+ frq_ordinal_number: '',
15
+ frg_on_time: null,
16
+ frg_on_week_days: [],
17
+ }
18
+ }
@@ -0,0 +1,14 @@
1
+ export interface UI_I_ScheduleNewTasksForm {
2
+ task_name: string
3
+ description: string
4
+ frequency: string
5
+ frg_after_startup: number
6
+ frg_interval: number
7
+ frg_end_time: number | null
8
+ frg_start_on_time: number | null
9
+ frg_monthly_day: number
10
+ frq_ordinal_number: string
11
+ frq_week_day: string
12
+ frg_on_time: number | null
13
+ frg_on_week_days: number[]
14
+ }
@@ -13,7 +13,7 @@
13
13
  <template #modalBody="{ selectedStep }">
14
14
  <atoms-loader v-show="!vmSettings" id="loader" />
15
15
  <div v-if="vmSettings" class="vm-context">
16
- <!-- TODO refactoring-->
16
+ <!-- TODO refactoring-->
17
17
  <templates-inventory-vm-configure-scheduled-tasks-modals-common-new-task-form
18
18
  v-show="selectedStep.id === dynamicSteps.scheduledTasks"
19
19
  v-model="newTaskForm"
@@ -136,7 +136,7 @@ import {
136
136
  } from '~/components/common/vm/actions/clone/lib/config/steps'
137
137
  import Wizard from '~/components/atoms/wizard/lib/utils/utils'
138
138
  import { mapCapabilities } from '~/components/common/vm/actions/common/lib/utils/capabilities'
139
- import { scheduledTaskDefaultFormFunc } from '~/components/common/vm/actions/clone/lib/config/defaultScheduledTask'
139
+ import { scheduledTaskDefaultFormFunc } from '~/components/common/pages/scheduledTasks/lib/config/createScheduledTask'
140
140
 
141
141
  const props = defineProps<{
142
142
  project: UI_T_Project
@@ -288,12 +288,20 @@ const checkName = async (
288
288
  return new Promise((resolve) => {
289
289
  nameFormSubmit.value = (isValid: boolean) => {
290
290
  if (!isValid) {
291
- stepHasError = wizard.setValidation(dynamicSteps.value.selectName, 'name', {
292
- fieldMessage: 'aaa',
293
- alertMessage: 'aaa',
294
- })
291
+ stepHasError = wizard.setValidation(
292
+ dynamicSteps.value.selectName,
293
+ 'name',
294
+ {
295
+ fieldMessage: 'aaa',
296
+ alertMessage: 'aaa',
297
+ }
298
+ )
295
299
  } else if (wizard.hasMessage(dynamicSteps.value.selectName, 'name')) {
296
- value = wizard.removeValidation(dynamicSteps.value.selectName, 'name', value)
300
+ value = wizard.removeValidation(
301
+ dynamicSteps.value.selectName,
302
+ 'name',
303
+ value
304
+ )
297
305
  }
298
306
 
299
307
  resolve({
@@ -312,12 +320,22 @@ const checkStorage = async (
312
320
  return new Promise((resolve) => {
313
321
  storageSubmit.value = (isValid: boolean) => {
314
322
  if (!isValid) {
315
- stepHasError = wizard.setValidation(dynamicSteps.value.selectStorage, 'storage', {
316
- fieldMessage: 'aaa',
317
- alertMessage: 'aaa',
318
- })
319
- } else if (wizard.hasMessage(dynamicSteps.value.selectStorage, 'storage')) {
320
- value = wizard.removeValidation(dynamicSteps.value.selectStorage, 'storage', value)
323
+ stepHasError = wizard.setValidation(
324
+ dynamicSteps.value.selectStorage,
325
+ 'storage',
326
+ {
327
+ fieldMessage: 'aaa',
328
+ alertMessage: 'aaa',
329
+ }
330
+ )
331
+ } else if (
332
+ wizard.hasMessage(dynamicSteps.value.selectStorage, 'storage')
333
+ ) {
334
+ value = wizard.removeValidation(
335
+ dynamicSteps.value.selectStorage,
336
+ 'storage',
337
+ value
338
+ )
321
339
  }
322
340
 
323
341
  resolve({
@@ -336,12 +354,25 @@ const checkCustomizeHardware = async (
336
354
  return new Promise((resolve) => {
337
355
  customizeHardwareSubmit.value = (isValid: boolean) => {
338
356
  if (!isValid) {
339
- stepHasError = wizard.setValidation(dynamicSteps.value.customizeHardware, 'customizeHardware', {
340
- fieldMessage: 'aaa',
341
- alertMessage: 'aaa',
342
- })
343
- } else if (wizard.hasMessage(dynamicSteps.value.customizeHardware, 'customizeHardware')) {
344
- value = wizard.removeValidation(dynamicSteps.value.customizeHardware, 'customizeHardware', value)
357
+ stepHasError = wizard.setValidation(
358
+ dynamicSteps.value.customizeHardware,
359
+ 'customizeHardware',
360
+ {
361
+ fieldMessage: 'aaa',
362
+ alertMessage: 'aaa',
363
+ }
364
+ )
365
+ } else if (
366
+ wizard.hasMessage(
367
+ dynamicSteps.value.customizeHardware,
368
+ 'customizeHardware'
369
+ )
370
+ ) {
371
+ value = wizard.removeValidation(
372
+ dynamicSteps.value.customizeHardware,
373
+ 'customizeHardware',
374
+ value
375
+ )
345
376
  }
346
377
 
347
378
  resolve({
@@ -13,10 +13,11 @@
13
13
  @submit="onFinish"
14
14
  >
15
15
  <template #modalBody="{ selectedStep }">
16
- <common-wizards-vm-migrate-select-type
16
+ <!-- TODO refactoring move to common-->
17
+ <templates-inventory-vm-configure-scheduled-tasks-modals-common-new-task-form
17
18
  v-if="selectedStep.id === 0"
18
- v-model="form.migrate_type"
19
- :project="props.project"
19
+ v-model="newScheduledTaskForm"
20
+ :target="selectedVirtualMachine"
20
21
  />
21
22
 
22
23
  <common-wizards-vm-migrate-select-type
@@ -95,7 +96,9 @@ import type { UI_I_VmSettings } from '~/lib/models/store/vm/interfaces'
95
96
  import type { UI_I_TreeNode } from '~/components/common/recursionTree/lib/models/interfaces'
96
97
  import type { UI_I_StorageConfigurePerDiskItem } from '~/components/common/wizards/vm/migrate/select/storage/configure/disk/table/lib/models/interfaces'
97
98
  import type { UI_I_TableInfoItem } from '~/components/atoms/table/info/lib/models/interfaces'
99
+ import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
98
100
  import { constructDataReadyViewFunc } from '~/components/common/wizards/vm/migrate/lib/config/constructDataReady'
101
+ import { scheduledTaskDefaultFormFunc } from '~/components/common/pages/scheduledTasks/lib/config/createScheduledTask'
99
102
  import * as validation from '~/components/common/wizards/vm/migrate/lib/validations'
100
103
 
101
104
  const props = defineProps<{
@@ -109,6 +112,7 @@ const props = defineProps<{
109
112
  configurePerDisks: UI_I_StorageConfigurePerDiskItem[]
110
113
  computeResourceTableData?: any
111
114
  computeResourceTree?: UI_I_TreeNode
115
+ selectedVirtualMachine?: string
112
116
  }>()
113
117
  const emits = defineEmits<{
114
118
  (event: 'hide'): void
@@ -125,6 +129,8 @@ const wizard: Wizard = new Wizard(
125
129
  const selectedScheme = computed<number[]>(() => wizard.selectedScheme.value)
126
130
  const alertMessages = computed<string[][]>(() => wizard.alertMessages.value)
127
131
 
132
+ const model = ref<any>({})
133
+
128
134
  const title = computed<string>(() => {
129
135
  let result = localization.value.common.migrate
130
136
  if (props.isScheduledTasks) {
@@ -161,6 +167,9 @@ const form = ref<UI_I_MigrateFormLocal>({
161
167
  },
162
168
  vMotion_priority: 'high',
163
169
  })
170
+ const newScheduledTaskForm = ref<UI_I_ScheduleNewTasksForm>(
171
+ useDeepCopy(scheduledTaskDefaultFormFunc())
172
+ )
164
173
 
165
174
  const validationFunc = async (
166
175
  value: UI_I_WizardStep[],
@@ -209,7 +218,7 @@ watch(
209
218
  (newValue: UI_T_VmMigrateType) => {
210
219
  const schemes: UI_I_ChangeStepsSchemes = {
211
220
  procurator: {
212
- storage: 0,
221
+ storage: props.isScheduledTasks ? 1 : 0,
213
222
  },
214
223
  sphere: {
215
224
  storage: 0,
@@ -6,7 +6,7 @@ export const stepsFunc = (
6
6
  localization: UI_I_Localization,
7
7
  isScheduledTasks: boolean
8
8
  ): UI_I_WizardStep[] => {
9
- let result: UI_I_WizardStep[] = [
9
+ const result: UI_I_WizardStep[] = [
10
10
  {
11
11
  id: 0,
12
12
  stepName: '',
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.4.232",
4
+ "version": "1.4.234",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,8 +0,0 @@
1
- // export const scheduledTaskDefaultFormFunc = (): I_ScheduleNewTasksForm => {
2
- export const scheduledTaskDefaultFormFunc = (): any => {
3
- return {
4
- task_name: '',
5
- description: '',
6
- frequency: '',
7
- }
8
- }