mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 17:41:56 +08:00
feat: add version display
This commit is contained in:
parent
1f9b667f0a
commit
97b5ff3a63
@ -1,19 +1,29 @@
|
|||||||
// src/components/Footer.tsx
|
import { fetchSetting } from "@/lib/nezha-api";
|
||||||
|
import { useQuery } from "@tanstack/react-query";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
import { useTranslation } from "react-i18next";
|
import { useTranslation } from "react-i18next";
|
||||||
|
|
||||||
const Footer: React.FC = () => {
|
const Footer: React.FC = () => {
|
||||||
const { t } = useTranslation();
|
const { t } = useTranslation();
|
||||||
|
|
||||||
|
const { data: settingData } = useQuery({
|
||||||
|
queryKey: ["setting"],
|
||||||
|
queryFn: () => fetchSetting(),
|
||||||
|
refetchOnMount: true,
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
|
});
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<footer className="mx-auto w-full max-w-5xl px-4 lg:px-0 pb-4">
|
<footer className="mx-auto w-full max-w-5xl px-4 lg:px-0 pb-4">
|
||||||
<section className="flex flex-col">
|
<section className="flex flex-col">
|
||||||
<section className="mt-1 flex items-center justify-between gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50">
|
<section className="mt-1 flex items-center justify-between gap-2 text-[13px] font-light tracking-tight text-neutral-600/50 dark:text-neutral-300/50">
|
||||||
<p>
|
<div className="flex items-center gap-1">
|
||||||
©2020-{new Date().getFullYear()}{" "}
|
©2020-{new Date().getFullYear()}{" "}
|
||||||
<a href={"https://github.com/naiba/nezha"} target="_blank">
|
<a href={"https://github.com/naiba/nezha"} target="_blank">
|
||||||
Nezha
|
Nezha
|
||||||
</a>
|
</a>
|
||||||
</p>
|
<p>{settingData?.data?.version || ""}</p>
|
||||||
|
</div>
|
||||||
<p>
|
<p>
|
||||||
{t("footer.themeBy")}
|
{t("footer.themeBy")}
|
||||||
<a
|
<a
|
||||||
|
@ -110,15 +110,11 @@ export default function ServerOverview({
|
|||||||
<section className="flex flex-row mt-1.5 -mr-1 sm:items-center items-start gap-1">
|
<section className="flex flex-row mt-1.5 -mr-1 sm:items-center items-start gap-1">
|
||||||
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
|
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
|
||||||
<ArrowUpCircleIcon className="size-3 mr-0.5 sm:mb-[1px]" />
|
<ArrowUpCircleIcon className="size-3 mr-0.5 sm:mb-[1px]" />
|
||||||
{formatBytes(
|
{formatBytes(upSpeed)}/s
|
||||||
upSpeed,
|
|
||||||
)}/s
|
|
||||||
</p>
|
</p>
|
||||||
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
|
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
|
||||||
<ArrowDownCircleIcon className="size-3 mr-0.5" />
|
<ArrowDownCircleIcon className="size-3 mr-0.5" />
|
||||||
{formatBytes(
|
{formatBytes(downSpeed)}/s
|
||||||
downSpeed,
|
|
||||||
)}/s
|
|
||||||
</p>
|
</p>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
@ -163,5 +163,6 @@ export interface SettingResponse {
|
|||||||
language: string;
|
language: string;
|
||||||
site_name: string;
|
site_name: string;
|
||||||
custom_code: string;
|
custom_code: string;
|
||||||
|
version: string;
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user