Skip to content

Commit

Permalink
Add a configurable alert to convey shutdown info
Browse files Browse the repository at this point in the history
  • Loading branch information
ian-noaa committed Sep 29, 2023
1 parent 11720e9 commit 596df1a
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 1 deletion.
4 changes: 3 additions & 1 deletion home/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,9 @@ First, you'll need a settings file like so in `MATS/home`:
"config": {
"is_met_express": false,
"is_production": false,
"environment_label": "Development"
"environment_label": "Development",
"display_alert": false,
"alert_message": "Lorem ipsum dolor shutdown amet..."
},
"groups": [
{
Expand Down
2 changes: 2 additions & 0 deletions home/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ type ConfigJSON struct {
IsMETexpress bool `json:"is_met_express"`
IsProduction bool `json:"is_production"`
EnvironmentLabel string `json:"environment_label"`
DisplayAlert bool `json:"display_alert"`
AlertMessage string `json:"alert_message"`
} `json:"config"`
Groups []struct {
Name string `json:"name"`
Expand Down
7 changes: 7 additions & 0 deletions home/templates/alert.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
<!-- Mostly used to convey government shutdowns -->

<div class="container-fluid p-3" style="background-color: #dddddd">
<div class="alert alert-danger" role="alert">
<p>{{ .Config.AlertMessage }}</p>
</div>
</div>
4 changes: 4 additions & 0 deletions home/templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@
<div id="main" class="container-fluid">
{{ template "navbar.html" . }}

{{ if .Config.DisplayAlert }}
{{ template "alert.html" . }}
{{ end }}

{{ if .Config.IsMETexpress }}
{{ else }}
{{ template "toggles.html" . }}
Expand Down

0 comments on commit 596df1a

Please sign in to comment.