🔨 修改终端逻辑.
This commit is contained in:
@@ -1,9 +0,0 @@
|
||||
import type { PieChartData } from '@/types/global';
|
||||
import axios from 'axios';
|
||||
|
||||
/**
|
||||
* 查询主机类型图表
|
||||
*/
|
||||
export function getHostTypeChart() {
|
||||
return axios.get<PieChartData>('/asset/statistics/host-type-chart');
|
||||
}
|
||||
@@ -7,11 +7,8 @@ import axios from 'axios';
|
||||
*/
|
||||
export interface TerminalWorkplaceStatisticsResponse {
|
||||
todayTerminalConnectCount: number;
|
||||
todayTerminalCommandCount: number;
|
||||
weekTerminalConnectCount: number;
|
||||
weekTerminalCommandCount: number;
|
||||
terminalConnectChart: LineSingleChartData;
|
||||
terminalCommandChart: LineSingleChartData;
|
||||
terminalConnectList: Array<TerminalConnectLogQueryResponse>;
|
||||
}
|
||||
|
||||
|
||||
@@ -61,7 +61,6 @@ export interface TerminalRdpGraphSetting {
|
||||
// SSH 操作栏设置
|
||||
export interface TerminalSshActionBarSetting {
|
||||
connectStatus?: boolean;
|
||||
share?: boolean;
|
||||
|
||||
[key: string]: unknown;
|
||||
}
|
||||
|
||||
@@ -1,12 +1,7 @@
|
||||
<template>
|
||||
<div class="layout-container" v-if="render">
|
||||
<!-- 列表-表格 -->
|
||||
<connect-session-table @open-watcher="openWatcher"
|
||||
@open-event="(s) => eventDrawer.open(s)" />
|
||||
<!-- 监视模态框 -->
|
||||
<xterm-watcher-modal ref="watcherModal" />
|
||||
<!-- 事件抽屉 -->
|
||||
<connect-event-drawer ref="eventDrawer" />
|
||||
<connect-session-table />
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -20,28 +15,11 @@
|
||||
import { ref, onBeforeMount } from 'vue';
|
||||
import { useDictStore } from '@/store';
|
||||
import { dictKeys } from './types/const';
|
||||
import { openNewRoute } from '@/router';
|
||||
import ConnectSessionTable from './components/connect-session-table.vue';
|
||||
import ConnectEventDrawer from '../connect-log/components/connect-event-drawer.vue';
|
||||
import XtermWatcherModal from '@/components/xterm/watcher/modal/index.vue';
|
||||
|
||||
const render = ref(false);
|
||||
const watcherModal = ref();
|
||||
const eventDrawer = ref();
|
||||
|
||||
// 打开监视
|
||||
const openWatcher = (sessionId: string, newWindow: boolean) => {
|
||||
if (newWindow) {
|
||||
// 跳转新页面
|
||||
openNewRoute({
|
||||
name: 'terminalWatcher',
|
||||
query: { sessionId }
|
||||
});
|
||||
} else {
|
||||
watcherModal.value.open(sessionId);
|
||||
}
|
||||
};
|
||||
|
||||
// 加载字典配置
|
||||
onBeforeMount(async () => {
|
||||
const dictStore = useDictStore();
|
||||
|
||||
@@ -262,28 +262,22 @@
|
||||
连接
|
||||
</a-button>
|
||||
<!-- 多协议连接 -->
|
||||
<a-popover v-else-if="(record.types?.length || 0) > 1"
|
||||
v-permission="['terminal:terminal:access']"
|
||||
<a-popover v-if="(record.types?.length || 0) > 1"
|
||||
:title="undefined"
|
||||
:content-style="{ padding: '8px' }">
|
||||
<a-button type="text" size="mini">
|
||||
<a-button v-permission="['terminal:terminal:access']"
|
||||
type="text"
|
||||
size="mini">
|
||||
连接
|
||||
</a-button>
|
||||
<template #content>
|
||||
<a-space>
|
||||
<!-- SSH -->
|
||||
<a-button v-if="record.types.includes(HostType.SSH.value)"
|
||||
<a-button v-for="type in record.types"
|
||||
:key="type"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: record.types[0] } })">
|
||||
SSH
|
||||
</a-button>
|
||||
<!-- RDP -->
|
||||
<a-button v-if="record.types.includes(HostType.RDP.value)"
|
||||
type="text"
|
||||
size="mini"
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type: 'RDP' } })">
|
||||
RDP
|
||||
@click="openNewRoute({ name: 'terminal', query: { connect: record.id, type} })">
|
||||
{{ type }}
|
||||
</a-button>
|
||||
</a-space>
|
||||
</template>
|
||||
@@ -346,7 +340,7 @@
|
||||
import { reactive, ref, onMounted } from 'vue';
|
||||
import { deleteHost, batchDeleteHost, getHostPage, updateHostStatus } from '@/api/asset/host';
|
||||
import { Message, Modal } from '@arco-design/web-vue';
|
||||
import { tagColor, hostTypeKey, hostStatusKey, HostType, hostOsTypeKey, hostArchTypeKey, TableName } from '../types/const';
|
||||
import { tagColor, hostTypeKey, hostStatusKey, hostOsTypeKey, hostArchTypeKey, TableName } from '../types/const';
|
||||
import { useTablePagination, useRowSelection, useTableColumns } from '@/hooks/table';
|
||||
import { useQueryOrder, ASC } from '@/hooks/query-order';
|
||||
import { useCacheStore, useDictStore } from '@/store';
|
||||
|
||||
@@ -8,6 +8,7 @@ export const terminalLogColumns = [
|
||||
dataIndex: 'hostName',
|
||||
slotName: 'hostName',
|
||||
align: 'left',
|
||||
minWidth: 98,
|
||||
ellipsis: true,
|
||||
}, {
|
||||
title: '类型',
|
||||
@@ -20,7 +21,7 @@ export const terminalLogColumns = [
|
||||
dataIndex: 'startTime',
|
||||
slotName: 'startTime',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
width: 168,
|
||||
render: ({ record }) => {
|
||||
return dateFormat(new Date(record.startTime));
|
||||
},
|
||||
@@ -40,6 +41,7 @@ export const batchExecColumns = [
|
||||
dataIndex: 'description',
|
||||
slotName: 'description',
|
||||
align: 'left',
|
||||
minWidth: 98,
|
||||
ellipsis: true,
|
||||
tooltip: true,
|
||||
}, {
|
||||
@@ -53,7 +55,7 @@ export const batchExecColumns = [
|
||||
dataIndex: 'startTime',
|
||||
slotName: 'startTime',
|
||||
align: 'center',
|
||||
width: 180,
|
||||
width: 168,
|
||||
render: ({ record }) => {
|
||||
return dateFormat(new Date(record.startTime));
|
||||
},
|
||||
@@ -72,6 +74,7 @@ export const userLoginColumns = [
|
||||
title: '登录设备',
|
||||
dataIndex: 'content',
|
||||
slotName: 'content',
|
||||
minWidth: 98,
|
||||
ellipsis: true,
|
||||
tooltip: true,
|
||||
}, {
|
||||
|
||||
@@ -30,12 +30,6 @@
|
||||
:default-checked="true"
|
||||
type="round" />
|
||||
</a-form-item>
|
||||
<!-- 分享按钮 -->
|
||||
<a-form-item field="share" label="分享按钮">
|
||||
<a-switch v-model="formModel.share"
|
||||
:default-checked="true"
|
||||
type="round" />
|
||||
</a-form-item>
|
||||
</a-space>
|
||||
</a-form>
|
||||
</div>
|
||||
|
||||
@@ -311,7 +311,7 @@
|
||||
border-radius: 8px;
|
||||
transition: .3s all;
|
||||
background: var(--color-bg-rdp-toolbar);
|
||||
filter: contrast(150%) brightness(80%);
|
||||
filter: contrast(50%) brightness(50%);
|
||||
|
||||
&.top {
|
||||
width: 240px;
|
||||
|
||||
@@ -73,6 +73,11 @@
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
|
||||
:deep(> div) {
|
||||
position: relative;
|
||||
z-index: 8;
|
||||
}
|
||||
}
|
||||
|
||||
.rdp-status-mask {
|
||||
|
||||
@@ -10,7 +10,7 @@ export default class TerminalPanelManager implements ITerminalPanelManager {
|
||||
|
||||
constructor() {
|
||||
this.active = 0;
|
||||
this.panels = [new TerminalTabManager(), new TerminalTabManager()];
|
||||
this.panels = [new TerminalTabManager()];
|
||||
}
|
||||
|
||||
// 获取当前面板
|
||||
|
||||
@@ -96,7 +96,6 @@ export const TerminalCloseCode = {
|
||||
export const TerminalMessages = {
|
||||
sessionClosed: '会话已结束...',
|
||||
waitingReconnect: '输入回车重新连接...',
|
||||
waitingJoin: '等待分享者同意...',
|
||||
loggedElsewhere: '该账号已在另一台设备登录',
|
||||
rdpConnectTimeout: '请检查远程计算机网络及其他配置是否正常',
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user