/** * 日志监控的 * @author weidy * @date 2020-12-06 */ layui.define(['layer','element','form' ],function(exports){ var Class = function(){ this.MODELNAME = "platform/developer/logs/VciLogMonitor"; this.moduleKey = "VciLogMonitor"; this.id = "VciLogMonitor"; this.backPath = configData.compatibility?path:configData.adminServicePath; this.getContent=function(){ var that = this; var html = ""; html = [ '
' ].join(""); return html; }; this.init = function(){ var that = this; $webUtil.copyConfig(that,that.moduleKey); var form = layui.form; //添加表单 var formItems= [{ type:'combox', name:'serviceId', text:'选择服务名称', url:"/vciServiceController/comboxService", comboxKey:'logService' },{ type:'combox', name:'logLevel', text:'日志等级', data:[{ key:"error", value:"错误" },{ key:"info", value:"信息" },{ key:"warn", value:"警告" },{ key:"all", value:"全部" }], comboxKey:'logLevel' }]; form.addItems(that.id,formItems, function(){ },{},{defaultColumnOneRow:2,inputWidth:200}); var height = window.innerHeight; var logContent = $("#logContent_" +that.id); logContent.height(height-300); $("#"+that.id+"_query").unbind('click').click(function (e){ var values = form.getValues(that.id); $webUtil.get("/vciServiceController/getLogContent",values,function (result){ if(result.success){ logContent.html(result.obj); }else{ logContent.html(result.msg); } },function (error,xhr){ $webUtil.showErrorMsg("服务链接不上"); },that.backPath); layui.stope(e); }); $("#"+that.id+"_downloadfile").unbind('click').click(function (e){ var values = form.getValues(that.id); $webUtil.fileDownload(that.backPath + "/vciServiceController/downloadLogFile?serviceId=" + values['serviceId'] + "&logLevel=" + values['logLevel']); layui.stope(e); }); }; }; var cs = new Class(); exports(cs.MODELNAME,cs); });