Authored by qinchao

优化显示

@@ -125,33 +125,36 @@ @@ -125,33 +125,36 @@
125 <div class="tab-content"> 125 <div class="tab-content">
126 <div id="mytab_pane_az1" class="tab-pane in active"> 126 <div id="mytab_pane_az1" class="tab-pane in active">
127 <div class="ckbox ckbox-default" style="margin-top:30px;"> 127 <div class="ckbox ckbox-default" style="margin-top:30px;">
128 - <input type="checkbox" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az1" secondgroup="az1" 128 + <%--<input type="checkbox" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az1" secondgroup="az1"
129 value="az1" /> 129 value="az1" />
130 - <label for="az1_target_operate_nginx_az1">az1</label> 130 + <label for="az1_target_operate_nginx_az1">az1</label>--%>
  131 + az1
131 &nbsp;&nbsp;&nbsp;&nbsp; 132 &nbsp;&nbsp;&nbsp;&nbsp;
132 <input id="az1_input_slider_az1" class="slider" type="text" 133 <input id="az1_input_slider_az1" class="slider" type="text"
133 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 134 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
134 </div> 135 </div>
135 136
136 <div class="ckbox ckbox-default" style="margin-top:30px;"> 137 <div class="ckbox ckbox-default" style="margin-top:30px;">
137 - <input type="checkbox" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az2" secondgroup="az1" 138 + <%--<input type="checkbox" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az2" secondgroup="az1"
138 value="az2" /> 139 value="az2" />
139 - <label for="az1_target_operate_nginx_az2">az2</label> 140 + <label for="az1_target_operate_nginx_az2">az2</label>--%>
  141 + az2
140 &nbsp;&nbsp;&nbsp;&nbsp; 142 &nbsp;&nbsp;&nbsp;&nbsp;
141 <input id="az1_input_slider_az2" class="slider" type="text" 143 <input id="az1_input_slider_az2" class="slider" type="text"
142 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 144 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
143 </div> 145 </div>
144 146
145 <div class="ckbox ckbox-default" style="margin-top:30px;"> 147 <div class="ckbox ckbox-default" style="margin-top:30px;">
146 - <input type="checkbox" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az3" secondgroup="az1" 148 + <%--<input type="checkbox" name="az1_target_operate_nginx" id="az1_target_operate_nginx_az3" secondgroup="az1"
147 value="az3" /> 149 value="az3" />
148 - <label for="az1_target_operate_nginx_az3">az3</label> 150 + <label for="az1_target_operate_nginx_az3">az3</label>--%>
  151 + az3
149 &nbsp;&nbsp;&nbsp;&nbsp; 152 &nbsp;&nbsp;&nbsp;&nbsp;
150 <input id="az1_input_slider_az3" class="slider" type="text" 153 <input id="az1_input_slider_az3" class="slider" type="text"
151 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 154 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
152 </div> 155 </div>
153 156
154 - <button class=" btn btn-sm btn-success" 157 + <button class=" btn btn-sm btn-danger"
155 style="display:inline;margin-left:30px;margin-top:20px;" 158 style="display:inline;margin-left:30px;margin-top:20px;"
156 onclick="nginxInitSwitch('az1')"> 159 onclick="nginxInitSwitch('az1')">
157 <em class="icon-cogs bigger-110"></em> 160 <em class="icon-cogs bigger-110"></em>
@@ -160,33 +163,36 @@ @@ -160,33 +163,36 @@
160 </div> 163 </div>
161 <div id="mytab_pane_az2" class="tab-pane"> 164 <div id="mytab_pane_az2" class="tab-pane">
162 <div class="ckbox ckbox-default" style="margin-top:30px;"> 165 <div class="ckbox ckbox-default" style="margin-top:30px;">
163 - <input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az1" secondgroup="az1" 166 + <%--<input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az1" secondgroup="az1"
164 value="az1" /> 167 value="az1" />
165 - <label for="az2_target_operate_nginx_az1">az1</label> 168 + <label for="az2_target_operate_nginx_az1">az1</label>--%>
  169 + az1
166 &nbsp;&nbsp;&nbsp;&nbsp; 170 &nbsp;&nbsp;&nbsp;&nbsp;
167 <input id="az2_input_slider_az1" class="slider" type="text" 171 <input id="az2_input_slider_az1" class="slider" type="text"
168 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 172 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
169 </div> 173 </div>
170 174
171 <div class="ckbox ckbox-default" style="margin-top:30px;"> 175 <div class="ckbox ckbox-default" style="margin-top:30px;">
172 - <input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az2" secondgroup="az1" 176 + <%--<input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az2" secondgroup="az1"
173 value="az2" /> 177 value="az2" />
174 - <label for="az2_target_operate_nginx_az2">az2</label> 178 + <label for="az2_target_operate_nginx_az2">az2</label>--%>
  179 + az2
175 &nbsp;&nbsp;&nbsp;&nbsp; 180 &nbsp;&nbsp;&nbsp;&nbsp;
176 <input id="az2_input_slider_az2" class="slider" type="text" 181 <input id="az2_input_slider_az2" class="slider" type="text"
177 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 182 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
178 </div> 183 </div>
179 184
180 <div class="ckbox ckbox-default" style="margin-top:30px;"> 185 <div class="ckbox ckbox-default" style="margin-top:30px;">
181 - <input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az3" secondgroup="az1" 186 + <%--<input type="checkbox" name="az2_target_operate_nginx" id="az2_target_operate_nginx_az3" secondgroup="az1"
182 value="az3" /> 187 value="az3" />
183 - <label for="az2_target_operate_nginx_az3">az3</label> 188 + <label for="az2_target_operate_nginx_az3">az3</label>--%>
  189 + az3
184 &nbsp;&nbsp;&nbsp;&nbsp; 190 &nbsp;&nbsp;&nbsp;&nbsp;
185 <input id="az2_input_slider_az3" class="slider" type="text" 191 <input id="az2_input_slider_az3" class="slider" type="text"
186 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 192 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
187 </div> 193 </div>
188 194
189 - <button class=" btn btn-sm btn-success" 195 + <button class=" btn btn-sm btn-danger"
190 style="display:inline;margin-left:30px;margin-top:20px;" 196 style="display:inline;margin-left:30px;margin-top:20px;"
191 onclick="nginxInitSwitch('az2')"> 197 onclick="nginxInitSwitch('az2')">
192 <em class="icon-cogs bigger-110"></em> 198 <em class="icon-cogs bigger-110"></em>
@@ -195,33 +201,36 @@ @@ -195,33 +201,36 @@
195 </div> 201 </div>
196 <div id="mytab_pane_az3" class="tab-pane"> 202 <div id="mytab_pane_az3" class="tab-pane">
197 <div class="ckbox ckbox-default" style="margin-top:30px;"> 203 <div class="ckbox ckbox-default" style="margin-top:30px;">
198 - <input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az1" secondgroup="az1" 204 + <%--<input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az1" secondgroup="az1"
199 value="az1" /> 205 value="az1" />
200 - <label for="az3_target_operate_nginx_az1">az1</label> 206 + <label for="az3_target_operate_nginx_az1">az1</label>--%>
  207 + az1
201 &nbsp;&nbsp;&nbsp;&nbsp; 208 &nbsp;&nbsp;&nbsp;&nbsp;
202 <input id="az3_input_slider_az1" class="slider" type="text" 209 <input id="az3_input_slider_az1" class="slider" type="text"
203 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 210 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
204 </div> 211 </div>
205 212
206 <div class="ckbox ckbox-default" style="margin-top:30px;"> 213 <div class="ckbox ckbox-default" style="margin-top:30px;">
207 - <input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az2" secondgroup="az1" 214 + <%--<input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az2" secondgroup="az1"
208 value="az2" /> 215 value="az2" />
209 - <label for="az3_target_operate_nginx_az2">az2</label> 216 + <label for="az3_target_operate_nginx_az2">az2</label>--%>
  217 + az2
210 &nbsp;&nbsp;&nbsp;&nbsp; 218 &nbsp;&nbsp;&nbsp;&nbsp;
211 <input id="az3_input_slider_az2" class="slider" type="text" 219 <input id="az3_input_slider_az2" class="slider" type="text"
212 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 220 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
213 </div> 221 </div>
214 222
215 <div class="ckbox ckbox-default" style="margin-top:30px;"> 223 <div class="ckbox ckbox-default" style="margin-top:30px;">
216 - <input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az3" secondgroup="az1" 224 + <%--<input type="checkbox" name="az3_target_operate_nginx" id="az3_target_operate_nginx_az3" secondgroup="az1"
217 value="az3" /> 225 value="az3" />
218 - <label for="az3_target_operate_nginx_az3">az3</label> 226 + <label for="az3_target_operate_nginx_az3">az3</label>--%>
  227 + az3
219 &nbsp;&nbsp;&nbsp;&nbsp; 228 &nbsp;&nbsp;&nbsp;&nbsp;
220 <input id="az3_input_slider_az3" class="slider" type="text" 229 <input id="az3_input_slider_az3" class="slider" type="text"
221 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/> 230 data-slider-min="0" data-slider-max="10" data-slider-step="1" data-slider-value="0" data-slider-tooltip="always"/>
222 </div> 231 </div>
223 232
224 - <button class=" btn btn-sm btn-success" 233 + <button class=" btn btn-sm btn-danger"
225 style="display:inline;margin-left:30px;margin-top:20px;" 234 style="display:inline;margin-left:30px;margin-top:20px;"
226 onclick="nginxInitSwitch('az3')"> 235 onclick="nginxInitSwitch('az3')">
227 <em class="icon-cogs bigger-110"></em> 236 <em class="icon-cogs bigger-110"></em>
@@ -245,7 +254,7 @@ @@ -245,7 +254,7 @@
245 </div> 254 </div>
246 255
247 <script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script> 256 <script src="<%=basePath %>script/common/genarate_left_panel.js?v=<%=ProjectConstant.MENU_VERSION %>"></script>
248 -<script src="<%=basePath %>script/switch.js?v=20180531-100"></script> 257 +<script src="<%=basePath %>script/switch.js?v=20180531-101"></script>
249 258
250 <script type="text/javascript"> 259 <script type="text/javascript">
251 $("#li_switch").addClass("active open"); 260 $("#li_switch").addClass("active open");
@@ -127,19 +127,19 @@ function drawData(resp) { @@ -127,19 +127,19 @@ function drawData(resp) {
127 if(cloud.indexOf("az1")>=0){ 127 if(cloud.indexOf("az1")>=0){
128 var link = newLink(scene,tmpElbObj, az1Nginx,weight); 128 var link = newLink(scene,tmpElbObj, az1Nginx,weight);
129 link.arrowsRadius = 10; 129 link.arrowsRadius = 10;
130 - $("#"+tmpCloud+"_target_operate_nginx_az1").prop("checked",true); 130 + //$("#"+tmpCloud+"_target_operate_nginx_az1").prop("checked",true);
131 $("#"+tmpCloud+"_input_slider_az1").slider("setValue",weight); 131 $("#"+tmpCloud+"_input_slider_az1").slider("setValue",weight);
132 } 132 }
133 if(cloud.indexOf("az2")>=0){ 133 if(cloud.indexOf("az2")>=0){
134 var link = newLink(scene,tmpElbObj, az2Nginx,weight); 134 var link = newLink(scene,tmpElbObj, az2Nginx,weight);
135 link.arrowsRadius = 10; 135 link.arrowsRadius = 10;
136 - $("#"+tmpCloud+"_target_operate_nginx_az2").prop("checked",true); 136 + //$("#"+tmpCloud+"_target_operate_nginx_az2").prop("checked",true);
137 $("#"+tmpCloud+"_input_slider_az2").slider("setValue",weight); 137 $("#"+tmpCloud+"_input_slider_az2").slider("setValue",weight);
138 } 138 }
139 if(cloud.indexOf("az3")>=0){ 139 if(cloud.indexOf("az3")>=0){
140 var link = newLink(scene,tmpElbObj, az3Nginx,weight); 140 var link = newLink(scene,tmpElbObj, az3Nginx,weight);
141 link.arrowsRadius = 10; 141 link.arrowsRadius = 10;
142 - $("#"+tmpCloud+"_target_operate_nginx_az3").prop("checked",true); 142 + //$("#"+tmpCloud+"_target_operate_nginx_az3").prop("checked",true);
143 $("#"+tmpCloud+"_input_slider_az3").slider("setValue",weight); 143 $("#"+tmpCloud+"_input_slider_az3").slider("setValue",weight);
144 } 144 }
145 } 145 }
@@ -230,25 +230,18 @@ function resetLbNodeIp(node,data) { @@ -230,25 +230,18 @@ function resetLbNodeIp(node,data) {
230 * @param onlineOrGray 切换:线上/灰度 230 * @param onlineOrGray 切换:线上/灰度
231 */ 231 */
232 function nginxInitSwitch(cloudName) { 232 function nginxInitSwitch(cloudName) {
233 - var operatorRadio=cloudName+"_target_operate_nginx";  
234 - /*var radioArray= ['az1_target_operate_nginx','az2_target_operate_nginx','az3_target_operate_nginx'];  
235 - for(var i= 0;i<radioArray.length;i++){  
236 - if(radioArray[i]!=operatorRadio){  
237 - $('input:radio[name='+radioArray[i]+']').prop("checked",false);  
238 - }  
239 - }*/  
240 -  
241 var target =""; 233 var target ="";
242 - $('input:checkbox[name='+operatorRadio+']:checked').each(function () {  
243 - var inputSliderId=cloudName+"_input_slider_"+$(this).val();  
244 - var weight=$("#"+inputSliderId).slider("getValue");  
245 - if(weight>0){  
246 - if(target.length>0){  
247 - target += ",";  
248 - }  
249 - target += $(this).val()+":"+weight;  
250 - }  
251 - }); 234 + var arr = ["az1","az2","az3"];
  235 + for(var i= 0;i<arr.length;i++){
  236 + var inputSliderId=cloudName+"_input_slider_"+arr[i];
  237 + var weight=$("#"+inputSliderId).slider("getValue");
  238 + if(weight>0){
  239 + if(target.length>0){
  240 + target += ",";
  241 + }
  242 + target += arr[i]+":"+weight;
  243 + }
  244 + }
252 245
253 if(!target){ 246 if(!target){
254 prompt("提示", "请选择<span style='color:red'>["+cloudName+"区]</span>目标nginx!"); 247 prompt("提示", "请选择<span style='color:red'>["+cloudName+"区]</span>目标nginx!");
@@ -298,8 +291,9 @@ function nginxInitSwitch(cloudName) { @@ -298,8 +291,9 @@ function nginxInitSwitch(cloudName) {
298 }, 291 },
299 error: function (e) { 292 error: function (e) {
300 //alert("系统错误"); 293 //alert("系统错误");
  294 + console.log(e);
301 layer.close(layerMirror); 295 layer.close(layerMirror);
302 - alert("系统错误:等待超时"); 296 + alert("系统错误:请求异常");
303 window.location.href = contextPath + "topoSwitch/toTopoSwitch"; 297 window.location.href = contextPath + "topoSwitch/toTopoSwitch";
304 } 298 }
305 }); 299 });