|
@@ -13,7 +13,6 @@ import (
|
|
|
mu "mfw/util"
|
|
|
"net"
|
|
|
"net/http"
|
|
|
- "qfw/common/src/qfw/util"
|
|
|
qu "qfw/util"
|
|
|
"qfw/util/mongodb"
|
|
|
"regexp"
|
|
@@ -50,7 +49,7 @@ func main() {
|
|
|
writer.WriteHeader(http.StatusOK)
|
|
|
})
|
|
|
mux.HandleFunc("/login", func(writer http.ResponseWriter, request *http.Request) {
|
|
|
- tp, err := template.ParseFiles("web/login.html")
|
|
|
+ tp, err := template.ParseFiles("src/web/login.html")
|
|
|
if err != nil {
|
|
|
log.Println(err)
|
|
|
writer.Write([]byte( "页面找不到了~"))
|
|
@@ -70,7 +69,7 @@ func main() {
|
|
|
email := request.Form.Get("username")
|
|
|
pwd := request.Form.Get("pwd")
|
|
|
if email == "ocr_task" && pwd == "ocr_task_pwd" {
|
|
|
- http.SetCookie(writer, &http.Cookie{Name: "username", Value: util.GetMd5String("email")})
|
|
|
+ http.SetCookie(writer, &http.Cookie{Name: "username", Value: qu.GetMd5String("email")})
|
|
|
http.Redirect(writer, request, "/query", http.StatusFound)
|
|
|
} else {
|
|
|
writer.WriteHeader(http.StatusUnauthorized)
|
|
@@ -80,10 +79,10 @@ func main() {
|
|
|
}
|
|
|
|
|
|
})
|
|
|
- res := http.FileServer(http.Dir("res"))
|
|
|
+ res := http.FileServer(http.Dir("src/res"))
|
|
|
mux.Handle("/res/", http.StripPrefix("/res/", res))
|
|
|
mux.HandleFunc("/query", func(writer http.ResponseWriter, request *http.Request) {
|
|
|
- tplogin, err := template.ParseFiles("web/login.html")
|
|
|
+ tplogin, err := template.ParseFiles("src/web/login.html")
|
|
|
if err != nil {
|
|
|
log.Println(err)
|
|
|
writer.Write([]byte( "页面找不到了~"))
|
|
@@ -100,7 +99,7 @@ func main() {
|
|
|
tplogin.Execute(writer, "密钥错误")
|
|
|
return
|
|
|
}
|
|
|
- tp, err := template.ParseFiles("web/index.html", "public/header.html")
|
|
|
+ tp, err := template.ParseFiles("src/web/index.html", "src/public/header.html")
|
|
|
if err != nil {
|
|
|
log.Println(err)
|
|
|
writer.Write([]byte( "页面找不到了~"))
|
|
@@ -110,7 +109,7 @@ func main() {
|
|
|
tp.Execute(writer, task)
|
|
|
})
|
|
|
mux.HandleFunc("/reload", func(writer http.ResponseWriter, request *http.Request) {
|
|
|
- tplogin, err := template.ParseFiles("web/login.html")
|
|
|
+ tplogin, err := template.ParseFiles("src/web/login.html")
|
|
|
if err != nil {
|
|
|
log.Println(err)
|
|
|
writer.Write([]byte( "页面找不到了~"))
|
|
@@ -122,7 +121,7 @@ func main() {
|
|
|
tplogin.Execute(writer, "请先登录")
|
|
|
return
|
|
|
}
|
|
|
- tpReload, err := template.ParseFiles("web/reload.html")
|
|
|
+ tpReload, err := template.ParseFiles("src/web/reload.html")
|
|
|
if err != nil {
|
|
|
log.Println(err)
|
|
|
writer.Write([]byte( "页面找不到了~"))
|
|
@@ -335,11 +334,10 @@ func DynamicTask(auto *bool) {
|
|
|
DynamicTask(auto)
|
|
|
} else {
|
|
|
if DoCMD(tmpip) {
|
|
|
- var isok bool
|
|
|
var tmpstr string
|
|
|
- isok2, udpstr := cluster.SshPgrep(tmpip, "pgrep udp2019", isok)
|
|
|
+ isok2, udpstr := cluster.SshPgrep(tmpip, "pgrep udp2019")
|
|
|
tmpstr += udpstr + "; "
|
|
|
- isok3, fil2textstr := cluster.SshPgrep(tmpip, "pgrep file2text", isok2)
|
|
|
+ isok3, fil2textstr := cluster.SshPgrep(tmpip, "pgrep file2text")
|
|
|
tmpstr += fil2textstr
|
|
|
if isok2 && isok3 {
|
|
|
(*escObject)[i]["OcrTaskStatus"] = "successful"
|
|
@@ -389,11 +387,10 @@ func reload(ip string) string {
|
|
|
tmpip = qu.ObjToString((*escObject)[0]["ip_nw"])
|
|
|
}
|
|
|
if DoCMD(tmpip) {
|
|
|
- var isok bool
|
|
|
var tmpstr string
|
|
|
- isok2, udpstr := cluster.SshPgrep(tmpip, "pgrep udp2019", isok)
|
|
|
+ isok2, udpstr := cluster.SshPgrep(tmpip, "pgrep udp2019")
|
|
|
tmpstr += udpstr + "; "
|
|
|
- isok3, fil2textstr := cluster.SshPgrep(tmpip, "pgrep file2text", isok2)
|
|
|
+ isok3, fil2textstr := cluster.SshPgrep(tmpip, "pgrep file2text")
|
|
|
tmpstr += fil2textstr
|
|
|
if isok2 && isok3 {
|
|
|
(*escObject)[0]["OcrTaskStatus"] = "successful"
|