"use client"; import type { Dispatch, SetStateAction } from "react"; import { Loader2, Power, RefreshCw } from "lucide-react"; import type { Server as ServerType, ServerConfigSnapshot } from "@/lib/api"; import { ConfigInfoRow } from "@/app/servers/components/server-config/ServerConfigPrimitives"; interface ServerConfigActionsPanelProps { server: ServerType; snapshot: ServerConfigSnapshot; snapshotLoadError?: string | null; resetConfirmation: string; setResetConfirmation: Dispatch>; confirmResetStep: boolean; setConfirmResetStep: Dispatch>; deleteConfirmed: boolean; isActionRunning: (actionKey: string) => boolean; getServerActionKey: (action: "reboot" | "restart-nginx") => string; onRequestServerActionConfirm: (action: "reboot" | "restart-nginx") => void; onReset: () => Promise; setError: Dispatch>; } export default function ServerConfigActionsPanel({ server, snapshot, snapshotLoadError, resetConfirmation, setResetConfirmation, confirmResetStep, setConfirmResetStep, deleteConfirmed, isActionRunning, getServerActionKey, onRequestServerActionConfirm, onReset, setError, }: ServerConfigActionsPanelProps) { const dockerStatusUnavailable = Boolean( snapshotLoadError || snapshot.docker.probeFailed, ); return (
{snapshotLoadError ? ( ) : null}
Server Controls

Trigger common maintenance actions for the host and web stack.

Reset Server

Type DELETE to unlock the final reset confirmation. This action interrupts SSH access and monitoring until the machine is back online.

{ const nextValue = event.target.value; setResetConfirmation(nextValue); if (nextValue.trim() !== "DELETE") { setConfirmResetStep(false); } }} style={{ width: "100%" }} /> {!confirmResetStep ? (
) : (
Final confirmation
Resetting {server.name} will interrupt SSH access and monitoring until the machine boots again.
)}
); }