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();
|
const t = Date.now();
|
||||||
export default defineConfig({
|
export default defineConfig({
|
||||||
proxy: {
|
proxy: {
|
||||||
...proxy('http://192.168.50.2:8088/')
|
...proxy()
|
||||||
},
|
},
|
||||||
history: {
|
history: {
|
||||||
type: 'hash'
|
type: 'hash'
|
||||||
|
|||||||
@@ -1,4 +1,18 @@
|
|||||||
.logs-viewer-wrap-w2 {
|
.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 {
|
.wrap {
|
||||||
padding: 5px 0 5px 10px;
|
padding: 5px 0 5px 10px;
|
||||||
background-color: var(--color-logs-bg);
|
background-color: var(--color-logs-bg);
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import '@xterm/xterm/css/xterm.css';
|
|||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import _ from 'lodash';
|
import _ from 'lodash';
|
||||||
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
import { memo, useCallback, useEffect, useRef, useState } from 'react';
|
||||||
|
import CopyButton from '../copy-button';
|
||||||
import './index.less';
|
import './index.less';
|
||||||
import useParseAnsi from './parse-ansi';
|
import useParseAnsi from './parse-ansi';
|
||||||
|
|
||||||
@@ -119,6 +120,13 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="logs-viewer-wrap-w2">
|
<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
|
<div
|
||||||
className="wrap"
|
className="wrap"
|
||||||
style={{ height: height }}
|
style={{ height: height }}
|
||||||
|
|||||||
Reference in New Issue
Block a user