chore: add button for copy logs
This commit is contained in:
+1
-1
@@ -14,7 +14,7 @@ const isProduction = env === 'production';
|
||||
const t = Date.now();
|
||||
export default defineConfig({
|
||||
proxy: {
|
||||
...proxy('http://192.168.50.2:8088/')
|
||||
...proxy()
|
||||
},
|
||||
history: {
|
||||
type: 'hash'
|
||||
|
||||
@@ -1,4 +1,18 @@
|
||||
.logs-viewer-wrap-w2 {
|
||||
position: relative;
|
||||
|
||||
.copy {
|
||||
position: absolute;
|
||||
top: 10px;
|
||||
right: 10px;
|
||||
z-index: 100;
|
||||
|
||||
button {
|
||||
background-color: rgba(255, 255, 255, 90%);
|
||||
border: none;
|
||||
}
|
||||
}
|
||||
|
||||
.wrap {
|
||||
padding: 5px 0 5px 10px;
|
||||
background-color: var(--color-logs-bg);
|
||||
|
||||
@@ -4,6 +4,7 @@ import '@xterm/xterm/css/xterm.css';
|
||||
import classNames from 'classnames';
|
||||
import _ from 'lodash';
|
||||
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
||||
import CopyButton from '../copy-button';
|
||||
import './index.less';
|
||||
import useParseAnsi from './parse-ansi';
|
||||
|
||||
@@ -119,6 +120,13 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
|
||||
|
||||
return (
|
||||
<div className="logs-viewer-wrap-w2">
|
||||
<span className="copy">
|
||||
<CopyButton
|
||||
text={logs?.map((item) => item.content).join('\n')}
|
||||
type="default"
|
||||
size="small"
|
||||
></CopyButton>
|
||||
</span>
|
||||
<div
|
||||
className="wrap"
|
||||
style={{ height: height }}
|
||||
|
||||
Reference in New Issue
Block a user