Authored by bblu

修改

@@ -169,44 +169,46 @@ @@ -169,44 +169,46 @@
169 }, { 169 }, {
170 text: "提交", 170 text: "提交",
171 className: "btn-success", 171 className: "btn-success",
172 - onclick: function () {  
173 - var toSendAjaxFlag = false;  
174 - var openLimitFlow = $("#open_limit_flow_a").find("input").val();  
175 - var limitConfig = [];  
176 - $("#limit_config_a").find("input").each(function () {  
177 - var config = $(this).val();  
178 - if (undefined !== config && null !== config && "" !== config) {  
179 - limitConfig.push(config);  
180 - }  
181 - });  
182 - var limitServiceConfig = [];  
183 - $("#limit_service_config_a").find("input").each(function () {  
184 - var config = $(this).val();  
185 - if (undefined !== config && null !== config && "" !== config) {  
186 - limitServiceConfig.push(config);  
187 - }  
188 - });  
189 - if (undefined === openLimitFlow || null === openLimitFlow || "" === openLimitFlow) {  
190 - prompt("提示", "限流开关不能为空!")  
191 - } else {  
192 - toSendAjaxFlag = true;  
193 - }  
194 -  
195 - if (toSendAjaxFlag) {  
196 - var param = {  
197 - openLimitFlow: openLimitFlow,  
198 - limitConfig: JSON.stringify(limitConfig),  
199 - limitServiceConfig: JSON.stringify(limitServiceConfig)  
200 - };  
201 - sendAjax("post", "viewToChangeLimitConf", param, "text", viewToChangeSuccess, errorFunc);  
202 - }  
203 - } 172 + onclick: toSubmit
204 }] 173 }]
205 }).find(".modal-body").css({ 174 }).find(".modal-body").css({
206 height: "650px" 175 height: "650px"
207 }); 176 });
208 } 177 }
209 178
  179 + function toSubmit() {
  180 + var toSendAjaxFlag = false;
  181 + var openLimitFlow = $("#open_limit_flow_a").find("input").val();
  182 + var limitConfig = [];
  183 + $("#limit_config_a").find("input").each(function () {
  184 + var config = $(this).val();
  185 + if (undefined !== config && null !== config && "" !== config) {
  186 + limitConfig.push(config);
  187 + }
  188 + });
  189 + var limitServiceConfig = [];
  190 + $("#limit_service_config_a").find("input").each(function () {
  191 + var config = $(this).val();
  192 + if (undefined !== config && null !== config && "" !== config) {
  193 + limitServiceConfig.push(config);
  194 + }
  195 + });
  196 + if (undefined === openLimitFlow || null === openLimitFlow || "" === openLimitFlow) {
  197 + prompt("提示", "限流开关不能为空!")
  198 + } else {
  199 + toSendAjaxFlag = true;
  200 + }
  201 +
  202 + if (toSendAjaxFlag) {
  203 + var param = {
  204 + openLimitFlow: openLimitFlow,
  205 + limitConfig: JSON.stringify(limitConfig),
  206 + limitServiceConfig: JSON.stringify(limitServiceConfig)
  207 + };
  208 + sendAjax("post", "viewToChangeLimitConf", param, "text", viewToChangeSuccess, errorFunc);
  209 + }
  210 + }
  211 +
210 function viewToChangeSuccess(resp) { 212 function viewToChangeSuccess(resp) {
211 $(dialog1).dialog("hide"); 213 $(dialog1).dialog("hide");
212 214