feat(daemon): Add UPSD (NUT) protocol support, Proxmox VM shutdown action, pause/resume monitoring, and network-loss/unreachable handling; bump config version to 4.2

This commit is contained in:
2026-02-20 11:51:59 +00:00
parent 782c8c9555
commit 42b8eaf6d2
30 changed files with 2183 additions and 697 deletions

View File

@@ -6,7 +6,7 @@
* 2. Threshold violations (battery/runtime cross below configured thresholds)
*/
export type TPowerStatus = 'online' | 'onBattery' | 'unknown';
export type TPowerStatus = 'online' | 'onBattery' | 'unknown' | 'unreachable';
/**
* Context provided to actions when they execute
@@ -52,7 +52,7 @@ export type TActionTriggerMode =
*/
export interface IActionConfig {
/** Type of action to execute */
type: 'shutdown' | 'webhook' | 'script';
type: 'shutdown' | 'webhook' | 'script' | 'proxmox';
// Trigger configuration
/**
@@ -96,6 +96,26 @@ export interface IActionConfig {
scriptTimeout?: number;
/** Only execute script on threshold violation */
scriptOnlyOnThresholdViolation?: boolean;
// Proxmox action configuration
/** Proxmox API host (default: localhost) */
proxmoxHost?: string;
/** Proxmox API port (default: 8006) */
proxmoxPort?: number;
/** Proxmox node name (default: auto-detect via hostname) */
proxmoxNode?: string;
/** Proxmox API token ID (e.g., 'root@pam!nupst') */
proxmoxTokenId?: string;
/** Proxmox API token secret */
proxmoxTokenSecret?: string;
/** VM/CT IDs to exclude from shutdown */
proxmoxExcludeIds?: number[];
/** Timeout for VM/CT shutdown in seconds (default: 120) */
proxmoxStopTimeout?: number;
/** Force-stop VMs that don't shut down gracefully (default: true) */
proxmoxForceStop?: boolean;
/** Skip TLS verification for self-signed certificates (default: true) */
proxmoxInsecure?: boolean;
}
/**