Skip to content

Commit 7ad26a0

Browse files
authored
fix(web): fix route dashboard link (#1020)
1 parent 4e05678 commit 7ad26a0

File tree

18 files changed

+145
-35
lines changed

18 files changed

+145
-35
lines changed
File renamed without changes.
File renamed without changes.
File renamed without changes.

web/public/locales/en/translation.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"Start": "Start",
336336
"TryLafAI": "Try 🎉 Laf AI !",
337337
"HomePage": {
338-
"LafLink": "https://laf.dev",
338+
"LafLink": "/dashboard",
339339
"DocsLink": "https://doc.laf.run/guide/",
340340
"VideoLink": "https://itceb8-video.oss.laf.run/laf-website-en.mp4",
341341
"WebSite": {

web/public/locales/zh-CN/translation.json

+80-3
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
"WX": "微信小程序/公众号",
129129
"Welcome": "欢迎来到 LAF 云开发平台!",
130130
"DeleteApp": "删除 APP",
131-
"DeleteTip": "当前操作将会永久删除应用, 包括函数、数据、云存储等与应用相关的数据, 删除后<strong>将无法撤消</strong>, 请输入 <strong>{{appId}}</strong> 后确认",
131+
"DeleteTip": "当前操作将会永久删除应用, 包括函数、数据、云存储等与应用相关的数据, 删除后<strong>将无法撤消</strong>, 请输入 <strong>{{appId}}</strong> 后确认",
132132
"Duration": "购买时长"
133133
},
134134
"LogPanel": {
@@ -333,5 +333,82 @@
333333
"Or": "",
334334
"Generating": "正在生成",
335335
"Start": "开始生成",
336-
"TryLafAI": "试试 🎉 Laf AI !"
337-
}
336+
"TryLafAI": "试试 🎉 Laf AI !",
337+
"HomePage": {
338+
"LafLink": "/dashboard",
339+
"DocsLink": "https://doc.laf.run/guide/",
340+
"VideoLink": "https://itceb8-video.oss.laf.run/laf-website.mp4",
341+
"WebSite": {
342+
"title": "Laf 云开发官网",
343+
"description": "Laf 是一个集函数、数据库、存储为一体的云开发平台,随时随地,发布上线"
344+
},
345+
"NavBar": {
346+
"title": "如果你喜欢 Laf 的话,请在 Github 上给我们一个 Star 吧!",
347+
"home": "主页",
348+
"price": "价格",
349+
"case": "案例",
350+
"aboutUs": "关于我们",
351+
"docs": "文档",
352+
"contact": "联系我们",
353+
"forum": "开发者社区",
354+
"faq": "FAQ",
355+
"start": "立即体验",
356+
"stars": "3.9K"
357+
},
358+
"HomePage": {
359+
"slogan": "像写博客一样写代码",
360+
"start": "立即体验",
361+
"content1": "Laf 是一个集函数、数据库、存储为一体的云开发平台",
362+
"content2": "随时随地,发布上线"
363+
},
364+
"Ability": {
365+
"title": "Laf 的能力",
366+
"learn": "了解详情",
367+
"function": "云函数",
368+
"functionSub": ", 5秒发布你的第一个函数。",
369+
"database": "数据库",
370+
"databaseSub": ", 无需创建数据库, 开箱即用.",
371+
"storage": "云储存",
372+
"storageSub": ",创建属于你的云储存,管理文件更简单。"
373+
},
374+
"Choice": {
375+
"title": "为什么选择 Laf",
376+
"open": "更开放",
377+
"openSub": "Laf 遵循 Apache License 2.0 开源协议",
378+
"fast": "请求更快",
379+
"fastSub": "没有冷启时间让你的请求响应更快",
380+
"private": "支持私有化部署",
381+
"privateSub": "担心云服务不稳定?没关系,我们支持私有化部署",
382+
"simple": "开发更简单",
383+
"simpleSub": "无需关心部署、运维,一切都是 Serverless",
384+
"cheap": "高性价比",
385+
"cheapSub": "百万次调用,最低仅需 0.01 元",
386+
"service": "我们致力于为所有开发者提供敏捷高效的服务",
387+
"serviceSub": "了解详情"
388+
},
389+
"Join": {
390+
"title": "加入 Laf 开发者社区",
391+
"subtitle": "和我们一起成长",
392+
"content": "在这里你可以在第一时间体验 Laf 的最新版本,以及在 Discord 或微信群与开发者和用户保持沟通",
393+
"WeChat": "微信",
394+
"forum": "开发者社区"
395+
},
396+
"Footer": {
397+
"laf": "Laf 是一个 Serverless 框架,提供开箱即用的云函数,云数据库,对象存储等能力,是一个干净清爽的开发平台,像写博客一样写代码!三分钟上线 ChatGPT 应用!",
398+
"product": "产品",
399+
"item1_1": "Laf 公有云",
400+
"item1_2": "Sealos",
401+
"item1_3": "更新日志",
402+
"item1_4": "Vscode 插件",
403+
"developer": "开发者",
404+
"item2_1": "私有化部署",
405+
"item2_2": "开放 API",
406+
"item2_3": "贡献者指南",
407+
"item2_4": "源码",
408+
"item2_5": "文档",
409+
"support": "支持",
410+
"item3_1": "问题反馈",
411+
"item3_2": "开发者社区"
412+
}
413+
}
414+
}

web/public/locales/zh/translation.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -335,7 +335,7 @@
335335
"Start": "开始生成",
336336
"TryLafAI": "试试 🎉 Laf AI !",
337337
"HomePage": {
338-
"LafLink": "https://laf.run",
338+
"LafLink": "/dashboard",
339339
"DocsLink": "https://doc.laf.run/guide/",
340340
"VideoLink": "https://itceb8-video.oss.laf.run/laf-website.mp4",
341341
"WebSite": {
@@ -356,7 +356,7 @@
356356
"stars": "3.9K"
357357
},
358358
"HomePage": {
359-
"slogan": "写博客一样,写函数",
359+
"slogan": "像写博客一样写代码",
360360
"start": "立即体验",
361361
"content1": "Laf 是一个集函数、数据库、存储为一体的云开发平台",
362362
"content2": "随时随地,发布上线"

web/src/constants/index.ts

+4
Original file line numberDiff line numberDiff line change
@@ -64,3 +64,7 @@ export enum CURRENCY {
6464
CNY = "CNY",
6565
USD = "USD",
6666
}
67+
68+
export const Routes = {
69+
dashboard: "/dashboard",
70+
};

web/src/pages/403.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { ArrowForwardIcon } from "@chakra-ui/icons";
33
import { Button, Center, HStack } from "@chakra-ui/react";
44
import { t } from "i18next";
55

6+
import { Routes } from "@/constants";
7+
68
export default function Index() {
79
const navigate = useNavigate();
810
return (
@@ -16,7 +18,7 @@ export default function Index() {
1618
<Button
1719
rightIcon={<ArrowForwardIcon />}
1820
size={"lg"}
19-
onClick={() => navigate("/", { replace: true })}
21+
onClick={() => navigate(Routes.dashboard, { replace: true })}
2022
>
2123
{t("Take me home")}
2224
</Button>

web/src/pages/404.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { ArrowForwardIcon } from "@chakra-ui/icons";
33
import { Button, Center, HStack } from "@chakra-ui/react";
44
import { t } from "i18next";
55

6+
import { Routes } from "@/constants";
7+
68
export default function Index() {
79
const navigate = useNavigate();
810
return (
@@ -16,7 +18,7 @@ export default function Index() {
1618
<Button
1719
rightIcon={<ArrowForwardIcon />}
1820
size={"lg"}
19-
onClick={() => navigate("/", { replace: true })}
21+
onClick={() => navigate(Routes.dashboard, { replace: true })}
2022
>
2123
{t("Take me home")}
2224
</Button>

web/src/pages/LoginCallback.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import { useNavigate, useSearchParams } from "react-router-dom";
22
import { Center, Spinner } from "@chakra-ui/react";
33
import { useQuery } from "@tanstack/react-query";
44

5+
import { Routes } from "@/constants";
6+
57
import { AuthControllerCode2token } from "@/apis/v1/code2token";
68

79
export default function LoginCallBack() {
@@ -17,7 +19,7 @@ export default function LoginCallBack() {
1719

1820
if (!tokenRes.isLoading && tokenRes.data?.data) {
1921
localStorage.setItem("token", tokenRes.data?.data);
20-
navigate("/", { replace: true });
22+
navigate(Routes.dashboard, { replace: true });
2123
}
2224

2325
return (

web/src/pages/app/mods/SideBar/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ import { Center } from "@chakra-ui/react";
77
import clsx from "clsx";
88
import { t } from "i18next";
99

10-
import { Pages, SideBarWidth } from "@/constants/index";
10+
import { Pages, Routes, SideBarWidth } from "@/constants/index";
1111

1212
import SysSetting from "../../setting/SysSetting";
1313

@@ -101,7 +101,7 @@ export default function SideBar() {
101101
}}
102102
className="cursor-pointer"
103103
onClick={() => {
104-
navigate("/dashboard");
104+
navigate(Routes.dashboard);
105105
}}
106106
>
107107
{item.component}

web/src/pages/app/setting/AppInfoList/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { useNavigate } from "react-router-dom";
55
import { Box, Button, HStack, useColorMode } from "@chakra-ui/react";
66
import clsx from "clsx";
77

8-
import { APP_PHASE_STATUS } from "@/constants/index";
8+
import { APP_PHASE_STATUS, Routes } from "@/constants/index";
99
import { formatDate } from "@/utils/format";
1010

1111
import InfoDetail from "./InfoDetail";
@@ -21,7 +21,7 @@ const AppEnvList = () => {
2121
const darkMode = useColorMode().colorMode === "dark";
2222

2323
if (currentApp?.state === APP_PHASE_STATUS.Deleted) {
24-
navigate("/");
24+
navigate(Routes.dashboard);
2525
return <></>;
2626
}
2727

@@ -77,7 +77,7 @@ const AppEnvList = () => {
7777
<DeleteAppModal
7878
item={currentApp}
7979
onSuccess={() => {
80-
navigate("/");
80+
navigate(Routes.dashboard);
8181
}}
8282
>
8383
<Button className="mr-2" fontWeight={"semibold"} size={"sm"} variant={"warnText"}>

web/src/pages/auth/signin/mods/LoginByPasswordPanel/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ import {
1212
} from "@chakra-ui/react";
1313
import { t } from "i18next";
1414

15+
import { Routes } from "@/constants";
16+
1517
import { useSigninByPasswordMutation } from "@/pages/auth/service";
1618

1719
type FormData = {
@@ -45,7 +47,7 @@ export default function LoginByPasswordPanel({
4547
});
4648

4749
if (res?.data) {
48-
navigate("/", { replace: true });
50+
navigate(Routes.dashboard, { replace: true });
4951
}
5052
};
5153

web/src/pages/auth/signin/mods/LoginByPhonePanel/index.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,8 @@ import {
1111
} from "@chakra-ui/react";
1212
import { t } from "i18next";
1313

14+
import { Routes } from "@/constants";
15+
1416
import { useSendSmsCodeMutation, useSigninBySmsCodeMutation } from "@/pages/auth/service";
1517
import useGlobalStore from "@/pages/globalStore";
1618

@@ -52,7 +54,7 @@ export default function LoginByPhonePanel({
5254
});
5355

5456
if (res?.data) {
55-
navigate("/", { replace: true });
57+
navigate(Routes.dashboard, { replace: true });
5658
}
5759
};
5860

web/src/pages/homepage/choice.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const Choice = (props: Props) => {
99
<div className="mt-[120px]">
1010
<h2 className="mb-[60px] font-[#152132]"> {t(`HomePage.Choice.title`)}</h2>
1111
<div className="mx-[16px] space-y-4 lg:mx-0 lg:grid lg:grid-cols-3 lg:gap-6 lg:space-y-0">
12-
<div className="flex h-auto justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9] ">
12+
<div className="flex justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9] ">
1313
<div className="w-1/4">
1414
<img src="/homepage/icon_01.svg" alt="logo1" />
1515
</div>
@@ -18,7 +18,7 @@ const Choice = (props: Props) => {
1818
<p className="font-[##3C455D] text-xl font-light"> {t(`HomePage.Choice.openSub`)}</p>
1919
</div>
2020
</div>
21-
<div className="flex h-auto justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
21+
<div className="flex justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
2222
<div className="w-1/4">
2323
<img src="/homepage/icon_02.svg" alt="icon_02" />
2424
</div>
@@ -27,7 +27,7 @@ const Choice = (props: Props) => {
2727
<p className="font-[##3C455D] text-xl font-light">{t(`HomePage.Choice.fastSub`)}</p>
2828
</div>
2929
</div>
30-
<div className="flex h-auto justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
30+
<div className="flex justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
3131
<div className="w-1/4">
3232
<img src="/homepage/icon_03.svg" alt="icon_03" />
3333
</div>
@@ -36,7 +36,7 @@ const Choice = (props: Props) => {
3636
<p className="font-[##3C455D] text-xl font-light">{t(`HomePage.Choice.privateSub`)}</p>
3737
</div>
3838
</div>
39-
<div className="flex h-auto justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
39+
<div className="flex justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
4040
<div className="w-1/4">
4141
<img src="/homepage/icon_04.svg" alt="icon_04" />
4242
</div>
@@ -45,7 +45,7 @@ const Choice = (props: Props) => {
4545
<p className="font-[##3C455D] text-xl font-light">{t(`HomePage.Choice.simpleSub`)}</p>
4646
</div>
4747
</div>
48-
<div className="flex h-[200px] justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
48+
<div className="flex justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
4949
<div className="w-1/4">
5050
<img src="/homepage/icon_05.svg" alt="icon_05" />
5151
</div>
@@ -54,7 +54,7 @@ const Choice = (props: Props) => {
5454
<p className="font-[##3C455D] text-xl font-light">{t(`HomePage.Choice.cheapSub`)}</p>
5555
</div>
5656
</div>
57-
<div className="flex h-[200px] justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
57+
<div className="flex justify-between rounded-md border border-solid p-[40px] hover:bg-[#F9F9F9]">
5858
<div className="w-1/4">
5959
<img src="/homepage/icon_06.png" className="h-12 w-12" alt="icon_06" />
6060
</div>

web/src/pages/homepage/hero.tsx

+3-1
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@ import React, { useState } from "react";
22
import { useTranslation } from "react-i18next";
33
import { Link } from "react-router-dom";
44

5+
import { Routes } from "@/constants";
6+
57
import Video from "./video";
68

79
type Props = {};
@@ -22,7 +24,7 @@ const Hero = (props: Props) => {
2224

2325
<div className="z-10 mt-8 lg:mt-6">
2426
<Link
25-
to={"/dashboard"}
27+
to={Routes.dashboard}
2628
className="bg-primary z-40 flex h-[48px] w-[144px] items-center justify-center rounded-md text-[16px] text-white hover:active:bg-[#00AFA3]"
2729
>
2830
{t(`HomePage.HomePage.start`)}

0 commit comments

Comments
 (0)