How to add a Server Alert on the welcome page - usegalaxy-no/galaxyadmin GitHub Wiki
Server Alerts are short messages displayed in colored boxes on the welcome page. These alerts are not hardcoded on the page itself but are downloaded from a JSON-file, formatted in HTML and inserted into the page dynamically.
To add a new Server Alert, log in as "sysadmin" to the usegalaxy server with SSH [Howto?] and open the following file in a text editor, such as "vim" or "nano". You must do this as sudo to have write permission to the file.
/srv/galaxy/server/static/server_alerts.json
This file defines the current Server Alerts as a list of JSON objects. You can modify and reuse one of the existing alerts or just add new ones to the list.
[
{
"title" : "Server Maintenance Alert",
"text" : "UseGalaxy.no will be upgraded to version 20.09 on <b>Friday, 11 December at 9:30</b>.<br>The process may take up to an hour, and some downtime is to be expected during this period. Jobs that have been started before this t
ime should not be affected.",
"color" : "red",
"show" : false
}
,
{
"title" : "Galaxy version upgrade",
"text" : "UseGalaxy.no has now been upgraded to version 20.09.<br>New features include the ability to upload data directly from the tool form and support for multimedia files. Visit <a href='https://docs.galaxyproject.org/en/master/
releases/20.09_announce_user.html' target='_blank'>this page</a> for more information.",
"color" : "green",
"show" : true,
"to" : "2020-12-22T13:00:00"
}
]
Each server alert is defined with the following attributes
- title: A concise alert message that will be used as the header (required)
-
text: A longer more descriptive message. This can include HTML tags, such as
<b> </b>or<i> </i>to format text in bold or italics,<br>to insert line breaks or<a href='url' target='_blank'> </a>to link to other pages. -
show: Set this attribute to
trueto display the alert andfalseto hide it. This attribute is optional and defaults totrue. -
color: A background color for the alert. Available options are:
red,orange,yellow,green,blueandviolet. Defaults to "red". - from: An optional timestamp that controls the time that the alert should first be shown. If this attribute is defined, the alert will not be displayed before this time.
- to: An optional timestamp that controls the time that the alert should be taken down. If this attribute is defined, the alert will not be displayed after this time.
The "from" and "to" attributes can be in one of the following date formats. Note that the "T" in the middle of the second line is a literal "T", whereas all the other letters are placeholders for integer numbers
- YYYY-MM-DD
- YYYY-MM-DD
THH:mm
The old NeLS Galaxies had a web site that Admins could visit to add new server alerts via a web form rather than having to edit a JSON file on the server. In the future, we hope to create something similar for UseGalaxy.no