Added timefilter to problems
This commit is contained in:
parent
9700bc9d3c
commit
f7dcb4a079
4 changed files with 62 additions and 62 deletions
|
|
@ -7,56 +7,20 @@
|
|||
|
||||
{{ block "page_label" . }}{{end}}
|
||||
|
||||
<form action="/datapoint/values/{{ .Data.Datapoint.ID }}" method="get" style="margin-top: -16px">
|
||||
<input type="hidden" name="preset" value="">
|
||||
<input type="hidden" name="offset-time" value=0>
|
||||
<div style="margin-bottom: 16px">
|
||||
<input onchange="selectDisplay('graph')" name="display" type="radio" id="display-graph" {{ if $graph }} checked {{ end}}> <label for="display-graph">Graph</label>
|
||||
<input onchange="selectDisplay('list')" name="display" type="radio" id="display-list" {{ if not $graph }} checked {{ end }}> <label for="display-list">List</label>
|
||||
</div>
|
||||
|
||||
{{ if eq .Data.Datapoint.Datatype "INT" }}
|
||||
<div>
|
||||
<input name="display" value="graph" type="radio" id="display-graph" {{ if $graph }} checked {{ end}}> <label for="display-graph">Graph</label>
|
||||
<input name="display" value="list" type="radio" id="display-list" {{ if not $graph }} checked {{ end }}> <label for="display-list">List</label>
|
||||
</div>
|
||||
{{ end }}
|
||||
{{ block "timefilter" . }}{{ end }}
|
||||
|
||||
<div class="value-selector">
|
||||
<div>Values from</div>
|
||||
<div>Values to</div>
|
||||
|
||||
<input name="f" type="datetime-local" step="1" value="{{ .Data.TimeFrom }}">
|
||||
<input name="t" type="datetime-local" step="1" value="{{ .Data.TimeTo }}">
|
||||
|
||||
<div class="time-offset">
|
||||
<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><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>
|
||||
|
||||
</form>
|
||||
<script type="text/javascript">
|
||||
const inputDisplay = document.createElement('input')
|
||||
inputDisplay.id = 'input-display'
|
||||
inputDisplay.name = 'display'
|
||||
inputDisplay.type = 'hidden'
|
||||
document.getElementById('form-time-selector').append(inputDisplay);
|
||||
</script>
|
||||
|
||||
{{ if $graph }}
|
||||
<div class="graph">
|
||||
|
|
@ -72,7 +36,6 @@
|
|||
{{ .Data.Datapoint.ID }},
|
||||
{{ .Data.Values }},
|
||||
)
|
||||
|
||||
</script>
|
||||
{{ else }}
|
||||
<div id="values">
|
||||
|
|
|
|||
|
|
@ -8,13 +8,15 @@
|
|||
</script>
|
||||
<link rel="stylesheet" type="text/css" href="/css/{{ .VERSION }}/{{ .CONFIG.THEME }}/problems.css">
|
||||
|
||||
{{ block "page_label" . }}{{end}}
|
||||
{{ block "page_label" . }}{{ end }}
|
||||
|
||||
<div>
|
||||
<div style="margin-bottom: 16px">
|
||||
<input type="radio" name="display" id="display-table" onclick="_ui.displayAreas()"> <label for="display-table">Areas</label>
|
||||
<input type="radio" name="display" id="display-list" onclick="_ui.displayList()"> <label for="display-list">List</label>
|
||||
</div>
|
||||
|
||||
{{ block "timefilter" . }}{{ end }}
|
||||
|
||||
<div class="display-list hidden">
|
||||
<div id="problems-list">
|
||||
<div style="grid-column: 1/-1;"><h2>Current</h2></div>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue