Authored by qinchao

nginx切换调整

... ... @@ -160,7 +160,7 @@
</div>
<div id="mytab_pane_az2" class="tab-pane">
<div class="ckbox ckbox-default" style="margin-top:30px;">
<input type="checkbox" name="az1_target_operate_nginx" id="az2_target_operate_nginx_az1" secondgroup="az1"
<input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az1" secondgroup="az1"
value="az1" />
<label for="az2_target_operate_nginx_az1">az1</label>
&nbsp;&nbsp;&nbsp;&nbsp;
... ... @@ -169,7 +169,7 @@
</div>
<div class="ckbox ckbox-default" style="margin-top:30px;">
<input type="checkbox" name="az1_target_operate_nginx" id="az2_target_operate_nginx_az2" secondgroup="az1"
<input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az2" secondgroup="az1"
value="az2" />
<label for="az2_target_operate_nginx_az2">az2</label>
&nbsp;&nbsp;&nbsp;&nbsp;
... ... @@ -178,7 +178,7 @@
</div>
<div class="ckbox ckbox-default" style="margin-top:30px;">
<input type="checkbox" name="az1_target_operate_nginx" id="az2_target_operate_nginx_az3" secondgroup="az1"
<input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az3" secondgroup="az1"
value="az3" />
<label for="az2_target_operate_nginx_az3">az3</label>
&nbsp;&nbsp;&nbsp;&nbsp;
... ... @@ -195,7 +195,7 @@
</div>
<div id="mytab_pane_az3" class="tab-pane">
<div class="ckbox ckbox-default" style="margin-top:30px;">
<input type="checkbox" name="az1_target_operate_nginx" id="az3_target_operate_nginx_az1" secondgroup="az1"
<input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az1" secondgroup="az1"
value="az1" />
<label for="az3_target_operate_nginx_az1">az1</label>
&nbsp;&nbsp;&nbsp;&nbsp;
... ... @@ -204,7 +204,7 @@
</div>
<div class="ckbox ckbox-default" style="margin-top:30px;">
<input type="checkbox" name="az1_target_operate_nginx" id="az3_target_operate_nginx_az2" secondgroup="az1"
<input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az2" secondgroup="az1"
value="az2" />
<label for="az3_target_operate_nginx_az2">az2</label>
&nbsp;&nbsp;&nbsp;&nbsp;
... ... @@ -213,7 +213,7 @@
</div>
<div class="ckbox ckbox-default" style="margin-top:30px;">
<input type="checkbox" name="az1_target_operate_nginx" id="az3_target_operate_nginx_az3" secondgroup="az1"
<input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az3" secondgroup="az1"
value="az3" />
<label for="az3_target_operate_nginx_az3">az3</label>
&nbsp;&nbsp;&nbsp;&nbsp;
... ... @@ -238,107 +238,6 @@
<!-- /row -->
</div>
</div>
<!--
<div class="form-group">
<button class="col-sm-1 btn btn-sm " disabled="disabled">
az1 area
</button>
<div class="col-sm-8" style="display: inline">
<div class="rdio rdio-default" style="display:inline;">
<input type="radio" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az1" secondgroup="az1"
value="az1" />
<label for="az1_target_operate_nginx_az1">az1</label>
</div>
<div class="rdio rdio-default" style="display:inline;margin-left:30px;">
<input type="radio" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az2" secondgroup="az1"
value="az2" />
<label for="az1_target_operate_nginx_az2">az2</label>
</div>
<div class="rdio rdio-default" style="display:inline;margin-left:30px;">
<input type="radio" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az3" secondgroup="az1"
value="az3" />
<label for="az1_target_operate_nginx_az3">az3</label>
</div>
<button class=" btn btn-sm btn-success"
style="display:inline;margin-left:30px;"
onclick="nginxInitSwitch('az1')">
<em class="icon-cogs bigger-110"></em>
切换az1
</button>
</div>
</div>
<br><br>
<div class="form-group">
<button class="col-sm-1 btn btn-sm " disabled="disabled">
az2 area
</button>
<div class="col-sm-8" style="display: inline">
<div class="rdio rdio-default" style="display:inline;">
<input type="radio" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az1" secondgroup="az2"
value="az1" />
<label for="az2_target_operate_nginx_az1">az1</label>
</div>
<div class="rdio rdio-default" style="display:inline;margin-left:30px;">
<input type="radio" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az2" secondgroup="az2"
value="az2" />
<label for="az2_target_operate_nginx_az2">az2</label>
</div>
<div class="rdio rdio-default" style="display:inline;margin-left:30px;">
<input type="radio" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az3" secondgroup="az2"
value="az3" />
<label for="az2_target_operate_nginx_az3">az3</label>
</div>
<button class=" btn btn-sm btn-success"
style="display:inline;margin-left:30px;"
onclick="nginxInitSwitch('az2')">
<em class="icon-cogs bigger-110"></em>
切换az2
</button>
</div>
</div>
<br><br>
<div class="form-group">
<button class="col-sm-1 btn btn-sm " disabled="disabled">
az3 area
</button>
<div class="col-sm-8" style="display: inline">
<div class="rdio rdio-default" style="display:inline;">
<input type="radio" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az1" secondgroup="az3"
value="az1" />
<label for="az3_target_operate_nginx_az1">az1</label>
</div>
<div class="rdio rdio-default" style="display:inline;margin-left:30px;">
<input type="radio" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az2" secondgroup="az3"
value="az2" />
<label for="az3_target_operate_nginx_az2">az2</label>
</div>
<div class="rdio rdio-default" style="display:inline;margin-left:30px;">
<input type="radio" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az3" secondgroup="az3"
value="az3" />
<label for="az3_target_operate_nginx_az3">az3</label>
</div>
<button class=" btn btn-sm btn-success"
style="display:inline;margin-left:30px;"
onclick="nginxInitSwitch('az3')">
<em class="icon-cogs bigger-110"></em>
切换az3
</button>
</div>
</div>
-->
</div>
</div>
... ... @@ -346,7 +245,7 @@
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script>
<script src="<%=basePath %>script/switch.js?v=20180529-004"></script>
<script src="<%=basePath %>script/switch.js?v=20180529-006"></script>
<script type="text/javascript">
$("#li_switch").addClass("active open");
... ...
... ... @@ -9,13 +9,13 @@ $(document).ready(function () {
*/
function drawData(resp) {
if(resp==null){
layer.msg("获取数据异常", {icon: 2});
alert("获取数据异常");
return;
}
if(200!=resp.code){
console.log(resp);
layer.msg("获取数据错误"+resp.message, {icon: 20});
alert("获取数据错误,"+resp.message);
return ;
}
var data = resp.data;
... ... @@ -230,15 +230,25 @@ function resetLbNodeIp(node,data) {
* @param onlineOrGray 切换:线上/灰度
*/
function nginxInitSwitch(cloudName) {
var radioArray= ['az1_target_operate_nginx','az2_target_operate_nginx','az3_target_operate_nginx'];
var operatorRadio=cloudName+"_target_operate_nginx";
/*var radioArray= ['az1_target_operate_nginx','az2_target_operate_nginx','az3_target_operate_nginx'];
for(var i= 0;i<radioArray.length;i++){
if(radioArray[i]!=operatorRadio){
$('input:radio[name='+radioArray[i]+']').prop("checked",false);
}
}
}*/
var target = $('input:radio[name='+operatorRadio+']:checked').val();
var target ="";
$('input:checkbox[name='+operatorRadio+']:checked').each(function () {
var inputSliderId=cloudName+"_input_slider_"+$(this).val();
var weight=$("#"+inputSliderId).slider("getValue");
if(weight>0){
if(target.length>0){
target += ",";
}
target += $(this).val()+":"+weight;
}
});
if(!target){
prompt("提示", "请选择<span style='color:red'>["+cloudName+"区]</span>目标nginx!");
... ... @@ -249,7 +259,7 @@ function nginxInitSwitch(cloudName) {
dialog.dialog({
title: "你确定切换吗",
backdrop: "static",
content: "你确定要将 " + cloudName + " 上的lb " + "流量切向 " + target + " 吗?",
content: "你确定要将 " + cloudName + " 上的lb " + "流量切向<span style='color:red'> " + target + " </span>吗?",
buttons: [{
text: "否",
className: "btn-danger",
... ... @@ -575,8 +585,8 @@ function prompt(title, content) {
backdrop: "static",
content: content,
buttons: [{
text: "确定",
className: "btn-success",
text: "关闭",
className: "btn-danger",
onclick: function () {
dialog.dialog("hide");
}
... ... @@ -641,7 +651,7 @@ function newNode(scene,x, y, w, h, text) {
node.textPosition = 'Middle_Center';// 文字居中
}else if(text!=null&&text.toLowerCase().indexOf("nginx")>=0){
node.setImage(contextPath + 'img/pstn/router2.png', true);
node.textPosition = 'Top_Center';// 文字居中
//node.textPosition = 'Top_Left';// 文字居中
}else if("az3Gateway"==text||"qqGateway"==text||"az1Gateway"==text||"az2Gateway"==text){
node.setImage(contextPath + 'img/pstn/msc.png', true);
//node.alarm = "";
... ...