syscfg_misc.go 947 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. package main
  2. import (
  3. "fmt"
  4. "html/template"
  5. "io"
  6. "net/http"
  7. "path/filepath"
  8. )
  9. func syscfg_misc(resp http.ResponseWriter, req *http.Request) {
  10. sess, ok := checkLogin(resp, req)
  11. if !ok {
  12. return
  13. }
  14. //视图输出
  15. files := []string{
  16. filepath.Join(Cfg.TmplDir, "syscfg", "misc.tmpl"),
  17. filepath.Join(Cfg.TmplDir, "header.tmpl"),
  18. filepath.Join(Cfg.TmplDir, "navbar.tmpl"),
  19. }
  20. tmpl, err := template.New("misc.tmpl").Funcs(TmplFuncMap).ParseFiles(files...)
  21. if err != nil {
  22. io.WriteString(resp, fmt.Sprintf("Error: %s\n", err.Error()))
  23. } else {
  24. tmpl.Execute(resp, struct {
  25. Sess *Session
  26. Req *http.Request
  27. Title string
  28. }{
  29. sess,
  30. req,
  31. "其它配置",
  32. })
  33. }
  34. }
  35. func syscfg_misc_get(resp http.ResponseWriter, req *http.Request) {
  36. _, ok := checkLogin(resp, req)
  37. if !ok {
  38. return
  39. }
  40. }
  41. func syscfg_misc_set(resp http.ResponseWriter, req *http.Request) {
  42. _, ok := checkLogin(resp, req)
  43. if !ok {
  44. return
  45. }
  46. }