package am
var tmpls = `
{{define "PageStart" -}}
am
{{end}}
{{define "PageEnd" -}}
{{- end}}
{{define "Error" -}}
{{template "PageStart"}}
Error
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- List
-------------------------------------------------------------------------------
{{define "LogList" -}}
{{template "PageStart"}}
Log
{{if .Args.BeforeID}}
Back
{{end}}
Time |
|
Source |
Text |
{{range .Entries}}
{{.TS.Format "2006-01-02 15:04"}}
|
{{if .Alert}}!{{end}} |
{{.SourceName}} |
{{.Text}} |
{{end}}
{{if .NextURL}}
More
{{end}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- Insert
-------------------------------------------------------------------------------
{{define "SourceInsert" -}}
{{template "PageStart"}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- List
-------------------------------------------------------------------------------
{{define "SourceList" -}}
{{template "PageStart"}}
Sources
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- View
-------------------------------------------------------------------------------
{{define "SourceView" -}}
{{template "PageStart"}}
- API Key
- {{.APIKey}}
- Description
- {{.Description}}
- Last Seen
- {{.LastSeenAt.Format "2006-01-02 15:04"}}
- Alert Timeout (sec)
- {{.AlertTimeout}}
- Alerted At
- {{.AlertedAt.Format "2006-01-02 15:04"}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- Update
-------------------------------------------------------------------------------
{{define "SourceUpdate" -}}
{{template "PageStart"}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- Delete
-------------------------------------------------------------------------------
{{define "SourceDelete" -}}
{{template "PageStart"}}
Really delete source {{.Source.Name}}?
{{template "PageEnd"}}
{{- end}}
{{define "CSS"}}
/*********
* Links *
*********/
a {
text-decoration: none;
color: #444;
}
/************
* Top Menu *
************/
.top-menu {
list-style-type: none;
margin: 0;
padding: 0;
overflow: hidden;
border-bottom: 1px solid #999999;
}
.top-menu li {
float: left;
}
.top-menu li a {
display: block;
text-align: center;
padding: 14px 16px;
}
/****************
* Section Menu *
****************/
.section-menu {
list-style-type: none;
padding: 0;
overflow: hidden;
}
.section-menu li {
float: left;
border: 1px solid #999999;
margin-right: 8px;
}
.section-menu li a {
display: block;
text-align: center;
padding: 8px 12px;
}
/***********
* Section *
***********/
section {
padding-left: 40px;
}
/********************
* Definition Lists *
********************/
dt {
font-weight: bold;
margin: 8px 0;
max-width: 400px;
}
dd {
margin: 0 0 0 32px;
padding: 8px 0 8px 16px;
min-height: 20px;
max-width: 480px;
border-left: 1px solid #999999;
}
.multiline {
white-space: pre-wrap;
}
/*********
* Table *
*********/
table {
border-collapse: collapse;
width: 100%;
}
th, td {
padding: 8px;
text-align: left;
white-space: nowrap;
}
tr:nth-child(even){
background-color: #f8f8f8;
}
/*********
* Forms *
*********/
.form-list {
max-width: 400px;
padding: 0;
}
.form-list li {
display: block;
list-style: none;
margin: 10px 0 0 0;
}
.form-list label{
margin:0 0 4px 0;
padding:0px;
display:block;
}
.form-list input,.form-list textarea,.form-liat select{
padding: 8px;
margin: 0px;
width: 100%;
box-sizing: border-box;
}
.form-list input[type=checkbox] {
padding: 8px;
margin: 0px;
width: auto;
}
.form-list input + label {
display: inline;
}
.form-list input[type=submit] {
padding: 8px;
margin: 0px;
width: auto;
background: none;
border: 1px solid #999999;
color: #444;
padding: 8px 12px;
}
/*************
* User List *
*************/
.user-list {
list-style: none;
padding: 0;
}
.user-list li {
}
.user-list li a {
margin: 6px 0;
display: block;
}
{{end}}
-------------------------------------------------------------------------------
-- Insert
-------------------------------------------------------------------------------
{{define "UserInsert" -}}
{{template "PageStart"}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- List
-------------------------------------------------------------------------------
{{define "UserList" -}}
{{template "PageStart"}}
Users
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- View
-------------------------------------------------------------------------------
{{define "UserView" -}}
{{template "PageStart"}}
Users / {{.Username}}
- Admin
- {{if .Admin}}True{{else}}False{{end}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- Update
-------------------------------------------------------------------------------
{{define "UserUpdate" -}}
{{template "PageStart"}}
{{template "PageEnd"}}
{{- end}}
-------------------------------------------------------------------------------
-- Delete
-------------------------------------------------------------------------------
{{define "UserDelete" -}}
{{template "PageStart"}}
Really delete user {{.User.Username}}?
{{template "PageEnd"}}
{{- end}}
`