From 627f67336f11930c37a908d582df1055549767c0 Mon Sep 17 00:00:00 2001 From: Pouzor Date: Sun, 8 Mar 2026 00:41:17 +0100 Subject: [PATCH] =?UTF-8?q?feat:=20add=20'none'=20check=20method=20?= =?UTF-8?q?=E2=80=94=20node=20always=20appears=20online?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- backend/app/services/status_checker.py | 5 ++++- frontend/src/components/modals/NodeModal.tsx | 2 +- frontend/src/types/index.ts | 2 +- 3 files changed, 6 insertions(+), 3 deletions(-) diff --git a/backend/app/services/status_checker.py b/backend/app/services/status_checker.py index 90ff6c0..ef9b273 100644 --- a/backend/app/services/status_checker.py +++ b/backend/app/services/status_checker.py @@ -1,4 +1,4 @@ -"""Per-node status checks: ping, http, https, tcp, ssh, prometheus, health.""" +"""Per-node status checks: ping, http, https, tcp, ssh, prometheus, health, none.""" import asyncio import logging import socket @@ -15,6 +15,9 @@ async def check_node(check_method: str, target: str | None, ip: str | None) -> d Run the appropriate check and return {status, response_time_ms}. status is one of: online, offline, unknown. """ + if check_method == "none": + return {"status": "online", "response_time_ms": None} + host = target or ip if not host: return {"status": "unknown", "response_time_ms": None} diff --git a/frontend/src/components/modals/NodeModal.tsx b/frontend/src/components/modals/NodeModal.tsx index 5c0ff40..4e5e776 100644 --- a/frontend/src/components/modals/NodeModal.tsx +++ b/frontend/src/components/modals/NodeModal.tsx @@ -11,7 +11,7 @@ import { ICON_REGISTRY, ICON_CATEGORIES } from '@/utils/nodeIcons' const NODE_TYPES = Object.entries(NODE_TYPE_LABELS) as [NodeType, string][] -const CHECK_METHODS: CheckMethod[] = ['ping', 'http', 'https', 'tcp', 'ssh', 'prometheus', 'health'] +const CHECK_METHODS: CheckMethod[] = ['none', 'ping', 'http', 'https', 'tcp', 'ssh', 'prometheus', 'health'] const DEFAULT_DATA: Partial = { type: 'server', diff --git a/frontend/src/types/index.ts b/frontend/src/types/index.ts index 334db4b..43d7003 100644 --- a/frontend/src/types/index.ts +++ b/frontend/src/types/index.ts @@ -15,7 +15,7 @@ export type EdgeType = 'ethernet' | 'wifi' | 'iot' | 'vlan' | 'virtual' export type NodeStatus = 'online' | 'offline' | 'pending' | 'unknown' -export type CheckMethod = 'ping' | 'http' | 'https' | 'tcp' | 'ssh' | 'prometheus' | 'health' +export type CheckMethod = 'ping' | 'http' | 'https' | 'tcp' | 'ssh' | 'prometheus' | 'health' | 'none' export interface ServiceInfo { port: number