2024-03-13 19:17:50 +08:00
|
|
|
<template>
|
|
|
|
|
<div class="layout-container" v-if="render">
|
|
|
|
|
<!-- 列表-表格 -->
|
2024-03-14 00:09:20 +08:00
|
|
|
<exec-log-table @view-command="viewCommand"
|
|
|
|
|
@view-params="viewParams" />
|
|
|
|
|
<!-- json 模态框 -->
|
|
|
|
|
<json-editor-modal ref="jsonModal"
|
|
|
|
|
:esc-to-close="true" />
|
|
|
|
|
<!-- shell 模态框 -->
|
|
|
|
|
<shell-editor-modal ref="shellModal"
|
|
|
|
|
:footer="false"
|
|
|
|
|
:esc-to-close="true" />
|
2024-03-13 19:17:50 +08:00
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts">
|
|
|
|
|
export default {
|
|
|
|
|
name: 'execLog'
|
|
|
|
|
};
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import { ref, onBeforeMount } from 'vue';
|
|
|
|
|
import { useDictStore } from '@/store';
|
|
|
|
|
import { dictKeys } from './types/const';
|
|
|
|
|
import ExecLogTable from './components/exec-log-table.vue';
|
2024-03-14 00:09:20 +08:00
|
|
|
import JsonEditorModal from '@/components/view/json-editor/modal/index.vue';
|
|
|
|
|
import ShellEditorModal from '@/components/view/shell-editor/modal/index.vue';
|
2024-03-13 19:17:50 +08:00
|
|
|
|
|
|
|
|
const render = ref(false);
|
2024-03-14 00:09:20 +08:00
|
|
|
const jsonModal = ref();
|
|
|
|
|
const shellModal = ref();
|
2024-03-13 19:17:50 +08:00
|
|
|
|
2024-03-14 00:09:20 +08:00
|
|
|
// 查看命令
|
|
|
|
|
const viewCommand = (data: string) => {
|
|
|
|
|
shellModal.value.open(data, '命令');
|
2024-03-13 19:17:50 +08:00
|
|
|
};
|
|
|
|
|
|
2024-03-14 00:09:20 +08:00
|
|
|
// 查看参数
|
|
|
|
|
const viewParams = (data: string) => {
|
|
|
|
|
jsonModal.value.open(JSON.parse(data));
|
2024-03-13 19:17:50 +08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
onBeforeMount(async () => {
|
|
|
|
|
const dictStore = useDictStore();
|
|
|
|
|
await dictStore.loadKeys(dictKeys);
|
|
|
|
|
render.value = true;
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style lang="less" scoped>
|
|
|
|
|
|
|
|
|
|
</style>
|