swarm-ui: let a closed stream reconnect and a failed caps read retry
When the server answers an event stream with an error status the browser gives up and the badge stayed on disconnected with nothing to press. The terminal, its state header and the messages page now offer a reconnect, and the one rule for the state after an error moved into a tested helper. The resource caps panel gets a retry beside its error, and its loading state announces itself.
This commit is contained in:
parent
9b1fe85706
commit
31b7452e56
1 changed files with 118 additions and 34 deletions
|
|
@ -117,10 +117,22 @@ export function AgentLimits({ agent }: { agent: string }) {
|
|||
// Shown as text, not a hover title. Caps already loaded stay under a
|
||||
// failed refetch, so a save that worked is not hidden by a read that did not.
|
||||
const errorPanel = error ? (
|
||||
<ApiErrorPanel context="reading the resource caps failed" problem={error} />
|
||||
<>
|
||||
<ApiErrorPanel
|
||||
context="reading the resource caps failed"
|
||||
problem={error}
|
||||
/>
|
||||
<Button onClick={() => setReload((n) => n + 1)}>retry</Button>
|
||||
</>
|
||||
) : null;
|
||||
if (caps === null) {
|
||||
return errorPanel ?? <span class="ui-agent-limits-muted">…</span>;
|
||||
return (
|
||||
errorPanel ?? (
|
||||
<span class="ui-agent-limits-muted" role="status">
|
||||
loading the resource caps…
|
||||
</span>
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
|
|||
Loading…
Reference in a new issue