@@ -332,22 +332,39 @@ func (s *SshdParser) Compile() error {
332
332
</style>
333
333
</head>
334
334
<body onload="loadImage({{.Current}}, currentType)">
335
+
335
336
<span>
336
337
<label for="statsday">Statistics for: </label>
337
338
<input id="statsday" type="date" value="{{.MaxDate}}" min="{{.MinDate}}" max="{{.MaxDate}}" onchange="currentDay = this.value.replace(/-/g, ''); loadImage(currentDay, currentType)"/>
338
- <select>
339
- {{range .YearList}}
340
- <option value="{{.}}">{{.}}</option>
339
+ </span>
340
+
341
+ <span>
342
+ <select>
343
+ <option selected value>year</option>
344
+ {{range $val := .YearList}}
345
+ <option value="{{$val}}">{{$val}}</option>
341
346
{{end}}
342
- </select>
347
+ </select>
343
348
</span>
349
+
350
+ <span>
351
+ <select>
352
+ <option selected value>month</option>
353
+ {{range $key, $val := .MonthList}}
354
+ {{range $month := index $val}}
355
+ <option value="{{$month}}">{{$month}}</option>
356
+ {{end}}
357
+ {{end}}
358
+ </select>
359
+ </span>
360
+
344
361
<span>
345
- <label for="statstype">Type: </label>
346
- <select selected="statsusername" onchange="currentType = this.value; loadImage(currentDay.replace(/-/g, ''), currentType)">
347
- <option value="statsusername">Usernames</option>
348
- <option value="statssrc">Sources</option>
349
- <option value="statshost">Hosts</option>
350
- </select>
362
+ <label for="statstype">Type: </label>
363
+ <select selected="statsusername" onchange="currentType = this.value; loadImage(currentDay.replace(/-/g, ''), currentType)">
364
+ <option value="statsusername">Usernames</option>
365
+ <option value="statssrc">Sources</option>
366
+ <option value="statshost">Hosts</option>
367
+ </select>
351
368
</span>
352
369
<div id="imageholder"></div>
353
370
</body>
@@ -448,6 +465,7 @@ func (s *SshdParser) Compile() error {
448
465
YearList : years ,
449
466
MonthList : months ,
450
467
}
468
+ _ = os .Remove ("statistics.html" )
451
469
f , err := os .OpenFile ("statistics.html" , os .O_RDWR | os .O_CREATE , 0666 )
452
470
defer f .Close ()
453
471
err = t .Execute (f , data )
0 commit comments