Mercurial > lbo > hg > analyrics
changeset 43:2ecb25f3adfe
Move stylesheet to separate file
author | Lewin Bormann <lbo@spheniscida.de> |
---|---|
date | Tue, 19 Jul 2022 19:56:14 -0700 |
parents | dfef5a8263c3 |
children | e7e91f288868 |
files | TODO assets/index.html.hbs assets/login.html.hbs assets/static/favicon.ico assets/static/style.css src/cacheresponder.rs |
diffstat | 6 files changed, 45 insertions(+), 40 deletions(-) [+] |
line wrap: on
line diff
--- a/TODO Mon Jul 18 08:21:35 2022 -0700 +++ b/TODO Tue Jul 19 19:56:14 2022 -0700 @@ -0,0 +1,3 @@ +* Configurable duration on index page +* Options bar + * display bots?
--- a/assets/index.html.hbs Mon Jul 18 08:21:35 2022 -0700 +++ b/assets/index.html.hbs Tue Jul 19 19:56:14 2022 -0700 @@ -6,6 +6,9 @@ <meta name="robots" content="noindex"> <meta name="viewport" content="width=device-width, initial-scale=1"> + <link rel="stylesheet" href="static/style.css" type="text/css" /> + <link rel="icon" type="image/png" href="/static/favicon.ico"> + <script src="static/chart.min.js" type="application/javascript"></script> <script type="application/javascript"> @@ -34,28 +37,6 @@ }; </script> - <style> - #logo { color: #22bb22; font-size: 20pt; font-style: bold; } - #header { color: #bb2222; } - .useraction { float: right; padding: 3pt; } - .userdomain { float: right; padding: 3pt; } - #logout { float: right; padding: 3pt; } - #flashtext { } - #flash { text-align: center; border-style: solid; border-color: #22aa22; margin-left: 30%; margin-right: 30%; } - #errortext { } - #error { text-align: center; border-style: solid; border-color: #aa2222; margin-left: 30%; margin-right: 30%; } - - .plottitle { text-align: center; } - .plotrow { border-style: solid; border-color: blue; text-align: center; display: flex; justify-content: center; } - .plotframe { border-style: solid; border-color: green; display: inline-block; margin: 5pt; } - - .fullwidth { width: 95%; } - .halfwidth { width: 48%; } - - .timenav { display: flex; justify-content: center; } - .timeindicator { text-align: center; } - </style> - </head> <body> @@ -76,18 +57,22 @@ {{#if error}}<div id="error"><span id="errortext">{{error}}</span></div>{{/if}} {{#if loggedin}} + <!-- Time navigation --> - <div class="timeindicator"> + <div id="timebox"> + <div id="timeindicator"> from {{ date.today }} ({{date.duration}} days) </div> - <div class="timenav"> + <div id="timenav"> <button onclick="adjustURLDateParams(-30, 1)">-30d</button> <button onclick="adjustURLDateParams(-7, 1)">-7d</button> <button onclick="adjustURLDateParams(-1, 1)">-1d</button> + <button onclick="adjustURLDateParams(1, 1)">+1d</button> <button onclick="adjustURLDateParams(7, 1)">+7d</button> <button onclick="adjustURLDateParams(30, 1)">+30d</button> </div> + </div> <!-- Plots -- only shown when logged in. -->
--- a/assets/login.html.hbs Mon Jul 18 08:21:35 2022 -0700 +++ b/assets/login.html.hbs Tue Jul 19 19:56:14 2022 -0700 @@ -5,22 +5,9 @@ <meta name="robots" content="noindex"> <meta name="viewport" content="width=device-width, initial-scale=1"> - <style> - #logo { color: #22bb22; font-size: 20pt; font-style: bold; } - #header { color: #bb2222; } - #flashtext { } - .flash { text-align: center; border-style: solid; border-color: #22aa22; margin-left: 30%; margin-right: 30%; } + <link rel="stylesheet" href="static/style.css" type="text/css" /> + <link rel="icon" type="image/png" href="/static/favicon.ico"> - #loginformbox { display: flex; justify-content: center; } - #loginform { } - #innerformbox { width: 25em; text-align: right; } - .entryline { padding: 3px; } - .submitbutton { text-align: right; padding: 1em; } - - input { height: 2.5em; border: lightgray solid; } - input:focus { outline: 0; } - label { } - </style> </head> <body> <div id="header">
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/assets/static/style.css Tue Jul 19 19:56:14 2022 -0700 @@ -0,0 +1,31 @@ +#logo { color: #22bb22; font-size: 20pt; font-style: bold; } +#header { color: #bb2222; } +.useraction { float: right; padding: 3pt; } +.userdomain { float: right; padding: 3pt; } +#logout { float: right; padding: 3pt; } +#flashtext { } +#flash { text-align: center; border-style: solid; border-color: #22aa22; margin-left: 30%; margin-right: 30%; } +#errortext { } +#error { text-align: center; border-style: solid; border-color: #aa2222; margin-left: 30%; margin-right: 30%; } + +.plottitle { text-align: center; } +.plotrow { border-style: solid; border-color: blue; text-align: center; display: flex; justify-content: center; } +.plotframe { border-style: solid; border-color: green; display: inline-block; margin: 5pt; } + +.fullwidth { width: 95%; } +.halfwidth { width: 48%; } + +#timebox { display: flex; justify-content: center; flex-direction: column; } +#timenav { text-align: center; } +#timeindicator { text-align: center; } + + +/* Login form */ +#loginformbox { display: flex; justify-content: center; } +#loginform { } +#innerformbox { width: 25em; text-align: right; } +.entryline { padding: 3px; } +.submitbutton { text-align: right; padding: 1em; } +input { height: 2.5em; border: lightgray solid; } +input:focus { outline: 0; } +label { }
--- a/src/cacheresponder.rs Mon Jul 18 08:21:35 2022 -0700 +++ b/src/cacheresponder.rs Tue Jul 19 19:56:14 2022 -0700 @@ -72,7 +72,6 @@ #[rocket::async_trait] impl<H: Clone + Handler> Handler for CachedHandler<H> { async fn handle<'r>(&self, req: &'r Request<'_>, data: Data<'r>) -> Outcome<'r> { - info!("Received request {:?}", req); match self.inner.handle(req, data).await { Outcome::Success(mut resp) => { resp.set_header(Header::new("cache-control", self.cachecontrol.0.clone()));