From a5476b26fe78e24b8de0e237a2817e12637cc19b Mon Sep 17 00:00:00 2001 From: thedrewen Date: Fri, 7 Nov 2025 10:49:56 +0100 Subject: [PATCH] feat(status): add router configurations and update InfraType to include routers --- .env.example | 8 ++++++- src/services/status.service.ts | 40 +++++++++++++++++++++++++++++++++- src/type.d.ts | 2 +- 3 files changed, 47 insertions(+), 3 deletions(-) diff --git a/.env.example b/.env.example index 58dc932..d95bb8b 100644 --- a/.env.example +++ b/.env.example @@ -18,4 +18,10 @@ DB_DATABASE=protojx_manager DB_LOGGING=false # Environment -NODE_ENV=development \ No newline at end of file +NODE_ENV=development + +# Protected IPS +PROTOJX_ROUTER_1= +PROTOJX_ROUTER_2= +PROTOJX_ROUTER_3= +PROTOJX_ROUTER_4= \ No newline at end of file diff --git a/src/services/status.service.ts b/src/services/status.service.ts index d5fe6c0..8e6dc5c 100644 --- a/src/services/status.service.ts +++ b/src/services/status.service.ts @@ -109,7 +109,40 @@ export class StatusService { ping_type: 'ping', type: 'games', notify: true - } + }, + // Routers + { + host: process.env.PROTOJX_ROUTER_1 as string, + name: 'ROUTER-FR 01', + alive: false, + ping_type: 'ping', + type: 'router', + notify: false + }, + { + host: process.env.PROTOJX_ROUTER_2 as string, + name: 'ROUTER-FR 02', + alive: false, + ping_type: 'ping', + type: 'router', + notify: false + }, + { + host: process.env.PROTOJX_ROUTER_3 as string, + name: 'ROUTER-DE 03', + alive: false, + ping_type: 'ping', + type: 'router', + notify: false + }, + { + host: process.env.PROTOJX_ROUTER_1 as string, + name: 'ROUTER-DE 04', + alive: false, + ping_type: 'ping', + type: 'router', + notify: false + }, ]; private client: Client | null = null; @@ -294,6 +327,11 @@ export class StatusService { title: 'Games', type: 'games', thumbnail: 'https://protojx.com/assets/img/hero-img.png' + }, + { + title: 'Routers', + type: 'router', + thumbnail: 'https://encrypted-tbn0.gstatic.com/images?q=tbn:ANd9GcRMnCmtQRkLlcD1Cb6vKXz6NOxAu79vzmq2pRqpNYxpTJa5JQEsouhqnVn7cyl6ivYSyzY&usqp=CAU' } ] diff --git a/src/type.d.ts b/src/type.d.ts index 647af85..6c08543 100644 --- a/src/type.d.ts +++ b/src/type.d.ts @@ -1,6 +1,6 @@ import { ButtonInteraction, ChatInputCommandInteraction, SlashCommandBuilder } from "discord.js"; -export type InfraType = 'website' | 'ryzen' | 'xeon' | 'games'; +export type InfraType = 'website' | 'ryzen' | 'xeon' | 'games' | 'router'; export type Host = { host: string, name: string,