1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- package main
- import (
- "fmt"
- "html/template"
- "io"
- "net/http"
- "path/filepath"
- )
- func syscfg_misc(resp http.ResponseWriter, req *http.Request) {
- sess, ok := checkLogin(resp, req)
- if !ok {
- return
- }
- //视图输出
- files := []string{
- filepath.Join(Cfg.TmplDir, "syscfg", "misc.tmpl"),
- filepath.Join(Cfg.TmplDir, "header.tmpl"),
- filepath.Join(Cfg.TmplDir, "navbar.tmpl"),
- }
- tmpl, err := template.New("misc.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,
- "其它配置",
- })
- }
- }
- func syscfg_misc_get(resp http.ResponseWriter, req *http.Request) {
- _, ok := checkLogin(resp, req)
- if !ok {
- return
- }
- }
- func syscfg_misc_set(resp http.ResponseWriter, req *http.Request) {
- _, ok := checkLogin(resp, req)
- if !ok {
- return
- }
- }
|