diff options
-rw-r--r-- | src/ui.rs | 5 | ||||
-rw-r--r-- | static/style.css | 2 | ||||
-rw-r--r-- | style.css | 9 | ||||
-rw-r--r-- | templates/dashboard.html | 6 | ||||
-rw-r--r-- | templates/incoming.html | 2 | ||||
-rw-r--r-- | templates/send.html | 21 | ||||
-rw-r--r-- | templates/settings.html | 3 |
7 files changed, 32 insertions, 16 deletions
@@ -109,12 +109,15 @@ async fn dashboard(State(state): State<SharedState>) -> DashboardTemplate<'stati }) .collect(); + let node_startup_time = format!("{} UTC", + node_startup_time.format("%Y-%m-%d %H:%M:%S")); + DashboardTemplate { title: "Dashboard", conf, page: ActivePage::Dashboard, num_received_frames : db.get_num_received_frames(), - node_startup_time : node_startup_time.format("%Y-%m-%d %H:%M:%S").to_string(), + node_startup_time, packets, } } diff --git a/static/style.css b/static/style.css index c23e8d0..1023b38 100644 --- a/static/style.css +++ b/static/style.css @@ -1 +1 @@ -/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }html{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));font-family:sans-serif}.mt-1{margin-top:.25rem}.flex{display:flex}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-60{width:15rem}.w-8{width:2rem}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem*var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.divide-sky-300>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(125 211 252/var(--tw-divide-opacity))}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.bg-sky-100{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.bg-sky-200{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity))}.bg-sky-300{--tw-bg-opacity:1;background-color:rgb(125 211 252/var(--tw-bg-opacity))}.p-3{padding:.75rem}.p-4{padding:1rem}.pb-4{padding-bottom:1rem}.pt-2{padding-top:.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-semibold{font-weight:600}.text-sky-800{--tw-text-opacity:1;color:rgb(7 89 133/var(--tw-text-opacity))}.text-sky-900{--tw-text-opacity:1;color:rgb(12 74 110/var(--tw-text-opacity))}h1{font-size:1.125rem;line-height:1.75rem}h1,h2{font-weight:700}fieldset{margin:.5rem;border-radius:.375rem;padding:.5rem;font-weight:400;--tw-text-opacity:1;color:rgb(3 105 161/var(--tw-text-opacity));outline-style:solid;outline-color:#3b82f61a}fieldset:hover{outline-color:#3b82f64d}legend{padding:.25rem;font-variant:small-caps}label{padding:.5rem}input,label{margin:.25rem}.btn{margin-top:.25rem;margin-bottom:.25rem;border-radius:.25rem;padding:.25rem .5rem;font-weight:700;--tw-bg-opacity:1;background-color:rgb(14 165 233/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.btn:hover{--tw-bg-opacity:1;background-color:rgb(2 132 199/var(--tw-bg-opacity))}.textinput{border-radius:.375rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity));padding:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(3 105 161/var(--tw-text-opacity));outline-style:solid;outline-width:0}.textinput:focus{border-width:2px;--tw-border-opacity:1;border-color:rgb(113 113 122/var(--tw-border-opacity));outline-width:0}.textinput:disabled{border-width:0;--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity))}.hover\:bg-sky-300:hover{--tw-bg-opacity:1;background-color:rgb(125 211 252/var(--tw-bg-opacity))}
\ No newline at end of file +/*! tailwindcss v3.3.5 | MIT License | https://tailwindcss.com*/*,:after,:before{box-sizing:border-box;border:0 solid #e5e7eb}:after,:before{--tw-content:""}html{line-height:1.5;-webkit-text-size-adjust:100%;-moz-tab-size:4;-o-tab-size:4;tab-size:4;font-family:ui-sans-serif,system-ui,-apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,Noto Sans,sans-serif,Apple Color Emoji,Segoe UI Emoji,Segoe UI Symbol,Noto Color Emoji;font-feature-settings:normal;font-variation-settings:normal}body{margin:0;line-height:inherit}hr{height:0;color:inherit;border-top-width:1px}abbr:where([title]){-webkit-text-decoration:underline dotted;text-decoration:underline dotted}h1,h2,h3,h4,h5,h6{font-size:inherit;font-weight:inherit}a{color:inherit;text-decoration:inherit}b,strong{font-weight:bolder}code,kbd,pre,samp{font-family:ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,Liberation Mono,Courier New,monospace;font-size:1em}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:initial}sub{bottom:-.25em}sup{top:-.5em}table{text-indent:0;border-color:inherit;border-collapse:collapse}button,input,optgroup,select,textarea{font-family:inherit;font-feature-settings:inherit;font-variation-settings:inherit;font-size:100%;font-weight:inherit;line-height:inherit;color:inherit;margin:0;padding:0}button,select{text-transform:none}[type=button],[type=reset],[type=submit],button{-webkit-appearance:button;background-color:initial;background-image:none}:-moz-focusring{outline:auto}:-moz-ui-invalid{box-shadow:none}progress{vertical-align:initial}::-webkit-inner-spin-button,::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}::-webkit-search-decoration{-webkit-appearance:none}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}summary{display:list-item}blockquote,dd,dl,figure,h1,h2,h3,h4,h5,h6,hr,p,pre{margin:0}fieldset{margin:0}fieldset,legend{padding:0}menu,ol,ul{list-style:none;margin:0;padding:0}dialog{padding:0}textarea{resize:vertical}input::-moz-placeholder,textarea::-moz-placeholder{opacity:1;color:#9ca3af}input::placeholder,textarea::placeholder{opacity:1;color:#9ca3af}[role=button],button{cursor:pointer}:disabled{cursor:default}audio,canvas,embed,iframe,img,object,svg,video{display:block;vertical-align:middle}img,video{max-width:100%;height:auto}[hidden]{display:none}*,::backdrop,:after,:before{--tw-border-spacing-x:0;--tw-border-spacing-y:0;--tw-translate-x:0;--tw-translate-y:0;--tw-rotate:0;--tw-skew-x:0;--tw-skew-y:0;--tw-scale-x:1;--tw-scale-y:1;--tw-pan-x: ;--tw-pan-y: ;--tw-pinch-zoom: ;--tw-scroll-snap-strictness:proximity;--tw-gradient-from-position: ;--tw-gradient-via-position: ;--tw-gradient-to-position: ;--tw-ordinal: ;--tw-slashed-zero: ;--tw-numeric-figure: ;--tw-numeric-spacing: ;--tw-numeric-fraction: ;--tw-ring-inset: ;--tw-ring-offset-width:0px;--tw-ring-offset-color:#fff;--tw-ring-color:#3b82f680;--tw-ring-offset-shadow:0 0 #0000;--tw-ring-shadow:0 0 #0000;--tw-shadow:0 0 #0000;--tw-shadow-colored:0 0 #0000;--tw-blur: ;--tw-brightness: ;--tw-contrast: ;--tw-grayscale: ;--tw-hue-rotate: ;--tw-invert: ;--tw-saturate: ;--tw-sepia: ;--tw-drop-shadow: ;--tw-backdrop-blur: ;--tw-backdrop-brightness: ;--tw-backdrop-contrast: ;--tw-backdrop-grayscale: ;--tw-backdrop-hue-rotate: ;--tw-backdrop-invert: ;--tw-backdrop-opacity: ;--tw-backdrop-saturate: ;--tw-backdrop-sepia: }html{--tw-bg-opacity:1;background-color:rgb(255 255 255/var(--tw-bg-opacity));font-family:sans-serif}.mt-1{margin-top:.25rem}.flex{display:flex}.h-full{height:100%}.min-h-screen{min-height:100vh}.w-60{width:15rem}.w-8{width:2rem}.flex-auto{flex:1 1 auto}.flex-none{flex:none}.space-y-1>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.25rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.25rem*var(--tw-space-y-reverse))}.space-y-2>:not([hidden])~:not([hidden]){--tw-space-y-reverse:0;margin-top:calc(.5rem*(1 - var(--tw-space-y-reverse)));margin-bottom:calc(.5rem*var(--tw-space-y-reverse))}.divide-y>:not([hidden])~:not([hidden]){--tw-divide-y-reverse:0;border-top-width:calc(1px*(1 - var(--tw-divide-y-reverse)));border-bottom-width:calc(1px*var(--tw-divide-y-reverse))}.divide-sky-300>:not([hidden])~:not([hidden]){--tw-divide-opacity:1;border-color:rgb(125 211 252/var(--tw-divide-opacity))}.rounded-lg{border-radius:.5rem}.rounded-md{border-radius:.375rem}.bg-sky-100{--tw-bg-opacity:1;background-color:rgb(224 242 254/var(--tw-bg-opacity))}.bg-sky-200{--tw-bg-opacity:1;background-color:rgb(186 230 253/var(--tw-bg-opacity))}.bg-sky-300{--tw-bg-opacity:1;background-color:rgb(125 211 252/var(--tw-bg-opacity))}.p-3{padding:.75rem}.p-4{padding:1rem}.pb-4{padding-bottom:1rem}.pt-2{padding-top:.5rem}.text-lg{font-size:1.125rem;line-height:1.75rem}.font-semibold{font-weight:600}.text-sky-800{--tw-text-opacity:1;color:rgb(7 89 133/var(--tw-text-opacity))}.text-sky-900{--tw-text-opacity:1;color:rgb(12 74 110/var(--tw-text-opacity))}h1{font-size:1.125rem;line-height:1.75rem}h1,h2{font-weight:700}fieldset{margin:.5rem;border-radius:.375rem;padding:.5rem;font-weight:400;--tw-text-opacity:1;color:rgb(3 105 161/var(--tw-text-opacity));outline-style:solid;outline-color:#3b82f61a}fieldset:hover{outline-color:#3b82f64d}legend{padding:.25rem;font-variant:small-caps}label{padding:.5rem}input,label{margin:.25rem}div.content{padding:.25rem .5rem}div.content,div.section{margin-top:.25rem;margin-bottom:.25rem}div.section{padding-top:.25rem;padding-bottom:.25rem;border-top-width:2px;--tw-border-opacity:1;border-color:rgb(125 211 252/var(--tw-border-opacity))}.btn{margin-top:.25rem;margin-bottom:.25rem;border-radius:.25rem;padding:.25rem .5rem;font-weight:700;--tw-bg-opacity:1;background-color:rgb(14 165 233/var(--tw-bg-opacity));--tw-text-opacity:1;color:rgb(255 255 255/var(--tw-text-opacity))}.btn:hover{--tw-bg-opacity:1;background-color:rgb(2 132 199/var(--tw-bg-opacity))}.textinput{border-radius:.375rem;border-width:2px;--tw-border-opacity:1;border-color:rgb(228 228 231/var(--tw-border-opacity));padding:.25rem;font-size:.875rem;line-height:1.25rem;font-weight:400;--tw-text-opacity:1;color:rgb(3 105 161/var(--tw-text-opacity));outline-style:solid;outline-width:0}.textinput:focus{border-width:2px;--tw-border-opacity:1;border-color:rgb(113 113 122/var(--tw-border-opacity));outline-width:0}.textinput:disabled{border-width:0;--tw-bg-opacity:1;background-color:rgb(250 250 250/var(--tw-bg-opacity))}.hover\:bg-sky-300:hover{--tw-bg-opacity:1;background-color:rgb(125 211 252/var(--tw-bg-opacity))}
\ No newline at end of file @@ -34,6 +34,15 @@ input { @apply m-1; } +div.content { + @apply py-1 px-2 my-1; +} + +div.section { + @apply py-1 my-1; + @apply border-t-2 border-sky-300; +} + .btn { @apply font-bold py-1 px-2 my-1 rounded; @apply bg-sky-500 hover:bg-sky-600 text-white; diff --git a/templates/dashboard.html b/templates/dashboard.html index fa899ba..a58bec6 100644 --- a/templates/dashboard.html +++ b/templates/dashboard.html @@ -1,12 +1,12 @@ {% include "head.html" %} -<div class=""> +<div class="content"> <h1>Dashboard</h1> - <div> + <div class="section"> <h2>Statistics</h2> <p>This node is up since {{ node_startup_time }}</p> <p>Database contains {{ num_received_frames }} received frames</p> </div> - <div> + <div class="section"> <h2>Ten most recent packets</h2> <ul> {% for packet in packets %} diff --git a/templates/incoming.html b/templates/incoming.html index 3de173d..2a43623 100644 --- a/templates/incoming.html +++ b/templates/incoming.html @@ -1,5 +1,5 @@ {% include "head.html" %} -<div class=""> +<div class="content"> Incoming! </div> {% include "foot.html" %} diff --git a/templates/send.html b/templates/send.html index 2a669e4..7889c20 100644 --- a/templates/send.html +++ b/templates/send.html @@ -1,14 +1,15 @@ {% include "head.html" %} -<div class=""> +<div class="content"> <h1>Send a frame</h1> - <p> - One main feature of CATS is that packets are constructed from Whiskers. + <p>One main feature of CATS is that packets are constructed from Whiskers. Each Whisker represents one possible attribute of data.</p> <p>On this page you can select which whiskers to include in your packet.</p> - <div> + <div class="section"> <h2>Identification</h2> <p>{{ conf.callsign }}-{{ conf.ssid }}</p> + </div> + <div class="section"> <h2>Destination Whisker</h2> <p>CATS packets can optionally have one or more destinations. This can be useful for e.g. sending a message to another amateur radio operator, @@ -16,21 +17,23 @@ The destination consists of a UTF-8 callsign and an SSID byte.</p> <template id="destination_template"> <p class="destination"> - <input class="textinput dest_callsign" type="text" placeholder="Type callsign here"> - <input class="textinput dest_ssid" type="text" placeholder="Type SSID here"> - <button class="btn" type="button" onclick="btn_remove_destination(this)">Remove</button> + <input class="textinput dest_callsign" type="text" placeholder="Type callsign here"> + <input class="textinput dest_ssid" type="text" placeholder="Type SSID here"> + <button class="btn" type="button" onclick="btn_remove_destination(this)">Remove</button> </p> </template> <div id="destinations"></div> <button class="btn" type="button" onclick="btn_add_destination()">Add destination</button> + </div> + <div class="section"> <h2>Comment Whisker</h2> <div> <input type="checkbox" id="with_comment" value="Include Comment" checked> <input class="textinput" type="text" id="whisker_comment" placeholder="Type comment here"> </div> - - <button class="btn" type="button" onclick="btn_send_packet()">Send</button> </div> + + <button class="btn" type="button" onclick="btn_send_packet()">Send</button> </div> {% include "foot.html" %} {# vi:set et sw=2 ts=2: #} diff --git a/templates/settings.html b/templates/settings.html index a24137e..b8ec258 100644 --- a/templates/settings.html +++ b/templates/settings.html @@ -1,7 +1,8 @@ {% include "head.html" %} -<div class=""> +<div class="content"> <h1>Node Settings</h1> + <div class="section"> <form action="/settings" method="post"> <fieldset> <legend>General</legend> |