feat: home page

This commit is contained in:
wonfen
2025-03-14 13:31:34 +08:00
parent c25015ed54
commit 1f99cee78b
37 changed files with 4488 additions and 74 deletions

View File

@@ -81,7 +81,7 @@ export const ProfileItem = (props: Props) => {
const expire = parseExpire(extra?.expire);
const progress = Math.min(
Math.round(((download + upload) * 100) / (total + 0.01)) + 1,
100
100,
);
const loading = loadingCache[itemData.uid] ?? false;
@@ -202,11 +202,12 @@ export const ProfileItem = (props: Props) => {
try {
await updateProfile(itemData.uid, option);
Notice.success(t("Update subscription successfully"));
mutate("getProfiles");
} catch (err: any) {
const errmsg = err?.message || err.toString();
Notice.error(
errmsg.replace(/error sending request for url (\S+?): /, "")
errmsg.replace(/error sending request for url (\S+?): /, ""),
);
} finally {
setLoadingCache((cache) => ({ ...cache, [itemData.uid]: false }));