chg: [template] more stats
parent
31b255fda5
commit
695290ec32
|
@ -332,15 +332,32 @@ func (s *SshdParser) Compile() error {
|
||||||
</style>
|
</style>
|
||||||
</head>
|
</head>
|
||||||
<body onload="loadImage({{.Current}}, currentType)">
|
<body onload="loadImage({{.Current}}, currentType)">
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<label for="statsday">Statistics for: </label>
|
<label for="statsday">Statistics for: </label>
|
||||||
<input id="statsday" type="date" value="{{.MaxDate}}" min="{{.MinDate}}" max="{{.MaxDate}}" onchange="currentDay = this.value.replace(/-/g, ''); loadImage(currentDay, currentType)"/>
|
<input id="statsday" type="date" value="{{.MaxDate}}" min="{{.MinDate}}" max="{{.MaxDate}}" onchange="currentDay = this.value.replace(/-/g, ''); loadImage(currentDay, currentType)"/>
|
||||||
|
</span>
|
||||||
|
|
||||||
|
<span>
|
||||||
<select>
|
<select>
|
||||||
{{range .YearList}}
|
<option selected value>year</option>
|
||||||
<option value="{{.}}">{{.}}</option>
|
{{range $val := .YearList}}
|
||||||
|
<option value="{{$val}}">{{$val}}</option>
|
||||||
{{end}}
|
{{end}}
|
||||||
</select>
|
</select>
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
|
<span>
|
||||||
|
<select>
|
||||||
|
<option selected value>month</option>
|
||||||
|
{{range $key, $val := .MonthList}}
|
||||||
|
{{range $month := index $val}}
|
||||||
|
<option value="{{$month}}">{{$month}}</option>
|
||||||
|
{{end}}
|
||||||
|
{{end}}
|
||||||
|
</select>
|
||||||
|
</span>
|
||||||
|
|
||||||
<span>
|
<span>
|
||||||
<label for="statstype">Type: </label>
|
<label for="statstype">Type: </label>
|
||||||
<select selected="statsusername" onchange="currentType = this.value; loadImage(currentDay.replace(/-/g, ''), currentType)">
|
<select selected="statsusername" onchange="currentType = this.value; loadImage(currentDay.replace(/-/g, ''), currentType)">
|
||||||
|
@ -448,6 +465,7 @@ func (s *SshdParser) Compile() error {
|
||||||
YearList: years,
|
YearList: years,
|
||||||
MonthList: months,
|
MonthList: months,
|
||||||
}
|
}
|
||||||
|
_ = os.Remove("statistics.html")
|
||||||
f, err := os.OpenFile("statistics.html", os.O_RDWR|os.O_CREATE, 0666)
|
f, err := os.OpenFile("statistics.html", os.O_RDWR|os.O_CREATE, 0666)
|
||||||
defer f.Close()
|
defer f.Close()
|
||||||
err = t.Execute(f, data)
|
err = t.Execute(f, data)
|
||||||
|
|
Loading…
Reference in New Issue