12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- package main
- import (
- "fmt"
- "html/template"
- "io"
- "net/http"
- "path/filepath"
- )
- func log_autoprocess(resp http.ResponseWriter, req *http.Request) {
- sess, ok := checkLogin(resp, req)
- if !ok {
- return
- }
- //视图输出
- files := []string{
- filepath.Join(Cfg.TmplDir, "log", "autoprocess.tmpl"),
- filepath.Join(Cfg.TmplDir, "header.tmpl"),
- filepath.Join(Cfg.TmplDir, "navbar.tmpl"),
- }
- tmpl, err := template.New("autoprocess.tmpl").Funcs(TmplFuncMap).ParseFiles(files...)
- if err != nil {
- io.WriteString(resp, fmt.Sprintf("Error: %s\n", err.Error()))
- } else {
- tmpl.Execute(resp, struct {
- Sess *Session
- Req *http.Request
- Title string
- }{
- sess,
- req,
- "Redis扩容日志",
- })
- }
- }
- func log_autoprocess_list(resp http.ResponseWriter, req *http.Request) {
- _, ok := checkLogin(resp, req)
- if !ok {
- return
- }
- }
|