Merge branch '1.2.0-beta2' into preview
This commit is contained in:
commit
1e2974a7d8
2
.env
2
.env
@ -4,7 +4,7 @@ VITE_APP_TITLE=Snail Job
|
|||||||
|
|
||||||
VITE_APP_DESC=A flexible, reliable, and fast platform for distributed task retry and distributed task scheduling.
|
VITE_APP_DESC=A flexible, reliable, and fast platform for distributed task retry and distributed task scheduling.
|
||||||
|
|
||||||
VITE_APP_VERSION=1.2.0-beta1
|
VITE_APP_VERSION=1.2.0-beta2
|
||||||
|
|
||||||
VITE_APP_DEFAULT_TOKEN=SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj
|
VITE_APP_DEFAULT_TOKEN=SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj
|
||||||
|
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { $t } from '@/locales';
|
import { $t } from '@/locales';
|
||||||
import { monthRange } from '@/utils/common';
|
import { dayRange, monthRange } from '@/utils/common';
|
||||||
|
|
||||||
defineOptions({
|
defineOptions({
|
||||||
name: 'DatetimeRange'
|
name: 'DatetimeRange'
|
||||||
@ -13,6 +13,9 @@ const modelValue = defineModel<[string, string] | null>('value');
|
|||||||
|
|
||||||
const createShortcuts = () => {
|
const createShortcuts = () => {
|
||||||
const shortcuts: any = {};
|
const shortcuts: any = {};
|
||||||
|
shortcuts[$t('common.today')] = dayRange(1);
|
||||||
|
shortcuts[$t('common.lastWeek')] = dayRange(7);
|
||||||
|
shortcuts[$t('common.lastMonth')] = monthRange(1, 'month');
|
||||||
shortcuts[$t('common.currentMonth')] = monthRange(0, 'month');
|
shortcuts[$t('common.currentMonth')] = monthRange(0, 'month');
|
||||||
shortcuts[$t('common.lastMonth')] = monthRange(1, 'month');
|
shortcuts[$t('common.lastMonth')] = monthRange(1, 'month');
|
||||||
shortcuts[$t('common.lastTwoMonth')] = monthRange(2, 'month');
|
shortcuts[$t('common.lastTwoMonth')] = monthRange(2, 'month');
|
||||||
|
@ -77,7 +77,7 @@ const rules: FormRules = {
|
|||||||
<NDrawer v-model:show="drawer" display-directive="if" :width="500" @after-leave="close">
|
<NDrawer v-model:show="drawer" display-directive="if" :width="500" @after-leave="close">
|
||||||
<NDrawerContent>
|
<NDrawerContent>
|
||||||
<template #header>
|
<template #header>
|
||||||
<div class="w-460px flex-center">
|
<div class="w-460px flex items-center">
|
||||||
<EditableInput v-model="form.nodeName" class="mr-16px max-w-320px min-w-320px" />
|
<EditableInput v-model="form.nodeName" class="mr-16px max-w-320px min-w-320px" />
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
@ -146,9 +146,17 @@ const getClass = (item: Workflow.ConditionNodeType) => {
|
|||||||
<div class="auto-judge" :class="getClass(item)" @click="showDetail(item, index)">
|
<div class="auto-judge" :class="getClass(item)" @click="showDetail(item, index)">
|
||||||
<div class="title">
|
<div class="title">
|
||||||
<span class="text text-#935af6">
|
<span class="text text-#935af6">
|
||||||
|
<span class="flex items-center">
|
||||||
<NBadge processing dot :color="item.workflowNodeStatus === 1 ? '#52c41a' : '#ff4d4f'" />
|
<NBadge processing dot :color="item.workflowNodeStatus === 1 ? '#52c41a' : '#ff4d4f'" />
|
||||||
{{ item.nodeName }}
|
{{ item.nodeName }}
|
||||||
<span v-if="item.id"> ({{ item.id }})</span>
|
<span v-if="item.id"> ({{ item.id }})</span>
|
||||||
|
<NTooltip>
|
||||||
|
<template #trigger>
|
||||||
|
<icon-ant-design:info-circle-outlined class="ml-3px text-16px" />
|
||||||
|
</template>
|
||||||
|
此节点后续将废弃,请使用定时任务中的 HTTP 内置执行器进行替换。
|
||||||
|
</NTooltip>
|
||||||
|
</span>
|
||||||
</span>
|
</span>
|
||||||
<icon-ant-design:close-outlined v-if="!disabled" class="close" @click.stop="delTerm" />
|
<icon-ant-design:close-outlined v-if="!disabled" class="close" @click.stop="delTerm" />
|
||||||
</div>
|
</div>
|
||||||
|
@ -210,6 +210,8 @@ const local: App.I18n.Schema = {
|
|||||||
},
|
},
|
||||||
updateDt: 'Updated Time',
|
updateDt: 'Updated Time',
|
||||||
createDt: 'Created Time',
|
createDt: 'Created Time',
|
||||||
|
today: 'Today',
|
||||||
|
lastWeek: 'Last Week',
|
||||||
currentMonth: 'Current Month',
|
currentMonth: 'Current Month',
|
||||||
lastMonth: 'Last Month',
|
lastMonth: 'Last Month',
|
||||||
lastTwoMonth: 'Last 2 Month'
|
lastTwoMonth: 'Last 2 Month'
|
||||||
|
@ -148,7 +148,7 @@ const local: App.I18n.Schema = {
|
|||||||
items: {
|
items: {
|
||||||
cluster: '集群',
|
cluster: '集群',
|
||||||
broadcast: '广播',
|
broadcast: '广播',
|
||||||
slice: '静态切片',
|
slice: '静态分片',
|
||||||
map: 'Map',
|
map: 'Map',
|
||||||
mapreduce: 'MapReduce'
|
mapreduce: 'MapReduce'
|
||||||
}
|
}
|
||||||
@ -210,6 +210,8 @@ const local: App.I18n.Schema = {
|
|||||||
},
|
},
|
||||||
updateDt: '更新时间',
|
updateDt: '更新时间',
|
||||||
createDt: '创建时间',
|
createDt: '创建时间',
|
||||||
|
today: '今天',
|
||||||
|
lastWeek: '最近一周',
|
||||||
currentMonth: '当月',
|
currentMonth: '当月',
|
||||||
lastMonth: '最近一月',
|
lastMonth: '最近一月',
|
||||||
lastTwoMonth: '最近两月'
|
lastTwoMonth: '最近两月'
|
||||||
|
2
src/typings/app.d.ts
vendored
2
src/typings/app.d.ts
vendored
@ -491,6 +491,8 @@ declare namespace App {
|
|||||||
};
|
};
|
||||||
updateDt: string;
|
updateDt: string;
|
||||||
createDt: string;
|
createDt: string;
|
||||||
|
today: string;
|
||||||
|
lastWeek: string;
|
||||||
currentMonth: string;
|
currentMonth: string;
|
||||||
lastMonth: string;
|
lastMonth: string;
|
||||||
lastTwoMonth: string;
|
lastTwoMonth: string;
|
||||||
|
@ -133,6 +133,23 @@ export function monthRange(months: number = 1, startOf: dayjs.OpUnitType = 'day'
|
|||||||
];
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 创建 `最近n个自然月` timestamp 时间区间
|
||||||
|
*
|
||||||
|
* @param days 日数
|
||||||
|
* @param startOf 时间的开始类型
|
||||||
|
* @returns timestamp时间区间
|
||||||
|
*/
|
||||||
|
export function dayRange(days: number = 1) {
|
||||||
|
return [
|
||||||
|
dayjs()
|
||||||
|
.subtract(days - 1, 'day')
|
||||||
|
.startOf('day')
|
||||||
|
.valueOf(),
|
||||||
|
dayjs().endOf('day').valueOf()
|
||||||
|
] as [number, number];
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 创建 `最近n个自然月` 字符串时间区间
|
* 创建 `最近n个自然月` 字符串时间区间
|
||||||
*
|
*
|
||||||
@ -147,6 +164,13 @@ export function monthRangeISO8601(months: number = 1, startOf: dayjs.OpUnitType
|
|||||||
] as [string, string];
|
] as [string, string];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export function weekRangeISO8601(weeks: number = 1, startOf: dayjs.OpUnitType = 'day') {
|
||||||
|
return [
|
||||||
|
dayjs().subtract(weeks, 'week').startOf(startOf).format('YYYY-MM-DDTHH:mm:ss'),
|
||||||
|
dayjs().endOf('day').format('YYYY-MM-DDTHH:mm:ss')
|
||||||
|
] as [string, string];
|
||||||
|
}
|
||||||
|
|
||||||
export function isNotNull(value: any) {
|
export function isNotNull(value: any) {
|
||||||
return value !== undefined && value !== null && value !== '' && value !== 'undefined';
|
return value !== undefined && value !== null && value !== '' && value !== 'undefined';
|
||||||
}
|
}
|
||||||
@ -190,7 +214,7 @@ export function stringToContent(
|
|||||||
if (typeof jsonString === 'string') {
|
if (typeof jsonString === 'string') {
|
||||||
try {
|
try {
|
||||||
parsedObj = JSON.parse(jsonString);
|
parsedObj = JSON.parse(jsonString);
|
||||||
} catch (e) {
|
} catch {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ import { $t } from '@/locales';
|
|||||||
import { useAppStore } from '@/store/modules/app';
|
import { useAppStore } from '@/store/modules/app';
|
||||||
import { useTable, useTableOperate } from '@/hooks/common/table';
|
import { useTable, useTableOperate } from '@/hooks/common/table';
|
||||||
import { operationReasonRecord, taskBatchStatusRecord, taskTypeRecord } from '@/constants/business';
|
import { operationReasonRecord, taskBatchStatusRecord, taskTypeRecord } from '@/constants/business';
|
||||||
import { monthRangeISO8601, tagColor } from '@/utils/common';
|
import { tagColor, weekRangeISO8601 } from '@/utils/common';
|
||||||
import SvgIcon from '@/components/custom/svg-icon.vue';
|
import SvgIcon from '@/components/custom/svg-icon.vue';
|
||||||
import JobBatchSearch from './modules/job-batch-search.vue';
|
import JobBatchSearch from './modules/job-batch-search.vue';
|
||||||
import JobBatchDetailDrawer from './modules/job-batch-detail-drawer.vue';
|
import JobBatchDetailDrawer from './modules/job-batch-detail-drawer.vue';
|
||||||
@ -38,7 +38,7 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
|||||||
jobName: null,
|
jobName: null,
|
||||||
taskBatchStatus: null,
|
taskBatchStatus: null,
|
||||||
jobId: null,
|
jobId: null,
|
||||||
datetimeRange: monthRangeISO8601()
|
datetimeRange: weekRangeISO8601()
|
||||||
},
|
},
|
||||||
searchParams: {
|
searchParams: {
|
||||||
jobId,
|
jobId,
|
||||||
|
@ -53,6 +53,8 @@ watch(
|
|||||||
model.value.jobName = value;
|
model.value.jobName = value;
|
||||||
} else {
|
} else {
|
||||||
noSearchFlag.value = false;
|
noSearchFlag.value = false;
|
||||||
|
model.value.jobId = null;
|
||||||
|
model.value.jobName = null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
@ -89,6 +91,8 @@ function renderLabel(option: SelectOption) {
|
|||||||
<NFormItemGi span="24 s:12 m:8" :label="$t('page.jobBatch.taskBatchStatus')" path="taskBatchStatus" class="pr-24px">
|
<NFormItemGi span="24 s:12 m:8" :label="$t('page.jobBatch.taskBatchStatus')" path="taskBatchStatus" class="pr-24px">
|
||||||
<NSelect
|
<NSelect
|
||||||
v-model:value="model.taskBatchStatus"
|
v-model:value="model.taskBatchStatus"
|
||||||
|
multiple
|
||||||
|
max-tag-count="responsive"
|
||||||
:placeholder="$t('common.taskBatchStatus.form')"
|
:placeholder="$t('common.taskBatchStatus.form')"
|
||||||
:options="
|
:options="
|
||||||
translateOptions(taskBatchStatusRecordOptions).filter(item => ![98, 99].includes(item.value as number))
|
translateOptions(taskBatchStatusRecordOptions).filter(item => ![98, 99].includes(item.value as number))
|
||||||
|
@ -188,6 +188,7 @@ const executorCustomOptions = [
|
|||||||
type ScriptParams = {
|
type ScriptParams = {
|
||||||
method: string;
|
method: string;
|
||||||
scriptParams: string;
|
scriptParams: string;
|
||||||
|
charset: string;
|
||||||
};
|
};
|
||||||
|
|
||||||
const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
|
const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
|
||||||
@ -195,7 +196,8 @@ const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
|
|||||||
function createDefaultScriptParams() {
|
function createDefaultScriptParams() {
|
||||||
return {
|
return {
|
||||||
method: 'LOCAL_SCRIPT',
|
method: 'LOCAL_SCRIPT',
|
||||||
scriptParams: ''
|
scriptParams: '',
|
||||||
|
charset: ''
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -589,6 +591,9 @@ const scriptMethodOptions = [
|
|||||||
<NFormItem label="脚本参数">
|
<NFormItem label="脚本参数">
|
||||||
<CodeMirror v-model="scriptParams.scriptParams" lang="json" placeholder="请输入脚本参数" />
|
<CodeMirror v-model="scriptParams.scriptParams" lang="json" placeholder="请输入脚本参数" />
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
|
<NFormItem label="编码格式">
|
||||||
|
<NInput v-model:value="scriptParams.charset" placeholder="请输入编码格式" />
|
||||||
|
</NFormItem>
|
||||||
</NForm>
|
</NForm>
|
||||||
</template>
|
</template>
|
||||||
</NFormItem>
|
</NFormItem>
|
||||||
@ -659,7 +664,11 @@ const scriptMethodOptions = [
|
|||||||
</NFormItem>
|
</NFormItem>
|
||||||
</NGi>
|
</NGi>
|
||||||
<NGi>
|
<NGi>
|
||||||
<NFormItem v-if="model.taskType !== 1" :label="$t('page.jobTask.parallelNum')" path="parallelNum">
|
<NFormItem
|
||||||
|
v-if="model.taskType !== 1 && model.taskType !== 2"
|
||||||
|
:label="$t('page.jobTask.parallelNum')"
|
||||||
|
path="parallelNum"
|
||||||
|
>
|
||||||
<NInputNumber
|
<NInputNumber
|
||||||
v-model:value="model.parallelNum"
|
v-model:value="model.parallelNum"
|
||||||
:min="1"
|
:min="1"
|
||||||
|
Loading…
Reference in New Issue
Block a user