196 lines
4.9 KiB
HTML
196 lines
4.9 KiB
HTML
|
|
-------------------------------------------------------------------------------
|
|
-- Insert
|
|
-------------------------------------------------------------------------------
|
|
|
|
{{define "SourceInsert" -}}
|
|
{{template "PageStart"}}
|
|
|
|
<h1 class="breadcrumbs">
|
|
<a href="/source/list">Sources</a> / Insert
|
|
</h1>
|
|
|
|
<section>
|
|
<form method="POST">
|
|
<input type="hidden" name="CSRF" value="{{.CSRF}}">
|
|
|
|
<ul class="form-list">
|
|
<li>
|
|
<label for="Name">Name:</label>
|
|
<input type="text" id="Name" name="Name" required>
|
|
</li>
|
|
<li>
|
|
<label for="Description">Description</label>
|
|
<textarea id="Description" name="Description" rows=8></textarea>
|
|
</li>
|
|
<li>
|
|
<label for="AlertTimeout">Alert Timeout:</label>
|
|
<input type="number" id="AlertTimeout" name="AlertTimeout">
|
|
</li>
|
|
<li>
|
|
<label for="LogAction">Log Action:</label>
|
|
<input type="text" id="LogAction" name="LogAction">
|
|
</li>
|
|
<li>
|
|
<label for="AlertAction">Alert Action:</label>
|
|
<input type="text" id="AlertAction" name="AlertAction">
|
|
</li>
|
|
<li>
|
|
<input type="submit" value="Insert">
|
|
</li>
|
|
</form>
|
|
</section>
|
|
|
|
{{template "PageEnd"}}
|
|
{{- end}}
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- List
|
|
-------------------------------------------------------------------------------
|
|
|
|
{{define "SourceList" -}}
|
|
{{template "PageStart"}}
|
|
|
|
<h1 class="breadcrumbs">Sources</h1>
|
|
|
|
<ul class="section-menu">
|
|
<li><a href="/source/insert">Insert</a></li>
|
|
</ul>
|
|
|
|
<section>
|
|
<ul class="user-list">
|
|
{{range . -}}
|
|
<li>
|
|
<a href="/source/view/{{.SourceID}}">
|
|
{{.Name}} {{if .TimedOut}}✖{{end}}
|
|
</a>
|
|
</li>
|
|
{{- end}}
|
|
</ul>
|
|
</section>
|
|
|
|
{{template "PageEnd"}}
|
|
{{- end}}
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- View
|
|
-------------------------------------------------------------------------------
|
|
|
|
{{define "SourceView" -}}
|
|
{{template "PageStart"}}
|
|
|
|
<h1 class="breadcrumbs">
|
|
<a href="/source/list">Sources</a> / {{.Name}}
|
|
</h1>
|
|
|
|
<ul class="section-menu">
|
|
<li><a href="/source/update/{{.SourceID}}">Update</a></li>
|
|
<li><a href="/source/delete/{{.SourceID}}">Delete</a></li>
|
|
</ul>
|
|
|
|
<section>
|
|
<dl>
|
|
<dt>API Key</dt>
|
|
<dd>{{.APIKey}}</dd>
|
|
|
|
<dt>Description</dt>
|
|
<dd class="multiline">{{.Description}}</dd>
|
|
|
|
<dt>Last Seen</dt>
|
|
<dd>{{.LastSeenAt.Format "2006-01-02 15:04"}}</dd>
|
|
|
|
<dt>Alert Timeout (sec)</dt>
|
|
<dd>{{.AlertTimeout}}</dd>
|
|
|
|
<dt>Alerted At</dt>
|
|
<dd>{{.AlertedAt.Format "2006-01-02 15:04"}}</dd>
|
|
|
|
<dt>Log Action</dt>
|
|
<dd>{{.LogAction}}</dd>
|
|
|
|
<dt>Alert Action</dt>
|
|
<dd>{{.AlertAction}}</dd>
|
|
</dl>
|
|
</section>
|
|
|
|
{{template "PageEnd"}}
|
|
{{- end}}
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Update
|
|
-------------------------------------------------------------------------------
|
|
|
|
{{define "SourceUpdate" -}}
|
|
{{template "PageStart"}}
|
|
|
|
<h1 class="breadcrumbs">
|
|
<a href="/source/list">Sources</a> /
|
|
<a href="/source/view/{{.Source.SourceID}}">{{.Source.Name}}</a> /
|
|
Update
|
|
</h1>
|
|
|
|
<section>
|
|
<form method="POST">
|
|
<input type="hidden" name="CSRF" value="{{.CSRF}}">
|
|
<input type="hidden" name="SourceID" value="{{.Source.SourceID}}">
|
|
|
|
<ul class="form-list">
|
|
<li>
|
|
<label for="APIKey">API Key:</label>
|
|
<input type="text" id="APIKey" name="APIKey" value="{{.Source.APIKey}}">
|
|
</li>
|
|
<li>
|
|
<label for="Description">Description</label>
|
|
<textarea id="Description" name="Description" rows=8>
|
|
{{- .Source.Description -}}
|
|
</textarea>
|
|
</li>
|
|
<li>
|
|
<label for="AlertTimeout">Alert Timeout:</label>
|
|
<input type="number" id="AlertTimeout" name="AlertTimeout" value="{{.Source.AlertTimeout}}">
|
|
</li>
|
|
<li>
|
|
<label for="LogAction">Log Action:</label>
|
|
<input type="text" id="LogAction" name="LogAction" value="{{.Source.LogAction}}">
|
|
</li>
|
|
<li>
|
|
<label for="AlertAction">Alert Action:</label>
|
|
<input type="text" id="AlertAction" name="AlertAction" value="{{.Source.AlertAction}}">
|
|
</li>
|
|
<li>
|
|
<input type="submit" value="Update">
|
|
</li>
|
|
</form>
|
|
</section>
|
|
|
|
{{template "PageEnd"}}
|
|
{{- end}}
|
|
|
|
-------------------------------------------------------------------------------
|
|
-- Delete
|
|
-------------------------------------------------------------------------------
|
|
|
|
{{define "SourceDelete" -}}
|
|
{{template "PageStart"}}
|
|
|
|
<h1 class="breadcrumbs">
|
|
<a href="/source/list">Sources</a> /
|
|
<a href="/source/view/{{.Source.SourceID}}">{{.Source.Name}}</a> /
|
|
Delete
|
|
</h1>
|
|
|
|
<section>
|
|
<p>Really delete source {{.Source.Name}}?</p>
|
|
<form method="POST">
|
|
<input type="hidden" name="CSRF" value="{{.CSRF}}">
|
|
<ul class="form-list">
|
|
<li>
|
|
<input type="submit" value="Delete">
|
|
</li>
|
|
</ul>
|
|
</form>
|
|
</section>
|
|
|
|
{{template "PageEnd"}}
|
|
{{- end}}
|