bfg-common 1.5.921 → 1.5.923
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.
- package/assets/localization/local_be.json +4 -16
- package/assets/localization/local_en.json +4 -16
- package/assets/localization/local_hy.json +4 -16
- package/assets/localization/local_kk.json +4 -16
- package/assets/localization/local_ru.json +4 -16
- package/assets/localization/local_zh.json +4 -16
- package/components/common/pages/scheduledTasks/lib/models/interfaces.ts +0 -6
- package/components/common/pages/scheduledTasks/modals/common/frequency/Frequency.vue +42 -46
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/AfterStartup.vue +48 -15
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/End.vue +69 -15
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Interval.vue +53 -19
- package/components/common/pages/scheduledTasks/modals/common/frequency/lib/utils.ts +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/On.vue +168 -28
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/lib/config/options.ts +0 -17
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/SelectWeek.vue +28 -17
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/lib/config/weekOptions.ts +50 -20
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/StartOn.vue +51 -15
- package/components/common/pages/scheduledTasks/modals/common/{taskForm/Old.vue → newTaskForm/NewTaskForm.vue} +69 -12
- package/components/common/pages/scheduledTasks/table/Table.vue +81 -27
- package/components/common/pages/scheduledTasks/table/expandDetails/ExpandDetails.vue +2 -2
- package/components/common/pages/scheduledTasks/table/expandDetails/New.vue +17 -48
- package/components/common/pages/scheduledTasks/table/expandDetails/Old.vue +3 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/HistoryRun.vue +54 -16
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/config/historyRunsTable.ts +4 -4
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/config/expandDetails.ts +5 -7
- package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/scheduledTasksTable.ts +9 -13
- package/components/common/pages/scheduledTasks/table/lib/config/schedulerStatus.ts +4 -0
- package/components/common/pages/scheduledTasks/table/{old/lib → lib}/config/tableKeys.ts +1 -1
- package/components/common/pages/scheduledTasks/table/lib/models/interfaces.ts +11 -0
- package/package.json +1 -1
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/New.vue +0 -43
- package/components/common/pages/scheduledTasks/modals/common/frequency/afterStartup/Old.vue +0 -65
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/New.vue +0 -73
- package/components/common/pages/scheduledTasks/modals/common/frequency/end/Old.vue +0 -112
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/New.vue +0 -49
- package/components/common/pages/scheduledTasks/modals/common/frequency/interval/Old.vue +0 -68
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/New.vue +0 -137
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/Old.vue +0 -234
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/New.vue +0 -66
- package/components/common/pages/scheduledTasks/modals/common/frequency/on/selectWeek/Old.vue +0 -44
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/New.vue +0 -46
- package/components/common/pages/scheduledTasks/modals/common/frequency/startOn/Old.vue +0 -77
- package/components/common/pages/scheduledTasks/modals/common/taskForm/New.vue +0 -194
- package/components/common/pages/scheduledTasks/modals/common/taskForm/TaskForm.vue +0 -129
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/New.vue +0 -147
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/lib/config/historyRunsTable.ts +0 -161
- package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/old/Old.vue +0 -68
- package/components/common/pages/scheduledTasks/table/expandDetails/lib/models/interfaces.ts +0 -8
- package/components/common/pages/scheduledTasks/table/lib/models/enums.ts +0 -4
- package/components/common/pages/scheduledTasks/table/new/New.vue +0 -320
- package/components/common/pages/scheduledTasks/table/new/lib/config/scheduledTasksTable.ts +0 -218
- package/components/common/pages/scheduledTasks/table/new/lib/models/enums.ts +0 -14
- package/components/common/pages/scheduledTasks/table/old/Old.vue +0 -93
- /package/components/common/pages/scheduledTasks/modals/common/{taskForm → newTaskForm}/lib/models/interfaces.ts +0 -0
- /package/components/common/pages/scheduledTasks/modals/common/{taskForm → newTaskForm}/lib/utils.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/expandDetails/historyRun/{old/lib → lib}/models/types.ts +0 -0
- /package/components/common/pages/scheduledTasks/table/{old/lib → lib}/models/types.ts +0 -0
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<!-- Аргумент (:template-view-mode) используется только для нового интерфейса -->
|
|
3
|
-
<component
|
|
4
|
-
:is="currentComponent"
|
|
5
|
-
v-model="scheduledTaskFormModel"
|
|
6
|
-
:target="props.target"
|
|
7
|
-
:form-validation-fields="initValidationFields"
|
|
8
|
-
:task-name-error-text="taskNameErrorText"
|
|
9
|
-
:frequency-method-options="frequencyMethodOptions"
|
|
10
|
-
:template-view-mode="props.templateViewMode"
|
|
11
|
-
@init-validation="onInitValidation"
|
|
12
|
-
/>
|
|
13
|
-
</template>
|
|
14
|
-
|
|
15
|
-
<script lang="ts" setup>
|
|
16
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
17
|
-
import type { UI_I_SelectInputItem } from '~/components/common/select/input/lib/models/interfaces'
|
|
18
|
-
import type { UI_I_ScheduleNewTasksForm } from '~/components/common/pages/scheduledTasks/modals/lib/models/interfaces'
|
|
19
|
-
import type { UI_I_InitialValidationFields } from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/models/interfaces'
|
|
20
|
-
import type { UI_T_FrequencyType } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/models/types'
|
|
21
|
-
import * as cron from '~/components/common/pages/scheduledTasks/modals/common/taskForm/lib/utils'
|
|
22
|
-
import { frequencyMethodFunc } from '~/components/common/pages/scheduledTasks/modals/common/frequency/lib/config/frequencyOptions'
|
|
23
|
-
import type { UI_I_OptionItem } from '~/components/atoms/lib/models/interfaces'
|
|
24
|
-
|
|
25
|
-
const scheduledTaskFormModel = defineModel<UI_I_ScheduleNewTasksForm>({
|
|
26
|
-
required: true,
|
|
27
|
-
})
|
|
28
|
-
const props = withDefaults(
|
|
29
|
-
defineProps<{
|
|
30
|
-
target: string
|
|
31
|
-
templateViewMode?: 'horizontal' | 'vertical'
|
|
32
|
-
}>(),
|
|
33
|
-
{ templateViewMode: 'vertical' }
|
|
34
|
-
)
|
|
35
|
-
|
|
36
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
37
|
-
const { $store }: any = useNuxtApp()
|
|
38
|
-
|
|
39
|
-
const isNewView = computed<boolean>(() => $store.getters['main/getIsNewView'])
|
|
40
|
-
const currentComponent = computed(() =>
|
|
41
|
-
isNewView.value
|
|
42
|
-
? defineAsyncComponent(() => import('./New.vue'))
|
|
43
|
-
: defineAsyncComponent(() => import('./Old.vue'))
|
|
44
|
-
)
|
|
45
|
-
|
|
46
|
-
const initValidationFields = ref<UI_I_InitialValidationFields>({
|
|
47
|
-
taskName: false,
|
|
48
|
-
})
|
|
49
|
-
const onInitValidation = (
|
|
50
|
-
types: (keyof UI_I_InitialValidationFields)[]
|
|
51
|
-
): void => {
|
|
52
|
-
types.forEach((type) => (initValidationFields.value[type] = true))
|
|
53
|
-
}
|
|
54
|
-
|
|
55
|
-
const taskNameErrorText = computed<string>(() => {
|
|
56
|
-
if (!initValidationFields.value.taskName) return ''
|
|
57
|
-
|
|
58
|
-
scheduledTaskFormModel.value.task_name =
|
|
59
|
-
scheduledTaskFormModel.value.task_name.replace(/^\s+/, '')
|
|
60
|
-
|
|
61
|
-
return !scheduledTaskFormModel.value.task_name
|
|
62
|
-
? localization.value.common.fieldRequired
|
|
63
|
-
: ''
|
|
64
|
-
})
|
|
65
|
-
|
|
66
|
-
const frequencyMethodOptions = computed<UI_I_SelectInputItem[]>(() =>
|
|
67
|
-
frequencyMethodFunc(localization.value)
|
|
68
|
-
)
|
|
69
|
-
|
|
70
|
-
watch(
|
|
71
|
-
scheduledTaskFormModel,
|
|
72
|
-
(newValue: UI_I_ScheduleNewTasksForm) => {
|
|
73
|
-
newValue.cron = generateCronExpression(newValue.frequency, newValue)
|
|
74
|
-
},
|
|
75
|
-
{ deep: true }
|
|
76
|
-
)
|
|
77
|
-
|
|
78
|
-
const generateCronExpression = (
|
|
79
|
-
runType: UI_T_FrequencyType,
|
|
80
|
-
interval: UI_I_ScheduleNewTasksForm
|
|
81
|
-
): string => {
|
|
82
|
-
let cronExpression
|
|
83
|
-
|
|
84
|
-
// Генерируем cron-выражение на основе runType
|
|
85
|
-
switch (runType) {
|
|
86
|
-
case 'once':
|
|
87
|
-
const timestamp = Math.floor(
|
|
88
|
-
new Date(interval.frg_on_time).getTime() / 1000
|
|
89
|
-
)
|
|
90
|
-
cronExpression = `* * * * * ${timestamp}:0-0-0-0:once`
|
|
91
|
-
break
|
|
92
|
-
case 'after-startup':
|
|
93
|
-
const suffixDelay =
|
|
94
|
-
interval.frg_after_startup === 0 ? '' : `-${interval.frg_after_startup}`
|
|
95
|
-
cronExpression = `* * * * * after_procurator_startup${suffixDelay}` // Выполняется после запуска procurator_startup с задержой N минут
|
|
96
|
-
break
|
|
97
|
-
case 'hour':
|
|
98
|
-
cronExpression = cron.generateHourlyCronExpression(interval)
|
|
99
|
-
break
|
|
100
|
-
case 'day':
|
|
101
|
-
cronExpression = cron.generateDailyCronExpression(interval)
|
|
102
|
-
break
|
|
103
|
-
case 'week':
|
|
104
|
-
cronExpression = cron.generateWeeklyCronExpression(interval)
|
|
105
|
-
break
|
|
106
|
-
case 'month':
|
|
107
|
-
cronExpression = cron.generateMonthlyCronExpression(interval)
|
|
108
|
-
break
|
|
109
|
-
default:
|
|
110
|
-
cronExpression = '* * * * *'
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
return cronExpression
|
|
114
|
-
}
|
|
115
|
-
|
|
116
|
-
// Используется только для нового интерфейса и вызывается в родительском компоненте
|
|
117
|
-
// Запускаем валидацию всех полей
|
|
118
|
-
const isValidateForm = (): boolean => {
|
|
119
|
-
onInitValidation(['taskName'])
|
|
120
|
-
|
|
121
|
-
const errorChecks = [taskNameErrorText.value]
|
|
122
|
-
|
|
123
|
-
// если поле невалидно — значение будет непустым
|
|
124
|
-
return errorChecks.every((text) => !text?.length)
|
|
125
|
-
}
|
|
126
|
-
defineExpose({
|
|
127
|
-
isValidateForm,
|
|
128
|
-
})
|
|
129
|
-
</script>
|
|
@@ -1,147 +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
|
-
>
|
|
15
|
-
<template #status="{ item }">
|
|
16
|
-
<ui-chip :test-id="item.data.testId" :color="item.data.chipColor" rounded>
|
|
17
|
-
<ui-icon
|
|
18
|
-
:name="item.data.icon"
|
|
19
|
-
width="14px"
|
|
20
|
-
height="14px"
|
|
21
|
-
class="chip-icon"
|
|
22
|
-
></ui-icon>
|
|
23
|
-
{{ item.text }}
|
|
24
|
-
</ui-chip>
|
|
25
|
-
|
|
26
|
-
<common-tooltip-help
|
|
27
|
-
v-if="item.data.chipColor === 'red'"
|
|
28
|
-
:title="localization.common.failureReason"
|
|
29
|
-
:help-text="'Lorem Ipsum'"
|
|
30
|
-
:test-id="`${item.data.testId}`"
|
|
31
|
-
:help-id="`${item.data.testId}-tooltip`"
|
|
32
|
-
status="error"
|
|
33
|
-
dropdown-width="320px"
|
|
34
|
-
dropdown-left
|
|
35
|
-
dropdown-top
|
|
36
|
-
class="ml-2"
|
|
37
|
-
/>
|
|
38
|
-
</template>
|
|
39
|
-
</ui-data-table>
|
|
40
|
-
</template>
|
|
41
|
-
|
|
42
|
-
<script setup lang="ts">
|
|
43
|
-
import { useDebounceFn } from '@vueuse/core'
|
|
44
|
-
import type {
|
|
45
|
-
UI_I_DataTable,
|
|
46
|
-
UI_I_DataTableHeader,
|
|
47
|
-
UI_I_DataTableBody,
|
|
48
|
-
UI_I_DataTableSkeleton,
|
|
49
|
-
UI_I_Pagination,
|
|
50
|
-
UI_I_TableTexts,
|
|
51
|
-
} from '~/node_modules/bfg-uikit/components/ui/dataTable/models/interfaces'
|
|
52
|
-
import type { UI_T_ArbitraryObject } from '~/node_modules/bfg-uikit/models/types'
|
|
53
|
-
import type { UI_I_TableTarget } from '~/lib/models/table/interfaces'
|
|
54
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
55
|
-
import type { UI_I_ScheduledTasks } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
|
|
56
|
-
import {
|
|
57
|
-
options,
|
|
58
|
-
getHeaderDataFunc,
|
|
59
|
-
getBodyDataFunc,
|
|
60
|
-
} from '~/components/common/pages/scheduledTasks/table/expandDetails/historyRun/new/lib/config/historyRunsTable'
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
const props = defineProps<{
|
|
64
|
-
tableItems: UI_I_ScheduledTasks['items']
|
|
65
|
-
totalItems: number
|
|
66
|
-
totalPages: number
|
|
67
|
-
isLoading: boolean
|
|
68
|
-
}>()
|
|
69
|
-
const emits = defineEmits<{
|
|
70
|
-
(event: 'sort', value: string): void
|
|
71
|
-
(event: 'pagination', value: UI_I_Pagination): void
|
|
72
|
-
(event: 'col-search', value: string): void
|
|
73
|
-
(event: 'select-node', value: UI_I_TableTarget<'sphere'>): void
|
|
74
|
-
}>()
|
|
75
|
-
|
|
76
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
77
|
-
|
|
78
|
-
const texts = computed<UI_I_TableTexts>(() => ({
|
|
79
|
-
searchHere: localization.value.common.searchHere,
|
|
80
|
-
rowsPerPage: localization.value.common.rowsPerPage,
|
|
81
|
-
of: localization.value.common.of,
|
|
82
|
-
selected: localization.value.common.selected,
|
|
83
|
-
columns: localization.value.common.columns,
|
|
84
|
-
previous: localization.value.common.previous,
|
|
85
|
-
next: localization.value.common.next,
|
|
86
|
-
noItemsFound: localization.value.common.noItemsFound,
|
|
87
|
-
exportAll: localization.value.common.exportAll,
|
|
88
|
-
exportSelected: localization.value.common.exportSelected,
|
|
89
|
-
all: localization.value.common.all,
|
|
90
|
-
filter: localization.value.common.filter,
|
|
91
|
-
}))
|
|
92
|
-
const skeletonData = ref<UI_I_DataTableSkeleton>({
|
|
93
|
-
columnsCount: 6,
|
|
94
|
-
headColumns: [],
|
|
95
|
-
bodyColumns: [],
|
|
96
|
-
})
|
|
97
|
-
|
|
98
|
-
const data = computed<UI_I_DataTable>(() => ({
|
|
99
|
-
id: 'scheduled-tasks-history-table',
|
|
100
|
-
header: taskHeadItems.value,
|
|
101
|
-
body: taskBodyItems.value,
|
|
102
|
-
}))
|
|
103
|
-
|
|
104
|
-
const taskHeadItems = computed<UI_I_DataTableHeader[]>(() =>
|
|
105
|
-
getHeaderDataFunc(localization.value)
|
|
106
|
-
)
|
|
107
|
-
const taskBodyItems = computed<UI_I_DataTableBody[]>(() => {
|
|
108
|
-
return getBodyDataFunc(props.tableItems || [], localization.value)
|
|
109
|
-
})
|
|
110
|
-
|
|
111
|
-
const onSorting = (value: string): void => {
|
|
112
|
-
emits('sort', value)
|
|
113
|
-
}
|
|
114
|
-
const onPagination = (value: UI_I_Pagination): void => {
|
|
115
|
-
emits('pagination', value)
|
|
116
|
-
}
|
|
117
|
-
const sendFilter = useDebounceFn((searchText: string) => {
|
|
118
|
-
emits('col-search', searchText)
|
|
119
|
-
}, 1000)
|
|
120
|
-
const onColumnFilter = (obj: UI_T_ArbitraryObject<string>): void => {
|
|
121
|
-
let searchText = ''
|
|
122
|
-
|
|
123
|
-
for (const [key, value] of Object.entries(obj)) {
|
|
124
|
-
const currentFilter = searchText
|
|
125
|
-
? ',' + key + '.' + value
|
|
126
|
-
: key + '.' + value
|
|
127
|
-
|
|
128
|
-
searchText = searchText + (value ? currentFilter : '')
|
|
129
|
-
}
|
|
130
|
-
sendFilter(searchText)
|
|
131
|
-
}
|
|
132
|
-
</script>
|
|
133
|
-
|
|
134
|
-
<style scoped lang="scss">
|
|
135
|
-
.task-table {
|
|
136
|
-
height: inherit;
|
|
137
|
-
.chip-icon {
|
|
138
|
-
min-width: 14px;
|
|
139
|
-
}
|
|
140
|
-
.icon {
|
|
141
|
-
margin-right: 4px;
|
|
142
|
-
}
|
|
143
|
-
&__tooltip {
|
|
144
|
-
margin-left: 8px;
|
|
145
|
-
}
|
|
146
|
-
}
|
|
147
|
-
</style>
|
|
@@ -1,161 +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_ScheduledTasks } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
|
|
8
|
-
import { UI_E_SchedulerRunStatus } from '~/components/common/pages/scheduledTasks/table/lib/models/enums'
|
|
9
|
-
import {
|
|
10
|
-
UI_E_SchedulerStatus,
|
|
11
|
-
UI_E_SchedulerChipColor,
|
|
12
|
-
UI_E_SchedulerChipIcon,
|
|
13
|
-
} from '~/components/common/pages/scheduledTasks/table/new/lib/models/enums'
|
|
14
|
-
|
|
15
|
-
// Маппинг для статусов
|
|
16
|
-
const STATUS_MAPPING = {
|
|
17
|
-
[UI_E_SchedulerStatus.Completed]: {
|
|
18
|
-
textKey: 'completed',
|
|
19
|
-
icon: UI_E_SchedulerChipIcon.StatusCheck,
|
|
20
|
-
chipColor: UI_E_SchedulerChipColor.Green,
|
|
21
|
-
},
|
|
22
|
-
[UI_E_SchedulerStatus.Running]: {
|
|
23
|
-
textKey: 'running',
|
|
24
|
-
icon: UI_E_SchedulerChipIcon.StatusCheck,
|
|
25
|
-
chipColor: UI_E_SchedulerChipColor.Green,
|
|
26
|
-
},
|
|
27
|
-
[UI_E_SchedulerStatus.Failed]: {
|
|
28
|
-
textKey: 'failed',
|
|
29
|
-
icon: UI_E_SchedulerChipIcon.Information,
|
|
30
|
-
chipColor: UI_E_SchedulerChipColor.Red,
|
|
31
|
-
},
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
export const getHeaderDataFunc = (
|
|
35
|
-
localization: UI_I_Localization
|
|
36
|
-
): UI_I_DataTableHeader[] => [
|
|
37
|
-
{
|
|
38
|
-
col: 'col0',
|
|
39
|
-
colName: 'start',
|
|
40
|
-
text: localization.common.startTime,
|
|
41
|
-
isSortable: true,
|
|
42
|
-
sort: 'asc',
|
|
43
|
-
width: '240px',
|
|
44
|
-
show: true,
|
|
45
|
-
filter: true,
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
col: 'col1',
|
|
49
|
-
colName: 'duration',
|
|
50
|
-
text: localization.scheduledTasks.duration,
|
|
51
|
-
isSortable: true,
|
|
52
|
-
sort: 'asc',
|
|
53
|
-
width: '180px',
|
|
54
|
-
show: true,
|
|
55
|
-
filter: true,
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
col: 'col2',
|
|
59
|
-
colName: 'end',
|
|
60
|
-
text: localization.scheduledTasks.endTime,
|
|
61
|
-
isSortable: true,
|
|
62
|
-
sort: 'asc',
|
|
63
|
-
width: '180px',
|
|
64
|
-
show: true,
|
|
65
|
-
filter: true,
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
col: 'col3',
|
|
69
|
-
colName: 'result',
|
|
70
|
-
text: localization.scheduledTasks.result,
|
|
71
|
-
isSortable: true,
|
|
72
|
-
sort: 'asc',
|
|
73
|
-
width: '110px',
|
|
74
|
-
show: true,
|
|
75
|
-
filter: true,
|
|
76
|
-
},
|
|
77
|
-
]
|
|
78
|
-
|
|
79
|
-
export const options: UI_I_DataTableOptions = {
|
|
80
|
-
perPageOptions: [
|
|
81
|
-
{ text: '10', value: 10 },
|
|
82
|
-
{ text: '25', value: 25 },
|
|
83
|
-
{ text: '50', value: 50 },
|
|
84
|
-
{ text: '100', value: 100, default: true },
|
|
85
|
-
],
|
|
86
|
-
isSelectable: false,
|
|
87
|
-
isFocusable: false,
|
|
88
|
-
showPagination: false,
|
|
89
|
-
showPaginationOnTop: false,
|
|
90
|
-
showPageInfo: false,
|
|
91
|
-
isSortable: true,
|
|
92
|
-
server: false,
|
|
93
|
-
isResizable: true,
|
|
94
|
-
showSearch: false,
|
|
95
|
-
showSelectedRows: false,
|
|
96
|
-
showColumnManager: false,
|
|
97
|
-
withActions: false,
|
|
98
|
-
inBlock: true,
|
|
99
|
-
showExport: false,
|
|
100
|
-
withCollapse: false,
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
export const getBodyDataFunc = (
|
|
104
|
-
bodyData: UI_I_ScheduledTasks['items'][number]['last_5_run'],
|
|
105
|
-
localization: UI_I_Localization
|
|
106
|
-
): UI_I_DataTableBody[] => {
|
|
107
|
-
const { $formattedDatetime }: any = useNuxtApp()
|
|
108
|
-
return bodyData.map((schedulerHistory, index: number) => {
|
|
109
|
-
const startTime = schedulerHistory.start
|
|
110
|
-
const formattedStartTime = $formattedDatetime(+startTime * 1000, {
|
|
111
|
-
hasSeconds: true,
|
|
112
|
-
})
|
|
113
|
-
|
|
114
|
-
const endTime = schedulerHistory.end
|
|
115
|
-
const formattedEndTime =
|
|
116
|
-
endTime && $formattedDatetime(+endTime * 1000, { hasSeconds: true })
|
|
117
|
-
|
|
118
|
-
const statusKey =
|
|
119
|
-
schedulerHistory?.result.toLowerCase() === UI_E_SchedulerRunStatus.SUCCESS
|
|
120
|
-
? UI_E_SchedulerStatus.Completed
|
|
121
|
-
: schedulerHistory?.result === UI_E_SchedulerRunStatus.RUNNING
|
|
122
|
-
? UI_E_SchedulerStatus.Running
|
|
123
|
-
: UI_E_SchedulerStatus.Failed
|
|
124
|
-
const statusData = {
|
|
125
|
-
...STATUS_MAPPING[statusKey],
|
|
126
|
-
testId: `${schedulerHistory.tid}-${index}-status`,
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return {
|
|
130
|
-
row: schedulerHistory.tid,
|
|
131
|
-
collapse: false,
|
|
132
|
-
isHiddenCollapse: false,
|
|
133
|
-
collapseToggle: false,
|
|
134
|
-
data: [
|
|
135
|
-
{
|
|
136
|
-
col: 'col0',
|
|
137
|
-
text: formattedStartTime,
|
|
138
|
-
testId: `table-item-${schedulerHistory.tid}`,
|
|
139
|
-
},
|
|
140
|
-
{
|
|
141
|
-
col: 'col1',
|
|
142
|
-
text: 'schedulerHistory.sched_type' || '--',
|
|
143
|
-
data: 'statusData',
|
|
144
|
-
testId: `table-item-${schedulerHistory.tid}`,
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
col: 'col2',
|
|
148
|
-
text: formattedEndTime,
|
|
149
|
-
testId: `table-item-${schedulerHistory.tid}`,
|
|
150
|
-
},
|
|
151
|
-
{
|
|
152
|
-
key: 'status',
|
|
153
|
-
col: 'col3',
|
|
154
|
-
text: localization.common[statusData.textKey],
|
|
155
|
-
data: statusData,
|
|
156
|
-
testId: `table-item-${schedulerHistory.tid}`,
|
|
157
|
-
},
|
|
158
|
-
],
|
|
159
|
-
}
|
|
160
|
-
})
|
|
161
|
-
}
|
|
@@ -1,68 +0,0 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<atoms-table-data-grid
|
|
3
|
-
:selected-row="null"
|
|
4
|
-
:page-size="1"
|
|
5
|
-
:page="1"
|
|
6
|
-
:head-items="headItems"
|
|
7
|
-
:body-items="bodyItems"
|
|
8
|
-
:total-items="props.totalItems"
|
|
9
|
-
:total-pages="props.totalPages"
|
|
10
|
-
:loading="props.isLoading"
|
|
11
|
-
test-id="scheduled-tasks-history-runs-table"
|
|
12
|
-
class="history-runs-table"
|
|
13
|
-
off-select-by-row
|
|
14
|
-
hide-footer
|
|
15
|
-
>
|
|
16
|
-
<template #icon="{ item }">
|
|
17
|
-
<atoms-the-icon :name="item.data.iconClassName" class="icon" />
|
|
18
|
-
<span :title="item.text" class="text-ellipsis">
|
|
19
|
-
{{ item.text }}
|
|
20
|
-
</span>
|
|
21
|
-
</template>
|
|
22
|
-
</atoms-table-data-grid>
|
|
23
|
-
</template>
|
|
24
|
-
|
|
25
|
-
<script lang="ts" setup>
|
|
26
|
-
import type {
|
|
27
|
-
UI_I_HeadItem,
|
|
28
|
-
UI_I_BodyItem,
|
|
29
|
-
} from '~/components/atoms/table/compact/lib/models/interfaces'
|
|
30
|
-
import type { UI_I_Localization } from '~/lib/models/interfaces'
|
|
31
|
-
import type { UI_I_ScheduledTasksTableItem } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
|
|
32
|
-
import * as historyRunTable from '~/components/common/pages/scheduledTasks/table/expandDetails/historyRun/old/lib/config/historyRunsTable'
|
|
33
|
-
|
|
34
|
-
const props = defineProps<{
|
|
35
|
-
tableItems: UI_I_ScheduledTasksTableItem['last_5_run']
|
|
36
|
-
totalItems: number
|
|
37
|
-
totalPages: number
|
|
38
|
-
isLoading: boolean
|
|
39
|
-
}>()
|
|
40
|
-
|
|
41
|
-
const localization = computed<UI_I_Localization>(() => useLocal())
|
|
42
|
-
|
|
43
|
-
const headItems = computed<UI_I_HeadItem[]>(() =>
|
|
44
|
-
historyRunTable.headItems(localization.value)
|
|
45
|
-
)
|
|
46
|
-
const bodyItems = computed<UI_I_BodyItem[][]>(() => {
|
|
47
|
-
return historyRunTable.bodyItems(props.tableItems || [])
|
|
48
|
-
})
|
|
49
|
-
</script>
|
|
50
|
-
|
|
51
|
-
<style lang="scss" scoped>
|
|
52
|
-
.history-runs-table {
|
|
53
|
-
height: inherit;
|
|
54
|
-
:deep(.datagrid-outer-wrapper) {
|
|
55
|
-
height: inherit;
|
|
56
|
-
padding-top: 0;
|
|
57
|
-
}
|
|
58
|
-
:deep(.datagrid-row-scrollable) {
|
|
59
|
-
flex-direction: row;
|
|
60
|
-
}
|
|
61
|
-
|
|
62
|
-
.icon {
|
|
63
|
-
width: 18px;
|
|
64
|
-
min-width: 18px;
|
|
65
|
-
margin-right: 3px;
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
</style>
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import { UI_I_TableRowDropDetails } from '~/components/atoms/table/dataGrid/lib/models/interfaces'
|
|
2
|
-
import type { UI_I_ScheduledTasks } from '~/components/common/pages/scheduledTasks/lib/models/interfaces'
|
|
3
|
-
|
|
4
|
-
export interface UI_I_ScheduleTableExpandDetails
|
|
5
|
-
extends Omit<UI_I_TableRowDropDetails, 'value'> {
|
|
6
|
-
value: string | UI_I_ScheduledTasks['items'][number]['last_5_run']
|
|
7
|
-
disabled?: boolean
|
|
8
|
-
}
|