bfg-common 1.5.887 → 1.5.889

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 (24) hide show
  1. package/components/common/pages/scheduledTasks/lib/models/interfaces.ts +0 -4
  2. package/components/common/pages/scheduledTasks/table/Table.vue +42 -20
  3. package/components/common/pages/scheduledTasks/table/expandDetails/New.vue +5 -118
  4. package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/lib/config/historyRunsTable.ts +3 -3
  5. package/components/common/pages/scheduledTasks/table/expandDetails/lib/config/expandDetails.ts +3 -4
  6. package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/scheduledTasksTable.ts +9 -13
  7. package/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus.ts +4 -0
  8. package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/tableKeys.ts +1 -1
  9. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Cpu.vue +2 -1
  10. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/New.vue +2 -1
  11. package/components/common/vm/actions/common/customizeHardware/virtualHardware/cpu/Old.vue +1 -0
  12. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/Limit.vue +3 -2
  13. package/components/common/vm/actions/common/customizeHardware/virtualHardware/limit/lib/config/options.ts +6 -3
  14. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Memory.vue +1 -0
  15. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/New.vue +3 -0
  16. package/components/common/vm/actions/common/customizeHardware/virtualHardware/memory/Old.vue +3 -1
  17. package/components/common/vm/actions/common/customizeHardware/virtualHardware/newHardDisk/NewHardDisk.vue +4 -3
  18. package/package.json +1 -1
  19. package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +0 -4
  20. package/components/common/pages/scheduledTasks/table/new/New.vue +0 -324
  21. package/components/common/pages/scheduledTasks/table/new/lib/config/scheduledTasksTable.ts +0 -218
  22. package/components/common/pages/scheduledTasks/table/new/lib/models/enums.ts +0 -14
  23. package/components/common/pages/scheduledTasks/table/old/Old.vue +0 -93
  24. /package/components/common/pages/scheduledTasks/table/{old/lib → lib}/models/types.ts +0 -0
@@ -1,5 +1,4 @@
1
1
  import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
2
- import type { API_UI_I_DataTable } from '~/lib/models/table/interfaces'
3
2
 
4
3
  export interface UI_I_ModalPayloadSchedulerData<T = UI_I_ScheduleNewTasksForm> {
5
4
  isSchedulerTask: false
@@ -32,9 +31,6 @@ export interface API_UI_I_ScheduledTasksTableItem {
32
31
  export interface UI_I_ScheduledTasksTableItem
33
32
  extends API_UI_I_ScheduledTasksTableItem {}
34
33
 
35
- export interface UI_I_ScheduledTasks
36
- extends API_UI_I_DataTable<UI_I_ScheduledTasksTableItem[]> {}
37
-
38
34
  export interface UI_I_CreateScheduledTaskArgs {
39
35
  name: string
40
36
  description: string
@@ -1,12 +1,38 @@
1
1
  <template>
2
- <component
3
- :is="currentComponent"
4
- v-model="selectedScheduledTaskLocal"
5
- :table-items="props.schedulerData?.items || []"
6
- :total-items="props.schedulerData?.total_items || 0"
7
- :total-pages="props.schedulerData?.total_pages || 1"
8
- :is-loading="props.isLoading"
9
- />
2
+ <div class="data-table-view">
3
+ <atoms-table-data-grid
4
+ v-model:selected-row="selectedScheduledTaskLocal"
5
+ v-model:page-size="pagination.pageSize"
6
+ v-model:page="pagination.page"
7
+ :head-items="headItems"
8
+ :body-items="bodyItems"
9
+ :total-items="props.totalItems"
10
+ :total-pages="props.totalPages"
11
+ :items-per-page="itemsPerPage"
12
+ :z-index-header-shift="2"
13
+ :loading="loading"
14
+ type="radio"
15
+ class="data-table"
16
+ test-id="scheduled-tasks-table"
17
+ hide-pagination
18
+ hide-page-size
19
+ off-select-by-row
20
+ server-off
21
+ >
22
+ <template #icon="{ item }">
23
+ <atoms-the-icon :name="item.data.iconClassName" class="icon" />
24
+ <span :title="item.text" class="text-ellipsis">
25
+ {{ item.text }}
26
+ </span>
27
+ </template>
28
+
29
+ <template #toggleBlock="{ item }">
30
+ <common-pages-scheduled-tasks-table-expand-details
31
+ :data="item[0].data.expandData"
32
+ />
33
+ </template>
34
+ </atoms-table-data-grid>
35
+ </div>
10
36
  </template>
11
37
 
12
38
  <script lang="ts" setup>
@@ -14,25 +40,21 @@ import type {
14
40
  UI_I_HeadItem,
15
41
  UI_I_BodyItem,
16
42
  } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
43
+ import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
17
44
  import type { UI_I_Localization } from '~/lib/models/interfaces'
18
45
  import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
19
- import type { UI_I_ScheduledTasks } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
46
+ import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
47
+ import * as scheduledTaskTable from '~/components/common/pages/scheduledTasks/table/lib/config/scheduledTasksTable'
20
48
 
21
- const selectedScheduledTaskLocal = defineModel<string | null>()
22
49
  const props = defineProps<{
23
- schedulerData: UI_I_ScheduledTasks
24
- isLoading: boolean
50
+ dataTable: UI_I_ScheduledTasksTableItem[]
51
+ loading: boolean
52
+ totalItems: number
53
+ totalPages: number
25
54
  }>()
55
+ const selectedScheduledTaskLocal = defineModel<string | null>()
26
56
 
27
57
  const localization = computed<UI_I_Localization>(() => useLocal())
28
- const { $store }: any = useNuxtApp()
29
-
30
- const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
31
- const currentComponent = computed(() =>
32
- isNewView.value
33
- ? defineAsyncComponent(() => import('./new/New.vue'))
34
- : defineAsyncComponent(() => import('./old/Old.vue'))
35
- )
36
58
 
37
59
  const pagination = ref<UI_I_Pagination>({
38
60
  page: 1,
@@ -1,119 +1,14 @@
1
1
  <template>
2
- <div class="expand-details">
3
- <div
4
- v-for="(item, key) in props.expandData"
5
- :key="key"
6
- class="expand-details__row"
7
- >
8
- <span class="expand-details__label"> {{ item.text }}: </span>
9
- <span class="expand-details__value">
10
- <ui-icon
11
- v-if="item.iconClassName"
12
- :name="item.iconClassName"
13
- width="18"
14
- height="18"
15
- />
16
- {{ item.value }}
17
- </span>
18
- </div>
19
-
20
- <!-- &lt;!&ndash; Event Type &ndash;&gt;-->
21
- <!-- <div class="expand-details__row">-->
22
- <!-- <span class="expand-details__label">-->
23
- <!-- {{ localization.common.type }}:-->
24
- <!-- </span>-->
25
- <!-- <span class="expand-details__status">-->
26
- <!-- <ui-chip-->
27
- <!-- :test-id="props.expandData[1].data.testId"-->
28
- <!-- :color="props.expandData[1].data.chipColor"-->
29
- <!-- size="sm"-->
30
- <!-- rounded-->
31
- <!-- >-->
32
- <!-- <ui-icon-->
33
- <!-- :name="props.expandData[1].data.icon"-->
34
- <!-- width="12px"-->
35
- <!-- height="12px"-->
36
- <!-- class="chip-icon"-->
37
- <!-- ></ui-icon>-->
38
- <!-- {{ props.expandData[1].text }}-->
39
- <!-- </ui-chip>-->
40
- <!-- </span>-->
41
- <!-- </div>-->
42
-
43
- <!-- &lt;!&ndash; Event Target &ndash;&gt;-->
44
- <!-- <div v-if="props.expandData[3].data?.id" class="expand-details__row">-->
45
- <!-- <span class="expand-details__label">-->
46
- <!-- {{ localization.common.target }}:-->
47
- <!-- </span>-->
48
-
49
- <!-- <span class="expand-details__value">-->
50
- <!-- <span :class="['icon', props.expandData[3].data.iconClassName]" />-->
51
- <!-- <slot name="objectTarget" :data="props.expandData[3]"></slot>-->
52
- <!-- </span>-->
53
- <!-- </div>-->
54
-
55
- <!-- &lt;!&ndash; Event User &ndash;&gt;-->
56
- <!-- <div v-if="eventUser" class="expand-details__row">-->
57
- <!-- <span class="expand-details__label">-->
58
- <!-- {{ localization.common.user }}:-->
59
- <!-- </span>-->
60
- <!-- <span class="expand-details__value">-->
61
- <!-- <span class="icon vsphere-icon-user" />-->
62
- <!-- {{ props.expandData[4].text }}-->
63
- <!-- </span>-->
64
- <!-- </div>-->
65
-
66
- <!-- &lt;!&ndash; Event Description &ndash;&gt;-->
67
- <!-- <div class="expand-details__row">-->
68
- <!-- <span class="expand-details__label">-->
69
- <!-- {{ localization.common.description }}:-->
70
- <!-- </span>-->
71
- <!-- <span class="expand-details__value">-->
72
- <!-- {{ props.expandData[0].text }}-->
73
- <!-- </span>-->
74
- <!-- </div>-->
75
-
76
- <!-- &lt;!&ndash; Event Possible Causes &ndash;&gt;-->
77
- <!-- <div v-if="eventPossibleCauses" class="expand-details__row">-->
78
- <!-- <span class="expand-details__label">-->
79
- <!-- {{ localization.common.possibleCauses }}:-->
80
- <!-- </span>-->
81
- <!-- <span class="expand-details__value">-->
82
- <!-- {{ eventPossibleCauses }}-->
83
- <!-- </span>-->
84
- <!-- </div>-->
85
-
86
- <!-- &lt;!&ndash; Related events &ndash;&gt;-->
87
- <!-- <div class="expand-details__row">-->
88
- <!-- <span class="expand-details__label events">-->
89
- <!-- {{ localization.common.relatedEvents }}:-->
90
- <!-- </span>-->
91
- <!-- <span class="expand-details__value disabled">-->
92
- <!-- {{ localization.common.emptyRelatedEvents }}-->
93
- <!-- </span>-->
94
- <!-- </div>-->
95
- </div>
2
+ <div class="expand-details" />
96
3
  </template>
97
4
 
98
5
  <script lang="ts" setup>
99
- import type { UI_I_DataTableBodyData } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
100
- import type { UI_I_Localization } from '~/node_modules/bfg-common/lib/models/interfaces'
101
-
102
- const props = defineProps<{
103
- expandData: UI_I_DataTableBodyData[]
104
- }>()
105
-
106
- const localization = computed<UI_I_Localization>(() => useLocal())
6
+ // import type { UI_I_DataTableBodyData } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
107
7
 
108
- const eventPossibleCauses = computed<string>(() => {
109
- const { expandData } = props.expandData[0].data
110
- return expandData?.message
111
- })
8
+ // const props = defineProps<{
9
+ // expandData: UI_I_DataTableBodyData[]
10
+ // }>()
112
11
 
113
- const eventUser = computed<string>(() => {
114
- const { expandData } = props.expandData[0].data
115
- return expandData?.user_name
116
- })
117
12
  </script>
118
13
 
119
14
  <style lang="scss" scoped>
@@ -146,17 +41,9 @@ const eventUser = computed<string>(() => {
146
41
  &__value {
147
42
  @extend %properties;
148
43
  color: var(--title-form-first-color);
149
- &.target-link {
150
- color: var(--bottom-pannel-rtask-link-text);
151
- cursor: pointer;
152
- &:hover {
153
- color: var(--bottom-pannel-rtask-link-hover-text);
154
- }
155
- }
156
44
  &.disabled {
157
45
  color: var(--table-disabled-btn);
158
46
  }
159
-
160
47
  .icon {
161
48
  margin-right: 4px;
162
49
  }
@@ -10,7 +10,7 @@ import {
10
10
  } from '~/lib/models/store/tasks/enums'
11
11
  import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
12
12
  import { historyLastRunTableKeys } from '~/components/common/pages/scheduledTasks/table/expandDetails/historyRun/lib/config/tableKeys'
13
- import { UI_E_SchedulerRunStatus } from '~/components/common/pages/scheduledTasks/table/lib/models/enums'
13
+ import { schedulerRunStatus } from '~/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus'
14
14
 
15
15
  const getItems = (
16
16
  localization: UI_I_Localization
@@ -68,9 +68,9 @@ export const bodyItems = (
68
68
  const statusData = {
69
69
  iconClassName:
70
70
  UI_E_IconNameByRecentTaskStatus[
71
- event?.result.toLowerCase() === UI_E_SchedulerRunStatus.SUCCESS
71
+ event?.result.toLowerCase() === schedulerRunStatus.SUCCESS
72
72
  ? 2
73
- : event?.result === UI_E_SchedulerRunStatus.RUNNING
73
+ : event?.result === schedulerRunStatus.RUNNING
74
74
  ? 1
75
75
  : 3
76
76
  ],
@@ -12,7 +12,7 @@ export const detailsListFunc = (
12
12
  {
13
13
  id: 1,
14
14
  text: localization.scheduledTasks.scheduledDescription,
15
- value: data?.description || '--',
15
+ value: data.description,
16
16
  testId: 'scheduled-tasks-description',
17
17
  },
18
18
 
@@ -25,14 +25,13 @@ export const detailsListFunc = (
25
25
  {
26
26
  id: 3,
27
27
  text: localization.scheduledTasks.emailNotification,
28
- value: data?.notify_emails || '--',
28
+ value: data.notify_emails,
29
29
  testId: 'scheduled-tasks-email-notification',
30
30
  },
31
31
  {
32
32
  id: 4,
33
33
  text: localization.common.initiator,
34
- value: data?.initiator || '--',
35
- iconClassName: data?.initiator ? 'user-icon' : '',
34
+ value: data.initiator,
36
35
  testId: 'scheduled-tasks-initiator',
37
36
  },
38
37
  {
@@ -9,8 +9,8 @@ import {
9
9
  } from '~/lib/models/store/tasks/enums'
10
10
  import * as defaultSettings from '~/components/atoms/table/dataGrid/lib/config/settingsTable'
11
11
  import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
12
- import { UI_E_SchedulerRunStatus } from '~/components/common/pages/scheduledTasks/table/lib/models/enums'
13
- import { scheduledTaskTableItemsKeys } from '~/components/common/pages/scheduledTasks/table/old/lib/config/tableKeys'
12
+ import { scheduledTaskTableItemsKeys } from '~/components/common/pages/scheduledTasks/table/lib/config/tableKeys'
13
+ import { schedulerRunStatus } from '~/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus'
14
14
 
15
15
  const getItems = (
16
16
  localization: UI_I_Localization
@@ -67,20 +67,16 @@ export const bodyItems = (
67
67
  const statusText =
68
68
  historyLastRun &&
69
69
  UI_E_RecentTaskStatus[
70
- historyLastRun?.result?.toLowerCase() ===
71
- UI_E_SchedulerRunStatus.SUCCESS
72
- ? 2
73
- : -1
70
+ historyLastRun?.result?.toLowerCase() === 'success' ? 2 : -1
74
71
  ]
75
72
 
76
73
  const statusData = {
77
74
  iconClassName:
78
75
  historyLastRun &&
79
76
  UI_E_IconNameByRecentTaskStatus[
80
- historyLastRun?.result.toLowerCase() ===
81
- UI_E_SchedulerRunStatus.SUCCESS
77
+ historyLastRun?.result.toLowerCase() === schedulerRunStatus.SUCCESS
82
78
  ? 2
83
- : historyLastRun?.result === UI_E_SchedulerRunStatus.RUNNING
79
+ : historyLastRun?.result === schedulerRunStatus.RUNNING
84
80
  ? 1
85
81
  : 3
86
82
  ],
@@ -117,8 +113,8 @@ export const bodyItems = (
117
113
  id: task.rid,
118
114
  testId: `adapter-table-${key}-row-item`,
119
115
  data: {
120
- sortValue: lastRun || 0,
121
- },
116
+ sortValue: lastRun || 0
117
+ }
122
118
  },
123
119
  {
124
120
  key: 'icon',
@@ -133,8 +129,8 @@ export const bodyItems = (
133
129
  id: task.rid,
134
130
  testId: `adapter-table-${key}-row-item`,
135
131
  data: {
136
- sortValue: task[scheduledTaskTableItemsKeys[4]],
137
- },
132
+ sortValue: task[scheduledTaskTableItemsKeys[4]]
133
+ }
138
134
  },
139
135
  ])
140
136
  })
@@ -0,0 +1,4 @@
1
+ export const schedulerRunStatus = {
2
+ RUNNING: 'this task has been started',
3
+ SUCCESS: 'success',
4
+ }
@@ -1,4 +1,4 @@
1
- import type { UI_T_ScheduledTaskTableItemsTuple } from '~/components/common/pages/scheduledTasks/table/old/lib/models/types'
1
+ import type { UI_T_ScheduledTaskTableItemsTuple } from '~/components/common/pages/scheduledTasks/table/lib/models/types'
2
2
 
3
3
  export const scheduledTaskTableItemsKeys: UI_T_ScheduledTaskTableItemsTuple = [
4
4
  'name',
@@ -144,7 +144,8 @@ const maxCpuOptions = computed<UI_I_OptionItem[]>(() =>
144
144
  cpuOptionsFunc(
145
145
  localization.value,
146
146
  model.value.cpu.vcpus,
147
- model.value.cpu.max_vcpus
147
+ // model.value.cpu.max_vcpus
148
+ capabilities.value.maxCpus,
148
149
  )
149
150
  )
150
151
  // const selectedMaxCpu = ref<number>(1)
@@ -106,6 +106,7 @@
106
106
  v-model:limit-type="limitType"
107
107
  :error-validation-fields="props.errorValidationFields"
108
108
  :disabled="props.isDisabled"
109
+ :min="model.cpu.reservation_mhz"
109
110
  type="mhz"
110
111
  component-type="cpu"
111
112
  @invalid="emits('limit-invalid', $event)"
@@ -194,7 +195,7 @@ const props = withDefaults(
194
195
  }>(),
195
196
  {
196
197
  vmCpuHelpTextSecond: undefined,
197
- nums: null
198
+ nums: null,
198
199
  }
199
200
  )
200
201
  const emits = defineEmits<{
@@ -84,6 +84,7 @@
84
84
  v-model:limit-type="limitType"
85
85
  :error-validation-fields="props.errorValidationFields"
86
86
  :disabled="props.isDisabled"
87
+ :min="model.cpu.reservation_mhz"
87
88
  type="mhz"
88
89
  component-type="cpu"
89
90
  @invalid="emits('limit-invalid', $event)"
@@ -26,9 +26,10 @@ const props = withDefaults(
26
26
  defineProps<{
27
27
  limit: string
28
28
  limitType: string
29
+ min: number
29
30
  type: 'mb' | 'mhz'
30
31
  componentType: string
31
- errorValidationFields: UI_I_ErrorValidationField<string>[]
32
+ errorValidationFields: UI_I_ErrorValidationField[]
32
33
  disabled?: boolean
33
34
  limitOptions?: UI_I_OptionItem[]
34
35
  multiply?: number
@@ -70,7 +71,7 @@ const binaryKeys: [string, string] =
70
71
  props.type === 'mb' ? ['mb', 'gb'] : ['mhz', 'ghz']
71
72
 
72
73
  const limitOptionsLocal = computed<UI_I_OptionItem[]>(
73
- () => props.limitOptions || limitOptionsFunc(localization.value, binaryKeys)
74
+ () => props.limitOptions || limitOptionsFunc(localization.value, binaryKeys, props.min)
74
75
  )
75
76
  const limitTypeOptions = ref<UI_I_OptionItem[]>(
76
77
  limitTypeOptionsFunc(localization.value, binaryKeys)
@@ -3,12 +3,15 @@ import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
3
3
 
4
4
  export const limitOptionsFunc = (
5
5
  localization: UI_I_Localization,
6
- binaryKeys: [string, string]
6
+ binaryKeys: [string, string],
7
+ min: number
7
8
  ): UI_I_OptionItem[] => {
8
- const min = binaryKeys[0] === 'mb' ? 2 : 1
9
+ // const min = binaryKeys[0] === 'mb' ? 2 : 1
9
10
  return [
10
11
  {
11
- text: `${localization.common.minimum}: ${min} ${localization.common[binaryKeys[0]]}`,
12
+ text: `${localization.common.minimum}: ${min} ${
13
+ localization.common[binaryKeys[0]]
14
+ }`,
12
15
  value: { value: min, type: binaryKeys[0] },
13
16
  },
14
17
  {
@@ -3,6 +3,7 @@
3
3
  <div>
4
4
  <component
5
5
  :is="currentComponent"
6
+ v-model="model"
6
7
  v-model:selected-memory="selectedMemory"
7
8
  v-model:memory-type="memoryType"
8
9
  v-model:reservation="reservation"
@@ -66,6 +66,7 @@
66
66
  :limit-options="props.limitOptions"
67
67
  :multiply="2"
68
68
  :disabled="isDisabled"
69
+ :min="model.memory.reservation_mb"
69
70
  type="mb"
70
71
  component-type="memory"
71
72
  class="memory-limit"
@@ -84,7 +85,9 @@
84
85
  import type { UI_I_Localization } from '~/lib/models/interfaces'
85
86
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
86
87
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
88
+ import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
87
89
 
90
+ const model = defineModel<UI_I_CreateVmData>({ required: true })
88
91
  const selectedMemory = defineModel<number>('selectedMemory', {
89
92
  required: true,
90
93
  })
@@ -80,6 +80,7 @@
80
80
  :limit-options="props.limitOptions"
81
81
  :multiply="2"
82
82
  :disabled="isDisabled"
83
+ :min="model.memory.reservation_mb"
83
84
  type="mb"
84
85
  component-type="memory"
85
86
  class="memory-limit"
@@ -99,7 +100,9 @@
99
100
  import type { UI_I_Localization } from '~/lib/models/interfaces'
100
101
  import type { UI_I_ErrorValidationField } from '~/lib/models/store/interfaces'
101
102
  import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
103
+ import type { UI_I_CreateVmData } from '~/components/common/vm/actions/common/lib/models/interfaces'
102
104
 
105
+ const model = defineModel<UI_I_CreateVmData>({ required: true })
103
106
  const selectedMemory = defineModel<number>('selectedMemory', {
104
107
  required: true,
105
108
  })
@@ -149,7 +152,6 @@ const emits = defineEmits<{
149
152
  }>()
150
153
 
151
154
  const localization = computed<UI_I_Localization>(() => useLocal())
152
-
153
155
  </script>
154
156
 
155
157
  <style scoped lang="scss"></style>
@@ -306,9 +306,10 @@ const isDisabledProvisioning = computed<boolean>(() => {
306
306
  const isDisabledSharing = computed<boolean>(() => {
307
307
  return isRunning.value && !isNewHardDisk.value
308
308
  })
309
- const isDisabledLimitIops = computed<boolean>(() => {
310
- return isRunning.value && !isNewHardDisk.value
311
- })
309
+ const isDisabledLimitIops = ref<boolean>(false)
310
+ // const isDisabledLimitIops = computed<boolean>(() => {
311
+ // return isRunning.value && !isNewHardDisk.value
312
+ // })
312
313
  const isDisabledMode = computed<boolean>(() => {
313
314
  return isRunning.value && !isNewHardDisk.value
314
315
  })
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bfg-common",
3
3
  "private": false,
4
- "version": "1.5.887",
4
+ "version": "1.5.889",
5
5
  "scripts": {
6
6
  "build": "nuxt build",
7
7
  "dev": "nuxt dev --port=3002",
@@ -1,4 +0,0 @@
1
- export enum UI_E_SchedulerRunStatus {
2
- RUNNING = 'this task has been started',
3
- SUCCESS = 'success',
4
- }
@@ -1,324 +0,0 @@
1
- <template>
2
- <ui-data-table
3
- :data="data"
4
- :options="options"
5
- :loading="props.isLoading"
6
- :total-pages="props.totalPages"
7
- :total-items="props.totalItems"
8
- :texts="texts"
9
- :skeleton="skeletonData"
10
- test-id="task-table"
11
- @sort="onSorting"
12
- @pagination="onPagination"
13
- @column-filter="onColumnFilter"
14
- @main-filter="onSearchEvents"
15
- @select-row="onSelectRow"
16
- >
17
- <template #insteadOfTitleActions>
18
- <!-- <common-pages-events-tools-panel-->
19
- <!-- v-model="filterFormModel"-->
20
- <!-- :selected-events="props.selectedEvents"-->
21
- <!-- @filter="onFilterEvents"-->
22
- <!-- />-->
23
- </template>
24
-
25
- <template #icon="{ item }">
26
- <span class="flex-align-center">
27
- <span :class="['icon', item.data.iconClassName]" />
28
-
29
- <span
30
- :data-id="`rtask-${item.data.testId}`"
31
- :class="item.data.isLink && 'target-link'"
32
- @click.stop="onSelectNodeOfTree(item.data)"
33
- >
34
- {{ item.text }}
35
- </span>
36
- </span>
37
- </template>
38
-
39
- <template #status="{ item }">
40
- <ui-chip :test-id="item.data.testId" :color="item.data.chipColor" rounded>
41
- <ui-icon
42
- :name="item.data.icon"
43
- width="14px"
44
- height="14px"
45
- class="chip-icon"
46
- ></ui-icon>
47
- {{ item.text }}
48
- </ui-chip>
49
- </template>
50
-
51
- <template #default-actions="{ item }">
52
- <div class="actions">
53
- <ui-button
54
- :id="`event-table-action-${item.data.id}`"
55
- :test-id="`event-table-action-${item.data.id}`"
56
- variant="text"
57
- is-without-height
58
- is-without-sizes
59
- @click.stop="onToggleActions(item.data.id)"
60
- >
61
- <span
62
- :class="['action-icon', { active: actionsShowId === item.data.id }]"
63
- >
64
- <ui-icon name="vertical-dotes" width="20" height="20" />
65
- </span>
66
- </ui-button>
67
- <ui-dropdown
68
- :show="actionsShowId === item.data.id"
69
- :test-id="`event-table-action-dropdown-${item.data.id}`"
70
- :items="actions"
71
- :elem-id="`event-table-action-${item.data.id}`"
72
- width="max-content"
73
- left
74
- @select="onSelectAction(item.data, $event)"
75
- @hide="onHideActionsDropdown"
76
- >
77
- <template #row="{ item: dropMenu }">
78
- <ui-icon :name="dropMenu.iconName" width="16" height="16" />
79
- <span class="action-text">
80
- {{ dropMenu.text }}
81
- </span>
82
- </template>
83
- </ui-dropdown>
84
- </div>
85
- </template>
86
-
87
- <template #expand="{ item }">
88
- <common-pages-scheduled-tasks-table-expand-details
89
- :data="item.data[0]?.data.expandData"
90
- />
91
- </template>
92
-
93
- <template #skeleton-header>
94
- <div class="skeleton-header">
95
- <div class="left-skeleton">
96
- <ui-skeleton-item width="70" height="16" />
97
- <div class="vertical-line"></div>
98
- <ui-skeleton-item width="70" height="16" />
99
- <ui-skeleton-item width="70" height="16" />
100
- </div>
101
- <div class="right-skeleton">
102
- <ui-skeleton-item width="128" height="36" border-radius="8" />
103
- </div>
104
- </div>
105
- </template>
106
- </ui-data-table>
107
- </template>
108
-
109
- <script setup lang="ts">
110
- import { useDebounceFn } from '@vueuse/core'
111
- import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
112
- import type {
113
- UI_I_DataTable,
114
- UI_I_DataTableHeader,
115
- UI_I_DataTableBody,
116
- UI_I_DataTableBodyData,
117
- UI_I_DataTableSkeleton,
118
- UI_I_Pagination,
119
- UI_I_TableTexts,
120
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
121
- import type { UI_T_ArbitraryObject } from '~/node_modules/bfg-uikit/models/types'
122
- import type { UI_I_TableTarget } from '~/lib/models/table/interfaces'
123
- import type { UI_I_Localization } from '~/lib/models/interfaces'
124
- import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
125
- import {
126
- options,
127
- getTargetActionsFunc,
128
- getHeaderDataFunc,
129
- getBodyDataFunc,
130
- } from '~/components/common/pages/scheduledTasks/table/new/lib/config/scheduledTasksTable'
131
-
132
- const selectedScheduledTaskLocal = defineModel<string | null>({
133
- required: true,
134
- })
135
- const props = defineProps<{
136
- tableItems: UI_I_ScheduledTasksTableItem[]
137
- totalItems: number
138
- totalPages: number
139
- selectedEvents: UI_I_ScheduledTasksTableItem
140
- isLoading: boolean
141
- }>()
142
- const emits = defineEmits<{
143
- (event: 'sort', value: string): void
144
- (event: 'pagination', value: UI_I_Pagination): void
145
- (event: 'col-search', value: string): void
146
- (event: 'select-node', value: UI_I_TableTarget<'sphere'>): void
147
- }>()
148
-
149
- const localization = computed<UI_I_Localization>(() => useLocal())
150
-
151
- const texts = computed<UI_I_TableTexts>(() => ({
152
- searchHere: localization.value.common.searchHere,
153
- rowsPerPage: localization.value.common.rowsPerPage,
154
- of: localization.value.common.of,
155
- selected: localization.value.common.selected,
156
- columns: localization.value.common.columns,
157
- previous: localization.value.common.previous,
158
- next: localization.value.common.next,
159
- noItemsFound: localization.value.common.noItemsFound,
160
- exportAll: localization.value.common.exportAll,
161
- exportSelected: localization.value.common.exportSelected,
162
- all: localization.value.common.all,
163
- filter: localization.value.common.filter,
164
- }))
165
- const skeletonData = ref<UI_I_DataTableSkeleton>({
166
- columnsCount: 6,
167
- headColumns: [],
168
- bodyColumns: [],
169
- })
170
-
171
- const actionsShowId = ref<number>(-1)
172
-
173
- const data = computed<UI_I_DataTable>(() => ({
174
- id: 'scheduled-tasks-table',
175
- header: taskHeadItems.value,
176
- body: taskBodyItems.value,
177
- }))
178
-
179
- const taskHeadItems = computed<UI_I_DataTableHeader[]>(() =>
180
- getHeaderDataFunc(localization.value)
181
- )
182
- const taskBodyItems = computed<UI_I_DataTableBody[]>(() => {
183
- return getBodyDataFunc(props.tableItems || [], localization.value)
184
- })
185
-
186
- const onSorting = (value: string): void => {
187
- emits('sort', value)
188
- }
189
- const onPagination = (value: UI_I_Pagination): void => {
190
- emits('pagination', value)
191
- }
192
- const sendFilter = useDebounceFn((searchText: string) => {
193
- emits('col-search', searchText)
194
- }, 1000)
195
- const onColumnFilter = (obj: UI_T_ArbitraryObject<string>): void => {
196
- let searchText = ''
197
-
198
- for (const [key, value] of Object.entries(obj)) {
199
- const currentFilter = searchText
200
- ? ',' + key + '.' + value
201
- : key + '.' + value
202
-
203
- searchText = searchText + (value ? currentFilter : '')
204
- }
205
- sendFilter(searchText)
206
- }
207
-
208
- const actions = computed<UI_I_Dropdown[]>(() =>
209
- getTargetActionsFunc(localization.value)
210
- )
211
- const onToggleActions = (id: number): void => {
212
- if (actionsShowId.value === id) {
213
- actionsShowId.value = -1
214
- } else {
215
- actionsShowId.value = id
216
- }
217
- }
218
- const onSelectAction = (
219
- data: UI_I_DataTableBodyData['data'],
220
- action: 'view-target' | 'copy-clipboard' | 'export'
221
- ): void => {
222
- const { target, event } = data
223
-
224
- switch (action) {
225
- case 'view-target':
226
- onSelectNodeOfTree(target)
227
- break
228
- case 'copy-clipboard': {
229
- const clipboardText =
230
- [event]?.map((item) => Object.values(item).join(',')).join('\n') || ''
231
-
232
- navigator.clipboard.writeText(clipboardText)
233
- break
234
- }
235
- case 'export':
236
- break
237
- }
238
- onHideActionsDropdown()
239
- }
240
- const onHideActionsDropdown = (): void => {
241
- actionsShowId.value = -1
242
- }
243
-
244
- const onSearchEvents = useDebounceFn((searchText: string) => {
245
- emits('search')
246
- }, 400)
247
-
248
- const onSelectNodeOfTree = (data: UI_I_TableTarget<'sphere'>): void => {
249
- emits('select-node', data)
250
- }
251
- const onSelectRow = (value: UI_I_DataTableBody[]): void => {
252
- selectedScheduledTaskLocal.value = value[0]?.row
253
- }
254
- </script>
255
-
256
- <style scoped lang="scss">
257
- .task-table {
258
- height: inherit;
259
-
260
- .target-link {
261
- font-family: 'Inter', sans-serif;
262
- font-size: 13px;
263
- color: var(--bottom-pannel-rtask-link-text);
264
- font-weight: 400;
265
- line-height: 15.73px;
266
- cursor: pointer;
267
- &:hover {
268
- color: var(--bottom-pannel-rtask-link-hover-text);
269
- }
270
- }
271
- .chip-icon {
272
- min-width: 14px;
273
- }
274
- .icon {
275
- margin-right: 4px;
276
- }
277
-
278
- .actions {
279
- width: 100%;
280
-
281
- .action-icon {
282
- width: 20px;
283
- height: 20px;
284
- color: var(--tasks-actions-icon-color);
285
-
286
- &:hover {
287
- color: var(--tasks-actions-icon-hover-color);
288
- }
289
- &.active {
290
- color: var(--tasks-actions-icon-icative-color);
291
- }
292
- }
293
-
294
- .action-text {
295
- margin-left: 8px;
296
- }
297
- }
298
- &__tooltip {
299
- margin-left: 8px;
300
- }
301
- }
302
-
303
- .skeleton-header {
304
- display: flex;
305
- justify-content: space-between;
306
- align-items: center;
307
-
308
- .left-skeleton {
309
- display: flex;
310
- align-items: center;
311
- column-gap: 16px;
312
- .vertical-line {
313
- height: 24px;
314
- border-right: 1px solid var(--table-line);
315
- }
316
- }
317
-
318
- .right-skeleton {
319
- display: flex;
320
- align-items: center;
321
- column-gap: 16px;
322
- }
323
- }
324
- </style>
@@ -1,218 +0,0 @@
1
- import type {
2
- UI_I_DataTableBody,
3
- UI_I_DataTableHeader,
4
- UI_I_DataTableOptions,
5
- } from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
6
- import type { UI_I_Localization } from '~/lib/models/interfaces'
7
- import type { UI_I_Dropdown } from '~/node_modules/bfg-uikit/components/ui/dropdown/models/interfaces'
8
- import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
9
- import { UI_E_SchedulerRunStatus } from '~/components/common/pages/scheduledTasks/table/lib/models/enums'
10
- import {
11
- E_SchedulerStatus,
12
- E_SchedulerChipColor,
13
- E_SchedulerChipIcon,
14
- } from '~/components/common/pages/scheduledTasks/table/new/lib/models/enums'
15
-
16
- // Маппинг для статусов
17
- const STATUS_MAPPING = {
18
- [E_SchedulerStatus.Completed]: {
19
- textKey: 'complete',
20
- icon: E_SchedulerChipIcon.StatusCheck,
21
- chipColor: E_SchedulerChipColor.Green,
22
- },
23
- [E_SchedulerStatus.Running]: {
24
- textKey: 'running',
25
- icon: E_SchedulerChipIcon.StatusCheck,
26
- chipColor: E_SchedulerChipColor.Green,
27
- },
28
- [E_SchedulerStatus.Failed]: {
29
- textKey: 'failed',
30
- icon: E_SchedulerChipIcon.Information,
31
- chipColor: E_SchedulerChipColor.Red,
32
- },
33
- }
34
-
35
- export const getHeaderDataFunc = (
36
- localization: UI_I_Localization
37
- ): UI_I_DataTableHeader[] => [
38
- {
39
- col: 'col0',
40
- colName: 'name',
41
- text: localization.common.scheduledTask,
42
- isSortable: true,
43
- sort: 'asc',
44
- width: '240px',
45
- show: true,
46
- filter: true,
47
- },
48
- {
49
- col: 'col1',
50
- colName: 'sheduler',
51
- text: localization.common.schedule,
52
- isSortable: true,
53
- sort: 'asc',
54
- width: '180px',
55
- show: true,
56
- filter: true,
57
- },
58
- {
59
- col: 'col2',
60
- colName: 'last_modified',
61
- text: localization.common.lastRun,
62
- isSortable: true,
63
- sort: 'asc',
64
- width: '180px',
65
- show: true,
66
- filter: true,
67
- },
68
- {
69
- col: 'col3',
70
- colName: 'last_run_result',
71
- text: localization.common.lastRunResult,
72
- isSortable: true,
73
- sort: 'asc',
74
- width: '110px',
75
- show: true,
76
- filter: true,
77
- },
78
-
79
- {
80
- col: 'col4',
81
- colName: 'next_run',
82
- text: localization.common.nextRun,
83
- isSortable: true,
84
- sort: 'asc',
85
- width: '160px',
86
- show: true,
87
- filter: true,
88
- },
89
- ]
90
-
91
- export const getTargetActionsFunc = (
92
- localization: UI_I_Localization
93
- ): UI_I_Dropdown[] => {
94
- return [
95
- {
96
- value: 'view-target',
97
- text: localization.common.viewTarget,
98
- iconName: 'password-hide',
99
- selected: false,
100
- },
101
- {
102
- value: 'copy-clipboard',
103
- text: localization.events.copyToClipboard,
104
- iconName: 'copy-to-clipboard',
105
- selected: false,
106
- },
107
- // {
108
- // value: 'export',
109
- // text: localization.common.export,
110
- // iconName: 'download-2',
111
- // selected: false,
112
- // },
113
- ]
114
- }
115
-
116
- export const options: UI_I_DataTableOptions = {
117
- perPageOptions: [
118
- { text: '10', value: 10 },
119
- { text: '25', value: 25 },
120
- { text: '50', value: 50 },
121
- { text: '100', value: 100, default: true },
122
- ],
123
- selectType: 'radio',
124
- isSelectable: true,
125
- isFocusable: false,
126
- showPagination: true,
127
- showPaginationOnTop: false,
128
- showPageInfo: true,
129
- isSortable: true,
130
- server: true,
131
- isResizable: true,
132
- showSearch: false,
133
- showSelectedRows: false,
134
- showColumnManager: true,
135
- withActions: true,
136
- inBlock: true,
137
- showExport: false,
138
- withCollapse: true,
139
- }
140
-
141
- export const getBodyDataFunc = (
142
- bodyData: UI_I_ScheduledTasksTableItem[],
143
- localization: UI_I_Localization
144
- ): UI_I_DataTableBody[] => {
145
- const { $formattedDatetime }: any = useNuxtApp()
146
- return bodyData.map((scheduler, index: number) => {
147
- const historyLastRun = scheduler?.last_5_run?.at(-1)
148
-
149
- const lastRun = historyLastRun?.start
150
- const formattedLastRun =
151
- lastRun && $formattedDatetime(+lastRun * 1000, { hasSeconds: true })
152
-
153
- const nextRun = scheduler.next_run
154
- const formattedNextRun =
155
- nextRun && $formattedDatetime(+nextRun * 1000, { hasSeconds: true })
156
-
157
- const statusKey =
158
- historyLastRun?.result.toLowerCase() === UI_E_SchedulerRunStatus.SUCCESS
159
- ? E_SchedulerStatus.Completed
160
- : historyLastRun?.result === UI_E_SchedulerRunStatus.RUNNING
161
- ? E_SchedulerStatus.Running
162
- : E_SchedulerStatus.Failed
163
- const statusData = {
164
- ...STATUS_MAPPING[statusKey],
165
- testId: `${scheduler.rid}-${index}-status`,
166
- }
167
-
168
- return {
169
- row: scheduler.rid,
170
- collapse: true,
171
- isHiddenCollapse: false,
172
- collapseToggle: false,
173
- data: [
174
- {
175
- key: 'icon',
176
- col: 'col0',
177
- text: scheduler.name,
178
- data: {
179
- iconClassName: 'icon-events',
180
- expandData: scheduler,
181
- },
182
- testId: `table-item-${scheduler.rid}`,
183
- },
184
- {
185
- col: 'col1',
186
- text: scheduler.sheduler || '--',
187
- data: 'statusData',
188
- testId: `table-item-${scheduler.rid}`,
189
- },
190
- {
191
- col: 'col2',
192
- text: formattedLastRun,
193
- testId: `table-item-${scheduler.rid}`,
194
- },
195
- {
196
- key: 'status',
197
- col: 'col3',
198
- text: localization.common[statusData.textKey],
199
- data: statusData,
200
- testId: `table-item-${scheduler.rid}`,
201
- },
202
- {
203
- key: 'icon',
204
- col: 'col4',
205
- text: formattedNextRun,
206
- data: 'dataTarget',
207
- testId: `table-item-${scheduler.rid}`,
208
- },
209
- {
210
- key: 'default-actions',
211
- col: 'default-actions',
212
- text: '',
213
- data: { id: index, target: 'dataTarget', scheduler },
214
- },
215
- ],
216
- }
217
- })
218
- }
@@ -1,14 +0,0 @@
1
- export enum E_SchedulerStatus {
2
- Completed = 'completed',
3
- Running = 'running',
4
- Failed = 'failed',
5
- }
6
-
7
- export enum E_SchedulerChipColor {
8
- Green = 'green',
9
- Red = 'red',
10
- }
11
- export enum E_SchedulerChipIcon {
12
- StatusCheck = 'status-check',
13
- Information = 'info-stroke',
14
- }
@@ -1,93 +0,0 @@
1
- <template>
2
- <div class="data-table-view">
3
- <atoms-table-data-grid
4
- v-model:selected-row="selectedScheduledTaskLocal"
5
- v-model:page-size="pagination.pageSize"
6
- v-model:page="pagination.page"
7
- :head-items="headItems"
8
- :body-items="bodyItems"
9
- :total-items="props.totalItems"
10
- :total-pages="props.totalPages"
11
- :items-per-page="itemsPerPage"
12
- :z-index-header-shift="2"
13
- :loading="props.isLoading"
14
- type="radio"
15
- class="data-table"
16
- test-id="scheduled-tasks-table"
17
- hide-pagination
18
- hide-page-size
19
- off-select-by-row
20
- server-off
21
- >
22
- <template #icon="{ item }">
23
- <atoms-the-icon :name="item.data.iconClassName" class="icon" />
24
- <span :title="item.text" class="text-ellipsis">
25
- {{ item.text }}
26
- </span>
27
- </template>
28
-
29
- <template #toggleBlock="{ item }">
30
- <common-pages-scheduled-tasks-table-expand-details
31
- :data="item[0].data.expandData"
32
- />
33
- </template>
34
- </atoms-table-data-grid>
35
- </div>
36
- </template>
37
-
38
- <script lang="ts" setup>
39
- import type {
40
- UI_I_HeadItem,
41
- UI_I_BodyItem,
42
- } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
43
- import { itemsPerPage } from '~/components/atoms/table/dataGrid/lib/config/itemsPerPage'
44
- import type { UI_I_Localization } from '~/lib/models/interfaces'
45
- import type { UI_I_Pagination } from '~/lib/models/table/interfaces'
46
- import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
47
- import * as scheduledTaskTable from '~/components/common/pages/scheduledTasks/table/old/lib/config/scheduledTasksTable'
48
-
49
- const selectedScheduledTaskLocal = defineModel<string | null>()
50
- const props = defineProps<{
51
- tableItems: UI_I_ScheduledTasksTableItem[]
52
- totalItems: number
53
- totalPages: number
54
- isLoading: boolean
55
- }>()
56
-
57
- const localization = computed<UI_I_Localization>(() => useLocal())
58
-
59
- const pagination = ref<UI_I_Pagination>({
60
- page: 1,
61
- pageSize: 100,
62
- })
63
-
64
- const headItems = computed<UI_I_HeadItem[]>(() =>
65
- scheduledTaskTable.headItems(localization.value)
66
- )
67
- const bodyItems = computed<UI_I_BodyItem[][]>(() => {
68
- return scheduledTaskTable.bodyItems(props.tableItems || [])
69
- })
70
- </script>
71
-
72
- <style lang="scss" scoped>
73
- .data-table-view {
74
- overflow: hidden;
75
- height: inherit;
76
- margin-bottom: 10px;
77
- :deep(.data-table) {
78
- height: inherit;
79
- .datagrid-outer-wrapper {
80
- height: inherit;
81
- padding-top: 0;
82
- //.datagrid {
83
- // margin-top: 0;
84
- //}
85
- }
86
- }
87
- .icon {
88
- width: 18px;
89
- min-width: 18px;
90
- margin-right: 3px;
91
- }
92
- }
93
- </style>