ondemand
ondemand copied to clipboard
Notify users when job starts
This is a two part solution:
- Use the Notifications API, which is user opt-in, to notify when a job starts or completes if the browser window/tab is not in focus
- Update the
<title>
of theMy Interactive Sessions
page with the following format:<most recent job card state, name, id> - <# active sessions> active sessions - My Interactive Sessions
and when the state of that job card changes, update the title using JavaScript.
┆Issue is synchronized with this Asana task by Unito
This is related to https://discourse.osc.edu/t/notifications-beyond-an-email/1338
Also, unlike the MDN example, we would need to get permission to use the Notifications API as soon as the user accesses the page, instead of when we go to produce our first notification change.
Example title:
Running VDI (Owens and Pitzer) (12990898) - 3 active sessions - My Interactive Sessions
That would be the title for the page below:
- there are 3 active sessions (the rest are completed)
- the first one's title and job id display in the title first
And editing the title is easy https://developer.mozilla.org/en-US/docs/Web/API/Document/title
document.title = "Running VDI (Owens and Pitzer) (12990898) - 3 active sessions - My Interactive Sessions"