升级依赖版本.

This commit is contained in:
lijiahang
2024-06-04 10:47:32 +08:00
parent 9386bfc5c1
commit cd59c51344
16 changed files with 896 additions and 588 deletions

View File

@@ -1,8 +1,9 @@
import type { IDisposable, ITerminalInitOnlyOptions, ITerminalOptions, Terminal } from 'xterm';
import type { FitAddon } from 'xterm-addon-fit';
import type { SearchAddon } from 'xterm-addon-search';
import type { WebLinksAddon } from 'xterm-addon-web-links';
import type { WebglAddon } from 'xterm-addon-webgl';
import type { IDisposable, ITerminalInitOnlyOptions, ITerminalOptions, Terminal } from '@xterm/xterm';
import type { FitAddon } from '@xterm/addon-fit';
import type { SearchAddon } from '@xterm/addon-search';
import type { WebLinksAddon } from '@xterm/addon-web-links';
import type { WebglAddon } from '@xterm/addon-webgl';
import type { Unicode11Addon } from '@xterm/addon-unicode11';
// 执行类型
export type ExecType = 'BATCH' | 'JOB';
@@ -61,6 +62,7 @@ export const LogAppenderOptions: ITerminalOptions & ITerminalInitOnlyOptions = {
fontSize: 13,
lineHeight: 1.12,
convertEol: true,
allowProposedApi: true,
};
// dom 引用
@@ -85,6 +87,7 @@ export interface LogAddons extends Record<string, IDisposable> {
webgl: WebglAddon;
search: SearchAddon;
weblink: WebLinksAddon;
unicode: Unicode11Addon;
}
// 执行日志 appender 定义

View File

@@ -8,11 +8,12 @@ import { Message } from '@arco-design/web-vue';
import { useDebounceFn } from '@vueuse/core';
import { addEventListen, removeEventListen } from '@/utils/event';
import { copy as copyText } from '@/hooks/copy';
import { Terminal } from 'xterm';
import { FitAddon } from 'xterm-addon-fit';
import { SearchAddon } from 'xterm-addon-search';
import { WebLinksAddon } from 'xterm-addon-web-links';
import { WebglAddon } from 'xterm-addon-webgl';
import { Terminal } from '@xterm/xterm';
import { FitAddon } from '@xterm/addon-fit';
import { SearchAddon } from '@xterm/addon-search';
import { WebLinksAddon } from '@xterm/addon-web-links';
import { WebglAddon } from '@xterm/addon-webgl';
import { Unicode11Addon } from '@xterm/addon-unicode11';
// 执行日志 appender 实现
export default class LogAppender implements ILogAppender {
@@ -130,15 +131,19 @@ export default class LogAppender implements ILogAppender {
const search = new SearchAddon();
const webgl = new WebglAddon();
const weblink = new WebLinksAddon();
const unicode = new Unicode11Addon();
terminal.loadAddon(fit);
terminal.loadAddon(search);
terminal.loadAddon(webgl);
terminal.loadAddon(weblink);
terminal.loadAddon(unicode);
terminal.unicode.activeVersion = '11';
return {
fit,
search,
webgl,
weblink
weblink,
unicode
};
}

View File

@@ -176,7 +176,7 @@
import { downloadExecJobLogFile } from '@/api/job/exec-job-log';
import { downloadFile } from '@/utils/file';
import XtermSearchModal from '@/components/xtrem/search-modal/index.vue';
import 'xterm/css/xterm.css';
import '@xterm/xterm/css/xterm.css';
const props = defineProps<{
type: ExecType;

View File

@@ -58,7 +58,7 @@
</script>
<script lang="ts" setup>
import type { ISearchOptions } from 'xterm-addon-search';
import type { ISearchOptions } from '@xterm/addon-search';
import useVisible from '@/hooks/visible';
import { nextTick, ref } from 'vue';