@@ -105,6 +116,7 @@
import columns from '../types/table.columns';
import {} from '../types/const';
import { usePagination } from '@/types/table';
+ import useCopy from '@/hooks/copy';
const emits = defineEmits(['openAdd', 'openUpdate']);
@@ -112,6 +124,7 @@
const pagination = usePagination();
const { loading, setLoading } = useLoading();
+ const { copy } = useCopy();
const formModel = reactive({
id: undefined,
diff --git a/orion-ops-ui/src/views/exec/exec-template/types/const.ts b/orion-ops-ui/src/views/exec/exec-template/types/const.ts
index e69de29b..a2f0c0f9 100644
--- a/orion-ops-ui/src/views/exec/exec-template/types/const.ts
+++ b/orion-ops-ui/src/views/exec/exec-template/types/const.ts
@@ -0,0 +1,47 @@
+// 模板参数
+export interface TemplateParam {
+ name?: string;
+ default?: string;
+ desc?: string;
+}
+
+// 内置参数
+export const builtinsParams: Array = [
+ {
+ name: 'hostId',
+ desc: '主机id'
+ }, {
+ name: 'hostName',
+ desc: '主机名称'
+ }, {
+ name: 'hostCode',
+ desc: '主机编码'
+ }, {
+ name: 'userId',
+ desc: '执行用户id'
+ }, {
+ name: 'username',
+ desc: '执行用户名称'
+ }, {
+ name: 'execId',
+ desc: '执行id'
+ }, {
+ name: 'uuid',
+ desc: 'uuid'
+ }, {
+ name: 'uuidShort',
+ desc: 'uuid 无 \'-\''
+ }, {
+ name: 'timeMillis',
+ desc: '时间戳毫秒'
+ }, {
+ name: 'timestamp',
+ desc: '时间戳'
+ }, {
+ name: 'date',
+ desc: '时间 yyyy-MM-dd'
+ }, {
+ name: 'datetime',
+ desc: '时间 yyyy-MM-dd HH:mm:ss'
+ },
+];
diff --git a/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts b/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts
index 4ed4d365..0ac807a5 100644
--- a/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts
+++ b/orion-ops-ui/src/views/exec/exec-template/types/form.rules.ts
@@ -2,30 +2,24 @@ import type { FieldRule } from '@arco-design/web-vue';
export const name = [{
required: true,
- message: '请输入名称'
+ message: '请输入模板名称'
}, {
maxLength: 64,
- message: '名称长度不能大于64位'
+ message: '模板名称长度不能大于64位'
}] as FieldRule[];
export const command = [{
required: true,
- message: '请输入命令'
+ message: '请输入模板命令'
}] as FieldRule[];
export const timeout = [{
required: true,
- message: '请输入超时时间 秒 0不超时'
-}] as FieldRule[];
-
-export const parameter = [{
- required: true,
- message: '请输入参数'
+ message: '请输入超时时间'
}] as FieldRule[];
export default {
name,
command,
timeout,
- parameter,
} as Record;
diff --git a/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts b/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts
index f277f7a5..57411f77 100644
--- a/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts
+++ b/orion-ops-ui/src/views/exec/exec-template/types/table.columns.ts
@@ -10,20 +10,18 @@ const columns = [
align: 'left',
fixed: 'left',
}, {
- title: '名称',
+ title: '模板名称',
dataIndex: 'name',
slotName: 'name',
align: 'left',
width: 200,
ellipsis: true,
- tooltip: true,
}, {
- title: '命令',
+ title: '模板命令',
dataIndex: 'command',
slotName: 'command',
align: 'left',
ellipsis: true,
- tooltip: true,
}, {
title: '修改时间',
dataIndex: 'updateTime',
@@ -33,12 +31,6 @@ const columns = [
render: ({ record }) => {
return dateFormat(new Date(record.updateTime));
},
- }, {
- title: '修改人',
- dataIndex: 'updater',
- slotName: 'updater',
- width: 90,
- ellipsis: true,
}, {
title: '操作',
slotName: 'handle',
diff --git a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue
index 9906ad30..467f5f6d 100644
--- a/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue
+++ b/orion-ops-ui/src/views/host/command-snippet/components/command-snippet-form-drawer.vue
@@ -33,8 +33,9 @@
+ theme="vs-dark"
+ :suggestions="true"
+ :auto-focus="true" />
@@ -55,10 +56,8 @@
import { createCommandSnippet, updateCommandSnippet } from '@/api/asset/command-snippet';
import formRules from '../types/form.rules';
import { Message } from '@arco-design/web-vue';
- import { useTerminalStore } from '@/store';
import CommandSnippetGroupSelect from './command-snippet-group-select.vue';
- const { preference } = useTerminalStore();
const { visible, setVisible } = useVisible();
const { loading, setLoading } = useLoading();