diff --git a/app/[locale]/types/nezha-api.ts b/app/[locale]/types/nezha-api.ts index eaca99a..ecfb986 100644 --- a/app/[locale]/types/nezha-api.ts +++ b/app/[locale]/types/nezha-api.ts @@ -17,6 +17,7 @@ export interface NezhaAPI { ipv6: string; valid_ip: string; display_index: number; + hide_for_guest: boolean; host: NezhaAPIHost; status: NezhaAPIStatus; } diff --git a/lib/serverFetch.tsx b/lib/serverFetch.tsx index 22d2451..a3c40f2 100644 --- a/lib/serverFetch.tsx +++ b/lib/serverFetch.tsx @@ -39,8 +39,14 @@ export async function GetNezhaData() { total_bandwidth: 0, result: [], }; + + // remove hidden servers + const nezhaDataFiltered = nezhaData.filter( + (element) => !element.hide_for_guest, + ); + const timestamp = Date.now() / 1000; - data.result = nezhaData.map( + data.result = nezhaDataFiltered.map( (element: MakeOptional) => { if (timestamp - element.last_active > 300) { data.offline_servers += 1;