mirror of
https://github.com/rcourtman/Pulse.git
synced 2026-12-03 18:43:38 +01:00
Do not turn absent used capacity into an empty pool or invented free space. Preserve independently observed bytes and explicit percentages, with guarded derivation only from known inputs. Cover live drawer transitions and desktop/phone browser states. Contract-Neutral: Correct presentation of existing nullable capacity fields; no shared primitive API, layout, collector schema or recovery authority changes. Change-source: pulse-maintainer
57 lines
2.1 KiB
TypeScript
57 lines
2.1 KiB
TypeScript
// Production pool drawer with synthetic partial collector snapshots; not appliance proof.
|
|
import { createSignal } from 'solid-js';
|
|
import { render } from 'solid-js/web';
|
|
import { StoragePoolDetail } from '../src/components/Storage/StoragePoolDetail';
|
|
import type { CapacitySnapshot, StorageRecord } from '../src/features/storageBackups/models';
|
|
import '../src/index.css';
|
|
|
|
const samples: Record<string, CapacitySnapshot> = {
|
|
missing: { totalBytes: 1024, usedBytes: null, freeBytes: null, usagePercent: null },
|
|
empty: { totalBytes: 1024, usedBytes: 0, freeBytes: null, usagePercent: null },
|
|
full: { totalBytes: 1024, usedBytes: 1024, freeBytes: 0, usagePercent: 100 },
|
|
partial: { totalBytes: null, usedBytes: 512, freeBytes: 0, usagePercent: null },
|
|
absent: { totalBytes: null, usedBytes: null, freeBytes: null, usagePercent: null },
|
|
};
|
|
const Fixture = () => {
|
|
const [phase, setPhase] = createSignal('missing');
|
|
const record = (): StorageRecord => ({
|
|
id: 'synthetic-pbs-pool',
|
|
name: 'Archive',
|
|
category: 'datastore',
|
|
health: 'unknown',
|
|
location: { label: 'archive-host', scope: 'host' },
|
|
source: {
|
|
platform: 'proxmox-pbs',
|
|
family: 'onprem',
|
|
origin: 'resource',
|
|
adapterId: 'resource-storage',
|
|
},
|
|
capacity: samples[phase()],
|
|
capabilities: ['capacity'],
|
|
observedAt: Date.now(),
|
|
});
|
|
return (
|
|
<main class="min-h-screen space-y-4 bg-surface p-4 text-base-content">
|
|
<h1 class="text-lg font-semibold">Storage capacity absence verification</h1>
|
|
<p>Synthetic partial PBS snapshots in the production pool drawer.</p>
|
|
<div class="flex flex-wrap gap-2">
|
|
{Object.keys(samples).map((name) => (
|
|
<button class="min-h-11 rounded border border-border px-3" onClick={() => setPhase(name)}>
|
|
{name}
|
|
</button>
|
|
))}
|
|
</div>
|
|
<table class="w-full table-fixed">
|
|
<tbody>
|
|
<StoragePoolDetail
|
|
record={record()}
|
|
physicalDisks={[]}
|
|
summarySeriesId="synthetic-pbs-pool"
|
|
/>
|
|
</tbody>
|
|
</table>
|
|
</main>
|
|
);
|
|
};
|
|
render(() => <Fixture />, document.getElementById('root')!);
|