This commit is contained in:
sijinhui
2023-12-16 23:05:14 +08:00
parent efdd61595e
commit b43c0b0109
91 changed files with 3399 additions and 12096 deletions

16
app/utils/custom.ts Normal file
View File

@@ -0,0 +1,16 @@
export function getCurrentTime(): string {
const now = new Date();
const formatter = new Intl.DateTimeFormat("zh-CN", {
timeZone: "Asia/Shanghai", // 设置为中国标准时间
year: "numeric",
month: "2-digit",
day: "2-digit",
hour: "2-digit",
minute: "2-digit",
second: "2-digit",
});
// console.log(formattedDateTime); // 输出中国标准时间格式
return formatter.format(now);
}

View File

@@ -9,8 +9,13 @@ export function useAllModels() {
return collectModels(
configStore.models,
[configStore.customModels, accessStore.customModels].join(","),
);
}, [accessStore.customModels, configStore.customModels, configStore.models]);
).filter((m) => !configStore.dontUseModel.includes(m.name as any));
}, [
accessStore.customModels,
configStore.customModels,
configStore.models,
configStore.dontUseModel,
]);
return models;
}

View File

@@ -1,13 +1,15 @@
export function merge(target: any, source: any) {
Object.keys(source).forEach(function (key) {
if (
source.hasOwnProperty(key) && // Check if the property is not inherited
source[key] &&
typeof source[key] === "object" || key === "__proto__" || key === "constructor"
(source.hasOwnProperty(key) && // Check if the property is not inherited
source[key] &&
typeof source[key] === "object") ||
key === "__proto__" ||
key === "constructor"
) {
merge((target[key] = target[key] || {}), source[key]);
return;
}
target[key] = source[key];
});
}
}

View File

@@ -6,7 +6,7 @@ export function collectModelTable(
) {
const modelTable: Record<
string,
{ available: boolean; name: string; displayName: string }
{ available: boolean; name: string; displayName: string; describe: string }
> = {};
// default models
@@ -37,6 +37,7 @@ export function collectModelTable(
name,
displayName: displayName || name,
available,
describe: "",
};
});
return modelTable;