fix: 移除容器日志中的 ANSI 转义序列 (#1991)

Refs #1655
pull/1996/head
ssongliu 1 year ago committed by GitHub
parent f8f231253d
commit 5dac95c3de
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -147,7 +147,7 @@ const searchLogs = async () => {
`${protocol}://${host}/api/v1/containers/search/log?container=${logSearch.containerID}&since=${logSearch.mode}&tail=${logSearch.tail}&follow=${logSearch.isWatch}`,
);
terminalSocket.value.onmessage = (event) => {
logInfo.value += event.data;
logInfo.value += event.data.replace(/\x1B\[[0-9;]*[mG]/g, '');
const state = view.value.state;
view.value.dispatch({
selection: { anchor: state.doc.length, head: state.doc.length },

Loading…
Cancel
Save