diff --git a/web/public/locales/en/translation.json b/web/public/locales/en/translation.json index 0bacbdec683..cc7ace052d3 100644 --- a/web/public/locales/en/translation.json +++ b/web/public/locales/en/translation.json @@ -204,5 +204,6 @@ "EditTip": "modified, unpublished", "NoInfo": "No information", "RefreshDataSuccess": "data refreshed", - "Language": "Language" + "Language": "Language", + "update success": "update completed" } \ No newline at end of file diff --git a/web/public/locales/zh-CN/translation.json b/web/public/locales/zh-CN/translation.json index ba8fb9a70ba..d5c8d3133a9 100644 --- a/web/public/locales/zh-CN/translation.json +++ b/web/public/locales/zh-CN/translation.json @@ -204,5 +204,6 @@ "RefreshData": "刷新数据", "NoInfo": "暂无信息", "RefreshDataSuccess": "数据刷新成功", - "Language": "语言" -} + "Language": "语言", + "update success": "更新成功" +} \ No newline at end of file diff --git a/web/public/locales/zh/translation.json b/web/public/locales/zh/translation.json index 5e81aa66620..ba896250a5c 100644 --- a/web/public/locales/zh/translation.json +++ b/web/public/locales/zh/translation.json @@ -204,5 +204,6 @@ "EditTip": "已修改,未发布", "NoInfo": "暂无信息", "RefreshDataSuccess": "数据刷新成功", - "Language": "语言" -} + "Language": "语言", + "update success": "更新成功" +} \ No newline at end of file diff --git a/web/src/pages/403.tsx b/web/src/pages/403.tsx new file mode 100644 index 00000000000..d354eece5f5 --- /dev/null +++ b/web/src/pages/403.tsx @@ -0,0 +1,25 @@ +import React from "react"; +import { useNavigate } from "react-router-dom"; +import { Button, Center, HStack } from "@chakra-ui/react"; + +export default function Index() { + const navigate = useNavigate(); + return ( +
+
+

403

+

+ You don't have permission to access this page +

+ + + + +
+
+ ); +} diff --git a/web/src/pages/404.tsx b/web/src/pages/404.tsx index 60b3ef2322f..51578013aef 100644 --- a/web/src/pages/404.tsx +++ b/web/src/pages/404.tsx @@ -1,5 +1,25 @@ import React from "react"; +import { useNavigate } from "react-router-dom"; +import { Button, Center, HStack } from "@chakra-ui/react"; export default function Index() { - return
404
; + const navigate = useNavigate(); + return ( +
+
+

404

+

+ We can't find that page +

+ + + + +
+
+ ); } diff --git a/web/src/pages/app/functions/mods/DebugPanel/index.tsx b/web/src/pages/app/functions/mods/DebugPanel/index.tsx index 61ba593e314..7d09b693a32 100644 --- a/web/src/pages/app/functions/mods/DebugPanel/index.tsx +++ b/web/src/pages/app/functions/mods/DebugPanel/index.tsx @@ -158,7 +158,7 @@ export default function DebugPanel() { > - Parameters + Params {queryParams.length > 0 && ( ({queryParams.length}) )} diff --git a/web/src/pages/home/mods/CreateAppModal/index.tsx b/web/src/pages/home/mods/CreateAppModal/index.tsx index 10ccbcf6481..983271d9cd2 100644 --- a/web/src/pages/home/mods/CreateAppModal/index.tsx +++ b/web/src/pages/home/mods/CreateAppModal/index.tsx @@ -81,7 +81,9 @@ const CreateAppModal = (props: { application?: any; children: React.ReactElement if (!res.error) { onClose(); - showSuccess(isEdit ? "update success." : "create success."); + if (isEdit) { + showSuccess(t("update success")); + } queryClient.invalidateQueries(["appListQuery"]); } else { showError(res.error); diff --git a/web/src/pages/home/mods/List/index.tsx b/web/src/pages/home/mods/List/index.tsx index bf088ee88a6..9d9587bea61 100644 --- a/web/src/pages/home/mods/List/index.tsx +++ b/web/src/pages/home/mods/List/index.tsx @@ -33,7 +33,7 @@ import useGlobalStore from "@/pages/globalStore"; function List(props: { appListQuery: any }) { const navigate = useNavigate(); - const { showSuccess, setCurrentApp } = useGlobalStore(); + const { setCurrentApp } = useGlobalStore(); const [searchKey, setSearchKey] = useState(""); @@ -42,7 +42,6 @@ function List(props: { appListQuery: any }) { const deleteAppMutation = useMutation((params: any) => ApplicationControllerRemove(params), { onSuccess: () => { appListQuery.refetch(); - showSuccess("delete success."); }, onError: () => {}, }); @@ -123,7 +122,7 @@ function List(props: { appListQuery: any }) { {t("HomePanel.Develop")} - + diff --git a/web/src/routes/index.tsx b/web/src/routes/index.tsx index 1c912596da4..b69cc54f766 100644 --- a/web/src/routes/index.tsx +++ b/web/src/routes/index.tsx @@ -44,6 +44,10 @@ const routes = [ }, ], }, + { + path: "/403", + element: () => import("@/pages/403"), + }, route404, ], }, diff --git a/web/src/utils/request.ts b/web/src/utils/request.ts index 453e7344e3d..521b6aae784 100644 --- a/web/src/utils/request.ts +++ b/web/src/utils/request.ts @@ -52,6 +52,8 @@ request.interceptors.response.use( // eslint-disable-next-line no-restricted-globals (window as any).location.href = (import.meta.env.VITE_SERVER_URL + "/v1/login") as string; return; + } else if (data.statusCode === 403) { + (window as any).location.href = "/403"; } toast({ title: data.message,