Added button to apply timefilter
This commit is contained in:
parent
9689283c0e
commit
cd123ae1c1
6
page.go
6
page.go
@ -2,7 +2,7 @@ package main
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
// External
|
// External
|
||||||
we "git.gibonuddevalla.se/go/wrappederror"
|
werr "git.gibonuddevalla.se/go/wrappederror"
|
||||||
|
|
||||||
// Standard
|
// Standard
|
||||||
"fmt"
|
"fmt"
|
||||||
@ -25,7 +25,7 @@ type Page struct {
|
|||||||
func (p *Page) Render(w http.ResponseWriter, r *http.Request) {
|
func (p *Page) Render(w http.ResponseWriter, r *http.Request) {
|
||||||
tmpl, err := getPage(p.LAYOUT, p.PAGE)
|
tmpl, err := getPage(p.LAYOUT, p.PAGE)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(w, we.Wrap(err).Log())
|
httpError(w, werr.Wrap(err).Log())
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -58,6 +58,6 @@ func (p *Page) Render(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
err = tmpl.Execute(w, data)
|
err = tmpl.Execute(w, data)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
httpError(w, we.Wrap(err).Log())
|
httpError(w, werr.Wrap(err).Log())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -20,5 +20,4 @@ input[type="datetime-local"] {
|
|||||||
background-color: #1b4e78;
|
background-color: #1b4e78;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
border: 1px solid #535353;
|
border: 1px solid #535353;
|
||||||
padding: 6px;
|
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ label {
|
|||||||
top: 16px;
|
top: 16px;
|
||||||
right: 16px;
|
right: 16px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 8px repeat(2, min-content) 8px 1px 8px repeat(3, min-content) 8px repeat(3, min-content) 8px 1px 8px repeat(2, min-content) 8px;
|
grid-template-columns: 8px repeat(2, min-content) 8px min-content 8px 1px 8px repeat(3, min-content) 8px repeat(3, min-content) 8px 1px 8px repeat(2, min-content) 8px;
|
||||||
grid-gap: 6px 8px;
|
grid-gap: 6px 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: min-content;
|
width: min-content;
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
input[type="datetime-local"] {
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
#notifications {
|
#notifications {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, min-content);
|
grid-template-columns: repeat(5, min-content);
|
||||||
grid-gap: 4px 16px;
|
grid-gap: 4px 16px;
|
||||||
margin-top: 32px;
|
margin-top: 96px;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
background-color: #2979b8;
|
background-color: #2979b8;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
|
@ -20,5 +20,4 @@ input[type="datetime-local"] {
|
|||||||
background-color: #202020;
|
background-color: #202020;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
border: 1px solid #535353;
|
border: 1px solid #535353;
|
||||||
padding: 6px;
|
|
||||||
}
|
}
|
||||||
|
@ -262,7 +262,7 @@ label {
|
|||||||
top: 16px;
|
top: 16px;
|
||||||
right: 16px;
|
right: 16px;
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 8px repeat(2, min-content) 8px 1px 8px repeat(3, min-content) 8px repeat(3, min-content) 8px 1px 8px repeat(2, min-content) 8px;
|
grid-template-columns: 8px repeat(2, min-content) 8px min-content 8px 1px 8px repeat(3, min-content) 8px repeat(3, min-content) 8px 1px 8px repeat(2, min-content) 8px;
|
||||||
grid-gap: 6px 8px;
|
grid-gap: 6px 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
width: min-content;
|
width: min-content;
|
||||||
|
@ -1,11 +1,8 @@
|
|||||||
input[type="datetime-local"] {
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
#notifications {
|
#notifications {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, min-content);
|
grid-template-columns: repeat(5, min-content);
|
||||||
grid-gap: 4px 16px;
|
grid-gap: 4px 16px;
|
||||||
margin-top: 32px;
|
margin-top: 96px;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
background-color: #333;
|
background-color: #333;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
|
69
static/images/default_light/forward.svg
Normal file
69
static/images/default_light/forward.svg
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="19.999975"
|
||||||
|
height="19.999975"
|
||||||
|
viewBox="0 0 5.29166 5.2916603"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
|
||||||
|
sodipodi:docname="forward.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="22.627417"
|
||||||
|
inkscape:cx="9.3028736"
|
||||||
|
inkscape:cy="12.772116"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
units="px"
|
||||||
|
inkscape:window-width="2190"
|
||||||
|
inkscape:window-height="1404"
|
||||||
|
inkscape:window-x="1463"
|
||||||
|
inkscape:window-y="16"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:showpageshadow="true"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d6d6d6"
|
||||||
|
showborder="true" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-123.825,-155.04583)">
|
||||||
|
<title
|
||||||
|
id="title1">alert</title>
|
||||||
|
<title
|
||||||
|
id="title1-1">arrow-right-bold-circle</title>
|
||||||
|
<path
|
||||||
|
d="m 123.825,157.69166 a 2.6458334,2.6458334 0 0 1 2.64583,-2.64583 2.6458334,2.6458334 0 0 1 2.64583,2.64583 2.6458334,2.6458334 0 0 1 -2.64583,2.64583 2.6458334,2.6458334 0 0 1 -2.64583,-2.64583 m 3.96875,0 -1.32292,-1.32292 v 0.79375 h -1.05833 v 1.05834 h 1.05833 v 0.79375 z"
|
||||||
|
id="path1"
|
||||||
|
style="stroke-width:0.264583;fill:#abc837" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
69
static/images/gruvbox/forward.svg
Normal file
69
static/images/gruvbox/forward.svg
Normal file
@ -0,0 +1,69 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
||||||
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
|
<svg
|
||||||
|
width="19.999975"
|
||||||
|
height="19.999975"
|
||||||
|
viewBox="0 0 5.29166 5.2916603"
|
||||||
|
version="1.1"
|
||||||
|
id="svg8"
|
||||||
|
inkscape:version="1.3.2 (1:1.3.2+202311252150+091e20ef0f)"
|
||||||
|
sodipodi:docname="forward.svg"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:svg="http://www.w3.org/2000/svg"
|
||||||
|
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
|
||||||
|
xmlns:cc="http://creativecommons.org/ns#"
|
||||||
|
xmlns:dc="http://purl.org/dc/elements/1.1/">
|
||||||
|
<defs
|
||||||
|
id="defs2" />
|
||||||
|
<sodipodi:namedview
|
||||||
|
id="base"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pageshadow="2"
|
||||||
|
inkscape:zoom="22.627417"
|
||||||
|
inkscape:cx="9.3028736"
|
||||||
|
inkscape:cy="12.772116"
|
||||||
|
inkscape:document-units="px"
|
||||||
|
inkscape:current-layer="layer1"
|
||||||
|
showgrid="false"
|
||||||
|
units="px"
|
||||||
|
inkscape:window-width="2190"
|
||||||
|
inkscape:window-height="1404"
|
||||||
|
inkscape:window-x="1463"
|
||||||
|
inkscape:window-y="16"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:showpageshadow="true"
|
||||||
|
inkscape:pagecheckerboard="0"
|
||||||
|
inkscape:deskcolor="#d6d6d6"
|
||||||
|
showborder="true" />
|
||||||
|
<metadata
|
||||||
|
id="metadata5">
|
||||||
|
<rdf:RDF>
|
||||||
|
<cc:Work
|
||||||
|
rdf:about="">
|
||||||
|
<dc:format>image/svg+xml</dc:format>
|
||||||
|
<dc:type
|
||||||
|
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
|
||||||
|
</cc:Work>
|
||||||
|
</rdf:RDF>
|
||||||
|
</metadata>
|
||||||
|
<g
|
||||||
|
inkscape:label="Layer 1"
|
||||||
|
inkscape:groupmode="layer"
|
||||||
|
id="layer1"
|
||||||
|
transform="translate(-123.825,-155.04583)">
|
||||||
|
<title
|
||||||
|
id="title1">alert</title>
|
||||||
|
<title
|
||||||
|
id="title1-1">arrow-right-bold-circle</title>
|
||||||
|
<path
|
||||||
|
d="m 123.825,157.69166 a 2.6458334,2.6458334 0 0 1 2.64583,-2.64583 2.6458334,2.6458334 0 0 1 2.64583,2.64583 2.6458334,2.6458334 0 0 1 -2.64583,2.64583 2.6458334,2.6458334 0 0 1 -2.64583,-2.64583 m 3.96875,0 -1.32292,-1.32292 v 0.79375 h -1.05833 v 1.05834 h 1.05833 v 0.79375 z"
|
||||||
|
id="path1"
|
||||||
|
style="stroke-width:0.264583;fill:#abc837" />
|
||||||
|
</g>
|
||||||
|
</svg>
|
After Width: | Height: | Size: 2.2 KiB |
@ -29,5 +29,4 @@ input[type="datetime-local"] {
|
|||||||
background-color: @bg2;
|
background-color: @bg2;
|
||||||
color: #ccc;
|
color: #ccc;
|
||||||
border: 1px solid #535353;
|
border: 1px solid #535353;
|
||||||
padding: 6px;
|
|
||||||
}
|
}
|
||||||
|
@ -297,7 +297,7 @@ label {
|
|||||||
right: 16px;
|
right: 16px;
|
||||||
|
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 8px repeat(2,min-content) 8px 1px 8px repeat(3,min-content) 8px repeat(3,min-content) 8px 1px 8px repeat(2,min-content) 8px;
|
grid-template-columns: 8px repeat(2,min-content) 8px min-content 8px 1px 8px repeat(3,min-content) 8px repeat(3,min-content) 8px 1px 8px repeat(2,min-content) 8px;
|
||||||
grid-gap: 6px 8px;
|
grid-gap: 6px 8px;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
|
|
||||||
|
@ -1,14 +1,10 @@
|
|||||||
@import "theme-@{THEME}.less";
|
@import "theme-@{THEME}.less";
|
||||||
|
|
||||||
input[type="datetime-local"] {
|
|
||||||
padding: 6px;
|
|
||||||
}
|
|
||||||
|
|
||||||
#notifications {
|
#notifications {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: repeat(5, min-content);
|
grid-template-columns: repeat(5, min-content);
|
||||||
grid-gap: 4px 16px;
|
grid-gap: 4px 16px;
|
||||||
margin-top: 32px;
|
margin-top: 96px;
|
||||||
margin-bottom: 32px;
|
margin-bottom: 32px;
|
||||||
background-color: @bg3;
|
background-color: @bg3;
|
||||||
padding: 16px 24px;
|
padding: 16px 24px;
|
||||||
|
@ -11,6 +11,11 @@
|
|||||||
el.value = seconds
|
el.value = seconds
|
||||||
el.form.submit()
|
el.form.submit()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function enterHandler(evt) {
|
||||||
|
if (evt.key == 'Enter')
|
||||||
|
document.getElementById('form-time-selector').submit()
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
||||||
@ -19,29 +24,32 @@
|
|||||||
<input type="hidden" name="time-offset" value=0>
|
<input type="hidden" name="time-offset" value=0>
|
||||||
|
|
||||||
<div id="time-selector">
|
<div id="time-selector">
|
||||||
|
{{/* ====== Row 1 ====== */}}
|
||||||
{{/* Row 1 */}}
|
|
||||||
<div></div>
|
<div></div>
|
||||||
<div class="header" style="grid-column: 2 / 4">Date and time</div>
|
<div class="header" style="grid-column: 2 / 6">Date and time</div>
|
||||||
|
|
||||||
<div></div>
|
<div></div>
|
||||||
<div class="vertical-line" style="grid-column: 5; grid-row: 1 / 5; height: 100%"> </div>
|
<div class="vertical-line" style="grid-column: 7; grid-row: 1 / 5; height: 100%"> </div>
|
||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
<div class="header" style="grid-column: 7 / 14">Offsets</div>
|
<div class="header" style="grid-column: 9 / 16">Offsets</div>
|
||||||
|
|
||||||
<div></div>
|
<div></div>
|
||||||
<div class="vertical-line" style="grid-column: 15; grid-row: 1 / 5; height: 100%"></div>
|
<div class="vertical-line" style="grid-column: 17; grid-row: 1 / 5; height: 100%"></div>
|
||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
<div class="header" style="grid-column: 17 / 19">Presets</div>
|
<div class="header" style="grid-column: 19 / 21">Presets</div>
|
||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
|
|
||||||
{{/* Row 2 */}}
|
|
||||||
|
|
||||||
|
{{/* ====== Row 2 ====== */}}
|
||||||
<div></div>
|
<div></div>
|
||||||
<div>From</div>
|
<div>From</div>
|
||||||
<input name="time-f" value="{{ .Data.TimeFrom }}" type="datetime-local">
|
<input name="time-f" value="{{ .Data.TimeFrom }}" type="datetime-local" onkeydown="enterHandler(event)">
|
||||||
|
<div></div>
|
||||||
|
<div></div>
|
||||||
|
|
||||||
<div></div>
|
<div></div>
|
||||||
{{/* Vertical line */}}
|
{{/* Vertical line */}}
|
||||||
@ -66,10 +74,14 @@
|
|||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
|
|
||||||
{{/* Row 3 */}}
|
|
||||||
|
|
||||||
|
{{/* ====== Row 3 ====== */}}
|
||||||
<div></div>
|
<div></div>
|
||||||
<div>To</div>
|
<div>To</div>
|
||||||
<input name="time-t" value="{{ .Data.TimeTo }}" type="datetime-local">
|
<input name="time-t" value="{{ .Data.TimeTo }}" type="datetime-local" onkeydown="enterHandler(event)">
|
||||||
|
<div><img src="/images/{{ .VERSION }}/{{ .CONFIG.THEME }}/forward.svg" onclick="document.getElementById('form-time-selector').submit()"></div>
|
||||||
|
<div></div>
|
||||||
|
|
||||||
<div></div>
|
<div></div>
|
||||||
{{/* Vertical line */}}
|
{{/* Vertical line */}}
|
||||||
@ -95,57 +107,12 @@
|
|||||||
<div></div>
|
<div></div>
|
||||||
|
|
||||||
|
|
||||||
{{/* Row 4 */}}
|
|
||||||
|
|
||||||
|
{{/* ====== Row 4 ====== */}}
|
||||||
<div style="grid-column: 1 / 5; height: 8px"></div>
|
<div style="grid-column: 1 / 5; height: 8px"></div>
|
||||||
<div style="grid-column: 6 / 15; height: 8px"></div>
|
<div style="grid-column: 8 / 17; height: 8px"></div>
|
||||||
<div style="grid-column: 16 / 20; height: 8px"></div>
|
<div style="grid-column: 18 / 22; height: 8px"></div>
|
||||||
|
|
||||||
|
|
||||||
{{/*
|
|
||||||
<div>From</div>
|
|
||||||
<div>To</div>
|
|
||||||
|
|
||||||
<div></div>
|
|
||||||
<div style="background-color: #f0f;"></div>
|
|
||||||
<div></div>
|
|
||||||
|
|
||||||
<input name="time-f" value="{{ .Data.TimeFrom }}" type="datetime-local">
|
|
||||||
<input name="time-t" value="{{ .Data.TimeTo }}" type="datetime-local">
|
|
||||||
|
|
||||||
|
|
||||||
<div id="time-filter">
|
|
||||||
<div class="header-1">Presets</div>
|
|
||||||
<div class="header-2">Offsets</div>
|
|
||||||
|
|
||||||
<div class="preset"><a href="#" onclick="preset(1)">Last hour</a></div>
|
|
||||||
|
|
||||||
<div><a href="#" onclick="offsetTime(-3600)">◀</a></div>
|
|
||||||
<div>Hour</div>
|
|
||||||
<div><a href="#" onclick="offsetTime(3600)">▶</a></div>
|
|
||||||
|
|
||||||
<div class="preset"><a href="#" onclick="preset(24)">Last 24 hours</a></div>
|
|
||||||
|
|
||||||
<div><a href="#" onclick="offsetTime(-86400)">◀</a></div>
|
|
||||||
<div>Day</div>
|
|
||||||
<div><a href="#" onclick="offsetTime(86400)">▶</a></div>
|
|
||||||
|
|
||||||
<div class="preset"><a href="#" onclick="preset(24 * 7)">Last 7 days</a></div>
|
|
||||||
|
|
||||||
<div><a href="#" onclick="offsetTime(-7 * 86400)">◀</a></div>
|
|
||||||
<div>Week</div>
|
|
||||||
<div><a href="#" onclick="offsetTime(7 * 86400)">▶</a></div>
|
|
||||||
|
|
||||||
<div class="preset"><a href="#" onclick="preset(24 * 31)">Last 31 days</a></div>
|
|
||||||
<div class="preset"><a href="#" onclick="preset(24)">Last 24 hours</a></div>
|
|
||||||
<div class="preset"><a href="#" onclick="preset(24)">Last 24 hours</a></div>
|
|
||||||
|
|
||||||
<div><a href="#" onclick="offsetTime(-31 * 86400)">◀</a></div>
|
|
||||||
<div>Month</div>
|
|
||||||
<div><a href="#" onclick="offsetTime(31 * 86400)">▶</a></div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<button>OK</button>
|
|
||||||
*/}}
|
|
||||||
</div>
|
</div>
|
||||||
</form>
|
</form>
|
||||||
{{ end }}
|
{{ end }}
|
||||||
|
Loading…
Reference in New Issue
Block a user