Authored by qinchao

缓存时间配置

... ... @@ -2,6 +2,7 @@ package com.ui.ctrl;
import java.util.List;
import com.ui.model.req.ZkDetailReq;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
... ... @@ -40,6 +41,14 @@ public class CacheInfoCtrl {
return httpClient.defaultPost(HttpUriContants.GET_CACHE_INFO,req,BaseResponse.class);
}
@ResponseBody
@RequestMapping("/getZkMonitorValue")
public BaseResponse getZkMonitorValue(ZkDetailReq req) {
BaseResponse response = httpClient.defaultPost(HttpUriContants.GET_RISKCTROL_ZK_DETAIL, req, BaseResponse.class);
return response;
}
@ResponseBody
@RequestMapping("/edit")
public BaseResponse<?> editCacheInfo(CacheInfoReq req) {
... ...
... ... @@ -194,74 +194,90 @@
});
function updateHystrixInfo(rowData){
paramObj.id = rowData.id;
paramObj.configName = rowData.configName;
paramObj.configValue = rowData.configValue;
paramObj.configCat = rowData.configCat;
paramObj.configDesc = rowData.configDesc;
paramObj.serverType = rowData.serverType;
var dialog0 = $("<div>").appendTo($("body"));
dialog0.dialog({
size : "modal-lg",
title : "修改路径",
backdrop : "static",
href : contextPath +"/jsp/cacheInfo/cacheInfoEdit.jsp",
buttons : [{
text : "关闭",
className : "btn-danger",
onclick : function() {
$(dialog0).dialog("hide");
}
}, {
text : "提交",
className : "btn-success",
onclick : function() {
$.ajax({
url: contextPath + "/cacheInfo/getZkMonitorValue",
type: 'POST',
data: {
ip:rowData.serverType,
zkPath:rowData.zkPath
},
dataType: 'json',
async: false,
success: function (resp) {
paramObj.id = rowData.id;
paramObj.configName = rowData.configName;
paramObj.configValue = resp.data;
paramObj.configCat = rowData.configCat;
paramObj.configDesc = rowData.configDesc;
paramObj.serverType = rowData.serverType;
var dialog0 = $("<div>").appendTo($("body"));
dialog0.dialog({
size : "modal-lg",
title : "修改路径",
backdrop : "static",
href : contextPath +"/jsp/cacheInfo/cacheInfoEdit.jsp",
buttons : [{
text : "关闭",
className : "btn-danger",
onclick : function() {
$(dialog0).dialog("hide");
}
}, {
text : "提交",
className : "btn-success",
onclick : function() {
var btn = $(this);
$(dialog0).dialog("hide");
$("#cacheInfoForm").form("submit", {
submitUrl : contextPath + "cacheInfo/edit.do",
submitData : {
id : rowData.id
},
onBeforeSubmit : function() {
if (!$(this).form("validate")) {
btn.removeAttr("disabled");
return false;
}
},
success : function(data) {
var mes="";
var title = "";
if(data.data==1){
mes="修改成功";
title = "修改成功";
}else{
title = "修改失败";
mes=data.message;
}
var btn = $(this);
$(dialog0).dialog("hide");
$("#cacheInfoForm").form("submit", {
submitUrl : contextPath + "cacheInfo/edit.do",
submitData : {
id : rowData.id
},
onBeforeSubmit : function() {
var dialog = $("<div>").appendTo($("body"));
dialog.dialog({
title :title,
backdrop : "static",
content : mes,
buttons : [{
text : "确定",
className : "btn-success",
onclick : function() {
$(dialog).dialog("hide");
$("#cacheInfoTable").table("load");
}
}]
});
$(dialog0).dialog("hide");
}
});
}
}]
});
},
error: function (e) {
alert("获取zk值异常");
}
});
if (!$(this).form("validate")) {
btn.removeAttr("disabled");
return false;
}
},
success : function(data) {
var mes="";
var title = "";
if(data.data==1){
mes="修改成功";
title = "修改成功";
}else{
title = "修改失败";
mes=data.message;
}
var dialog = $("<div>").appendTo($("body"));
dialog.dialog({
title :title,
backdrop : "static",
content : mes,
buttons : [{
text : "确定",
className : "btn-success",
onclick : function() {
$(dialog).dialog("hide");
$("#cacheInfoTable").table("load");
}
}]
});
$(dialog0).dialog("hide");
}
});
}
}]
});
}
//点击查询按钮
... ...