(1)common.js中action change的代码移除
(2)initCommIpVal的调用改到common.js中
This commit is contained in:
@@ -5,7 +5,10 @@
|
|||||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
|
$(".action").on("change", function() {
|
||||||
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#cfgFrom").validate({
|
$("#cfgFrom").validate({
|
||||||
errorPlacement: function(error,element){
|
errorPlacement: function(error,element){
|
||||||
|
|||||||
@@ -199,7 +199,7 @@ var delContent = function(contentClassName, addBtnClassName) {
|
|||||||
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
|
<label class="control-label col-md-3"><font color="red">*</font><spring:message code="social_app"/></label>
|
||||||
<div class="col-md-6">
|
<div class="col-md-6">
|
||||||
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
|
<sys:treeselect id="specServiceId" name="specServiceId" value="${_cfg.specServiceId}"
|
||||||
labelName="parent.specServiceName"
|
labelName="parent.specServiceName" notAllowSelectParent="true"
|
||||||
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
|
labelValue="${empty _cfg.specServiceId?spec_service_id:fns:getBySpecServiceId(_cfg.specServiceId).specServiceName}"
|
||||||
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
|
title="${spec_service_id}" url="/specific/specificServiceCfg/treeData?isLeafShow=false&cfgType=${app}" extId="0"
|
||||||
notAllowSelectRoot="true" cssClass="form-control required"/>
|
notAllowSelectRoot="true" cssClass="form-control required"/>
|
||||||
|
|||||||
@@ -5,7 +5,10 @@
|
|||||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
initCommIpVal();
|
$(".action").on("change", function() {
|
||||||
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate({
|
$("#cfgFrom").validate({
|
||||||
|
|||||||
@@ -5,7 +5,11 @@
|
|||||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
|
$(".action").on("change", function() {
|
||||||
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate({
|
$("#cfgFrom").validate({
|
||||||
|
|||||||
@@ -13,14 +13,13 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
initCommIpVal();
|
|
||||||
/* $("#cancel").on("click", function() {
|
/* $("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});*/
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
}); */
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate(
|
$("#cfgFrom").validate(
|
||||||
|
|||||||
@@ -9,7 +9,245 @@ $(function(){
|
|||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
}
|
}
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
|
var serviceType=$("input[name='cfgRegionCode']").attr("serviceType");
|
||||||
|
if(serviceType){
|
||||||
|
if(serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']:checked").val()==32){
|
||||||
|
$("select[name$='protocol'] option").each(function(){
|
||||||
|
if($(this).attr("value")==1){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='protocol']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
if(serviceType&&serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']").val()==32){
|
||||||
|
$("select[name$='protocol'] option").each(function(){
|
||||||
|
if($(this).attr("value")==1){
|
||||||
|
$(this).removeAttr("disabled");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='protocol']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
if(serviceType.indexOf("ipmulitiplex")>-1){
|
||||||
|
$(".ipmulitiplex").removeClass("hidden");
|
||||||
|
$("input[name$='isAreaEffective']").each(function(){
|
||||||
|
if($(this).val()==0){
|
||||||
|
$(this).click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
$(".areaInfo").addClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(".areaInfo").removeClass("hidden");
|
||||||
|
$(".ipmulitiplex").addClass("hidden");
|
||||||
|
}
|
||||||
|
if(serviceType.indexOf("ratelimit")>-1){
|
||||||
|
if($("input[name$='action']").val()==64||$("input[name$='action']:checked").val()==64){
|
||||||
|
$(".ratelimit").removeClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(".ratelimit").addClass("hidden");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$(".ratelimit").addClass("hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
$(".action").on("change", function() {
|
||||||
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
|
var actionCode=$(this).val();
|
||||||
|
var regionCode=$(this).attr("regionCode");
|
||||||
|
if(!regionCode){
|
||||||
|
regionCode=$("input[name='action']").attr("regionCode");
|
||||||
|
}
|
||||||
|
if(regionCode){
|
||||||
|
if(regionCode.indexOf(",")==-1){
|
||||||
|
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
|
||||||
|
$("#cfgType"+regionCode).attr("name","cfgType");
|
||||||
|
$("[id^='cfgRegionCode']").each(function(){
|
||||||
|
if($(this).attr("id")==("cfgRegionCode"+regionCode)){
|
||||||
|
$(this).attr("name","cfgRegionCode");
|
||||||
|
}else{
|
||||||
|
$(this).removeAttr("name");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("[id^='cfgType']").each(function(){
|
||||||
|
if($(this).attr("id")==("cfgType"+regionCode)){
|
||||||
|
$(this).attr("name","cfgType");
|
||||||
|
}else{
|
||||||
|
$(this).removeAttr("name");
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}else{
|
||||||
|
var _region='';
|
||||||
|
var regionArr=regionCode.split(',');
|
||||||
|
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
|
||||||
|
for(var re in regionArr){
|
||||||
|
if($(this).val()==regionArr[re]){
|
||||||
|
serviceType=$(this).attr("serviceType");
|
||||||
|
_region=regionArr[re];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
if(_region!=''){
|
||||||
|
regionCode=_region;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
var ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
|
||||||
|
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
|
||||||
|
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
|
||||||
|
portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
|
||||||
|
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
|
||||||
|
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
|
||||||
|
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
|
||||||
|
//ip,端口处理
|
||||||
|
if(ipPortShow){
|
||||||
|
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
|
||||||
|
$("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
|
||||||
|
$("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
|
||||||
|
}else{
|
||||||
|
$("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
|
||||||
|
$("input[name$='srcPort']").parents(".form-group").addClass("hidden");
|
||||||
|
}
|
||||||
|
if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口
|
||||||
|
$("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
|
||||||
|
$("input[name$='destPort']").parents(".form-group").removeClass("hidden");
|
||||||
|
}else{
|
||||||
|
$("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
|
||||||
|
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(ipType){
|
||||||
|
var arr=ipType.split(',');
|
||||||
|
$("select[name$='ipType'] option").each(function(){
|
||||||
|
var has=false;
|
||||||
|
for(var type in arr){
|
||||||
|
if($(this).val()==arr[type]){
|
||||||
|
has=true;
|
||||||
|
if($(this).attr("disabled")){
|
||||||
|
$(this).removeAttr("disabled")
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!has){
|
||||||
|
$(this).attr("disabled",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='ipType']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
if(ipPattern){
|
||||||
|
arr=ipPattern.split(',');
|
||||||
|
$("select[name$='ipPattern'] option").each(function(){
|
||||||
|
var has=false;
|
||||||
|
for(var type in arr){
|
||||||
|
if($(this).val()==arr[type]){
|
||||||
|
has=true;
|
||||||
|
if($(this).attr("disabled")){
|
||||||
|
$(this).removeAttr("disabled")
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!has){
|
||||||
|
$(this).attr("disabled",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='ipPattern']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
if(portPattern){
|
||||||
|
arr=portPattern.split(',');
|
||||||
|
$("select[name$='portPattern'] option").each(function(){
|
||||||
|
var has=false;
|
||||||
|
for(var type in arr){
|
||||||
|
if($(this).val()==arr[type]){
|
||||||
|
has=true;
|
||||||
|
if($(this).attr("disabled")){
|
||||||
|
$(this).removeAttr("disabled")
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!has){
|
||||||
|
$(this).attr("disabled",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='portPattern']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
if(direction){
|
||||||
|
arr=direction.split(',');
|
||||||
|
$("select[name$='direction'] option").each(function(){
|
||||||
|
var has=false;
|
||||||
|
for(var type in arr){
|
||||||
|
if($(this).val()==arr[type]){
|
||||||
|
has=true;
|
||||||
|
if($(this).attr("disabled")){
|
||||||
|
$(this).removeAttr("disabled")
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!has){
|
||||||
|
$(this).attr("disabled",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='direction']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
|
||||||
|
if(protocol){
|
||||||
|
arr=protocol.split(',');
|
||||||
|
$("select[name$='protocol'] option").each(function(){
|
||||||
|
var has=false;
|
||||||
|
for(var type in arr){
|
||||||
|
if($(this).val()==arr[type]){
|
||||||
|
has=true;
|
||||||
|
if($(this).attr("disabled")){
|
||||||
|
$(this).removeAttr("disabled")
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!has){
|
||||||
|
$(this).attr("disabled",true);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
$("select[name$='protocol']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
|
||||||
|
//处理自定义字段
|
||||||
|
var serviceType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("serviceType");
|
||||||
|
if(serviceType){
|
||||||
|
if(serviceType.indexOf("ipaddr")>-1){
|
||||||
|
if($(this).val()==32){
|
||||||
|
$("select[name$='protocol'] option[value='1']").removeAttr("disabled")
|
||||||
|
}else{
|
||||||
|
$("select[name$='protocol'] option[value='1']").attr("disabled",true);
|
||||||
|
}
|
||||||
|
$("select[name$='protocol']").selectpicker("refresh");
|
||||||
|
}
|
||||||
|
if(serviceType.indexOf("ipmulitiplex")>-1){
|
||||||
|
$(".ipmulitiplex").removeClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(".ipmulitiplex").addClass("hidden");
|
||||||
|
}
|
||||||
|
if(serviceType.indexOf("ratelimit")>-1){
|
||||||
|
if($(this).val()==64){
|
||||||
|
$(".ratelimit").removeClass("hidden");
|
||||||
|
}else{
|
||||||
|
$(".ratelimit").addClass("hidden");
|
||||||
|
}
|
||||||
|
}else{
|
||||||
|
$(".ratelimit").addClass("hidden");
|
||||||
|
}
|
||||||
|
if($(this).val()==0x20||$(this).val()==0x60){
|
||||||
|
$("input[name$='isAreaEffective']").each(function(){
|
||||||
|
if($(this).val()==0){
|
||||||
|
$(this).click();
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
$("#ipCfgFrom").validate({
|
$("#ipCfgFrom").validate({
|
||||||
errorPlacement: function(error,element){
|
errorPlacement: function(error,element){
|
||||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||||
|
|||||||
@@ -5,14 +5,14 @@
|
|||||||
<title><spring:message code="${cfgName}"></spring:message></title>
|
<title><spring:message code="${cfgName}"></spring:message></title>
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
/* $("#cancel").on("click",function(){
|
/* $("#cancel").on("click",function(){
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});*/
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
}); */
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate({
|
$("#cfgFrom").validate({
|
||||||
|
|||||||
@@ -13,14 +13,14 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
/* $("#cancel").on("click", function() {
|
/* $("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});*/
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
}); */
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate(
|
$("#cfgFrom").validate(
|
||||||
|
|||||||
@@ -13,14 +13,14 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
initCommIpVal();
|
/*initCommIpVal();
|
||||||
/* $("#cancel").on("click", function() {
|
/* $("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});*/
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
}); */
|
});
|
||||||
$("#fileInfo").on('click',function(){
|
$("#fileInfo").on('click',function(){
|
||||||
$("#file").trigger("click");
|
$("#file").trigger("click");
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -13,14 +13,14 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
/* $("#cancel").on("click", function() {
|
/* $("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});*/
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
}); */
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
|
|
||||||
|
|||||||
@@ -19,6 +19,8 @@
|
|||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
|
var action=$("input[name='action']:checked").val();
|
||||||
|
switchAction(action);
|
||||||
});
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
|
|||||||
@@ -13,14 +13,14 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
initCommIpVal();
|
//initCommIpVal();
|
||||||
//$("#cancel").on("click", function() {
|
//$("#cancel").on("click", function() {
|
||||||
// window.history.back();
|
// window.history.back();
|
||||||
//});
|
//});
|
||||||
//$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
// $("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
// $("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
//});
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
if($("#cfgId").val()!=""){
|
if($("#cfgId").val()!=""){
|
||||||
|
|||||||
@@ -13,14 +13,14 @@
|
|||||||
$(document)
|
$(document)
|
||||||
.ready(
|
.ready(
|
||||||
function() {
|
function() {
|
||||||
initCommIpVal();
|
/*initCommIpVal();
|
||||||
/* $("#cancel").on("click", function() {
|
$("#cancel").on("click", function() {
|
||||||
window.history.back();
|
window.history.back();
|
||||||
});
|
});*/
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
}); */
|
});
|
||||||
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
$("#serviceId").val($(".action:checked").attr("serviceId"));
|
||||||
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
$("#protocolId").val($(".action:checked").attr("protocolId"));
|
||||||
$("#cfgFrom").validate(
|
$("#cfgFrom").validate(
|
||||||
|
|||||||
@@ -6,7 +6,9 @@
|
|||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
$(function(){
|
$(function(){
|
||||||
switchIpInfo($("select[name$='ipType']"),"ipType");
|
switchIpInfo($("select[name$='ipType']"),"ipType");
|
||||||
initCommIpVal();
|
$(".action").on("change",function(){
|
||||||
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
|
});
|
||||||
$("#ipCfgFrom").validate({
|
$("#ipCfgFrom").validate({
|
||||||
errorPlacement: function(error,element){
|
errorPlacement: function(error,element){
|
||||||
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
$(element).parents(".form-group").find("div[for='"+element.attr("name")+"']").append(error);
|
||||||
|
|||||||
@@ -358,219 +358,8 @@ $(function(){
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
$(".action").on("change", function() {
|
$(".action").on("change", function() {
|
||||||
//DNS REJECT 时选择dnsStrategyId
|
|
||||||
var action=$("input[name='action']:checked").val();
|
|
||||||
switchAction(action);
|
|
||||||
|
|
||||||
//拦截根据action切换动作部分
|
|
||||||
setInterceptDefaultInfo("");
|
|
||||||
|
|
||||||
//dolog 白名单默认不显示,不记录日志
|
|
||||||
if(action == 128 || action == 32){
|
|
||||||
$(".doLog").addClass("hidden");
|
|
||||||
$("input[name='doLog'][value=0]").prop("checked",true);
|
|
||||||
}else{
|
|
||||||
$(".doLog").removeClass("hidden");
|
|
||||||
$("input[name='doLog'][value=2]").prop("checked",true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$("#serviceId").val($(this).attr("serviceId"));
|
$("#serviceId").val($(this).attr("serviceId"));
|
||||||
$("#protocolId").val($(this).attr("protocolId"));
|
$("#protocolId").val($(this).attr("protocolId"));
|
||||||
var actionCode=$(this).val();
|
|
||||||
var regionCode=$(this).attr("regionCode");
|
|
||||||
if(!regionCode){
|
|
||||||
regionCode=$("input[name='action']").attr("regionCode");
|
|
||||||
}
|
|
||||||
if(regionCode){
|
|
||||||
if(regionCode.indexOf(",")==-1){
|
|
||||||
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
|
|
||||||
$("#cfgType"+regionCode).attr("name","cfgType");
|
|
||||||
$("[id^='cfgRegionCode']").each(function(){
|
|
||||||
if($(this).attr("id")==("cfgRegionCode"+regionCode)){
|
|
||||||
$(this).attr("name","cfgRegionCode");
|
|
||||||
}else{
|
|
||||||
$(this).removeAttr("name");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("[id^='cfgType']").each(function(){
|
|
||||||
if($(this).attr("id")==("cfgType"+regionCode)){
|
|
||||||
$(this).attr("name","cfgType");
|
|
||||||
}else{
|
|
||||||
$(this).removeAttr("name");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}else{
|
|
||||||
var _region='';
|
|
||||||
var regionArr=regionCode.split(',');
|
|
||||||
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
|
|
||||||
for(var re in regionArr){
|
|
||||||
if($(this).val()==regionArr[re]){
|
|
||||||
serviceType=$(this).attr("serviceType");
|
|
||||||
_region=regionArr[re];
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
if(_region!=''){
|
|
||||||
regionCode=_region;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
var ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
|
|
||||||
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
|
|
||||||
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
|
|
||||||
portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
|
|
||||||
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
|
|
||||||
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
|
|
||||||
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
|
|
||||||
//ip,端口处理
|
|
||||||
if(ipPortShow){
|
|
||||||
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
|
|
||||||
$("input[name$='srcIpAddress']").parents(".form-group").removeClass("hidden");
|
|
||||||
$("input[name$='srcPort']").parents(".form-group").removeClass("hidden");
|
|
||||||
}else{
|
|
||||||
$("input[name$='srcIpAddress']").parents(".form-group").addClass("hidden");
|
|
||||||
$("input[name$='srcPort']").parents(".form-group").addClass("hidden");
|
|
||||||
}
|
|
||||||
if(ipPortShow.indexOf('2')>-1){//展示目的IP,端口
|
|
||||||
$("input[name$='destIpAddress']").parents(".form-group").removeClass("hidden");
|
|
||||||
$("input[name$='destPort']").parents(".form-group").removeClass("hidden");
|
|
||||||
}else{
|
|
||||||
$("input[name$='destIpAddress']").parents(".form-group").addClass("hidden");
|
|
||||||
$("input[name$='destPort']").parents(".form-group").addClass("hidden");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(ipType){
|
|
||||||
var arr=ipType.split(',');
|
|
||||||
$("select[name$='ipType'] option").each(function(){
|
|
||||||
var has=false;
|
|
||||||
for(var type in arr){
|
|
||||||
if($(this).val()==arr[type]){
|
|
||||||
has=true;
|
|
||||||
if($(this).attr("disabled")){
|
|
||||||
$(this).removeAttr("disabled")
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!has){
|
|
||||||
$(this).attr("disabled",true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='ipType']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
if(ipPattern){
|
|
||||||
arr=ipPattern.split(',');
|
|
||||||
$("select[name$='ipPattern'] option").each(function(){
|
|
||||||
var has=false;
|
|
||||||
for(var type in arr){
|
|
||||||
if($(this).val()==arr[type]){
|
|
||||||
has=true;
|
|
||||||
if($(this).attr("disabled")){
|
|
||||||
$(this).removeAttr("disabled")
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!has){
|
|
||||||
$(this).attr("disabled",true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='ipPattern']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
if(portPattern){
|
|
||||||
arr=portPattern.split(',');
|
|
||||||
$("select[name$='portPattern'] option").each(function(){
|
|
||||||
var has=false;
|
|
||||||
for(var type in arr){
|
|
||||||
if($(this).val()==arr[type]){
|
|
||||||
has=true;
|
|
||||||
if($(this).attr("disabled")){
|
|
||||||
$(this).removeAttr("disabled")
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!has){
|
|
||||||
$(this).attr("disabled",true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='portPattern']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
if(direction){
|
|
||||||
arr=direction.split(',');
|
|
||||||
$("select[name$='direction'] option").each(function(){
|
|
||||||
var has=false;
|
|
||||||
for(var type in arr){
|
|
||||||
if($(this).val()==arr[type]){
|
|
||||||
has=true;
|
|
||||||
if($(this).attr("disabled")){
|
|
||||||
$(this).removeAttr("disabled")
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!has){
|
|
||||||
$(this).attr("disabled",true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='direction']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
|
|
||||||
if(protocol){
|
|
||||||
arr=protocol.split(',');
|
|
||||||
$("select[name$='protocol'] option").each(function(){
|
|
||||||
var has=false;
|
|
||||||
for(var type in arr){
|
|
||||||
if($(this).val()==arr[type]){
|
|
||||||
has=true;
|
|
||||||
if($(this).attr("disabled")){
|
|
||||||
$(this).removeAttr("disabled")
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if(!has){
|
|
||||||
$(this).attr("disabled",true);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='protocol']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
|
|
||||||
//处理自定义字段
|
|
||||||
var serviceType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("serviceType");
|
|
||||||
if(serviceType){
|
|
||||||
if(serviceType.indexOf("ipaddr")>-1){
|
|
||||||
if($(this).val()==32){
|
|
||||||
$("select[name$='protocol'] option[value='1']").removeAttr("disabled")
|
|
||||||
}else{
|
|
||||||
$("select[name$='protocol'] option[value='1']").attr("disabled",true);
|
|
||||||
}
|
|
||||||
$("select[name$='protocol']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
if(serviceType.indexOf("ipmulitiplex")>-1){
|
|
||||||
$(".ipmulitiplex").removeClass("hidden");
|
|
||||||
}else{
|
|
||||||
$(".ipmulitiplex").addClass("hidden");
|
|
||||||
}
|
|
||||||
if(serviceType.indexOf("ratelimit")>-1){
|
|
||||||
if($(this).val()==64){
|
|
||||||
$(".ratelimit").removeClass("hidden");
|
|
||||||
}else{
|
|
||||||
$(".ratelimit").addClass("hidden");
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$(".ratelimit").addClass("hidden");
|
|
||||||
}
|
|
||||||
if($(this).val()==0x20||$(this).val()==0x60){
|
|
||||||
$("input[name$='isAreaEffective']").each(function(){
|
|
||||||
if($(this).val()==0){
|
|
||||||
$(this).click();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
});
|
||||||
//选择hex cfgkeywords需校验十六进制
|
//选择hex cfgkeywords需校验十六进制
|
||||||
$("select[name$='isHexbin']").each(function(){
|
$("select[name$='isHexbin']").each(function(){
|
||||||
@@ -642,6 +431,7 @@ $(function(){
|
|||||||
window.history.back();
|
window.history.back();
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
initCommIpVal();
|
||||||
});
|
});
|
||||||
window.onload=function(){
|
window.onload=function(){
|
||||||
//日志查询IP类型增加格式提示
|
//日志查询IP类型增加格式提示
|
||||||
@@ -1486,14 +1276,12 @@ var initCommIpVal=function(){
|
|||||||
if(regionCode.indexOf(",")==-1){
|
if(regionCode.indexOf(",")==-1){
|
||||||
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
|
$("#cfgRegionCode"+regionCode).attr("name","cfgRegionCode");
|
||||||
$("#cfgType"+regionCode).attr("name","cfgType");
|
$("#cfgType"+regionCode).attr("name","cfgType");
|
||||||
serviceType=$("input[name$='cfgRegionCode'][regionType='1'][value='"+regionCode+"']").attr("serviceType");
|
|
||||||
}else{
|
}else{
|
||||||
var _region='';
|
var _region='';
|
||||||
var regionArr=regionCode.split(',');
|
var regionArr=regionCode.split(',');
|
||||||
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
|
$("input[name$='cfgRegionCode'][regionType='1']").each(function(){
|
||||||
for(var re in regionArr){
|
for(var re in regionArr){
|
||||||
if($(this).val()==regionArr[re]){
|
if($(this).val()==regionArr[re]){
|
||||||
serviceType=$(this).attr("serviceType");
|
|
||||||
_region=regionArr[re];
|
_region=regionArr[re];
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1504,52 +1292,13 @@ var initCommIpVal=function(){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(serviceType){
|
ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
|
||||||
if(serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']:checked").val()==32){
|
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
|
||||||
$("select[name$='protocol'] option").each(function(){
|
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
|
||||||
if($(this).attr("value")==1){
|
portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
|
||||||
$(this).removeAttr("disabled");
|
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
|
||||||
}
|
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
|
||||||
});
|
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
|
||||||
$("select[name$='protocol']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
if(serviceType&&serviceType.indexOf("ipaddr")>-1&&$("input[name$='action']").val()==32){
|
|
||||||
$("select[name$='protocol'] option").each(function(){
|
|
||||||
if($(this).attr("value")==1){
|
|
||||||
$(this).removeAttr("disabled");
|
|
||||||
}
|
|
||||||
});
|
|
||||||
$("select[name$='protocol']").selectpicker("refresh");
|
|
||||||
}
|
|
||||||
if(serviceType.indexOf("ipmulitiplex")>-1){
|
|
||||||
$(".ipmulitiplex").removeClass("hidden");
|
|
||||||
$("input[name$='isAreaEffective']").each(function(){
|
|
||||||
if($(this).val()==0){
|
|
||||||
$(this).click();
|
|
||||||
}
|
|
||||||
})
|
|
||||||
$(".areaInfo").addClass("hidden");
|
|
||||||
}else{
|
|
||||||
$(".areaInfo").removeClass("hidden");
|
|
||||||
$(".ipmulitiplex").addClass("hidden");
|
|
||||||
}
|
|
||||||
if(serviceType.indexOf("ratelimit")>-1){
|
|
||||||
if($("input[name$='action']").val()==64||$("input[name$='action']:checked").val()==64){
|
|
||||||
$(".ratelimit").removeClass("hidden");
|
|
||||||
}else{
|
|
||||||
$(".ratelimit").addClass("hidden");
|
|
||||||
}
|
|
||||||
}else{
|
|
||||||
$(".ratelimit").addClass("hidden");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
ipPortShow=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPortShow"),
|
|
||||||
ipType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipType"),
|
|
||||||
ipPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("ipPattern"),
|
|
||||||
portPattern=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("portPattern"),
|
|
||||||
direction=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("direction"),
|
|
||||||
protocol=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("protocol"),
|
|
||||||
regionType=$("input[name$='cfgRegionCode'][value='"+regionCode+"']").attr("regionType");
|
|
||||||
//ip,端口处理
|
//ip,端口处理
|
||||||
if(ipPortShow){
|
if(ipPortShow){
|
||||||
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
|
if(ipPortShow.indexOf('1')>-1){//展示源IP,端口
|
||||||
|
|||||||
Reference in New Issue
Block a user