mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 09:31:55 +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 { useTranslation } from "react-i18next";
|
||||
|
||||
const Footer: React.FC = () => {
|
||||
const { t } = useTranslation();
|
||||
|
||||
const { data: settingData } = useQuery({
|
||||
queryKey: ["setting"],
|
||||
queryFn: () => fetchSetting(),
|
||||
refetchOnMount: true,
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
|
||||
return (
|
||||
<footer className="mx-auto w-full max-w-5xl px-4 lg:px-0 pb-4">
|
||||
<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">
|
||||
<p>
|
||||
<div className="flex items-center gap-1">
|
||||
©2020-{new Date().getFullYear()}{" "}
|
||||
<a href={"https://github.com/naiba/nezha"} target="_blank">
|
||||
Nezha
|
||||
</a>
|
||||
</p>
|
||||
<p>{settingData?.data?.version || ""}</p>
|
||||
</div>
|
||||
<p>
|
||||
{t("footer.themeBy")}
|
||||
<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">
|
||||
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
|
||||
<ArrowUpCircleIcon className="size-3 mr-0.5 sm:mb-[1px]" />
|
||||
{formatBytes(
|
||||
upSpeed,
|
||||
)}/s
|
||||
{formatBytes(upSpeed)}/s
|
||||
</p>
|
||||
<p className="sm:text-[12px] flex items-center text-[10px] text-nowrap font-semibold">
|
||||
<ArrowDownCircleIcon className="size-3 mr-0.5" />
|
||||
{formatBytes(
|
||||
downSpeed,
|
||||
)}/s
|
||||
{formatBytes(downSpeed)}/s
|
||||
</p>
|
||||
</section>
|
||||
</section>
|
||||
|
@ -163,5 +163,6 @@ export interface SettingResponse {
|
||||
language: string;
|
||||
site_name: string;
|
||||
custom_code: string;
|
||||
version: string;
|
||||
};
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user