Merge Fixes and Technical changes from development into main branch #1
@@ -17,10 +17,10 @@ class DiskSpaceProvider:
|
||||
class NullDiskSpaceProvider(DiskSpaceProvider):
|
||||
async def get_free_bytes(self, target_host: str) -> DiskSpaceProbeResult:
|
||||
return DiskSpaceProbeResult(
|
||||
source="none",
|
||||
source="agentless",
|
||||
status="unavailable",
|
||||
free_bytes=None,
|
||||
message=f"No infra probe configured for host {target_host}. Add SSH/Agent provider later.",
|
||||
message=f"Agentless mode: host-level free disk is not available for {target_host}.",
|
||||
)
|
||||
|
||||
|
||||
|
||||
@@ -41,6 +41,19 @@ function formatNumber(value, digits = 2) {
|
||||
return Number(value).toFixed(digits);
|
||||
}
|
||||
|
||||
function formatHostMetricUnavailable() {
|
||||
return "N/A (agentless)";
|
||||
}
|
||||
|
||||
function formatDiskSpaceAgentless(diskSpace) {
|
||||
if (!diskSpace) return formatHostMetricUnavailable();
|
||||
if (diskSpace.free_bytes !== null && diskSpace.free_bytes !== undefined) {
|
||||
return formatBytes(diskSpace.free_bytes);
|
||||
}
|
||||
if (diskSpace.status === "unavailable") return formatHostMetricUnavailable();
|
||||
return "-";
|
||||
}
|
||||
|
||||
function MetricsTooltip({ active, payload, label }) {
|
||||
if (!active || !payload || payload.length === 0) return null;
|
||||
const row = payload[0]?.payload || {};
|
||||
@@ -346,6 +359,9 @@ export function TargetDetailPage() {
|
||||
{uiMode === "dba" && overview && (
|
||||
<div className="card">
|
||||
<h3>Database Overview</h3>
|
||||
<p className="muted" style={{ marginTop: 2 }}>
|
||||
Agentless mode: host-level CPU, RAM, and free-disk metrics are not available.
|
||||
</p>
|
||||
<div className="grid three overview-kv">
|
||||
<div><span>PostgreSQL Version</span><strong>{overview.instance.server_version || "-"}</strong></div>
|
||||
<div>
|
||||
@@ -366,8 +382,8 @@ export function TargetDetailPage() {
|
||||
<div title="Total WAL directory size (when available)">
|
||||
<span>WAL Size</span><strong>{formatBytes(overview.storage.wal_directory_size_bytes)}</strong>
|
||||
</div>
|
||||
<div title="Optional metric via future Agent/SSH provider">
|
||||
<span>Free Disk</span><strong>{formatBytes(overview.storage.disk_space.free_bytes)}</strong>
|
||||
<div title={overview.storage.disk_space?.message || "Agentless mode: host-level free disk is unavailable."}>
|
||||
<span>Free Disk</span><strong>{formatDiskSpaceAgentless(overview.storage.disk_space)}</strong>
|
||||
</div>
|
||||
<div title="Replication replay delay on standby">
|
||||
<span>Replay Lag</span>
|
||||
@@ -378,6 +394,12 @@ export function TargetDetailPage() {
|
||||
<div><span>Replication Slots</span><strong>{overview.replication.replication_slots_count ?? "-"}</strong></div>
|
||||
<div><span>Repl Clients</span><strong>{overview.replication.active_replication_clients ?? "-"}</strong></div>
|
||||
<div><span>Autovacuum Workers</span><strong>{overview.performance.autovacuum_workers ?? "-"}</strong></div>
|
||||
<div title="Host CPU requires OS-level telemetry">
|
||||
<span>Host CPU</span><strong>{formatHostMetricUnavailable()}</strong>
|
||||
</div>
|
||||
<div title="Host RAM requires OS-level telemetry">
|
||||
<span>Host RAM</span><strong>{formatHostMetricUnavailable()}</strong>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div className="grid two">
|
||||
|
||||
Reference in New Issue
Block a user