feat(platform): 开源发布 - 初始化 Open AI Canvas
This commit is contained in:
commit
aea35896eb
365 files changed
+66410
No files matched your search
@@ -0,0 +1,20 @@
|
||||
export type ResourceStorageLocation = "oss" | "local" | "none";
|
||||
|
||||
export function resourceStorageLocation(storageKey?: string): ResourceStorageLocation {
|
||||
if (!storageKey) return "none";
|
||||
return storageKey.startsWith("resource:") ? "oss" : "local";
|
||||
}
|
||||
|
||||
export function resourceStorageLabel(storageKey?: string) {
|
||||
const location = resourceStorageLocation(storageKey);
|
||||
if (location === "oss") return "已上传";
|
||||
if (location === "local") return "本地";
|
||||
return "未同步";
|
||||
}
|
||||
|
||||
export function resourceStorageTitle(storageKey?: string) {
|
||||
const location = resourceStorageLocation(storageKey);
|
||||
if (location === "oss") return "已上传到 OSS,并以账号资源同步";
|
||||
if (location === "local") return "保存在当前浏览器本地,通常是 OSS 未启用或上传失败后的降级";
|
||||
return "还没有可同步的资源标识";
|
||||
}
|
||||
Reference in new issue
Block a user