⚡ 修改终端提示.
This commit is contained in:
@@ -3,7 +3,7 @@ import { dateFormat } from '@/utils';
|
||||
|
||||
const fieldConfig = {
|
||||
rowGap: '10px',
|
||||
labelSpan: 8,
|
||||
labelSpan: 6,
|
||||
minHeight: '22px',
|
||||
fields: [
|
||||
{
|
||||
|
||||
@@ -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 = "连接服务器超时. {}";
|
||||
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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) {
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { dateFormat } from '@/utils';
|
||||
|
||||
const fieldConfig = {
|
||||
rowGap: '10px',
|
||||
labelSpan: 8,
|
||||
labelSpan: 6,
|
||||
minHeight: '22px',
|
||||
fields: [
|
||||
{
|
||||
|
||||
@@ -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',
|
||||
|
||||
@@ -3,7 +3,7 @@ import { dateFormat } from '@/utils';
|
||||
|
||||
const fieldConfig = {
|
||||
rowGap: '10px',
|
||||
labelSpan: 8,
|
||||
labelSpan: 6,
|
||||
minHeight: '22px',
|
||||
fields: [
|
||||
{
|
||||
|
||||
@@ -2,7 +2,7 @@ import type { CardField, CardFieldConfig } from '@/types/card';
|
||||
|
||||
const fieldConfig = {
|
||||
rowGap: '10px',
|
||||
labelSpan: 8,
|
||||
labelSpan: 6,
|
||||
minHeight: '22px',
|
||||
fields: [
|
||||
{
|
||||
|
||||
@@ -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(
|
||||
'[1;94m[root[0m@[1;96mOrionServer usr]#[0m\r\n' +
|
||||
'dr-xr-xr-x. 2 root root [0m[01;34mbin[0m\r\n' +
|
||||
'dr-xr-xr-x. 2 root root [01;34msbin[0m\r\n' +
|
||||
'drwxr-xr-x. 4 root root [01;34msrc[0m\r\n' +
|
||||
'lrwxrwxrwx. 1 root root [01;36mtmp[0m -> [30;42m../var/tmp[0m '
|
||||
);
|
||||
term.value = markRaw(terminal);
|
||||
});
|
||||
|
||||
defineExpose({ term });
|
||||
|
||||
@@ -363,7 +363,7 @@ export const TransferReceiver = {
|
||||
};
|
||||
|
||||
// 会话关闭信息
|
||||
export const sessionCloseMsg = 'session closed...';
|
||||
export const sessionCloseMsg = '会话已结束...';
|
||||
|
||||
// 打开 settingModal key
|
||||
export const openSettingModalKey = Symbol();
|
||||
|
||||
Reference in New Issue
Block a user