app payload特征配置的l3_header配置增加属性,并且必须输入十六进制字符串,后台转为偏移表达式的字符串配置

This commit is contained in:
zhangwei
2018-12-22 20:34:57 +06:00
parent 347ec045d3
commit 8ff231208a
10 changed files with 504 additions and 28 deletions

View File

@@ -8,6 +8,41 @@ $(function(){
$(".action").on("change", function() {
$("#serviceId").val($(this).attr("serviceId"));
});
$(".district").on("change", function() {
if($(this).val()=='L3_header'){
$(this).parents(".boxSolid").find(".keywords").addClass("hidden");
$(this).parents(".boxSolid").find(".L3_header").removeClass("hidden");
$(this).parents(".boxSolid").find(".matchMethod").addClass("hidden");
$(this).parents(".boxSolid").find(".exprType").addClass("hidden");
$(this).parents(".boxSolid").find("input:radio[name$='isHex'][value=1]").prop("checked",true);
$(this).parents(".boxSolid").find("input:radio[name$='isCaseSenstive'][value=0]").prop("checked",true);
$(this).parents(".boxSolid").find("input:radio[name$='isHex']").attr("disabled",true);
$(this).parents(".boxSolid").find("input:radio[name$='isCaseSenstive']").attr("disabled",true);
$(this).parents(".boxSolid").find(".headerType").change();
}else{
$(this).parents(".boxSolid").find(".keywords").removeClass("hidden");
$(this).parents(".boxSolid").find(".L3_header").addClass("hidden");
$(this).parents(".boxSolid").find(".matchMethod").removeClass("hidden");
$(this).parents(".boxSolid").find(".exprType").removeClass("hidden");
$(this).parents(".boxSolid").find(".IP_header").addClass("hidden");
$(this).parents(".boxSolid").find(".ICMP_header").addClass("hidden");
$(this).parents(".boxSolid").find("input:radio[name$='isHex']").attr("disabled",false);
$(this).parents(".boxSolid").find("input:radio[name$='isCaseSenstive']").attr("disabled",false);
}
});
$(".headerType").on("change", function() {
if($(this).val()=='IP_header'){
$(this).parents(".boxSolid").find(".ICMP_header").addClass("hidden");
$(this).parents(".boxSolid").find(".IP_header").removeClass("hidden");
}else{
$(this).parents(".boxSolid").find(".IP_header").addClass("hidden");
$(this).parents(".boxSolid").find(".ICMP_header").removeClass("hidden");
}
});
$(".boxSolid:visible").find(".district").each(function(){
$(this).change();
});
$("#serviceId").val($(".action:checked").attr("serviceId"));
$("#cfgFrom").validate({
errorPlacement: function(error,element){
@@ -25,21 +60,35 @@ $(function(){
return;
}
$(".boxSolid:visible").find("input[name$='cfgKeywords']").each(function(){
if($(this).val()==''){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
var length = 0;
$(this).parents(".boxSolid").find(".l3_header_prop").each(function(){
if($(this).val()!=''){
length += 1;
}
})
if(length==0){
$(this).parents(".form-group").find(
"div[for='"
+ $(this).attr("name")
+ "']").html("<label id=\"cfgKeywordsError\" class=\"error\">"+$("#keywordError").text()+"</label>");
flag = false;
}else if(length>4){
$(this).parents(".boxSolid").find(
"div[class='l3_header_tips']").html("<label id=\"l3_header_error\" class=\"error\">"+$("#l3_header_error").text()+"</label>");
flag = false;
}
}
})
});
//keywords非空校验完成校验二进制字符串
$(".boxSolid:visible").find("select[name$='isHexbin']").each(function(){
var isHexbin=$(this).val();
if(isHexbin == 1){ //十六进制
var keywords=$("input[name$='"+$(this).attr("name").replace("isHexbin","cfgKeywords")+"']").val();
keywords=keywords.replace("***and***","")
if(keywords != ''){
keywords=keywords.replace("***and***","");
if(keywords != ''){
if(!(/^([0-9|a-f|A-F]*)$/.test(keywords))){
$(this).parents(".boxSolid").find(
"div[for='"
@@ -109,6 +158,8 @@ var delContent = function(contentClassName, addBtnClassName) {
code="required"></spring:message></span>
<span id="tagsinputTip" style="display:none"><spring:message
code="multiple_keywords_tip"></spring:message></span>
<span id="l3_header_error" style="display:none"><spring:message
code="l3_header_error"></spring:message></span>
<div class="page-content">
<c:forEach items="${serviceList}" var="service">
<c:if test="${cfg.functionId eq service.functionId}">
@@ -143,6 +194,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<input type="hidden" id="appCode" name="appCode" value="${_cfg.appCode}">
<input type="hidden" id="behavCode" name="behavCode" value="${_cfg.behavCode}">
<input type="hidden" id="doLog" name="doLog" value="2">
<c:set var="serviceId" value="${_cfg.serviceId}" />
<!-- 配置域类型 -->
<div class="form-body">
<div class="row">
@@ -191,6 +243,7 @@ var delContent = function(contentClassName, addBtnClassName) {
<spring:message code="${dict.itemValue }" />
</c:if>
</c:forEach>
<c:set var="serviceId" value="${service.serviceId}" />
</c:if>
</label>
</c:forEach>