UI confirm of datapoint renaming
This commit is contained in:
parent
8ef6a2bbfa
commit
96f7b50e4e
3 changed files with 73 additions and 43 deletions
|
|
@ -3,58 +3,59 @@
|
|||
|
||||
<script type="module" defer>
|
||||
import {UI} from "/js/{{ .VERSION }}/datapoint_edit.mjs"
|
||||
window._ui = new UI()
|
||||
window._ui = new UI({{ .Data.Datapoint }})
|
||||
</script>
|
||||
|
||||
{{ block "page_label" . }}{{end}}
|
||||
|
||||
<form id="form-trigger" action="/datapoint/update/{{ .Data.Datapoint.ID }}" method="post">
|
||||
<div id="widgets" class="widgets">
|
||||
<div class="label">Group</div>
|
||||
<div><input type="text" name="group" value="{{ .Data.Datapoint.Group }}"></div>
|
||||
<form id="form-trigger" action="/datapoint/update/{{ .Data.Datapoint.ID }}" method="post" onsubmit="return _ui.check_rename()">
|
||||
<div id="widgets" class="widgets">
|
||||
<div class="label">Group</div>
|
||||
<div><input type="text" name="group" value="{{ .Data.Datapoint.Group }}"></div>
|
||||
|
||||
<div class="label">Name</div>
|
||||
<div><input type="text" name="name" value="{{ .Data.Datapoint.Name }}"></div>
|
||||
|
||||
<div class="label">Datatype</div>
|
||||
<div>
|
||||
<select name="datatype">
|
||||
<option {{ if eq .Data.Datapoint.Datatype "INT" }}selected{{end}}>INT</option>
|
||||
<option {{ if eq .Data.Datapoint.Datatype "STRING" }}selected{{end}}>STRING</option>
|
||||
<option {{ if eq .Data.Datapoint.Datatype "DATETIME" }}selected{{end}}>DATETIME</option>
|
||||
</select>
|
||||
</div>
|
||||
<div class="label">Name</div>
|
||||
<div><input type="text" name="name" value="{{ .Data.Datapoint.Name }}"></div>
|
||||
|
||||
<div class="label">No data<br>problem time<br>(seconds)</div>
|
||||
<div>
|
||||
<input type="text" name="nodata_seconds" value="{{ .Data.Datapoint.NodataProblemSeconds }}">
|
||||
<div class="description">A problem is raised and notified if an entry isn't made within this time.</div>
|
||||
<div class="description">Set to 0 to disable.</div>
|
||||
</div>
|
||||
<div class="label">Datatype</div>
|
||||
<div>
|
||||
<select name="datatype">
|
||||
<option {{ if eq .Data.Datapoint.Datatype "INT" }}selected{{end}}>INT</option>
|
||||
<option {{ if eq .Data.Datapoint.Datatype "STRING" }}selected{{end}}>STRING</option>
|
||||
<option {{ if eq .Data.Datapoint.Datatype "DATETIME" }}selected{{end}}>DATETIME</option>
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div class="label">Comment</div>
|
||||
<div>
|
||||
<textarea name="comment" rows=4>{{ .Data.Datapoint.Comment }}</textarea>
|
||||
</div>
|
||||
<div class="label">No data<br>problem time<br>(seconds)</div>
|
||||
<div>
|
||||
<input type="text" name="nodata_seconds" value="{{ .Data.Datapoint.NodataProblemSeconds }}">
|
||||
<div class="description">A problem is raised and notified if an entry isn't made within this time.</div>
|
||||
<div class="description">Set to 0 to disable.</div>
|
||||
</div>
|
||||
|
||||
<div class="label">Comment</div>
|
||||
<div>
|
||||
<textarea name="comment" rows=4>{{ .Data.Datapoint.Comment }}</textarea>
|
||||
</div>
|
||||
|
||||
|
||||
<div></div>
|
||||
<div class="action">
|
||||
{{ if eq .Data.Datapoint.ID 0 }}
|
||||
<button id="button-update">Create</button>
|
||||
{{ else }}
|
||||
<button id="button-update">Update</button>
|
||||
{{ end }}
|
||||
</div>
|
||||
|
||||
<div></div>
|
||||
<div style="margin-top: 32px">
|
||||
<b>Used in the following triggers:</b>
|
||||
<ul>
|
||||
{{ range .Data.Triggers }}
|
||||
<li><a href="/trigger/edit/{{ .ID }}">{{ .Name }}</a></li>
|
||||
<div></div>
|
||||
<div class="action">
|
||||
{{ if eq .Data.Datapoint.ID 0 }}
|
||||
<button id="button-update">Create</button>
|
||||
{{ else }}
|
||||
<button id="button-update">Update</button>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div></div>
|
||||
<div style="margin-top: 32px">
|
||||
<b>Used in the following triggers:</b>
|
||||
<ul>
|
||||
{{ range .Data.Triggers }}
|
||||
<li><a href="/trigger/edit/{{ .ID }}">{{ .Name }}</a></li>
|
||||
{{ end }}
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue