update translation
This commit is contained in:
1 parent
02d0c1dcd6
commit
1689347494
9 files changed
+1170
-324
No files matched your search
@@ -523,13 +523,13 @@ const scheduleCronDesigner = ref({
|
||||
weekly_minute: 0,
|
||||
});
|
||||
const weeklyDayOptions = [
|
||||
{ value: 1, label: '周一' },
|
||||
{ value: 2, label: '周二' },
|
||||
{ value: 3, label: '周三' },
|
||||
{ value: 4, label: '周四' },
|
||||
{ value: 5, label: '周五' },
|
||||
{ value: 6, label: '周六' },
|
||||
{ value: 0, label: '周日' },
|
||||
{ value: 1, label: t('admin.schedule.weekday.mon') },
|
||||
{ value: 2, label: t('admin.schedule.weekday.tue') },
|
||||
{ value: 3, label: t('admin.schedule.weekday.wed') },
|
||||
{ value: 4, label: t('admin.schedule.weekday.thu') },
|
||||
{ value: 5, label: t('admin.schedule.weekday.fri') },
|
||||
{ value: 6, label: t('admin.schedule.weekday.sat') },
|
||||
{ value: 0, label: t('admin.schedule.weekday.sun') },
|
||||
];
|
||||
|
||||
const buildCronExprFromDesigner = () => {
|
||||
@@ -808,20 +808,20 @@ const selectedSchedule = computed(() =>
|
||||
);
|
||||
|
||||
const scheduleRunStatusOptions = [
|
||||
{ value: 'all', label: '全部状态' },
|
||||
{ value: 'success', label: '成功' },
|
||||
{ value: 'partial_failed', label: '部分成功' },
|
||||
{ value: 'failed', label: '失败' },
|
||||
{ value: 'running', label: '执行中' },
|
||||
{ value: 'all', label: t('admin.schedule.status.all') },
|
||||
{ value: 'success', label: t('admin.schedule.status.success') },
|
||||
{ value: 'partial_failed', label: t('admin.schedule.status.partialFailed') },
|
||||
{ value: 'failed', label: t('admin.schedule.status.failed') },
|
||||
{ value: 'running', label: t('admin.schedule.status.running') },
|
||||
];
|
||||
|
||||
const getScheduleRunStatusBadge = (status: string) => {
|
||||
const map: Record<string, { cls: string; label: string }> = {
|
||||
success: { cls: 'bg-emerald-100 text-emerald-700', label: '成功' },
|
||||
partial_failed: { cls: 'bg-blue-100 text-blue-700', label: '部分成功' },
|
||||
failed: { cls: 'bg-rose-100 text-rose-700', label: '失败' },
|
||||
running: { cls: 'bg-amber-100 text-amber-700', label: '执行中' },
|
||||
queued: { cls: 'bg-slate-100 text-slate-600', label: '排队中' },
|
||||
success: { cls: 'bg-emerald-100 text-emerald-700', label: t('admin.schedule.status.success') },
|
||||
partial_failed: { cls: 'bg-blue-100 text-blue-700', label: t('admin.schedule.status.partialFailed') },
|
||||
failed: { cls: 'bg-rose-100 text-rose-700', label: t('admin.schedule.status.failed') },
|
||||
running: { cls: 'bg-amber-100 text-amber-700', label: t('admin.schedule.status.running') },
|
||||
queued: { cls: 'bg-slate-100 text-slate-600', label: t('admin.schedule.status.queued') },
|
||||
};
|
||||
return map[status] || { cls: 'bg-slate-100 text-slate-600', label: status };
|
||||
};
|
||||
@@ -837,15 +837,15 @@ const formatDateTime = (iso?: string | null) => {
|
||||
const expandedScheduleRunId = ref<number | null>(null);
|
||||
|
||||
const stepLabelMap: Record<string, string> = {
|
||||
fetch_srm: '抓取外部系统数据',
|
||||
call_dify: '调用Dify服务',
|
||||
writeback_srm: '回写外部系统数据',
|
||||
call_internal_api: '调用内部API',
|
||||
pre_dify: 'Dify前处理',
|
||||
fetch_srm: t('admin.schedule.step.fetchSrm'),
|
||||
call_dify: t('admin.schedule.step.callDify'),
|
||||
writeback_srm: t('admin.schedule.step.writebackSrm'),
|
||||
call_internal_api: t('admin.schedule.step.callInternalApi'),
|
||||
pre_dify: t('admin.schedule.step.preDify'),
|
||||
};
|
||||
const stepStatusMap: Record<string, { cls: string; label: string }> = {
|
||||
success: { cls: 'bg-emerald-100 text-emerald-700', label: '成功' },
|
||||
failed: { cls: 'bg-rose-100 text-rose-700', label: '失败' },
|
||||
success: { cls: 'bg-emerald-100 text-emerald-700', label: t('admin.schedule.status.success') },
|
||||
failed: { cls: 'bg-rose-100 text-rose-700', label: t('admin.schedule.status.failed') },
|
||||
};
|
||||
|
||||
const showTestRunDialog = ref(false);
|
||||
@@ -893,7 +893,7 @@ const handleTestRun = async () => {
|
||||
await viewScheduleRuns(s.id);
|
||||
}
|
||||
} catch (e: any) {
|
||||
msg.error(`测试执行失败: ${e?.message || e}`);
|
||||
msg.error(`${t('admin.schedule.msg.testRunFailed')}: ${e?.message || e}`);
|
||||
} finally {
|
||||
testRunLoading.value = false;
|
||||
}
|
||||
@@ -1025,7 +1025,7 @@ const createSchedule = async () => {
|
||||
const hasSql = dst === 'database' && !!scheduleSqlEditForm.value.base_fetch_sql.trim();
|
||||
const hasApi = dst === 'external_api' && !!scheduleSqlEditForm.value.api_url.trim();
|
||||
if (!hasAgent && !hasSql && !hasApi) {
|
||||
msg.error('Dify Agent、SQL 配置或外部 API 至少填写一项,否则排程执行无任何效果');
|
||||
msg.error(t('admin.schedule.msg.configRequired'));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -1033,7 +1033,7 @@ const createSchedule = async () => {
|
||||
try {
|
||||
headerLabels = JSON.parse(scheduleSqlEditForm.value.header_labels_str || '{}');
|
||||
} catch {
|
||||
msg.error('header_labels JSON 格式错误,请检查');
|
||||
msg.error(t('admin.schedule.msg.headerLabelsJsonInvalid'));
|
||||
return;
|
||||
}
|
||||
let apiHeaders: Record<string, string> = {};
|
||||
@@ -1041,7 +1041,7 @@ const createSchedule = async () => {
|
||||
try {
|
||||
apiHeaders = JSON.parse(scheduleSqlEditForm.value.api_headers_str || '{}');
|
||||
} catch {
|
||||
msg.error('API Headers JSON 格式错误,请检查');
|
||||
msg.error(t('admin.schedule.msg.apiHeadersJsonInvalid'));
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -1165,7 +1165,7 @@ const runScheduleNow = async (taskId: number) => {
|
||||
const res = await runAdminSchedule(taskId);
|
||||
if (!res.ok) {
|
||||
const data = await res.json().catch(() => ({}));
|
||||
msg.error(data?.error || '手动执行失败');
|
||||
msg.error(data?.error || t('admin.schedule.msg.runNowFailed'));
|
||||
return;
|
||||
}
|
||||
await viewScheduleRuns(taskId);
|
||||
@@ -1189,7 +1189,7 @@ const setScheduleEnabled = async (taskId: number, enabled: boolean) => {
|
||||
const downloadScheduleExcel = async (runId: number) => {
|
||||
const res = await fetch(`/api/admin/schedule-runs/${runId}/excel`, { headers: getAuthHeaders() });
|
||||
if (!res.ok) {
|
||||
msg.error('下载 Excel 失败');
|
||||
msg.error(t('admin.schedule.msg.downloadExcelFailed'));
|
||||
return;
|
||||
}
|
||||
const blob = await res.blob();
|
||||
@@ -1206,11 +1206,11 @@ const downloadScheduleExcel = async (runId: number) => {
|
||||
|
||||
const deleteSchedule = (task: ScheduleTask) => {
|
||||
openDeleteConfirmDialog(
|
||||
`确认删除排程「${task.name}」?`,
|
||||
t('admin.schedule.deleteConfirmMessage', { name: task.name }),
|
||||
async () => {
|
||||
const res = await deleteAdminSchedule(task.id);
|
||||
if (!res.ok) {
|
||||
msg.error('删除排程失败');
|
||||
msg.error(t('admin.schedule.msg.deleteFailed'));
|
||||
return;
|
||||
}
|
||||
if (selectedScheduleId.value === task.id) {
|
||||
@@ -1219,7 +1219,7 @@ const deleteSchedule = (task: ScheduleTask) => {
|
||||
}
|
||||
await loadSchedules();
|
||||
},
|
||||
'删除排程'
|
||||
t('admin.schedule.deleteDialogTitle')
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user