mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 21:13:50 +00:00

* perf: teaxtarea no wheel * remove render error * adapt workflow skip circle * perf: change tab can stream output
25 lines
672 B
TypeScript
25 lines
672 B
TypeScript
import { useSystemStore } from './useSystemStore';
|
|
|
|
export const downloadFetch = async ({ url, filename }: { url: string; filename: string }) => {
|
|
const a = document.createElement('a');
|
|
a.href = url;
|
|
a.download = filename;
|
|
document.body.appendChild(a);
|
|
a.click();
|
|
document.body.removeChild(a);
|
|
};
|
|
|
|
export const getWebLLMModel = (model?: string) => {
|
|
const list = useSystemStore.getState().llmModelList;
|
|
return list.find((item) => item.model === model || item.name === model) ?? list[0];
|
|
};
|
|
|
|
export const watchWindowHidden = () => {
|
|
// @ts-ignore
|
|
if (document.hidden) {
|
|
window.windowHidden = true;
|
|
} else {
|
|
window.windowHidden = false;
|
|
}
|
|
};
|