maxiaoshan 2 lat temu
rodzic
commit
56fc763ec0

+ 14 - 5
src/front/spider.go

@@ -406,7 +406,13 @@ func (f *Front) SaveStep() {
 			param["spiderhistorymaxpage"] = f.OtherBase.SpiderHistoryMaxPage
 			qu.Debug(f.OtherBase.SpiderMoveEvent)
 			tmpEvent, err := strconv.Atoi(f.OtherBase.SpiderMoveEvent) //f.OtherBase.SpiderMoveEvent此处SpiderMoveEvent已不表示comm、bid,表示增量的节点
-			if f.OtherBase.SpiderType == "history" {                   //爬虫类型是history的放到7000节点,并记录历史节点
+			checkLua := false
+			msg := "保存成功"
+			checkMsg := ""
+			if f.OtherBase.SpiderType == "history" { //爬虫类型是history的放到7000节点,并记录历史节点
+				if f.OtherBase.SpiderHistoryMaxPage > 500 { //新爬虫跑历史超过500页提醒新建复制爬虫
+					msg += "提醒,历史页过大,考虑复制爬虫!"
+				}
 				param["event"] = 7000
 				if err == nil {
 					param["incrementevent"] = tmpEvent //开发人员切换增量节点
@@ -429,8 +435,8 @@ func (f *Front) SaveStep() {
 			param["iscopycontent"] = f.StepRe3.Checked
 			//
 			param["listisfilter"] = ListFilterReg.MatchString(f.Step2.Expert) //列表页校验是否含“--关键词过滤”
-			matchLua, msg := LuaTextCheck(f.Base.SpiderCode, f.Step2.Expert, f.Step3.Expert, f.Step2.Types, infoformat, model)
-			if !matchLua {
+			checkLua, checkMsg = LuaTextCheck(f.Base.SpiderCode, f.Step2.Expert, f.Step3.Expert, f.Step2.Types, infoformat, model)
+			if !checkLua {
 				issave := spider.SaveSpider(code, param) //保存脚本
 				if issave {
 					for k, v := range *one {
@@ -439,12 +445,15 @@ func (f *Front) SaveStep() {
 						}
 					}
 					Wlog(f.Base.SpiderName, f.Base.SpiderCode, user, f.GetSession("userid").(string), "修改", param)
-					rep["msg"] = "保存成功"
+					rep["msg"] = msg + checkMsg
+					rep["ok"] = true
 				} else {
 					rep["msg"] = "保存失败"
+					rep["ok"] = false
 				}
 			} else {
-				rep["msg"] = "保存失败," + msg
+				rep["msg"] = "保存失败," + checkMsg
+				rep["ok"] = false
 			}
 			rep["code"] = util.Se.Encode2Hex(code)
 			f.ServeJson(rep)

+ 1 - 1
src/taskManager/taskManager.go

@@ -1142,7 +1142,7 @@ func (t *TaskM) SearchDataInfo() {
 		text := ""
 		if coll == "spider_warn" {
 			info := (*data)["data"].(map[string]interface{})
-			publishtime := qu.Int64All(info["publishtime"])
+			publishtime := qu.Int64All(info["l_np_publishtime"])
 			publishtime_str := qu.FormatDateByInt64(&publishtime, qu.Date_Full_Layout)
 			text = "publishtime:" + publishtime_str + "\ntitle:" + qu.ObjToString((*data)["title"]) + ";\ndetail:" + qu.ObjToString(info["detail"])
 		} else {

+ 2 - 1
src/web/staticres/js/common.js

@@ -420,7 +420,8 @@ common.spider.save_unnew=function(){
 		data:all,
 		async : false,
 		success:function(r){
-			if(r["msg"]=="保存成功"){
+			if (r["ok"]){
+				showMsg(r["msg"],function(){});
 				issave = true;
 				common.spider.saveTip("保存成功");
 				if(window.location.pathname=="/center/spider"){