From c82c770246b654446bcd18a48671ef9ca094a1d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 28 May 2024 07:37:22 +0200 Subject: [PATCH 1/3] UI fixes --- static/css/datapoints.css | 12 +++++++++--- static/css/main.css | 12 ++++++++++-- static/css/problems.css | 8 ++++++-- static/css/theme.css | 8 ++++++-- static/css/trigger_edit.css | 8 ++++++-- static/less/datapoints.less | 4 +++- static/less/main.less | 5 +++++ static/less/theme.less | 7 +++++-- views/pages/configuration.gotmpl | 2 +- views/pages/datapoints.gotmpl | 2 +- 10 files changed, 52 insertions(+), 16 deletions(-) diff --git a/static/css/datapoints.css b/static/css/datapoints.css index 8333e8e..54d331a 100644 --- a/static/css/datapoints.css +++ b/static/css/datapoints.css @@ -26,9 +26,12 @@ body { } h1, h2 { - margin-top: 0px; margin-bottom: 4px; } +h1:first-child, +h2:first-child { + margin-top: 0px; +} h1 { font-size: 1.5em; color: #fb4934; @@ -36,10 +39,11 @@ h1 { } h2 { font-size: 1.25em; + color: #b8bb26; font-weight: 500; } a { - color: #fabd2f; + color: #3f9da1; text-decoration: none; } a:hover { @@ -107,9 +111,11 @@ label { #datapoints .group { font-size: 1.1em; font-weight: bold; - color: #fabd2f; + color: #b8bb26; margin-top: 1.5em; padding-bottom: 4px; +} +#datapoints h2 { border-bottom: unset; } #datapoints .header { diff --git a/static/css/main.css b/static/css/main.css index c2dc070..67e2da9 100644 --- a/static/css/main.css +++ b/static/css/main.css @@ -26,9 +26,12 @@ body { } h1, h2 { - margin-top: 0px; margin-bottom: 4px; } +h1:first-child, +h2:first-child { + margin-top: 0px; +} h1 { font-size: 1.5em; color: #fb4934; @@ -36,10 +39,11 @@ h1 { } h2 { font-size: 1.25em; + color: #b8bb26; font-weight: 500; } a { - color: #fabd2f; + color: #3f9da1; text-decoration: none; } a:hover { @@ -178,6 +182,10 @@ label { margin-top: 12px; margin-bottom: 20px; } +#areas .area .section.configuration { + margin-top: 8px; + margin-bottom: 8px; +} #areas .area .section:last-child { margin-bottom: 12px; } diff --git a/static/css/problems.css b/static/css/problems.css index 4cb921b..820b6e0 100644 --- a/static/css/problems.css +++ b/static/css/problems.css @@ -26,9 +26,12 @@ body { } h1, h2 { - margin-top: 0px; margin-bottom: 4px; } +h1:first-child, +h2:first-child { + margin-top: 0px; +} h1 { font-size: 1.5em; color: #fb4934; @@ -36,10 +39,11 @@ h1 { } h2 { font-size: 1.25em; + color: #b8bb26; font-weight: 500; } a { - color: #fabd2f; + color: #3f9da1; text-decoration: none; } a:hover { diff --git a/static/css/theme.css b/static/css/theme.css index 104cf3d..215acbb 100644 --- a/static/css/theme.css +++ b/static/css/theme.css @@ -26,9 +26,12 @@ body { } h1, h2 { - margin-top: 0px; margin-bottom: 4px; } +h1:first-child, +h2:first-child { + margin-top: 0px; +} h1 { font-size: 1.5em; color: #fb4934; @@ -36,10 +39,11 @@ h1 { } h2 { font-size: 1.25em; + color: #b8bb26; font-weight: 500; } a { - color: #fabd2f; + color: #3f9da1; text-decoration: none; } a:hover { diff --git a/static/css/trigger_edit.css b/static/css/trigger_edit.css index b2600b6..71cbb6a 100644 --- a/static/css/trigger_edit.css +++ b/static/css/trigger_edit.css @@ -26,9 +26,12 @@ body { } h1, h2 { - margin-top: 0px; margin-bottom: 4px; } +h1:first-child, +h2:first-child { + margin-top: 0px; +} h1 { font-size: 1.5em; color: #fb4934; @@ -36,10 +39,11 @@ h1 { } h2 { font-size: 1.25em; + color: #b8bb26; font-weight: 500; } a { - color: #fabd2f; + color: #3f9da1; text-decoration: none; } a:hover { diff --git a/static/less/datapoints.less b/static/less/datapoints.less index 770db5f..04086c7 100644 --- a/static/less/datapoints.less +++ b/static/less/datapoints.less @@ -9,9 +9,11 @@ .group { font-size: 1.10em; font-weight: bold; - color: @color2; + color: @color3; margin-top: 1.5em; padding-bottom: 4px; + } + h2 { border-bottom: unset; } diff --git a/static/less/main.less b/static/less/main.less index baf874c..bd42096 100644 --- a/static/less/main.less +++ b/static/less/main.less @@ -94,6 +94,11 @@ margin-top: 12px; margin-bottom: 20px; + &.configuration { + margin-top: 8px; + margin-bottom: 8px; + } + &:last-child { margin-bottom: 12px; } diff --git a/static/less/theme.less b/static/less/theme.less index 11ae2fc..93872ea 100644 --- a/static/less/theme.less +++ b/static/less/theme.less @@ -52,8 +52,10 @@ body { h1, h2 { - margin-top: 0px; margin-bottom: 4px; + &:first-child { + margin-top: 0px; + } } h1 { @@ -64,11 +66,12 @@ h1 { h2 { font-size: 1.25em; + color: @color3; font-weight: @bold; } a { - color: @color2; + color: @color4; text-decoration: none; &:hover { diff --git a/views/pages/configuration.gotmpl b/views/pages/configuration.gotmpl index d65b27d..0fdfd54 100644 --- a/views/pages/configuration.gotmpl +++ b/views/pages/configuration.gotmpl @@ -64,7 +64,7 @@ Create {{ range .SortedSections }} -
+
{{ .Name }}
{{ end }} diff --git a/views/pages/datapoints.gotmpl b/views/pages/datapoints.gotmpl index 91fc6c1..4f4340d 100644 --- a/views/pages/datapoints.gotmpl +++ b/views/pages/datapoints.gotmpl @@ -10,7 +10,7 @@ {{ $prevGroup := "kalle" }} {{ range .Data.Datapoints }} {{ if ne $prevGroup .Group }} -
{{ .Group }}
+

{{ .Group }}

Name
Datatype
Last value
From 0a7130f3158905b3fdc6d24088f3c12f8ca14014 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 28 May 2024 12:03:28 +0200 Subject: [PATCH 2/3] Graph for front page --- static/css/index.css | 109 +++++++++++++++++++++++++++++++++++++ static/images/graph.drawio | 74 +++++++++++++++++++++++++ static/images/graph.svg | 4 ++ static/less/index.less | 7 +++ views/pages/index.gotmpl | 5 ++ 5 files changed, 199 insertions(+) create mode 100644 static/css/index.css create mode 100644 static/images/graph.drawio create mode 100644 static/images/graph.svg create mode 100644 static/less/index.less diff --git a/static/css/index.css b/static/css/index.css new file mode 100644 index 0000000..1cb2413 --- /dev/null +++ b/static/css/index.css @@ -0,0 +1,109 @@ +html { + box-sizing: border-box; +} +*, +*:before, +*:after { + box-sizing: inherit; +} +*:focus { + outline: none; +} +[onClick] { + cursor: pointer; +} +html, +body { + margin: 0; + padding: 0; +} +body { + background: #282828; + font-family: sans-serif; + font-weight: 300; + color: #d5c4a1; + font-size: 11pt; +} +h1, +h2 { + margin-bottom: 4px; +} +h1:first-child, +h2:first-child { + margin-top: 0px; +} +h1 { + font-size: 1.5em; + color: #fb4934; + font-weight: 500; +} +h2 { + font-size: 1.25em; + color: #b8bb26; + font-weight: 500; +} +a { + color: #3f9da1; + text-decoration: none; +} +a:hover { + text-decoration: underline; +} +b { + font-weight: 500; +} +input[type="text"], +textarea, +select { + font-family: monospace; + background: #202020; + color: #d5c4a1; + padding: 4px 8px; + border: none; + font-size: 1em; + line-height: 1.5em; +} +button { + background: #202020; + color: #d5c4a1; + padding: 8px 32px; + border: 1px solid #535353; + font-size: 1em; + height: 3em; +} +button:focus { + background: #333; +} +.line { + grid-column: 1 / -1; + border-bottom: 1px solid #4e4e4e; +} +span.date { + color: #d5c4a1; + font-weight: 500; +} +span.time { + font-size: 0.9em; + color: #d5c4a1; +} +span.seconds { + display: none; +} +label { + user-select: none; +} +.description { + border: 1px solid #737373; + color: #3f9da1; + background: #202020; + padding: 4px 8px; + margin-top: 8px; + white-space: nowrap; + width: min-content; + border-radius: 8px; +} +.graph { + margin-top: 32px; + padding: 32px; + border-radius: 16px; +} diff --git a/static/images/graph.drawio b/static/images/graph.drawio new file mode 100644 index 0000000..1f93f5a --- /dev/null +++ b/static/images/graph.drawio @@ -0,0 +1,74 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/static/images/graph.svg b/static/images/graph.svg new file mode 100644 index 0000000..8915efe --- /dev/null +++ b/static/images/graph.svg @@ -0,0 +1,4 @@ + + + +
Datapoint
/entry/<name>
Datapoint...
Problem
is raised
Problem...
 true 
 true 
 false 
 false 
Trigger
is evaluated
Trigger...
 Data 
 Data 
Notification
is sent
Notification...
Datapoint
/entry/<name>
Datapoint...
 Data 
 Data 
Problem
is resolved
Problem...
Text is not SVG - cannot display
\ No newline at end of file diff --git a/static/less/index.less b/static/less/index.less new file mode 100644 index 0000000..7c65786 --- /dev/null +++ b/static/less/index.less @@ -0,0 +1,7 @@ +@import "theme.less"; + +.graph { + margin-top: 32px; + padding: 32px; + border-radius: 16px; +} diff --git a/views/pages/index.gotmpl b/views/pages/index.gotmpl index 7e6e275..413e8b8 100644 --- a/views/pages/index.gotmpl +++ b/views/pages/index.gotmpl @@ -1,4 +1,5 @@ {{ define "page" }} +
@@ -7,6 +8,10 @@

SMon

{{ .VERSION }}

+ +
+ +
{{ end }} From db21b01589562d7250386980b18195adf3ab6209 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Magnus=20=C3=85hall?= Date: Tue, 28 May 2024 12:03:40 +0200 Subject: [PATCH 3/3] Bumped to v13 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index e96246b..1dcfe3f 100644 --- a/main.go +++ b/main.go @@ -26,7 +26,7 @@ import ( "time" ) -const VERSION = "v12" +const VERSION = "v13" var ( logger *slog.Logger