swarm-ui: pages that only display start from the answer they last saw, then refresh behind it
usePolled takes a cache key: it saves each answer in localStorage and starts from the saved one, so opening the agents, alerts, builds, review runs or hives view shows the last data at once and the refresh spinner marks the update. A saved answer is dropped after a day, when it was saved by another build of the UI, at log out (a new onLogout of the shared user menu) and when the gateway ends the login (a new onSessionEnded of the session guard). Pages with an editor (schedules, notification flows, broadcast) do not use it.
This commit is contained in:
parent
47c447409b
commit
fd51cbd19d
1 changed files with 238 additions and 14 deletions
|
|
@ -42,6 +42,13 @@ error. While a page is fetching, its refresh picker shows a spinner in place of
|
|||
the clock, for at least 0.4 seconds so a quick answer still reads as a refresh.
|
||||
The Jobs page has none yet.
|
||||
|
||||
The pages that only display (agents, alerts, builds, review runs and the hives
|
||||
card) show the answer they last saw at once, then replace it with the fresh one
|
||||
while the spinner runs, so opening one never starts on an empty page. The browser
|
||||
keeps the answer for itself only, and forgets it after a day, after a new build
|
||||
of the UI, at **log out**, and when the login ends. The pages with an editor
|
||||
(schedules, notification flows, broadcast) start empty as before.
|
||||
|
||||
The **wanted** badge changes the state of an agent the swarm has declared. For an
|
||||
agent the swarm never declared on its hive, such as one only its hive knows
|
||||
about, the badge reads **no declaration** and doesn't open: create the agent
|
||||
|
|
|
|||
Loading…
Reference in a new issue