🐛 批量执行历史显示错误.
This commit is contained in:
@@ -84,27 +84,27 @@
|
|||||||
:hide-asterisk="true">
|
:hide-asterisk="true">
|
||||||
<host-identity-selector v-model="formModel.identityId" />
|
<host-identity-selector v-model="formModel.identityId" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
<!-- 连接超时时间 -->
|
||||||
|
<a-form-item field="connectTimeout"
|
||||||
|
label="连接超时时间"
|
||||||
|
:hide-asterisk="true">
|
||||||
|
<a-input-number v-model="formModel.connectTimeout"
|
||||||
|
placeholder="请输入连接超时时间"
|
||||||
|
hide-button>
|
||||||
|
<template #suffix>
|
||||||
|
ms
|
||||||
|
</template>
|
||||||
|
</a-input-number>
|
||||||
|
</a-form-item>
|
||||||
<!-- 其他配置 -->
|
<!-- 其他配置 -->
|
||||||
<a-collapse :bordered="false">
|
<a-collapse :bordered="false">
|
||||||
<a-collapse-item key="1">
|
<a-collapse-item key="1">
|
||||||
<template #header>
|
<template #header>
|
||||||
<span class="usn">其他配置</span>
|
<span class="usn">其他配置</span>
|
||||||
</template>
|
</template>
|
||||||
<!-- 连接超时时间 -->
|
|
||||||
<a-form-item class="mt4"
|
|
||||||
field="connectTimeout"
|
|
||||||
label="连接超时时间"
|
|
||||||
:hide-asterisk="true">
|
|
||||||
<a-input-number v-model="formModel.connectTimeout"
|
|
||||||
placeholder="请输入连接超时时间"
|
|
||||||
hide-button>
|
|
||||||
<template #suffix>
|
|
||||||
ms
|
|
||||||
</template>
|
|
||||||
</a-input-number>
|
|
||||||
</a-form-item>
|
|
||||||
<!-- SSH 输出编码 -->
|
<!-- SSH 输出编码 -->
|
||||||
<a-form-item field="charset"
|
<a-form-item class="mt4"
|
||||||
|
field="charset"
|
||||||
label="SSH输出编码"
|
label="SSH输出编码"
|
||||||
:hide-asterisk="true">
|
:hide-asterisk="true">
|
||||||
<a-input v-model="formModel.charset" placeholder="请输入 SSH 输出编码" />
|
<a-input v-model="formModel.charset" placeholder="请输入 SSH 输出编码" />
|
||||||
@@ -311,4 +311,14 @@
|
|||||||
width: 148px;
|
width: 148px;
|
||||||
margin-left: 8px;
|
margin-left: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
:deep(.arco-collapse-item-content) {
|
||||||
|
background: unset;
|
||||||
|
padding: 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
:deep(.arco-collapse-item-header) {
|
||||||
|
border: none;
|
||||||
|
}
|
||||||
|
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
@@ -143,7 +143,7 @@
|
|||||||
// 上传文件
|
// 上传文件
|
||||||
await filesRef.value.startUpload(data.token);
|
await filesRef.value.startUpload(data.token);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
taskStatus.value = UploadTaskStepStatus.FAILED;
|
taskStatus.value = UploadTaskStepStatus.WAITING;
|
||||||
} finally {
|
} finally {
|
||||||
setLoading(false);
|
setLoading(false);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -47,7 +47,7 @@
|
|||||||
import type { ExecCommandRequest } from '@/api/exec/exec-command';
|
import type { ExecCommandRequest } from '@/api/exec/exec-command';
|
||||||
import { onMounted, ref } from 'vue';
|
import { onMounted, ref } from 'vue';
|
||||||
import { getExecCommandLogHistory } from '@/api/exec/exec-command-log';
|
import { getExecCommandLogHistory } from '@/api/exec/exec-command-log';
|
||||||
import { historyCount } from '../types/const';
|
import { historyCount, descOmit, omit } from '../types/const';
|
||||||
import useLoading from '@/hooks/loading';
|
import useLoading from '@/hooks/loading';
|
||||||
|
|
||||||
const emits = defineEmits(['selected']);
|
const emits = defineEmits(['selected']);
|
||||||
@@ -58,12 +58,20 @@
|
|||||||
|
|
||||||
// 添加
|
// 添加
|
||||||
const add = (record: ExecCommandRequest) => {
|
const add = (record: ExecCommandRequest) => {
|
||||||
|
const command = record.command as string;
|
||||||
|
if (!record.description) {
|
||||||
|
if (command.length < descOmit + omit.length) {
|
||||||
|
record.description = command;
|
||||||
|
} else {
|
||||||
|
record.description = command.substring(0, descOmit) + omit;
|
||||||
|
}
|
||||||
|
}
|
||||||
const index = historyLogs.value.findIndex(s => s.description === record.description);
|
const index = historyLogs.value.findIndex(s => s.description === record.description);
|
||||||
if (index === -1) {
|
if (index === -1) {
|
||||||
// 不存在
|
// 不存在
|
||||||
historyLogs.value.unshift({
|
historyLogs.value.unshift({
|
||||||
description: record.description,
|
description: record.description,
|
||||||
command: record.command,
|
command: command,
|
||||||
parameterSchema: record.parameterSchema,
|
parameterSchema: record.parameterSchema,
|
||||||
timeout: record.timeout,
|
timeout: record.timeout,
|
||||||
hostIdList: record.hostIdList
|
hostIdList: record.hostIdList
|
||||||
@@ -74,7 +82,7 @@
|
|||||||
historyLogs.value.splice(index, 1);
|
historyLogs.value.splice(index, 1);
|
||||||
historyLogs.value.unshift({
|
historyLogs.value.unshift({
|
||||||
...his,
|
...his,
|
||||||
command: record.command,
|
command: command,
|
||||||
parameterSchema: record.parameterSchema,
|
parameterSchema: record.parameterSchema,
|
||||||
timeout: record.timeout,
|
timeout: record.timeout,
|
||||||
hostIdList: record.hostIdList
|
hostIdList: record.hostIdList
|
||||||
|
|||||||
@@ -1,2 +1,8 @@
|
|||||||
// 历史数量
|
// 历史数量
|
||||||
export const historyCount = 15;
|
export const historyCount = 15;
|
||||||
|
|
||||||
|
// 描述最大大小
|
||||||
|
export const descOmit = 60;
|
||||||
|
|
||||||
|
// 省略
|
||||||
|
export const omit = '...';
|
||||||
|
|||||||
@@ -353,6 +353,7 @@
|
|||||||
|
|
||||||
:deep(.sftp-path-unit) {
|
:deep(.sftp-path-unit) {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
|
white-space: nowrap;
|
||||||
font-size: 12px;
|
font-size: 12px;
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
|
|||||||
@@ -148,7 +148,7 @@
|
|||||||
// 下载文件
|
// 下载文件
|
||||||
const downloadFiles = (paths: Array<string>) => {
|
const downloadFiles = (paths: Array<string>) => {
|
||||||
if (!paths.length) {
|
if (!paths.length) {
|
||||||
return paths;
|
return;
|
||||||
}
|
}
|
||||||
Message.success('已开始下载, 点击右侧传输列表查看进度');
|
Message.success('已开始下载, 点击右侧传输列表查看进度');
|
||||||
// 映射为文件
|
// 映射为文件
|
||||||
|
|||||||
@@ -140,6 +140,30 @@
|
|||||||
</a-tag>
|
</a-tag>
|
||||||
</a-space>
|
</a-space>
|
||||||
</template>
|
</template>
|
||||||
|
<!-- 权限标识 -->
|
||||||
|
<template #permission="{ record }">
|
||||||
|
<span v-if="record.permission"
|
||||||
|
class="text-copy"
|
||||||
|
@click="copy(record.permission, '已复制')">
|
||||||
|
{{ record.permission }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<!-- 组件名称 -->
|
||||||
|
<template #component="{ record }">
|
||||||
|
<span v-if="record.component"
|
||||||
|
class="text-copy"
|
||||||
|
@click="copy(record.component, '已复制')">
|
||||||
|
{{ record.component }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
|
<!-- 链接路径 -->
|
||||||
|
<template #path="{ record }">
|
||||||
|
<span v-if="record.path"
|
||||||
|
class="text-copy"
|
||||||
|
@click="copy(record.path, '已复制')">
|
||||||
|
{{ record.path }}
|
||||||
|
</span>
|
||||||
|
</template>
|
||||||
<!-- 操作 -->
|
<!-- 操作 -->
|
||||||
<template #handle="{ record }">
|
<template #handle="{ record }">
|
||||||
<div class="table-handle-wrapper">
|
<div class="table-handle-wrapper">
|
||||||
@@ -193,28 +217,28 @@
|
|||||||
import { useCacheStore, useDictStore } from '@/store';
|
import { useCacheStore, useDictStore } from '@/store';
|
||||||
import usePermission from '@/hooks/permission';
|
import usePermission from '@/hooks/permission';
|
||||||
import { findParentNode } from '@/utils/tree';
|
import { findParentNode } from '@/utils/tree';
|
||||||
|
import { copy } from '@/hooks/copy';
|
||||||
|
|
||||||
|
const emits = defineEmits(['openAdd', 'openUpdate']);
|
||||||
|
|
||||||
const { toOptions, getDictValue, toggleDictValue } = useDictStore();
|
|
||||||
const cacheStore = useCacheStore();
|
const cacheStore = useCacheStore();
|
||||||
const { hasPermission } = usePermission();
|
const { hasPermission } = usePermission();
|
||||||
|
const { loading: fetchLoading, setLoading: setFetchLoading } = useLoading();
|
||||||
|
const { toOptions, getDictValue, toggleDictValue } = useDictStore();
|
||||||
|
|
||||||
const formRef = ref();
|
const formRef = ref();
|
||||||
|
const tableRef = ref();
|
||||||
|
const expandStatus = ref<boolean>(false);
|
||||||
|
const tableRenderData = ref<Array<MenuQueryResponse>>([]);
|
||||||
const formModel = reactive<MenuQueryRequest>({
|
const formModel = reactive<MenuQueryRequest>({
|
||||||
name: undefined,
|
name: undefined,
|
||||||
status: undefined
|
status: undefined
|
||||||
});
|
});
|
||||||
|
|
||||||
const tableRef = ref();
|
|
||||||
const expandStatus = ref<boolean>(false);
|
|
||||||
|
|
||||||
const tableRenderData = ref<MenuQueryResponse[]>([]);
|
|
||||||
const { loading: fetchLoading, setLoading: setFetchLoading } = useLoading();
|
|
||||||
|
|
||||||
const emits = defineEmits(['openAdd', 'openUpdate']);
|
|
||||||
|
|
||||||
// 删除菜单
|
// 删除菜单
|
||||||
const doDeleteMenu = async ({ id }: any) => {
|
const doDeleteMenu = async (record: MenuQueryResponse) => {
|
||||||
try {
|
try {
|
||||||
|
const id = record.id;
|
||||||
setFetchLoading(true);
|
setFetchLoading(true);
|
||||||
// 调用删除接口
|
// 调用删除接口
|
||||||
await deleteMenu(id);
|
await deleteMenu(id);
|
||||||
|
|||||||
@@ -13,12 +13,14 @@ const columns = [
|
|||||||
title: '角色名称',
|
title: '角色名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
slotName: 'name',
|
slotName: 'name',
|
||||||
|
minWidth: 118,
|
||||||
ellipsis: true,
|
ellipsis: true,
|
||||||
tooltip: true,
|
tooltip: true,
|
||||||
}, {
|
}, {
|
||||||
title: '角色编码',
|
title: '角色编码',
|
||||||
dataIndex: 'code',
|
dataIndex: 'code',
|
||||||
slotName: 'code',
|
slotName: 'code',
|
||||||
|
minWidth: 118,
|
||||||
}, {
|
}, {
|
||||||
title: '角色状态',
|
title: '角色状态',
|
||||||
dataIndex: 'status',
|
dataIndex: 'status',
|
||||||
|
|||||||
Reference in New Issue
Block a user