修改终端提示.

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 = {
rowGap: '10px',
labelSpan: 8,
labelSpan: 6,
minHeight: '22px',
fields: [
{

View File

@@ -31,10 +31,10 @@ package org.dromara.visor.module.asset.handler.host.jsch;
*/
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.handler.host.config.model.HostSshConfigModel;
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.HostExtraService;
import org.dromara.visor.module.asset.service.TerminalService;
@@ -81,7 +82,7 @@ public class TerminalServiceImpl implements TerminalService {
private HostExtraService hostExtraService;
@Resource
private AssetAuthorizedDataServiceImpl assetAuthorizedDataService;
private AssetAuthorizedDataService assetAuthorizedDataService;
@Resource
private HostDAO hostDAO;

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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