view individual page of logs

This commit is contained in:
mappu 2017-08-13 15:54:18 +12:00
parent 5c26ff75aa
commit 9a2a3aa12c

View File

@ -105,8 +105,18 @@ func (this *ArchiveServer) ServeHTTP(w http.ResponseWriter, r *http.Request) {
arc.renderError(w, fmt.Sprintf("Unknown source '%s'", matches[1])) arc.renderError(w, fmt.Sprintf("Unknown source '%s'", matches[1]))
} }
} else if this.rxViewPage.MatchString(r.URL.Path) { } else if matches := this.rxViewPage.FindStringSubmatch(r.URL.Path); len(matches) > 0 {
arc.renderError(w, "Not implemented.") // FIXME if ls := this.lookupSource(matches[1]); ls != nil {
arc.selectSource(ls, matches[1])
y, _ := strconv.Atoi(matches[2])
m, _ := strconv.Atoi(matches[3])
arc.ym = YearMonth{Year: y, Month: time.Month(m)} // 1-based months
arc.page, _ = strconv.Atoi(matches[4])
arc.renderView(w)
} else {
arc.renderError(w, fmt.Sprintf("Unknown source '%s'", matches[1]))
}
} else if this.rxSearch.MatchString(r.URL.Path) { } else if this.rxSearch.MatchString(r.URL.Path) {
arc.renderError(w, "Not implemented.") // FIXME arc.renderError(w, "Not implemented.") // FIXME