import React, { useEffect, useState } from "react"; import { apiFetch } from "../api"; import { useAuth } from "../state"; function formatUptime(seconds) { const total = Math.max(0, Number(seconds || 0)); const d = Math.floor(total / 86400); const h = Math.floor((total % 86400) / 3600); const m = Math.floor((total % 3600) / 60); const s = total % 60; if (d > 0) return `${d}d ${h}h ${m}m`; if (h > 0) return `${h}h ${m}m ${s}s`; return `${m}m ${s}s`; } export function ServiceInfoPage() { const { tokens, refresh, serviceInfo } = useAuth(); const [info, setInfo] = useState(null); const [message, setMessage] = useState(""); const [error, setError] = useState(""); const [busy, setBusy] = useState(false); const load = async () => { setError(""); const data = await apiFetch("/service/info", {}, tokens, refresh); setInfo(data); }; useEffect(() => { load().catch((e) => setError(String(e.message || e))); }, []); useEffect(() => { if (serviceInfo) setInfo(serviceInfo); }, [serviceInfo]); const checkNow = async () => { try { setBusy(true); setError(""); setMessage(""); const result = await apiFetch("/service/info/check", { method: "POST" }, tokens, refresh); await load(); if (result.last_check_error) { setMessage(`Version check finished with warning: ${result.last_check_error}`); } else if (result.update_available) { setMessage(`Update available: ${result.latest_version}`); } else { setMessage("Version check completed. No update detected."); } } catch (e) { setError(String(e.message || e)); } finally { setBusy(false); } }; if (!info) { return
Runtime details, installed version, and update check status for this NexaPG instance.
{error &&Automatic release checks run every 30 seconds. Source: official NexaPG upstream releases.
Update checks run against the official NexaPG repository. This source is fixed in code and cannot be changed via UI.
Version and update-source settings are not editable in the app. Only code maintainers of the official NexaPG repository can change that behavior.