|
|
@ -84,16 +84,17 @@ func WebConsole(w http.ResponseWriter, r *http.Request) { |
|
|
data.FileName = filepath.Base(realFilePath) |
|
|
data.FileName = filepath.Base(realFilePath) |
|
|
} |
|
|
} |
|
|
// add self template function
|
|
|
// add self template function
|
|
|
fmap := template.FuncMap{"b64en": util.Bas64end} |
|
|
fmap := template.FuncMap{"b64en": util.Bas64end, "hshcal": util.CalacHash} |
|
|
// 文件列表模板
|
|
|
// 文件列表模板
|
|
|
tmpl, err := template.New("console").Funcs(fmap).Parse(web.WbConsole) |
|
|
tmpl, err := template.New("console").Funcs(fmap).Parse(web.WbConsole) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
http.Error(w, err.Error(), http.StatusInternalServerError) |
|
|
// http.Error(w, err.Error(), http.StatusInternalServerError)
|
|
|
return |
|
|
return |
|
|
} |
|
|
} |
|
|
err = tmpl.Execute(w, data) |
|
|
err = tmpl.Execute(w, data) |
|
|
if err != nil { |
|
|
if err != nil { |
|
|
http.Error(w, err.Error(), http.StatusInternalServerError) |
|
|
http.Error(w, err.Error(), http.StatusInternalServerError) |
|
|
|
|
|
return |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|