feat: add 'none' check method — node always appears online
This commit is contained in:
@@ -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}
|
||||
|
||||
@@ -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<NodeData> = {
|
||||
type: 'server',
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user