))}
diff --git a/web/src/pages/app/setting/SysSetting/CustomDomain/index.tsx b/web/src/pages/app/setting/SysSetting/CustomDomain/index.tsx
index 2276e76814..ab91c83227 100644
--- a/web/src/pages/app/setting/SysSetting/CustomDomain/index.tsx
+++ b/web/src/pages/app/setting/SysSetting/CustomDomain/index.tsx
@@ -19,7 +19,7 @@ import { useBindDomainMutation, useRemoveApplicationMutation } from "./service";
import useGlobalStore from "@/pages/globalStore";
export default function CustomDomain() {
- const { currentApp, showSuccess, setCurrentApp } = useGlobalStore();
+ const { currentApp, showSuccess, setCurrentApp, showWarning } = useGlobalStore();
const { register, handleSubmit } = useForm<{ domain: string }>({
defaultValues: { domain: currentApp?.domain?.customDomain || "" },
@@ -94,6 +94,8 @@ export default function CustomDomain() {
if (res.data) {
setCurrentApp({ ...currentApp, domain: res.data });
showSuccess(t("StoragePanel.DomainUpdateSuccess"));
+ } else if (res.error === "domain not resolved") {
+ showWarning(t("StoragePanel.DomainNotResolved"));
}
})}
>
diff --git a/web/src/pages/app/setting/UserSetting/BillingDetails/index.tsx b/web/src/pages/app/setting/UserSetting/BillingDetails/index.tsx
index bee5b8cf05..444d7722f6 100644
--- a/web/src/pages/app/setting/UserSetting/BillingDetails/index.tsx
+++ b/web/src/pages/app/setting/UserSetting/BillingDetails/index.tsx
@@ -94,7 +94,11 @@ export default function BillingDetails() {
- {t("OrderNumber")}
+
+ {t("OrderNumber")}
+
|
-
+
{t("Duration")}
@@ -119,7 +126,12 @@ export default function RechargeHistory() {
|
-
+
{t("State")}
@@ -152,17 +164,32 @@ export default function RechargeHistory() {
|
-
+
{t("Recharge amount")}
|
-
+
{t("Bonus amount")}
|
-
+
{t("Total payment amount")}
|
@@ -180,10 +207,18 @@ export default function RechargeHistory() {
>
{item._id}
- {formatDate(item.createdAt)} |
+
+ {formatDate(item.createdAt)}
+ |
diff --git a/web/src/pages/app/setting/index.tsx b/web/src/pages/app/setting/index.tsx
index 97b63cbf24..910ed69e87 100644
--- a/web/src/pages/app/setting/index.tsx
+++ b/web/src/pages/app/setting/index.tsx
@@ -117,10 +117,10 @@ const SettingModal = (props: {
}}
>
- {tab.icon}
- {tab.name}
+ {tab.icon}
+ {tab.name}
{tab?.status && (
-
+
{tab.status}
)}
diff --git a/web/src/pages/app/storages/index.tsx b/web/src/pages/app/storages/index.tsx
index ab7c8d8819..b03548a092 100644
--- a/web/src/pages/app/storages/index.tsx
+++ b/web/src/pages/app/storages/index.tsx
@@ -1,8 +1,9 @@
/****************************
* cloud functions storage page
***************************/
-import { useRef } from "react";
+import { useEffect, useRef } from "react";
import { useTranslation } from "react-i18next";
+import { Center } from "@chakra-ui/react";
import Content from "@/components/Content";
import EmptyBox from "@/components/EmptyBox";
@@ -19,34 +20,57 @@ import StorageListPanel from "./mods/StorageListPanel";
import useStorageStore from "./store";
import useCustomSettingStore from "@/pages/customSetting";
+import useGlobalStore from "@/pages/globalStore";
export default function StoragePage() {
const { t } = useTranslation();
const containerRef = useRef(null);
const settingStore = useCustomSettingStore();
const { currentStorage } = useStorageStore();
+
+ const { currentApp, showWarning } = useGlobalStore((state) => state);
+
+ useEffect(() => {
+ if (currentApp.state !== "Running") {
+ showWarning(t("StoragePanel.StartAppTips"));
+ }
+ // eslint-disable-next-line react-hooks/exhaustive-deps
+ }, []);
+
return (
-
+
- {currentStorage === undefined ? (
+ {currentApp.state === "Running" ? (
+ currentStorage === undefined ? (
+
+
+
+ {t("StoragePanel.EmptyText")}
+
+
+ {t("CreateNow")}
+
+
+
+
+
+ ) : (
+
+ )
+ ) : (
-
-
- {t("StoragePanel.EmptyText")}
-
-
- {t("CreateNow")}
-
-
-
-
+
+ {t("StoragePanel.StartAppTips")}
+
- ) : (
-
)}
diff --git a/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx b/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx
index 097eee3253..6add1fed8b 100644
--- a/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx
+++ b/web/src/pages/app/storages/mods/CreateBucketModal/index.tsx
@@ -1,5 +1,6 @@
import React from "react";
import { useForm } from "react-hook-form";
+import { InfoOutlineIcon } from "@chakra-ui/icons";
import {
Button,
FormControl,
@@ -145,6 +146,11 @@ function CreateBucketModal(props: { storage?: TBucket; children: React.ReactElem
+
+
+
+ {t("StoragePanel.BucketTips")}
+
diff --git a/web/src/pages/app/storages/mods/CreateWebsiteModal/index.tsx b/web/src/pages/app/storages/mods/CreateWebsiteModal/index.tsx
index 8f3281277b..d6f02e2402 100644
--- a/web/src/pages/app/storages/mods/CreateWebsiteModal/index.tsx
+++ b/web/src/pages/app/storages/mods/CreateWebsiteModal/index.tsx
@@ -37,9 +37,12 @@ import useStorageStore from "../../store";
import SiteStatus from "./SiteStatus";
+import useGlobalStore from "@/pages/globalStore";
+
function CreateWebsiteModal() {
const { isOpen, onOpen, onClose } = useDisclosure();
const { currentStorage, getOrigin } = useStorageStore();
+ const { showSuccess, showInfo, showWarning } = useGlobalStore();
const { register, setFocus, handleSubmit, reset } = useForm<{ domain: string }>();
const { t } = useTranslation();
const createWebsiteMutation = useWebsiteCreateMutation();
@@ -113,7 +116,7 @@ function CreateWebsiteModal() {
variant={"secondary"}
style={{ borderRadius: "1rem" }}
disabled={currentStorage === undefined}
- onClick={() => {
+ onClick={async () => {
if (!(currentStorage?.policy === BUCKET_POLICY_TYPE.readonly)) {
toast({
status: "warning",
@@ -122,10 +125,14 @@ function CreateWebsiteModal() {
});
return;
}
- createWebsiteMutation.mutateAsync({
+ const res = await createWebsiteMutation.mutateAsync({
bucketName: currentStorage && currentStorage.name,
state: BUCKET_STATUS.Active,
});
+ if (!res.error) {
+ showSuccess(t("StoragePanel.SuccessfullyHosted"));
+ showInfo(t("StoragePanel.SuccessfullyHostedTips"), 5000, true);
+ }
}}
>
{t("StoragePanel.websiteHost")}
@@ -175,12 +182,14 @@ function CreateWebsiteModal() {
type="submit"
isLoading={updateWebsiteMutation.isLoading}
onClick={handleSubmit(async (value) => {
- const res: any = await updateWebsiteMutation.mutateAsync({
+ const res = await updateWebsiteMutation.mutateAsync({
id: currentStorage?.websiteHosting._id,
domain: value.domain,
});
if (res.data) {
onClose();
+ } else if (res.error === "domain not resolved") {
+ showWarning(t("StoragePanel.DomainNotResolved"));
}
})}
>
diff --git a/web/src/pages/app/storages/mods/StorageListPanel/index.tsx b/web/src/pages/app/storages/mods/StorageListPanel/index.tsx
index 5f7b742b1b..5dcea89596 100644
--- a/web/src/pages/app/storages/mods/StorageListPanel/index.tsx
+++ b/web/src/pages/app/storages/mods/StorageListPanel/index.tsx
@@ -115,9 +115,9 @@ export default function StorageListPanel() {
}}
>
<>
-
+
- {storage.name}
+ {storage.name}
diff --git a/web/src/pages/auth/signin/index.tsx b/web/src/pages/auth/signin/index.tsx
index 3d1749454d..c2fd394f0f 100644
--- a/web/src/pages/auth/signin/index.tsx
+++ b/web/src/pages/auth/signin/index.tsx
@@ -11,6 +11,7 @@ import LoginByPasswordPanel from "./mods/LoginByPasswordPanel";
import LoginByPhonePanel from "./mods/LoginByPhonePanel";
import useAuthStore from "@/pages/auth/store";
+import useGlobalStore from "@/pages/globalStore";
type providersTypes = "user-password" | "phone" | "github" | "wechat";
@@ -22,11 +23,18 @@ export default function SignIn() {
const [currentProvider, setCurrentProvider] = useState();
const isBindGithub = !!sessionStorage.getItem("githubToken");
+ const { showInfo } = useGlobalStore();
useEffect(() => {
setCurrentProvider(defaultProvider.name);
}, [defaultProvider]);
+ useEffect(() => {
+ if (isBindGithub) {
+ showInfo(t("AuthPanel.PleaseBindUser"), 5000, true);
+ }
+ }, [isBindGithub, showInfo]);
+
return (
()(
SideBar: {
id: "SideBar",
style: {
- width: 218,
- minWidth: 0,
+ width: 240,
+ minWidth: 220,
},
},
@@ -71,7 +71,7 @@ const useCustomSettingStore = create ()(
id: "RightPanel",
style: {
width: 270,
- minWidth: 0,
+ minWidth: 232,
},
},
@@ -113,7 +113,7 @@ const useCustomSettingStore = create()(
id: "SideBar",
style: {
width: 300,
- minWidth: 0,
+ minWidth: 206,
},
},
CollectionPanel: {
@@ -142,7 +142,7 @@ const useCustomSettingStore = create()(
id: "SideBar",
style: {
width: 300,
- minWidth: 0,
+ minWidth: 230,
maxWidth: 800,
},
},
@@ -184,7 +184,7 @@ const useCustomSettingStore = create()(
{
name: "laf_custom_setting",
- version: 2,
+ version: 3,
},
),
),
diff --git a/web/src/pages/globalStore.ts b/web/src/pages/globalStore.ts
index f29c122798..421dca9e6c 100644
--- a/web/src/pages/globalStore.ts
+++ b/web/src/pages/globalStore.ts
@@ -32,7 +32,8 @@ type State = {
visitedViews: string[];
showSuccess: (text: string | React.ReactNode) => void;
- showInfo: (text: string | React.ReactNode) => void;
+ showInfo: (text: string | React.ReactNode, duration?: number, isClosable?: boolean) => void;
+ showWarning: (text: string | React.ReactNode) => void;
showError: (text: string | React.ReactNode) => void;
};
@@ -161,16 +162,35 @@ const useGlobalStore = create()(
});
},
- showInfo: (text: string | React.ReactNode) => {
+ showWarning: (text: string | React.ReactNode) => {
toast({
position: "top",
title: text,
+ status: "warning",
variant: localStorage.getItem(CHAKRA_UI_COLOR_MODE_KEY) ? "subtle" : "solid",
- duration: 1000,
+ duration: 3000,
+ containerStyle: {
+ maxWidth: "100%",
+ minWidth: "100px",
+ },
+ });
+ },
+
+ showInfo: (
+ text: string | React.ReactNode,
+ duration: number = 1000,
+ isClosable: boolean = false,
+ ) => {
+ toast({
+ position: "top",
+ title: text,
+ variant: localStorage.getItem(CHAKRA_UI_COLOR_MODE_KEY) ? "subtle" : "solid",
+ duration: duration,
containerStyle: {
maxWidth: "100%",
minWidth: "100px",
},
+ isClosable: isClosable,
});
},
})),
diff --git a/web/src/pages/home/mods/List/index.tsx b/web/src/pages/home/mods/List/index.tsx
index d5249661ca..bb0c95c292 100644
--- a/web/src/pages/home/mods/List/index.tsx
+++ b/web/src/pages/home/mods/List/index.tsx
@@ -111,13 +111,13 @@ function List(props: { appList: TApplicationItem[] }) {
bg={bg}
className="group mb-3 flex h-[68px] items-center rounded-[10px] px-6"
>
-
-
- {item?.name}
+
+
+ {item?.name}
{item?.createdBy !== userInfo?._id && (
|