Show a hint when Proxmox storage list comes back empty, not silently
Confirmed via the user's rebuild: my previous fix caught a *thrown*
storage-fetch error, but Proxmox's /nodes/{node}/storage instead
returns 200 with an empty array when the API token has no
Datastore.Audit on any storage — it filters the list per-token rather
than erroring the whole call. That shape has error === null and
storages.length === 0, so it fell through both my error banner and
the "no storages" render guard, showing nothing.
The Storage section now renders a hint (naming the missing
Datastore.Audit privilege) whenever storages is empty and no error
was recorded, instead of just disappearing. CPU/RAM/uptime are
unaffected by this since they come from the separate /status call.
Verified against a mock Proxmox API returning this exact 200-with-
empty-array shape for /storage.
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
@@ -218,7 +218,7 @@ export default function Proxmox({ user }: { user: CurrentUser }) {
|
||||
)}
|
||||
</div>
|
||||
|
||||
{n.storages.length > 0 && (
|
||||
{n.storages.length > 0 ? (
|
||||
<div className="mt-3">
|
||||
<div className="text-secondary small mb-1">Storage</div>
|
||||
<table className="table table-sm table-vcenter mb-0">
|
||||
@@ -239,6 +239,14 @@ export default function Proxmox({ user }: { user: CurrentUser }) {
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
) : (
|
||||
!n.error && (
|
||||
<div className="text-secondary small mt-3">
|
||||
No storage visible to this API token. Proxmox filters the storage list per-token —
|
||||
grant it <code>Datastore.Audit</code> (e.g. on <code>/storage</code>) to see disk
|
||||
usage here.
|
||||
</div>
|
||||
)
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
|
||||
Reference in New Issue
Block a user