增加配置保护名单管理功能.

This commit is contained in:
zhangwenqing
2019-03-27 18:05:18 +08:00
parent b7a64234f8
commit 08dd0f3868
15 changed files with 838 additions and 20 deletions

View File

@@ -1,11 +1,5 @@
$(function(){
var protectedList = [".com"];
$(".domainCheck").each(function(){
$(this).on("blur",function(){
protectedListWarn(this,$(this).val(),protectedList);
});
protectedListWarn(this,$(this).val(),protectedList);
});
// var leff =$("span[class~='le-ca-fo']").attr("data-original-title")
// getConfigSyncStatus();
$("#contentTable").not(".logTb").find("tbody tr").each(function(i){
@@ -33,8 +27,33 @@ $(function(){
}
})
/** 获取配置保护名单 **/
var protectionData;
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
$.ajax({
type:'get',
url:pathName+'/basics/innerProtectionList/ajaxGetAllInfo',
dataType:"json",
async:false,
success:function(data){
if(data != null){
protectionData = data;
for(var key in data){
var list = data[key];
$("."+key).each(function(){
if(!$(this).hasClass("tags")){
this.setAttribute("onblur","protectedListWarn(this,'"+list+"')");
}
protectedListWarn(this,list);
});
}
}
}
});
//增加描述新增时的文字长度限制
$("form input[name='cfgDesc']").attr("maxlength","128");
$("form input[name='cfgDesc']").addClass("required");
@@ -436,8 +455,12 @@ $(function(){
});
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
exprTypeChecked(objNamePrefix,size,options);
if($(this).hasClass("urlCheck")){
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
var tagObj = $(this);
for(var key in protectionData){
if(tagObj.hasClass(key)){
protectedListWarn(tagObj,protectionData[key]);
}
}
},
onRemoveTag:function(tag,size){
@@ -449,8 +472,12 @@ $(function(){
});
$(this).prev("input[name$='cfgKeywords']").val(keywordValue);*/
exprTypeChecked(objNamePrefix,size,options);
if($(this).hasClass("urlCheck")){
protectedListWarn($("#"+$(this).attr("id")+"_tagsinput"),$(this).val(),protectedList);
var tagObj = $(this);
for(var key in protectionData){
if(tagObj.hasClass(key)){
protectedListWarn(tagObj,protectionData[key]);
}
}
}
});
@@ -1719,9 +1746,11 @@ function addPrintTableCss(rowValue,cellValue,tableIdValue,cssName){
}
}
/**保护名单提醒**/
function protectedListWarn(obj,value,protectedList){
function protectedListWarn(obj,protectedList){
$(obj).next(".fa-warning").remove();
if(value !=null){
var value = $(obj).val();
if(value != ""){
protectedList = typeof(protectedList) == 'string' ? protectedList.split(",") : protectedList;
if(protectedList.indexOf(value) >= 0){
//$(obj).after("<i class='fa fa-warning font-red-flamingo'>"+$.validator.messages.protect_warn+"</i>");
$.jBox.info($.validator.messages.protect_warn,$.validator.messages.info);