mirror of
https://github.com/woodchen-ink/nezha-dash-v1.git
synced 2025-07-18 17:41:56 +08:00
feat: offline badge
This commit is contained in:
parent
17d62ce0b1
commit
3cf4897258
@ -11,6 +11,7 @@ import { useTranslation } from "react-i18next"
|
|||||||
import { useNavigate } from "react-router-dom"
|
import { useNavigate } from "react-router-dom"
|
||||||
|
|
||||||
import { LanguageSwitcher } from "./LanguageSwitcher"
|
import { LanguageSwitcher } from "./LanguageSwitcher"
|
||||||
|
import { Loader } from "./loading/Loader"
|
||||||
import { Button } from "./ui/button"
|
import { Button } from "./ui/button"
|
||||||
|
|
||||||
function Header() {
|
function Header() {
|
||||||
@ -80,9 +81,13 @@ function Header() {
|
|||||||
size="sm"
|
size="sm"
|
||||||
className={cn("hover:bg-white dark:hover:bg-black cursor-default rounded-full flex items-center px-[9px] bg-white dark:bg-black")}
|
className={cn("hover:bg-white dark:hover:bg-black cursor-default rounded-full flex items-center px-[9px] bg-white dark:bg-black")}
|
||||||
>
|
>
|
||||||
{connected ? onlineCount : "..."}
|
{connected ? onlineCount : <Loader visible={true} />}
|
||||||
<p className="text-muted-foreground">{t("online")}</p>
|
<p className="text-muted-foreground">{connected ? t("online") : t("offline")}</p>
|
||||||
<span className="h-2 w-2 rounded-full bg-green-500"></span>
|
<span
|
||||||
|
className={cn("h-2 w-2 rounded-full bg-green-500", {
|
||||||
|
"bg-red-500": !connected,
|
||||||
|
})}
|
||||||
|
></span>
|
||||||
</Button>
|
</Button>
|
||||||
</section>
|
</section>
|
||||||
</section>
|
</section>
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
"dashboard": "Dashboard",
|
"dashboard": "Dashboard",
|
||||||
"login": "Login",
|
"login": "Login",
|
||||||
"online": "Online",
|
"online": "Online",
|
||||||
|
"offline": "Offline",
|
||||||
"whereTheTimeIs": "Where the time is",
|
"whereTheTimeIs": "Where the time is",
|
||||||
"info": {
|
"info": {
|
||||||
"websocketConnecting": "WebSocket connecting",
|
"websocketConnecting": "WebSocket connecting",
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
"dashboard": "管理后台",
|
"dashboard": "管理后台",
|
||||||
"login": "登录",
|
"login": "登录",
|
||||||
"online": "在线",
|
"online": "在线",
|
||||||
|
"offline": "离线",
|
||||||
"whereTheTimeIs": "当前时间",
|
"whereTheTimeIs": "当前时间",
|
||||||
"info": {
|
"info": {
|
||||||
"websocketConnecting": "WebSocket 连接中",
|
"websocketConnecting": "WebSocket 连接中",
|
||||||
|
@ -4,6 +4,7 @@
|
|||||||
"dashboard": "管理後台",
|
"dashboard": "管理後台",
|
||||||
"login": "登錄",
|
"login": "登錄",
|
||||||
"online": "在線",
|
"online": "在線",
|
||||||
|
"offline": "離線",
|
||||||
"whereTheTimeIs": "目前時間",
|
"whereTheTimeIs": "目前時間",
|
||||||
"info": {
|
"info": {
|
||||||
"websocketConnecting": "WebSocket 連接中",
|
"websocketConnecting": "WebSocket 連接中",
|
||||||
|
Loading…
x
Reference in New Issue
Block a user