mirror of
https://github.com/certimate-go/certimate.git
synced 2026-06-30 21:05:12 +08:00
feat(ui): show upgrade button in Dashboard
This commit is contained in:
parent
73bd57c612
commit
03e165e1de
@ -11,6 +11,7 @@
|
||||
"dashboard.shortcut.create_workflow": "Create new workflow",
|
||||
"dashboard.shortcut.change_account": "Change username or password",
|
||||
"dashboard.shortcut.configure_ca": "Configure certificate authorities",
|
||||
"dashboard.shortcut.upgrade": "New version available!",
|
||||
|
||||
"dashboard.latest_workflow_runs": "Latest workflow runs",
|
||||
"dashboard.latest_workflow_runs.nodata.description": "It looks like you don't have any runs. Get started by running a workflow.",
|
||||
|
||||
@ -11,6 +11,7 @@
|
||||
"dashboard.shortcut.create_workflow": "创建新的工作流",
|
||||
"dashboard.shortcut.change_account": "修改登录账号密码",
|
||||
"dashboard.shortcut.configure_ca": "配置证书颁发机构",
|
||||
"dashboard.shortcut.upgrade": "新版本可升级!",
|
||||
|
||||
"dashboard.latest_workflow_runs": "最近的工作流运行",
|
||||
"dashboard.latest_workflow_runs.nodata.description": "当前未找到任何工作流运行历史。请先运行一个工作流。",
|
||||
|
||||
@ -5,6 +5,7 @@ import {
|
||||
IconActivity,
|
||||
IconAlertHexagon,
|
||||
IconCirclePlus,
|
||||
IconConfetti,
|
||||
IconExternalLink,
|
||||
IconHexagonLetterX,
|
||||
IconHistory,
|
||||
@ -23,9 +24,10 @@ import { get as getStatistics } from "@/api/statistics";
|
||||
import Empty from "@/components/Empty";
|
||||
import WorkflowRunDetailDrawer from "@/components/workflow/WorkflowRunDetailDrawer";
|
||||
import WorkflowStatus from "@/components/workflow/WorkflowStatus";
|
||||
import { APP_DOWNLOAD_URL } from "@/domain/app";
|
||||
import { type Statistics } from "@/domain/statistics";
|
||||
import { type WorkflowRunModel } from "@/domain/workflowRun";
|
||||
import { useBrowserTheme } from "@/hooks";
|
||||
import { useBrowserTheme, useVersionChecker } from "@/hooks";
|
||||
import { get as getWorkflowRun, list as listWorkflowRuns } from "@/repository/workflowRun";
|
||||
import { mergeCls } from "@/utils/css";
|
||||
import { getErrMsg } from "@/utils/error";
|
||||
@ -217,6 +219,8 @@ const Shortcuts = ({ className, style }: { className?: string; style?: React.CSS
|
||||
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { hasUpdate } = useVersionChecker();
|
||||
|
||||
return (
|
||||
<div className={className} style={style}>
|
||||
<div className="flex items-center gap-4 not-md:flex-wrap">
|
||||
@ -247,6 +251,17 @@ const Shortcuts = ({ className, style }: { className?: string; style?: React.CSS
|
||||
>
|
||||
<span className="text-sm">{t("dashboard.shortcut.configure_ca")}</span>
|
||||
</Button>
|
||||
{hasUpdate && (
|
||||
<Button
|
||||
className="shadow"
|
||||
icon={<IconConfetti className="animate-bounce" color="var(--color-error)" size="1.25em" />}
|
||||
shape="round"
|
||||
size="large"
|
||||
onClick={() => window.open(APP_DOWNLOAD_URL, "_blank")}
|
||||
>
|
||||
<span className="text-sm">{t("dashboard.shortcut.upgrade")}</span>
|
||||
</Button>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user