✨ 计划任务中断及清理.
This commit is contained in:
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="wrapper">
|
||||
<exec-log-panel ref="log" :visible-back="false" />
|
||||
<exec-log-panel ref="log"
|
||||
type="BATCH"
|
||||
:visible-back="false" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
<exec-command-log-clear-modal ref="clearModal"
|
||||
@clear="clearCallback" />
|
||||
<!-- 执行日志模态框 -->
|
||||
<exec-log-panel-modal ref="logModal" />
|
||||
<exec-log-panel-modal ref="logModal"
|
||||
type="BATCH" />
|
||||
<!-- json 模态框 -->
|
||||
<json-editor-modal ref="jsonModal"
|
||||
:esc-to-close="true" />
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
<!-- 执行日志 -->
|
||||
<div v-if="logVisible" class="panel-wrapper">
|
||||
<exec-log-panel ref="log"
|
||||
type="BATCH"
|
||||
:visibleBack="true"
|
||||
@back="setLogVisible(false)" />
|
||||
</div>
|
||||
|
||||
@@ -1,7 +1,9 @@
|
||||
<template>
|
||||
<div class="container">
|
||||
<div class="wrapper">
|
||||
<exec-log-panel ref="log" :visible-back="false" />
|
||||
<exec-log-panel ref="log"
|
||||
type="JOB"
|
||||
:visible-back="false" />
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -103,17 +103,17 @@
|
||||
<script lang="ts" setup>
|
||||
import type { ExecLogQueryResponse, ExecHostLogQueryResponse } from '@/api/exec/exec-log';
|
||||
import { deleteExecJobHostLog } from '@/api/exec/exec-job-log';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import columns from '../../exec-command-log/types/host-table.columns';
|
||||
import { interruptHostExecJob } from '@/api/exec/exec-job-log';
|
||||
import { execHostStatusKey, execHostStatus } from '@/components/exec/log/const';
|
||||
import { useDictStore } from '@/store';
|
||||
import useLoading from '@/hooks/loading';
|
||||
import columns from '../../exec-command-log/types/host-table.columns';
|
||||
import { useExpandable } from '@/types/table';
|
||||
import { dateFormat, formatDuration } from '@/utils';
|
||||
// import { interruptHostExecJob } from '@/api/exec/exec-job';
|
||||
import { downloadExecJobLogFile } from '@/api/exec/exec-job-log';
|
||||
import { copy } from '@/hooks/copy';
|
||||
import { downloadFile } from '@/utils/file';
|
||||
import { Message } from '@arco-design/web-vue';
|
||||
|
||||
const props = defineProps<{
|
||||
row: ExecLogQueryResponse;
|
||||
@@ -136,9 +136,9 @@
|
||||
try {
|
||||
setLoading(true);
|
||||
// 调用中断接口
|
||||
// await interruptHostExecJob({
|
||||
// hostLogId: record.id
|
||||
// });
|
||||
await interruptHostExecJob({
|
||||
hostLogId: record.id
|
||||
});
|
||||
Message.success('已中断');
|
||||
record.status = execHostStatus.INTERRUPTED;
|
||||
} catch (e) {
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
<a-modal v-model:visible="visible"
|
||||
body-class="modal-form"
|
||||
title-align="start"
|
||||
title="清空批量执行日志"
|
||||
title="清空计划任务日志"
|
||||
:align-center="false"
|
||||
:draggable="true"
|
||||
:mask-closable="false"
|
||||
@@ -25,17 +25,12 @@
|
||||
show-time
|
||||
format="YYYY-MM-DD HH:mm:ss" />
|
||||
</a-form-item>
|
||||
<!-- 执行用户 -->
|
||||
<a-form-item field="userId" label="执行用户">
|
||||
<user-selector v-model="formModel.userId"
|
||||
placeholder="请选择执行用户"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 执行描述 -->
|
||||
<a-form-item field="description" label="执行描述">
|
||||
<a-input v-model="formModel.description"
|
||||
placeholder="请输入执行描述"
|
||||
allow-clear />
|
||||
<!-- 计划任务 -->
|
||||
<a-form-item field="sourceId" label="计划任务">
|
||||
<exec-job-selector v-model:model-value="formModel.sourceId"
|
||||
v-model:name="formModel.description"
|
||||
allow-create
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 执行命令 -->
|
||||
<a-form-item field="command" label="执行命令">
|
||||
@@ -69,7 +64,7 @@
|
||||
import { getExecJobLogCount, clearExecJobLog } from '@/api/exec/exec-job-log';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import { useDictStore } from '@/store';
|
||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||
import ExecJobSelector from '@/components/exec/job/selector/index.vue';
|
||||
|
||||
const emits = defineEmits(['clear']);
|
||||
|
||||
@@ -83,7 +78,7 @@
|
||||
const defaultForm = (): ExecLogQueryRequest => {
|
||||
return {
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
sourceId: undefined,
|
||||
description: undefined,
|
||||
command: undefined,
|
||||
status: undefined,
|
||||
@@ -103,6 +98,7 @@
|
||||
};
|
||||
|
||||
defineExpose({ open });
|
||||
|
||||
// 确定
|
||||
const handlerOk = async () => {
|
||||
setLoading(true);
|
||||
|
||||
@@ -3,14 +3,14 @@
|
||||
<a-card class="general-card table-search-card">
|
||||
<query-header :model="formModel"
|
||||
label-align="left"
|
||||
:itemOptions="{ 5: { span: 2 } }"
|
||||
:itemOptions="{ 4: { span: 2 } }"
|
||||
@submit="fetchTableData"
|
||||
@reset="fetchTableData"
|
||||
@keyup.enter="() => fetchTableData()">
|
||||
<!-- 执行描述 -->
|
||||
<a-form-item field="description" label="执行描述">
|
||||
<!-- 任务名称 -->
|
||||
<a-form-item field="description" label="任务名称">
|
||||
<a-input v-model="formModel.description"
|
||||
placeholder="请输入执行描述"
|
||||
placeholder="请输入任务名称"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 执行状态 -->
|
||||
@@ -20,12 +20,6 @@
|
||||
placeholder="请选择执行状态"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 执行用户 -->
|
||||
<a-form-item field="userId" label="执行用户">
|
||||
<user-selector v-model="formModel.userId"
|
||||
placeholder="请选择执行用户"
|
||||
allow-clear />
|
||||
</a-form-item>
|
||||
<!-- 执行命令 -->
|
||||
<a-form-item field="command" label="执行命令">
|
||||
<a-input v-model="formModel.command"
|
||||
@@ -212,8 +206,7 @@
|
||||
import { useExpandable, usePagination, useRowSelection } from '@/types/table';
|
||||
import { useDictStore } from '@/store';
|
||||
import { dateFormat, formatDuration } from '@/utils';
|
||||
// import { interruptExecJob } from '@/api/exec/exec-job';
|
||||
import UserSelector from '@/components/user/user/selector/index.vue';
|
||||
import { interruptExecJob } from '@/api/exec/exec-job-log';
|
||||
import ExecJobHostLogTable from './exec-job-host-log-table.vue';
|
||||
|
||||
const emits = defineEmits(['viewCommand', 'viewParams', 'viewLog', 'openClear']);
|
||||
@@ -230,7 +223,6 @@
|
||||
const tableRenderData = ref<ExecLogQueryResponse[]>([]);
|
||||
const formModel = reactive<ExecLogQueryRequest>({
|
||||
id: undefined,
|
||||
userId: undefined,
|
||||
description: undefined,
|
||||
command: undefined,
|
||||
status: undefined,
|
||||
@@ -239,7 +231,7 @@
|
||||
|
||||
// 打开清理
|
||||
const openClear = () => {
|
||||
emits('openClear', { ...formModel, id: undefined });
|
||||
emits('openClear', { ...formModel, id: undefined, description: undefined });
|
||||
};
|
||||
|
||||
// 删除选中行
|
||||
@@ -281,9 +273,9 @@
|
||||
try {
|
||||
setLoading(true);
|
||||
// 调用中断接口
|
||||
// await interruptExecJob({
|
||||
// logId: record.id
|
||||
// });
|
||||
await interruptExecJob({
|
||||
logId: record.id
|
||||
});
|
||||
Message.success('已中断');
|
||||
record.status = execStatus.COMPLETED;
|
||||
} catch (e) {
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
<exec-job-log-clear-modal ref="clearModal"
|
||||
@clear="clearCallback" />
|
||||
<!-- 执行日志模态框 -->
|
||||
<exec-log-panel-modal ref="logModal" />
|
||||
<exec-log-panel-modal ref="logModal"
|
||||
type="JOB" />
|
||||
<!-- json 模态框 -->
|
||||
<json-editor-modal ref="jsonModal"
|
||||
:esc-to-close="true" />
|
||||
|
||||
Reference in New Issue
Block a user