mirror of
https://github.com/Buriburizaem0n/nezha-dash-v1.git
synced 2026-02-04 12:40:10 +00:00
fix: inline card server name overflow
This commit is contained in:
@@ -1,22 +1,24 @@
|
||||
import { useRegisterSW } from 'virtual:pwa-register/react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { toast } from 'sonner';
|
||||
import { useRegisterSW } from "virtual:pwa-register/react";
|
||||
import { useTranslation } from "react-i18next";
|
||||
import { toast } from "sonner";
|
||||
|
||||
function ReloadPrompt() {
|
||||
const { t } = useTranslation();
|
||||
|
||||
|
||||
const {
|
||||
needRefresh: [needRefresh, setNeedRefresh],
|
||||
updateServiceWorker,
|
||||
} = useRegisterSW({
|
||||
onRegisteredSW(swUrl) {
|
||||
console.log(`SW Registered: ${swUrl} (Version: ${import.meta.env.VITE_GIT_HASH})`);
|
||||
console.log(
|
||||
`SW Registered: ${swUrl} (Version: ${import.meta.env.VITE_GIT_HASH})`,
|
||||
);
|
||||
},
|
||||
onRegisterError(error) {
|
||||
console.log('SW registration error', error);
|
||||
console.log("SW registration error", error);
|
||||
},
|
||||
onOfflineReady() {
|
||||
toast.success(t('pwa.offlineReady'));
|
||||
toast.success(t("pwa.offlineReady"));
|
||||
},
|
||||
});
|
||||
|
||||
@@ -32,19 +34,14 @@ function ReloadPrompt() {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
toast.message(
|
||||
`${t('pwa.newContent')} (${import.meta.env.VITE_GIT_HASH})`,
|
||||
{
|
||||
action: {
|
||||
label: t('pwa.reload'),
|
||||
onClick: () => update(),
|
||||
},
|
||||
onDismiss: close,
|
||||
duration: Infinity,
|
||||
}
|
||||
);
|
||||
toast.message(`${t("pwa.newContent")} (${import.meta.env.VITE_GIT_HASH})`, {
|
||||
action: {
|
||||
label: t("pwa.reload"),
|
||||
onClick: () => update(),
|
||||
},
|
||||
onDismiss: close,
|
||||
duration: Infinity,
|
||||
});
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
@@ -82,7 +82,7 @@ export default function ServerCardInline({
|
||||
>
|
||||
{showFlag ? <ServerFlag country_code={country_code} /> : null}
|
||||
</div>
|
||||
<div className="relative flex flex-col">
|
||||
<div className="relative w-24 flex flex-col">
|
||||
<p
|
||||
className={cn(
|
||||
"break-all font-bold tracking-tight",
|
||||
@@ -226,7 +226,7 @@ export default function ServerCardInline({
|
||||
<div className="relative">
|
||||
<p
|
||||
className={cn(
|
||||
"break-all font-bold tracking-tight",
|
||||
"break-all font-bold w-24 tracking-tight",
|
||||
showFlag ? "text-xs" : "text-sm",
|
||||
)}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user