修改终端提示.

This commit is contained in:
lijiahangmax
2025-03-08 12:44:33 +08:00
parent 6c9065072d
commit 79d9f69ed4
11 changed files with 25 additions and 21 deletions

View File

@@ -3,7 +3,7 @@ import { dateFormat } from '@/utils';
const fieldConfig = { const fieldConfig = {
rowGap: '10px', rowGap: '10px',
labelSpan: 8, labelSpan: 6,
minHeight: '22px', minHeight: '22px',
fields: [ fields: [
{ {

View File

@@ -31,10 +31,10 @@ package org.dromara.visor.module.asset.handler.host.jsch;
*/ */
public interface SessionMessage { public interface SessionMessage {
String AUTHENTICATION_FAILURE = "authentication failed. please check the configuration. - {}"; String AUTHENTICATION_FAILURE = "身份认证失败. {}";
String SERVER_UNREACHABLE = "remote server unreachable. please check the configuration. - {}"; String SERVER_UNREACHABLE = "无法连接至服务器. {}";
String CONNECTION_TIMEOUT = "connection timeout. - {}"; String CONNECTION_TIMEOUT = "连接服务器超时. {}";
} }

View File

@@ -48,6 +48,7 @@ import org.dromara.visor.module.asset.enums.HostIdentityTypeEnum;
import org.dromara.visor.module.asset.enums.HostSshAuthTypeEnum; import org.dromara.visor.module.asset.enums.HostSshAuthTypeEnum;
import org.dromara.visor.module.asset.handler.host.config.model.HostSshConfigModel; import org.dromara.visor.module.asset.handler.host.config.model.HostSshConfigModel;
import org.dromara.visor.module.asset.handler.host.extra.model.HostSshExtraModel; import org.dromara.visor.module.asset.handler.host.extra.model.HostSshExtraModel;
import org.dromara.visor.module.asset.service.AssetAuthorizedDataService;
import org.dromara.visor.module.asset.service.HostConfigService; import org.dromara.visor.module.asset.service.HostConfigService;
import org.dromara.visor.module.asset.service.HostExtraService; import org.dromara.visor.module.asset.service.HostExtraService;
import org.dromara.visor.module.asset.service.TerminalService; import org.dromara.visor.module.asset.service.TerminalService;
@@ -81,7 +82,7 @@ public class TerminalServiceImpl implements TerminalService {
private HostExtraService hostExtraService; private HostExtraService hostExtraService;
@Resource @Resource
private AssetAuthorizedDataServiceImpl assetAuthorizedDataService; private AssetAuthorizedDataService assetAuthorizedDataService;
@Resource @Resource
private HostDAO hostDAO; private HostDAO hostDAO;

View File

@@ -27,7 +27,7 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { ExecLogQueryResponse } from '@/api/exec/exec-log'; import type { ExecLogQueryResponse } from '@/api/exec/exec-log';
import type { ExecType, ILogAppender } from '../const'; import type { ExecType, ILogAppender } from '../const';
import { onUnmounted, ref, nextTick, onMounted } from 'vue'; import { onUnmounted, ref, nextTick, onMounted, markRaw } from 'vue';
import { getExecCommandLogStatus } from '@/api/exec/exec-command-log'; import { getExecCommandLogStatus } from '@/api/exec/exec-command-log';
import { getExecJobLogStatus } from '@/api/exec/exec-job-log'; import { getExecJobLogStatus } from '@/api/exec/exec-job-log';
import { dictKeys, ExecHostStatus, ExecStatus } from '../const'; import { dictKeys, ExecHostStatus, ExecStatus } from '../const';
@@ -58,11 +58,11 @@
const { log_webScrollLines } = await useCacheStore().loadSystemSetting(); const { log_webScrollLines } = await useCacheStore().loadSystemSetting();
const scrollLines = toAnonymousNumber(log_webScrollLines) || 1000; const scrollLines = toAnonymousNumber(log_webScrollLines) || 1000;
// 创建 appender // 创建 appender
appender.value = new LogAppender({ appender.value = markRaw(new LogAppender({
id: record.id, id: record.id,
type: props.type, type: props.type,
scrollLines, scrollLines,
}); }));
// 定时查询执行状态 // 定时查询执行状态
if (record.status === ExecStatus.WAITING || if (record.status === ExecStatus.WAITING ||
record.status === ExecStatus.RUNNING) { record.status === ExecStatus.RUNNING) {

View File

@@ -1,5 +1,4 @@
import type { TableColumnData } from '@arco-design/web-vue/es/table/interface'; import type { TableColumnData } from '@arco-design/web-vue/es/table/interface';
import { dateFormat } from '@/utils';
const columns = [ const columns = [
{ {
@@ -32,8 +31,8 @@ const columns = [
title: '状态', title: '状态',
dataIndex: 'status', dataIndex: 'status',
slotName: 'status', slotName: 'status',
align: 'center', align: 'left',
width: 106, width: 118,
}, { }, {
title: '留痕地址', title: '留痕地址',
dataIndex: 'address', dataIndex: 'address',

View File

@@ -3,7 +3,7 @@ import { dateFormat } from '@/utils';
const fieldConfig = { const fieldConfig = {
rowGap: '10px', rowGap: '10px',
labelSpan: 8, labelSpan: 6,
minHeight: '22px', minHeight: '22px',
fields: [ fields: [
{ {

View File

@@ -19,6 +19,8 @@ const columns = [
title: '用户名', title: '用户名',
dataIndex: 'username', dataIndex: 'username',
slotName: 'username', slotName: 'username',
ellipsis: true,
tooltip: true
}, { }, {
title: '类型', title: '类型',
dataIndex: 'type', dataIndex: 'type',
@@ -28,6 +30,7 @@ const columns = [
title: '主机密钥', title: '主机密钥',
dataIndex: 'keyId', dataIndex: 'keyId',
slotName: 'keyId', slotName: 'keyId',
width: 180,
}, { }, {
title: '描述', title: '描述',
dataIndex: 'description', dataIndex: 'description',

View File

@@ -3,7 +3,7 @@ import { dateFormat } from '@/utils';
const fieldConfig = { const fieldConfig = {
rowGap: '10px', rowGap: '10px',
labelSpan: 8, labelSpan: 6,
minHeight: '22px', minHeight: '22px',
fields: [ fields: [
{ {

View File

@@ -2,7 +2,7 @@ import type { CardField, CardFieldConfig } from '@/types/card';
const fieldConfig = { const fieldConfig = {
rowGap: '10px', rowGap: '10px',
labelSpan: 8, labelSpan: 6,
minHeight: '22px', minHeight: '22px',
fields: [ fields: [
{ {

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="terminal-example" ref="terminal" /> <div class="terminal-example" ref="terminalRef" />
</template> </template>
<script lang="ts"> <script lang="ts">
@@ -11,31 +11,32 @@
<script lang="ts" setup> <script lang="ts" setup>
import type { TerminalThemeSchema } from '@/api/asset/terminal'; import type { TerminalThemeSchema } from '@/api/asset/terminal';
import { Terminal } from '@xterm/xterm'; import { Terminal } from '@xterm/xterm';
import { onMounted, onUnmounted, ref } from 'vue'; import { markRaw, onMounted, onUnmounted, ref } from 'vue';
const props = defineProps<{ const props = defineProps<{
schema: TerminalThemeSchema | Record<string, any>; schema: TerminalThemeSchema | Record<string, any>;
}>(); }>();
const terminal = ref(); const terminalRef = ref();
const term = ref(); const term = ref();
onMounted(() => { onMounted(() => {
term.value = new Terminal({ const terminal = new Terminal({
theme: { ...props.schema, cursor: props.schema.background }, theme: { ...props.schema, cursor: props.schema.background },
cols: 42, cols: 42,
rows: 6, rows: 6,
fontSize: 15, fontSize: 15,
cursorInactiveStyle: 'none', cursorInactiveStyle: 'none',
}); });
term.value.open(terminal.value); terminal.open(terminalRef.value);
term.value.write( terminal.write(
'[root@OrionServer usr]#\r\n' + '[root@OrionServer usr]#\r\n' +
'dr-xr-xr-x. 2 root root bin\r\n' + 'dr-xr-xr-x. 2 root root bin\r\n' +
'dr-xr-xr-x. 2 root root sbin\r\n' + 'dr-xr-xr-x. 2 root root sbin\r\n' +
'drwxr-xr-x. 4 root root src\r\n' + 'drwxr-xr-x. 4 root root src\r\n' +
'lrwxrwxrwx. 1 root root tmp -> ../var/tmp ' 'lrwxrwxrwx. 1 root root tmp -> ../var/tmp '
); );
term.value = markRaw(terminal);
}); });
defineExpose({ term }); defineExpose({ term });

View File

@@ -363,7 +363,7 @@ export const TransferReceiver = {
}; };
// 会话关闭信息 // 会话关闭信息
export const sessionCloseMsg = 'session closed...'; export const sessionCloseMsg = '会话已结束...';
// 打开 settingModal key // 打开 settingModal key
export const openSettingModalKey = Symbol(); export const openSettingModalKey = Symbol();