fix: logs view format

main
jialin 1 year ago
parent 0317a370da
commit 05390743e0

@ -17,8 +17,11 @@
"@huggingface/hub": "^0.15.1",
"@huggingface/tasks": "^0.11.6",
"@monaco-editor/react": "^4.6.0",
"@react-hook/resize-observer": "^2.0.2",
"@types/lodash": "^4.17.4",
"@umijs/max": "^4.2.11",
"@xterm/addon-fit": "^0.10.0",
"@xterm/xterm": "^5.5.0",
"ansi-to-html": "^0.7.2",
"antd": "^5.18.3",
"antd-style": "^3.6.2",

@ -23,12 +23,21 @@ dependencies:
'@monaco-editor/react':
specifier: ^4.6.0
version: 4.6.0(monaco-editor@0.50.0)(react-dom@18.2.0)(react@18.2.0)
'@react-hook/resize-observer':
specifier: ^2.0.2
version: 2.0.2(react@18.2.0)
'@types/lodash':
specifier: ^4.17.4
version: 4.17.4
'@umijs/max':
specifier: ^4.2.11
version: 4.2.11(@babel/core@7.24.9)(@types/react-dom@18.3.0)(@types/react@18.3.1)(dva@2.5.0-beta.2)(prettier@3.2.5)(rc-field-form@1.44.0)(react-dom@18.2.0)(react@18.2.0)(typescript@5.4.5)(webpack@5.93.0)
'@xterm/addon-fit':
specifier: ^0.10.0
version: 0.10.0(@xterm/xterm@5.5.0)
'@xterm/xterm':
specifier: ^5.5.0
version: 5.5.0
ansi-to-html:
specifier: ^0.7.2
version: 0.7.2
@ -4452,6 +4461,32 @@ packages:
react-dom: 18.2.0(react@18.2.0)
dev: false
/@react-hook/latest@1.0.3(react@18.2.0):
resolution: {integrity: sha512-dy6duzl+JnAZcDbNTfmaP3xHiKtbXYOaz3G51MGVljh548Y8MWzTr+PHLOfvpypEVW9zwvl+VyKjbWKEVbV1Rg==, tarball: https://registry.npmjs.org/@react-hook/latest/-/latest-1.0.3.tgz}
peerDependencies:
react: '>=16.8'
dependencies:
react: 18.2.0
dev: false
/@react-hook/passive-layout-effect@1.2.1(react@18.2.0):
resolution: {integrity: sha512-IwEphTD75liO8g+6taS+4oqz+nnroocNfWVHWz7j+N+ZO2vYrc6PV1q7GQhuahL0IOR7JccFTsFKQ/mb6iZWAg==, tarball: https://registry.npmjs.org/@react-hook/passive-layout-effect/-/passive-layout-effect-1.2.1.tgz}
peerDependencies:
react: '>=16.8'
dependencies:
react: 18.2.0
dev: false
/@react-hook/resize-observer@2.0.2(react@18.2.0):
resolution: {integrity: sha512-tzKKzxNpfE5TWmxuv+5Ae3IF58n0FQgQaWJmcbYkjXTRZATXxClnTprQ2uuYygYTpu1pqbBskpwMpj6jpT1djA==, tarball: https://registry.npmjs.org/@react-hook/resize-observer/-/resize-observer-2.0.2.tgz}
peerDependencies:
react: '>=18'
dependencies:
'@react-hook/latest': 1.0.3(react@18.2.0)
'@react-hook/passive-layout-effect': 1.2.1(react@18.2.0)
react: 18.2.0
dev: false
/@sinclair/typebox@0.27.8:
resolution: {integrity: sha512-+Fj43pSMwJs4KRrH/938Uf+uAELIgVBmQzg/q1YG10djyfA3TnrU8N8XzqCh/okZdszqBQTZf96idMfE5lnwTA==, tarball: https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz}
dev: false
@ -6692,6 +6727,18 @@ packages:
'@webassemblyjs/ast': 1.12.1
'@xtuc/long': 4.2.2
/@xterm/addon-fit@0.10.0(@xterm/xterm@5.5.0):
resolution: {integrity: sha512-UFYkDm4HUahf2lnEyHvio51TNGiLK66mqP2JoATy7hRZeXaGMRDr00JiSF7m63vR5WKATF605yEggJKsw0JpMQ==, tarball: https://registry.npmjs.org/@xterm/addon-fit/-/addon-fit-0.10.0.tgz}
peerDependencies:
'@xterm/xterm': ^5.0.0
dependencies:
'@xterm/xterm': 5.5.0
dev: false
/@xterm/xterm@5.5.0:
resolution: {integrity: sha512-hqJHYaQb5OptNunnyAnkHyM8aCjZ1MEIDTQu1iIbbTD/xops91NB5yq1ZK/dC2JDbVWtF23zUtl9JE2NqwT87A==, tarball: https://registry.npmjs.org/@xterm/xterm/-/xterm-5.5.0.tgz}
dev: false
/@xtuc/ieee754@1.2.0:
resolution: {integrity: sha512-DX8nKgqcGwsc0eJSqYt5lwP4DH5FlHnmuWWBRy7X0NcaGR0ZtuyeESgMwTYVEtxmsNGY+qit4QYT/MIYTOTPeA==, tarball: https://registry.npmjs.org/@xtuc/ieee754/-/ieee754-1.2.0.tgz}

@ -19,4 +19,8 @@
background-color: var(--color-logs-bg);
}
}
.xterm .xterm-viewport {
overflow-y: hidden !important;
}
}

@ -1,9 +1,12 @@
import useSetChunkRequest from '@/hooks/use-chunk-request';
import useContainerScroll from '@/hooks/use-container-scorll';
import Convert from 'ansi-to-html';
import { FitAddon } from '@xterm/addon-fit';
import { Terminal } from '@xterm/xterm';
import '@xterm/xterm/css/xterm.css';
import classNames from 'classnames';
import { memo, useCallback, useEffect, useRef, useState } from 'react';
import _ from 'lodash';
import { memo, useEffect, useRef, useState } from 'react';
import './index.less';
import useSize from './use-size';
interface LogsViewerProps {
height: number;
@ -14,94 +17,23 @@ interface LogsViewerProps {
const LogsViewer: React.FC<LogsViewerProps> = (props) => {
const { height, content, url } = props;
const [nowrap, setNowrap] = useState(false);
const [logsContent, setLogsContent] = useState<string[]>([]);
const { setChunkRequest } = useSetChunkRequest();
const chunkRequedtRef = useRef<any>(null);
const scroller = useRef<any>(null);
const { updateScrollerPosition, handleContentWheel } = useContainerScroll(
scroller,
{ toBottom: true }
);
const convert = new Convert({
newline: true,
escapeXML: true,
stream: false
});
useEffect(() => {
updateScrollerPosition();
}, [logsContent]);
const ansiEscapeRegex = /(\x1B\[[0-9;]*[A-Za-z])+$/;
const endsWithAnsiEscapeSequence = useCallback((str: string) => {
return ansiEscapeRegex.test(str);
}, []);
const getCursorUpLines = useCallback((str: string) => {
const matches = str.match(/(?:\x1B\[A)+$/);
return matches ? matches[0].length / 3 : 0;
}, []);
const removeDot = useCallback((str: string) => {
return str.replace(/^\(.*?\)/, '');
}, []);
const replaceAnsiEscapeSequence = useCallback((str: string) => {
const res = str.replace(ansiEscapeRegex, '');
return removeDot(res);
}, []);
const handleRControl = useCallback((str: string) => {
if (str.includes('\r')) {
const parts = str.split('\r');
const lastLine = parts[parts.length - 1];
return lastLine;
}
return str;
}, []);
const parseHtmlStr = useCallback((logStr: string) => {
const result: string[] = [];
const lines = logStr.split('\n').filter((line) => line.trim() !== '');
// const lines = text;
lines.forEach((line: string, index: number) => {
const upCount = getCursorUpLines(line);
console.log('line=========1', {
line,
upCount,
result
});
if (endsWithAnsiEscapeSequence(line)) {
const newLine = handleRControl(line);
const val = removeDot(newLine);
if (result.length < upCount) {
result.push('');
}
if (upCount) {
console.log('line=========0', {
line,
upCount,
result
});
const placeIndex = result.length - upCount;
result[placeIndex] = replaceAnsiEscapeSequence(val);
} else {
result.push(val);
}
} else {
const val = handleRControl(line);
result.push(val);
}
});
return result.map((item) => {
return convert.toHtml(item);
});
}, []);
const termRef = useRef<any>(null);
const termInsRef = useRef<any>(null);
const fitAddonRef = useRef<any>(null);
const cacheDatARef = useRef<any>(null);
const size = useSize(scroller);
const updateContent = (newVal: string) => {
const list = parseHtmlStr(newVal);
setLogsContent(list);
cacheDatARef.current = newVal;
termRef.current?.reset();
termRef.current?.write?.(newVal);
};
const fitTerm = () => {
fitAddonRef.current.fit();
};
const createChunkConnection = async () => {
@ -116,6 +48,38 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
handler: updateContent
});
};
const initTerm = () => {
termRef.current?.dispose?.();
termRef.current = new Terminal({
lineHeight: 1.2,
fontSize: 12,
fontFamily:
"monospace,Menlo,Courier,'Courier New',Consolas,Monaco, 'Liberation Mono'",
disableStdin: true,
convertEol: true,
theme: {
background: '#1e1e1e'
},
cursorInactiveStyle: 'none'
// windowOptions: {
// setWinPosition: true,
// setWinSizePixels: true,
// refreshWin: true
// }
});
fitAddonRef.current = new FitAddon();
termRef.current.loadAddon(fitAddonRef.current);
termRef.current.open(termInsRef.current);
fitAddonRef.current?.fit();
};
const handleResize = _.throttle(() => {
termRef.current?.clear();
if (cacheDatARef.current) {
updateContent(cacheDatARef.current);
}
fitTerm();
}, 100);
useEffect(() => {
createChunkConnection();
@ -124,21 +88,23 @@ const LogsViewer: React.FC<LogsViewerProps> = (props) => {
};
}, [url, props.params]);
useEffect(() => {
if (termInsRef.current) {
initTerm();
}
}, []);
useEffect(() => {
handleResize();
console.log('size======', size);
}, [size]);
return (
<div className="logs-viewer-wrap-w2">
<div
className="wrap"
style={{ height: height }}
ref={scroller}
onWheel={handleContentWheel}
>
<div className="wrap" style={{ height: height }} ref={scroller}>
<div className={classNames('content', { 'line-break': nowrap })}>
<div className="text">
{logsContent.map((item, index) => {
return (
<div key={index} dangerouslySetInnerHTML={{ __html: item }} />
);
})}
<div ref={termInsRef}></div>
</div>
</div>
</div>

@ -1,186 +0,0 @@
export default [
'2024-09-11T20:09:42+08:00 - gpustack.worker.downloaders - INFO - Downloading model leafspark/Reflection-Llama-3.1-70B-GGUF/Reflection-Llama-3.1-70B.fp16*.gguf',
'\rFetching 4 files: 0%| | 0/4 [00:00<?, ?it/s]',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 0.00/21.7G [00:00<?, ?B/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 0.00/39.8G [00:00<?, ?B/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 0.00/39.8G [00:00<?, ?B/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 0.00/39.8G [00:00<?, ?B/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 10.5M/21.7G [00:00<33:18, 10.9MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 10.5M/39.8G [00:00<57:50, 11.5MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 10.5M/39.8G [00:01<1:10:14, 9.43MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 10.5M/39.8G [00:01<1:49:48, 6.04MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 21.0M/21.7G [00:01<32:32, 11.1MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 21.0M/39.8G [00:01<1:01:12, 10.8MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 21.0M/39.8G [00:02<1:13:42, 8.99MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 21.0M/39.8G [00:02<1:15:27, 8.79MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 31.5M/21.7G [00:02<31:03, 11.6MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 31.5M/39.8G [00:02<1:01:49, 10.7MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 31.5M/39.8G [00:03<1:11:03, 9.32MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 31.5M/39.8G [00:03<1:14:10, 8.94MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 41.9M/21.7G [00:03<33:05, 10.9MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 41.9M/39.8G [00:04<1:05:32, 10.1MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 41.9M/39.8G [00:04<1:08:05, 9.72MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 41.9M/39.8G [00:04<1:16:35, 8.66MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 52.4M/21.7G [00:05<38:18, 9.42MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 52.4M/39.8G [00:05<1:15:47, 8.75MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 52.4M/39.8G [00:05<1:10:49, 9.34MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 52.4M/39.8G [00:05<1:09:52, 9.49MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 62.9M/21.7G [00:06<38:36, 9.34MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 62.9M/39.8G [00:06<1:08:09, 9.72MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 62.9M/39.8G [00:06<1:12:01, 9.18MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 62.9M/39.8G [00:06<1:08:42, 9.65MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 73.4M/21.7G [00:07<35:51, 10.1MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 73.4M/39.8G [00:07<1:10:30, 9.40MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 73.4M/39.8G [00:07<1:07:33, 9.79MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 73.4M/39.8G [00:08<1:08:59, 9.60MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 83.9M/21.7G [00:08<35:46, 10.1MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 83.9M/39.8G [00:08<1:09:18, 9.56MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 83.9M/39.8G [00:08<1:06:26, 9.95MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 83.9M/39.8G [00:09<1:09:44, 9.50MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 94.4M/21.7G [00:09<37:16, 9.66MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 94.4M/39.8G [00:09<1:08:35, 9.66MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 94.4M/39.8G [00:10<1:15:34, 8.75MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 0%| | 105M/21.7G [00:10<38:00, 9.47MB/s] \x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 94.4M/39.8G [00:10<1:15:42, 8.75MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 105M/39.8G [00:10<1:09:51, 9.48MB/s] \x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 105M/39.8G [00:11<1:08:19, 9.67MB/s] \x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 105M/39.8G [00:11<1:08:56, 9.60MB/s] \x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 115M/21.7G [00:11<39:31, 9.10MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 115M/39.8G [00:11<1:09:17, 9.55MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 115M/39.8G [00:11<1:05:22, 10.1MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 115M/39.8G [00:12<1:07:16, 9.84MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 126M/21.7G [00:12<39:05, 9.20MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 126M/39.8G [00:13<1:10:29, 9.39MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 126M/39.8G [00:13<1:10:04, 9.43MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 126M/39.8G [00:13<1:10:03, 9.45MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 136M/39.8G [00:14<1:08:49, 9.61MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 136M/21.7G [00:14<41:08, 8.74MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 136M/39.8G [00:14<1:09:47, 9.46MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 136M/39.8G [00:14<1:11:33, 9.25MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 147M/21.7G [00:15<37:06, 9.68MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 147M/39.8G [00:15<1:08:57, 9.59MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 147M/39.8G [00:15<1:09:54, 9.44MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 147M/39.8G [00:15<1:09:24, 9.53MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 157M/21.7G [00:16<38:27, 9.34MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 157M/39.8G [00:16<1:10:05, 9.43MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 157M/39.8G [00:16<1:07:01, 9.85MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 157M/39.8G [00:16<1:07:50, 9.75MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 168M/21.7G [00:17<38:21, 9.36MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 168M/39.8G [00:17<1:09:56, 9.45MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 168M/39.8G [00:17<1:08:31, 9.63MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 168M/39.8G [00:17<1:07:58, 9.73MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 178M/21.7G [00:18<36:28, 9.84MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 178M/39.8G [00:18<1:08:43, 9.62MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 178M/39.8G [00:18<1:06:23, 9.93MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 178M/39.8G [00:18<1:07:04, 9.85MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 189M/21.7G [00:19<36:05, 9.93MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 0%| | 189M/39.8G [00:19<1:09:17, 9.53MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 0%| | 189M/39.8G [00:19<1:09:44, 9.46MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 0%| | 189M/39.8G [00:20<1:08:53, 9.59MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 199M/21.7G [00:20<37:40, 9.51MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 199M/39.8G [00:20<1:10:46, 9.33MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 199M/39.8G [00:20<1:09:30, 9.49MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 199M/39.8G [00:22<1:24:55, 7.78MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 210M/21.7G [00:23<57:14, 6.26MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 210M/39.8G [00:27<2:43:58, 4.02MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 210M/39.8G [00:27<2:51:41, 3.85MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 210M/39.8G [00:30<3:47:09, 2.91MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 220M/21.7G [00:34<2:34:24, 2.32MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 220M/39.8G [00:37<5:20:53, 2.06MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 220M/39.8G [00:38<5:29:14, 2.00MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 220M/39.8G [00:41<6:03:25, 1.82MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 231M/21.7G [00:45<3:38:08, 1.64MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 231M/39.8G [00:48<7:09:37, 1.54MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 220M/39.8G [00:49<5:29:14, 2.00MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 231M/39.8G [00:49<7:23:13, 1.49MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 231M/39.8G [00:53<7:47:12, 1.41MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 241M/21.7G [00:56<4:26:13, 1.34MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 231M/39.8G [00:59<7:09:37, 1.54MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 241M/39.8G [00:59<8:28:36, 1.30MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 241M/39.8G [01:00<8:38:48, 1.27MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 241M/39.8G [01:04<8:55:29, 1.23MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 252M/21.7G [01:07<4:59:02, 1.20MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 252M/39.8G [01:10<9:24:07, 1.17MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 252M/39.8G [01:11<9:31:14, 1.15MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 252M/39.8G [01:15<9:43:07, 1.13MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%| | 262M/21.7G [01:18<5:22:04, 1.11MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 262M/39.8G [01:21<10:02:41, 1.09MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 262M/39.8G [01:22<10:07:38, 1.08MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 262M/39.8G [01:26<10:16:38, 1.07MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 273M/21.7G [01:29<5:37:49, 1.06MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 273M/39.8G [01:32<10:30:00, 1.05MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 273M/39.8G [01:33<10:33:40, 1.04MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 273M/39.8G [01:37<10:38:34, 1.03MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 273M/21.7G [01:40<5:37:49, 1.06MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 283M/21.7G [01:40<5:49:35, 1.02MB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 283M/39.8G [01:43<10:49:55, 1.01MB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 283M/39.8G [01:44<10:50:42, 1.01MB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 283M/39.8G [01:48<10:54:20, 1.01MB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 294M/21.7G [01:51<5:57:39, 997kB/s] \x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 294M/39.8G [01:54<11:03:10, 994kB/s] \x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 294M/39.8G [01:55<11:03:01, 992kB/s] \x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 294M/39.8G [01:59<11:06:45, 988kB/s] \x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 304M/21.7G [02:02<6:02:42, 983kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 304M/39.8G [02:06<11:11:58, 980kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 304M/39.8G [02:07<11:13:31, 976kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 304M/39.8G [02:10<11:13:59, 977kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 315M/21.7G [02:13<6:06:19, 973kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 315M/39.8G [02:17<11:18:04, 971kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 315M/39.8G [02:18<11:19:02, 968kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 304M/39.8G [02:20<11:13:59, 977kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 315M/39.8G [02:21<11:19:35, 969kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 1%|▏ | 325M/21.7G [02:25<6:09:00, 965kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 325M/39.8G [02:28<11:23:11, 964kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 325M/39.8G [02:29<11:24:16, 960kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 325M/39.8G [02:32<11:23:06, 964kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 336M/21.7G [02:36<6:10:37, 961kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 336M/39.8G [02:39<11:30:56, 953kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 336M/39.8G [02:40<11:27:52, 955kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 336M/39.8G [02:43<11:26:57, 958kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 346M/21.7G [02:47<6:12:02, 957kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 346M/39.8G [02:50<11:27:09, 958kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 336M/39.8G [02:50<11:27:52, 955kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 346M/39.8G [02:51<11:29:24, 953kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 346M/39.8G [02:54<11:28:21, 956kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 357M/21.7G [02:58<6:12:46, 954kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 346M/39.8G [03:00<11:27:09, 958kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 357M/39.8G [03:01<11:28:44, 955kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 357M/39.8G [03:02<11:30:19, 951kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 357M/39.8G [03:05<11:29:12, 955kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 367M/21.7G [03:09<6:13:01, 953kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 367M/39.8G [03:12<11:29:49, 953kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 367M/39.8G [03:13<11:30:10, 951kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 367M/39.8G [03:16<11:30:21, 953kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 377M/21.7G [03:20<6:13:22, 952kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 377M/39.8G [03:23<11:30:39, 952kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 377M/39.8G [03:24<11:30:37, 950kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 377M/39.8G [03:27<11:31:13, 951kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 388M/21.7G [03:31<6:13:41, 950kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 388M/39.8G [03:34<11:31:12, 951kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 388M/39.8G [03:35<11:30:13, 951kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 388M/39.8G [03:38<11:31:04, 951kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 388M/21.7G [03:41<6:13:41, 950kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 398M/21.7G [03:42<6:14:00, 949kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 398M/39.8G [03:45<11:31:46, 950kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 398M/39.8G [03:46<11:30:55, 949kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 398M/39.8G [03:49<11:31:42, 950kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 409M/21.7G [03:53<6:14:52, 947kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 409M/39.8G [03:56<11:32:14, 949kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 409M/39.8G [03:57<11:31:30, 948kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 409M/39.8G [04:00<11:31:46, 950kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 419M/21.7G [04:04<6:14:17, 948kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 419M/39.8G [04:07<11:32:00, 949kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 419M/39.8G [04:08<11:30:58, 949kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 409M/39.8G [04:11<11:31:46, 950kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 419M/39.8G [04:11<11:32:14, 949kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 430M/21.7G [04:15<6:14:11, 947kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 430M/39.8G [04:18<11:33:24, 947kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 430M/39.8G [04:19<11:30:43, 949kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 430M/39.8G [04:22<11:31:17, 950kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 440M/21.7G [04:26<6:13:49, 948kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 440M/39.8G [04:29<11:32:42, 948kB/s]\x1B[A\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00001-of-00004.gguf: 1%| | 440M/39.8G [04:30<11:30:07, 950kB/s]\x1B[A\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00003-of-00004.gguf: 1%| | 440M/39.8G [04:33<11:30:57, 950kB/s]\x1B[A\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00004-of-00004.gguf: 2%|▏ | 451M/21.7G [04:37<6:13:16, 949kB/s]\x1B[A',
'\r(…)n-Llama-3.1-70B.fp16-00002-of-00004.gguf: 1%| | 451M/39.8G [04:40<11:32:03, 948kB/s]\x1B[A\x1B[A\x1B[A\x1B[A'
];

@ -0,0 +1,13 @@
import useResizeObserver from '@react-hook/resize-observer';
import React from 'react';
export default function useSize(target: any) {
const [size, setSize] = React.useState();
React.useLayoutEffect(() => {
setSize(target.current.getBoundingClientRect());
}, [target]);
useResizeObserver(target, (entry: any) => setSize(entry?.contentRect));
return size;
}

@ -46,6 +46,7 @@ export default {
'common.button.disabled': 'Disabled',
'common.button.upgrade': 'Upgrade',
'common.input.holder': 'Please enter',
'common.validate.value': 'value is required',
'common.button.edit': 'Edit',
'common.button.authorize': 'Role Authorization',
'common.button.confirm': 'Confirm',

@ -9,6 +9,7 @@ export default {
'models.form.repoid.desc': 'Only .gguf format is supported',
'models.form.filename': 'File Name',
'models.form.replicas': 'Replicas',
'models.form.selector': 'Selector',
'models.form.configurations': 'Configurations',
'models.form.s3address': 'S3 Address',
'models.form.partialoffload.tips':

@ -109,6 +109,7 @@ export default {
'common.ws.reconnect': '重新连接',
'common.input.key': '键',
'common.input.value': '值',
'common.validate.value': '值必填',
'common.input.type': '类型',
'common.input.visible': '是否可见',
'common.input.description': '描述',

@ -9,6 +9,7 @@ export default {
'models.form.repoid.desc': '只支持 .gguf 格式',
'models.form.filename': '文件名',
'models.form.replicas': '副本数',
'models.form.selector': '选择器',
'models.form.configurations': '配置',
'models.form.s3address': 'S3 地址',
'models.form.partialoffload.tips':

@ -11,6 +11,7 @@ import {
Tooltip,
Typography
} from 'antd';
import _ from 'lodash';
import React, { useCallback, useMemo } from 'react';
import { placementStrategyOptions } from '../config';
import { FormData } from '../config/types';
@ -129,7 +130,33 @@ const AdvanceConfig: React.FC<AdvanceConfigProps> = (props) => {
description={renderSelectTips(placementStrategyTips)}
></SealSelect>
</Form.Item>
<Form.Item<FormData> name="worker_selector">
<Form.Item<FormData>
name="worker_selector"
rules={[
({ getFieldValue }) => ({
validator(rule, value) {
if (
getFieldValue('scheduleType') === 'auto' &&
_.keys(value).length > 0
) {
if (_.some(_.keys(value), (k: string) => !value[k])) {
return Promise.reject(
intl.formatMessage(
{
id: 'common.validate.value'
},
{
name: 'models.form.selector'
}
)
);
}
}
return Promise.resolve();
}
})
]}
>
<LabelSelector
label={intl.formatMessage({
id: 'resources.form.workerSelector'

@ -1,7 +1,6 @@
import LogsViewer from '@/components/logs-viewer';
import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Modal } from 'antd';
import { Modal } from 'antd';
import React, { useEffect, useState } from 'react';
type ViewModalProps = {
@ -43,13 +42,13 @@ const ViewCodeModal: React.FC<ViewModalProps> = (props) => {
title={
<span className="flex flex-center">
<span> {intl.formatMessage({ id: 'common.button.viewlog' })}</span>
<Button size="middle" type="text" onClick={handleFullscreenToggle}>
{/* <Button size="middle" type="text" onClick={handleFullscreenToggle}>
{isFullScreenRef.current ? (
<FullscreenExitOutlined />
) : (
<FullscreenOutlined />
)}
</Button>
</Button> */}
</span>
}
open={open}

2
typings.d.ts vendored

@ -17,5 +17,7 @@ declare module 'react-fittext';
declare module 'lodash';
declare module 'crypto-js';
declare module 'has-ansi';
declare module 'terminal-kit';
declare module 'monaco-vim';
declare const REACT_APP_ENV: 'test' | 'dev' | 'pre' | false;

Loading…
Cancel
Save