fix: evaluate status add lock state
This commit is contained in:
@@ -20,12 +20,6 @@ export default function createProxyTable(target?: string) {
|
|||||||
ws: true,
|
ws: true,
|
||||||
log: 'debug',
|
log: 'debug',
|
||||||
pathRewrite: (pth: string) => pth.replace(`/^/${api}`, `/${api}`),
|
pathRewrite: (pth: string) => pth.replace(`/^/${api}`, `/${api}`),
|
||||||
// onProxyRes: (proxyRes: any, req: any, res: any) => {
|
|
||||||
// console.log('headers=========', {
|
|
||||||
// res: proxyRes.headers,
|
|
||||||
// req: req.headers
|
|
||||||
// });
|
|
||||||
// },
|
|
||||||
headers: {
|
headers: {
|
||||||
origin: newTarget,
|
origin: newTarget,
|
||||||
Connection: 'keep-alive'
|
Connection: 'keep-alive'
|
||||||
|
|||||||
+6
-1
@@ -33,7 +33,7 @@
|
|||||||
"ansi-to-html": "^0.7.2",
|
"ansi-to-html": "^0.7.2",
|
||||||
"antd": "^5.21.6",
|
"antd": "^5.21.6",
|
||||||
"antd-style": "^3.6.2",
|
"antd-style": "^3.6.2",
|
||||||
"axios": "^1.7.2",
|
"axios": "^1.8.2",
|
||||||
"classnames": "^2.5.1",
|
"classnames": "^2.5.1",
|
||||||
"clipboard": "^2.0.11",
|
"clipboard": "^2.0.11",
|
||||||
"crypto-js": "^4.2.0",
|
"crypto-js": "^4.2.0",
|
||||||
@@ -101,5 +101,10 @@
|
|||||||
"url-loader": "^4.1.1",
|
"url-loader": "^4.1.1",
|
||||||
"webpack-bundle-analyzer": "^4.10.2",
|
"webpack-bundle-analyzer": "^4.10.2",
|
||||||
"worker-loader": "^3.0.8"
|
"worker-loader": "^3.0.8"
|
||||||
|
},
|
||||||
|
"pnpm": {
|
||||||
|
"overrides": {
|
||||||
|
"elliptic": "^6.6.1"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+12
-8
@@ -6,6 +6,7 @@ settings:
|
|||||||
|
|
||||||
overrides:
|
overrides:
|
||||||
immer: ^9.0.6
|
immer: ^9.0.6
|
||||||
|
elliptic: ^6.6.1
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
'@ant-design/icons':
|
'@ant-design/icons':
|
||||||
@@ -60,8 +61,8 @@ dependencies:
|
|||||||
specifier: ^3.6.2
|
specifier: ^3.6.2
|
||||||
version: 3.6.2(@types/react@18.3.1)(antd@5.21.6)(react-dom@18.2.0)(react@18.2.0)
|
version: 3.6.2(@types/react@18.3.1)(antd@5.21.6)(react-dom@18.2.0)(react@18.2.0)
|
||||||
axios:
|
axios:
|
||||||
specifier: ^1.7.2
|
specifier: ^1.8.2
|
||||||
version: 1.7.2
|
version: 1.9.0
|
||||||
classnames:
|
classnames:
|
||||||
specifier: ^2.5.1
|
specifier: ^2.5.1
|
||||||
version: 2.5.1
|
version: 2.5.1
|
||||||
@@ -7832,8 +7833,8 @@ packages:
|
|||||||
transitivePeerDependencies:
|
transitivePeerDependencies:
|
||||||
- debug
|
- debug
|
||||||
|
|
||||||
/axios@1.7.2:
|
/axios@1.9.0:
|
||||||
resolution: {integrity: sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==, tarball: https://registry.npmjs.org/axios/-/axios-1.7.2.tgz}
|
resolution: {integrity: sha512-re4CqKTJaURpzbLHtIi6XpDv20/CnpXOtjRY5/CU32L8gU8ek9UIivcfvSWvmKEngmVbrUtPpdDwWDWL7DNHvg==, tarball: https://registry.npmjs.org/axios/-/axios-1.9.0.tgz}
|
||||||
dependencies:
|
dependencies:
|
||||||
follow-redirects: 1.15.6
|
follow-redirects: 1.15.6
|
||||||
form-data: 4.0.0
|
form-data: 4.0.0
|
||||||
@@ -8177,7 +8178,7 @@ packages:
|
|||||||
browserify-rsa: 4.1.0
|
browserify-rsa: 4.1.0
|
||||||
create-hash: 1.2.0
|
create-hash: 1.2.0
|
||||||
create-hmac: 1.1.7
|
create-hmac: 1.1.7
|
||||||
elliptic: 6.5.5
|
elliptic: 6.6.1
|
||||||
hash-base: 3.0.4
|
hash-base: 3.0.4
|
||||||
inherits: 2.0.4
|
inherits: 2.0.4
|
||||||
parse-asn1: 5.1.7
|
parse-asn1: 5.1.7
|
||||||
@@ -8790,7 +8791,7 @@ packages:
|
|||||||
resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==, tarball: https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz}
|
resolution: {integrity: sha512-mf+TCx8wWc9VpuxfP2ht0iSISLZnt0JgWlrOKZiNqyUZWnjIaCIVNQArMHnCZKfEYRg6IM7A+NeJoN8gf/Ws0A==, tarball: https://registry.npmjs.org/create-ecdh/-/create-ecdh-4.0.4.tgz}
|
||||||
dependencies:
|
dependencies:
|
||||||
bn.js: 4.12.0
|
bn.js: 4.12.0
|
||||||
elliptic: 6.5.5
|
elliptic: 6.6.1
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/create-hash@1.2.0:
|
/create-hash@1.2.0:
|
||||||
@@ -9530,8 +9531,8 @@ packages:
|
|||||||
/electron-to-chromium@1.5.73:
|
/electron-to-chromium@1.5.73:
|
||||||
resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==, tarball: https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.73.tgz}
|
resolution: {integrity: sha512-8wGNxG9tAG5KhGd3eeA0o6ixhiNdgr0DcHWm85XPCphwZgD1lIEoi6t3VERayWao7SF7AAZTw6oARGJeVjH8Kg==, tarball: https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.73.tgz}
|
||||||
|
|
||||||
/elliptic@6.5.5:
|
/elliptic@6.6.1:
|
||||||
resolution: {integrity: sha512-7EjbcmUm17NQFu4Pmgmq2olYMj8nwMnpcddByChSUjArp8F5DQWcIcpriwO4ZToLNAJig0yiyjswfyGNje/ixw==, tarball: https://registry.npmjs.org/elliptic/-/elliptic-6.5.5.tgz}
|
resolution: {integrity: sha512-RaddvvMatK2LJHqFJ+YA4WysVN5Ita9E35botqIYspQ4TkRAlCicdzKOjlyv/1Za5RyTNn7di//eEV0uTAfe3g==, tarball: https://registry.npmjs.org/elliptic/-/elliptic-6.6.1.tgz}
|
||||||
dependencies:
|
dependencies:
|
||||||
bn.js: 4.12.0
|
bn.js: 4.12.0
|
||||||
brorand: 1.1.0
|
brorand: 1.1.0
|
||||||
@@ -19107,6 +19108,7 @@ packages:
|
|||||||
|
|
||||||
/tr46@0.0.3:
|
/tr46@0.0.3:
|
||||||
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==, tarball: https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz}
|
resolution: {integrity: sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==, tarball: https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz}
|
||||||
|
requiresBuild: true
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/trim-lines@3.0.1:
|
/trim-lines@3.0.1:
|
||||||
@@ -19928,6 +19930,7 @@ packages:
|
|||||||
|
|
||||||
/webidl-conversions@3.0.1:
|
/webidl-conversions@3.0.1:
|
||||||
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==, tarball: https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz}
|
resolution: {integrity: sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==, tarball: https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz}
|
||||||
|
requiresBuild: true
|
||||||
dev: false
|
dev: false
|
||||||
|
|
||||||
/webpack-5-chain@8.0.1:
|
/webpack-5-chain@8.0.1:
|
||||||
@@ -20007,6 +20010,7 @@ packages:
|
|||||||
|
|
||||||
/whatwg-url@5.0.0:
|
/whatwg-url@5.0.0:
|
||||||
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==, tarball: https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz}
|
resolution: {integrity: sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==, tarball: https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz}
|
||||||
|
requiresBuild: true
|
||||||
dependencies:
|
dependencies:
|
||||||
tr46: 0.0.3
|
tr46: 0.0.3
|
||||||
webidl-conversions: 3.0.1
|
webidl-conversions: 3.0.1
|
||||||
|
|||||||
@@ -128,7 +128,7 @@ const MixLineBarChart: React.FC<
|
|||||||
...options.xAxis,
|
...options.xAxis,
|
||||||
data: xAxisData
|
data: xAxisData
|
||||||
},
|
},
|
||||||
series: [...linedata, ...barData]
|
series: [...barData, ...linedata]
|
||||||
};
|
};
|
||||||
}, [seriesData, xAxisData, yAxisName, title, smooth, legendData, options]);
|
}, [seriesData, xAxisData, yAxisName, title, smooth, legendData, options]);
|
||||||
|
|
||||||
|
|||||||
@@ -84,7 +84,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
const [query, setQuery] = useState({
|
const [query, setQuery] = useState({
|
||||||
page: 1,
|
page: 1,
|
||||||
perPage: 10,
|
perPage: 10,
|
||||||
total: 100
|
total: 0
|
||||||
});
|
});
|
||||||
const modelFilesSortOptions = useRef<any[]>([
|
const modelFilesSortOptions = useRef<any[]>([
|
||||||
{
|
{
|
||||||
@@ -120,7 +120,8 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
return isGGUF || isGGUFFromMs;
|
return isGGUF || isGGUFFromMs;
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleOnSelectModel = (item: any, evaluate?: boolean) => {
|
const handleOnSelectModel = (model: any, evaluate?: boolean) => {
|
||||||
|
const item = model || {};
|
||||||
onSelectModel(item, evaluate);
|
onSelectModel(item, evaluate);
|
||||||
setCurrent(item.id);
|
setCurrent(item.id);
|
||||||
currentRef.current = item.id;
|
currentRef.current = item.id;
|
||||||
@@ -207,6 +208,13 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
});
|
});
|
||||||
return list;
|
return list;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
setQuery((prev) => {
|
||||||
|
return {
|
||||||
|
...prev,
|
||||||
|
page: queryParams.page,
|
||||||
|
total: 0
|
||||||
|
};
|
||||||
|
});
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@@ -367,7 +375,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
displayEvaluateStatus?.({
|
displayEvaluateStatus?.({
|
||||||
show: true,
|
show: true,
|
||||||
flag: {
|
flag: {
|
||||||
model: true
|
model: list.length > 0
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
handleOnSelectModel(list[0]);
|
handleOnSelectModel(list[0]);
|
||||||
@@ -375,6 +383,7 @@ const SearchModel: React.FC<SearchInputProps> = (props) => {
|
|||||||
|
|
||||||
handleEvaluate(list);
|
handleEvaluate(list);
|
||||||
} catch (error: any) {
|
} catch (error: any) {
|
||||||
|
console.log('error:', error);
|
||||||
setDataSource({
|
setDataSource({
|
||||||
repoOptions: [],
|
repoOptions: [],
|
||||||
loading: false,
|
loading: false,
|
||||||
|
|||||||
@@ -36,6 +36,11 @@ type MessageStatus = {
|
|||||||
evaluateResult?: EvaluateResult;
|
evaluateResult?: EvaluateResult;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
type WarningStausOptions = {
|
||||||
|
lockAfterUpdate?: boolean;
|
||||||
|
override?: boolean;
|
||||||
|
};
|
||||||
|
|
||||||
export const useGenerateFormEditInitialValues = () => {
|
export const useGenerateFormEditInitialValues = () => {
|
||||||
const gpuDeviceList = useRef<any[]>([]);
|
const gpuDeviceList = useRef<any[]>([]);
|
||||||
const workerList = useRef<any[]>([]);
|
const workerList = useRef<any[]>([]);
|
||||||
@@ -268,6 +273,7 @@ export const useCheckCompatibility = () => {
|
|||||||
const submitAnyway = useRef<boolean>(false);
|
const submitAnyway = useRef<boolean>(false);
|
||||||
const requestIdRef = useRef(0);
|
const requestIdRef = useRef(0);
|
||||||
const updateStatusTimer = useRef<any>(null);
|
const updateStatusTimer = useRef<any>(null);
|
||||||
|
const isLockWarningStatus = useRef<boolean>(false);
|
||||||
const [warningStatus, setWarningStatus] = useState<MessageStatus>({
|
const [warningStatus, setWarningStatus] = useState<MessageStatus>({
|
||||||
show: false,
|
show: false,
|
||||||
title: '',
|
title: '',
|
||||||
@@ -279,6 +285,33 @@ export const useCheckCompatibility = () => {
|
|||||||
return requestIdRef.current;
|
return requestIdRef.current;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const lockWarningStatus = () => {
|
||||||
|
isLockWarningStatus.current = true;
|
||||||
|
};
|
||||||
|
|
||||||
|
const unlockWarningStatus = () => {
|
||||||
|
isLockWarningStatus.current = false;
|
||||||
|
};
|
||||||
|
|
||||||
|
const updateWarningStatus = (
|
||||||
|
params: MessageStatus,
|
||||||
|
options?: WarningStausOptions
|
||||||
|
) => {
|
||||||
|
const { lockAfterUpdate = false, override = false } = options || {};
|
||||||
|
|
||||||
|
setWarningStatus((prev: MessageStatus) => {
|
||||||
|
if (isLockWarningStatus.current && !override) {
|
||||||
|
return prev;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (lockAfterUpdate) {
|
||||||
|
lockWarningStatus();
|
||||||
|
}
|
||||||
|
|
||||||
|
return params;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
|
||||||
const handleEvaluate = async (data: any) => {
|
const handleEvaluate = async (data: any) => {
|
||||||
try {
|
try {
|
||||||
checkTokenRef.current?.cancel();
|
checkTokenRef.current?.cancel();
|
||||||
@@ -374,13 +407,16 @@ export const useCheckCompatibility = () => {
|
|||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const handleShowCompatibleAlert = (evaluateResult: EvaluateResult | null) => {
|
const handleShowCompatibleAlert = (
|
||||||
|
evaluateResult: EvaluateResult | null,
|
||||||
|
options?: WarningStausOptions
|
||||||
|
) => {
|
||||||
const result = handleCheckCompatibility(evaluateResult);
|
const result = handleCheckCompatibility(evaluateResult);
|
||||||
if (updateStatusTimer.current) {
|
if (updateStatusTimer.current) {
|
||||||
clearTimeout(updateStatusTimer.current);
|
clearTimeout(updateStatusTimer.current);
|
||||||
}
|
}
|
||||||
updateStatusTimer.current = setTimeout(() => {
|
updateStatusTimer.current = setTimeout(() => {
|
||||||
setWarningStatus(result);
|
updateWarningStatus(result, options);
|
||||||
}, 300);
|
}, 300);
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -562,7 +598,8 @@ export const useCheckCompatibility = () => {
|
|||||||
handleDoEvalute,
|
handleDoEvalute,
|
||||||
generateGPUIds,
|
generateGPUIds,
|
||||||
handleEvaluate,
|
handleEvaluate,
|
||||||
setWarningStatus,
|
setWarningStatus: updateWarningStatus,
|
||||||
|
unlockWarningStatus,
|
||||||
cancelEvaluate,
|
cancelEvaluate,
|
||||||
handleBackendChangeBefore,
|
handleBackendChangeBefore,
|
||||||
handleOnValuesChange: debounceHandleValuesChange,
|
handleOnValuesChange: debounceHandleValuesChange,
|
||||||
|
|||||||
Reference in New Issue
Block a user