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_VERSION=1.2.0-beta1
|
||||
VITE_APP_VERSION=1.2.0-beta2
|
||||
|
||||
VITE_APP_DEFAULT_TOKEN=SJ_Wyz3dmsdbDOkDujOTSSoBjGQP1BMsVnj
|
||||
|
||||
|
@ -1,6 +1,6 @@
|
||||
<script setup lang="ts">
|
||||
import { $t } from '@/locales';
|
||||
import { monthRange } from '@/utils/common';
|
||||
import { dayRange, monthRange } from '@/utils/common';
|
||||
|
||||
defineOptions({
|
||||
name: 'DatetimeRange'
|
||||
@ -13,6 +13,9 @@ const modelValue = defineModel<[string, string] | null>('value');
|
||||
|
||||
const createShortcuts = () => {
|
||||
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.lastMonth')] = monthRange(1, '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">
|
||||
<NDrawerContent>
|
||||
<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" />
|
||||
</div>
|
||||
</template>
|
||||
|
@ -146,9 +146,17 @@ const getClass = (item: Workflow.ConditionNodeType) => {
|
||||
<div class="auto-judge" :class="getClass(item)" @click="showDetail(item, index)">
|
||||
<div class="title">
|
||||
<span class="text text-#935af6">
|
||||
<NBadge processing dot :color="item.workflowNodeStatus === 1 ? '#52c41a' : '#ff4d4f'" />
|
||||
{{ item.nodeName }}
|
||||
<span v-if="item.id"> ({{ item.id }})</span>
|
||||
<span class="flex items-center">
|
||||
<NBadge processing dot :color="item.workflowNodeStatus === 1 ? '#52c41a' : '#ff4d4f'" />
|
||||
{{ item.nodeName }}
|
||||
<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>
|
||||
<icon-ant-design:close-outlined v-if="!disabled" class="close" @click.stop="delTerm" />
|
||||
</div>
|
||||
|
@ -210,6 +210,8 @@ const local: App.I18n.Schema = {
|
||||
},
|
||||
updateDt: 'Updated Time',
|
||||
createDt: 'Created Time',
|
||||
today: 'Today',
|
||||
lastWeek: 'Last Week',
|
||||
currentMonth: 'Current Month',
|
||||
lastMonth: 'Last Month',
|
||||
lastTwoMonth: 'Last 2 Month'
|
||||
|
@ -148,7 +148,7 @@ const local: App.I18n.Schema = {
|
||||
items: {
|
||||
cluster: '集群',
|
||||
broadcast: '广播',
|
||||
slice: '静态切片',
|
||||
slice: '静态分片',
|
||||
map: 'Map',
|
||||
mapreduce: 'MapReduce'
|
||||
}
|
||||
@ -210,6 +210,8 @@ const local: App.I18n.Schema = {
|
||||
},
|
||||
updateDt: '更新时间',
|
||||
createDt: '创建时间',
|
||||
today: '今天',
|
||||
lastWeek: '最近一周',
|
||||
currentMonth: '当月',
|
||||
lastMonth: '最近一月',
|
||||
lastTwoMonth: '最近两月'
|
||||
|
2
src/typings/app.d.ts
vendored
2
src/typings/app.d.ts
vendored
@ -491,6 +491,8 @@ declare namespace App {
|
||||
};
|
||||
updateDt: string;
|
||||
createDt: string;
|
||||
today: string;
|
||||
lastWeek: string;
|
||||
currentMonth: string;
|
||||
lastMonth: string;
|
||||
lastTwoMonth: string;
|
||||
|
@ -120,7 +120,7 @@ export function toggleHtmlClass(className: string) {
|
||||
}
|
||||
|
||||
/**
|
||||
* 创建 `最近n个自然月` timestamp时间区间
|
||||
* 创建 `最近n个自然月` timestamp 时间区间
|
||||
*
|
||||
* @param months 月数
|
||||
* @param startOf 时间的开始类型
|
||||
@ -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个自然月` 字符串时间区间
|
||||
*
|
||||
@ -147,6 +164,13 @@ export function monthRangeISO8601(months: number = 1, startOf: dayjs.OpUnitType
|
||||
] 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) {
|
||||
return value !== undefined && value !== null && value !== '' && value !== 'undefined';
|
||||
}
|
||||
@ -190,7 +214,7 @@ export function stringToContent(
|
||||
if (typeof jsonString === 'string') {
|
||||
try {
|
||||
parsedObj = JSON.parse(jsonString);
|
||||
} catch (e) {
|
||||
} catch {
|
||||
return [];
|
||||
}
|
||||
}
|
||||
|
@ -14,7 +14,7 @@ import { $t } from '@/locales';
|
||||
import { useAppStore } from '@/store/modules/app';
|
||||
import { useTable, useTableOperate } from '@/hooks/common/table';
|
||||
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 JobBatchSearch from './modules/job-batch-search.vue';
|
||||
import JobBatchDetailDrawer from './modules/job-batch-detail-drawer.vue';
|
||||
@ -38,7 +38,7 @@ const { columnChecks, columns, data, getData, loading, mobilePagination, searchP
|
||||
jobName: null,
|
||||
taskBatchStatus: null,
|
||||
jobId: null,
|
||||
datetimeRange: monthRangeISO8601()
|
||||
datetimeRange: weekRangeISO8601()
|
||||
},
|
||||
searchParams: {
|
||||
jobId,
|
||||
|
@ -53,6 +53,8 @@ watch(
|
||||
model.value.jobName = value;
|
||||
} else {
|
||||
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">
|
||||
<NSelect
|
||||
v-model:value="model.taskBatchStatus"
|
||||
multiple
|
||||
max-tag-count="responsive"
|
||||
:placeholder="$t('common.taskBatchStatus.form')"
|
||||
:options="
|
||||
translateOptions(taskBatchStatusRecordOptions).filter(item => ![98, 99].includes(item.value as number))
|
||||
|
@ -188,6 +188,7 @@ const executorCustomOptions = [
|
||||
type ScriptParams = {
|
||||
method: string;
|
||||
scriptParams: string;
|
||||
charset: string;
|
||||
};
|
||||
|
||||
const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
|
||||
@ -195,7 +196,8 @@ const scriptParams = reactive<ScriptParams>(createDefaultScriptParams());
|
||||
function createDefaultScriptParams() {
|
||||
return {
|
||||
method: 'LOCAL_SCRIPT',
|
||||
scriptParams: ''
|
||||
scriptParams: '',
|
||||
charset: ''
|
||||
};
|
||||
}
|
||||
|
||||
@ -589,6 +591,9 @@ const scriptMethodOptions = [
|
||||
<NFormItem label="脚本参数">
|
||||
<CodeMirror v-model="scriptParams.scriptParams" lang="json" placeholder="请输入脚本参数" />
|
||||
</NFormItem>
|
||||
<NFormItem label="编码格式">
|
||||
<NInput v-model:value="scriptParams.charset" placeholder="请输入编码格式" />
|
||||
</NFormItem>
|
||||
</NForm>
|
||||
</template>
|
||||
</NFormItem>
|
||||
@ -659,7 +664,11 @@ const scriptMethodOptions = [
|
||||
</NFormItem>
|
||||
</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
|
||||
v-model:value="model.parallelNum"
|
||||
:min="1"
|
||||
|
Loading…
Reference in New Issue
Block a user