Authored by qinchao

搜索流量切换

package com.ui.ctrl;
import com.alibaba.fastjson.JSONObject;
import com.ui.contants.HttpUriContants;
import com.ui.http.HttpRestClient;
import com.ui.model.BaseResponse;
import org.apache.commons.lang.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.ParameterizedTypeReference;
import org.springframework.stereotype.Controller;
import org.springframework.util.LinkedMultiValueMap;
import org.springframework.util.MultiValueMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.servlet.ModelAndView;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
/**
* 搜索流量切换
*
* @author qinchao 2017-11-21
*/
@Controller
@RequestMapping("/searchSwitch")
public class SearchSwitchCtrl {
private Logger logger = LoggerFactory.getLogger(getClass());
@Autowired
HttpRestClient httpRestClient;
@RequestMapping(value = "toSearchSwitch")
public ModelAndView toSearchSwitch() {
ModelAndView mdv = new ModelAndView("switch/switch_search");
return mdv;
}
}
\ No newline at end of file
... ...
... ... @@ -244,7 +244,7 @@
</div>
</div>
</body>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=20171030-1"></script>
<script src="<%=basePath %>script/common/genarate_left_panel.js?v=20171121"></script>
<script type="text/javascript">
$("#li_dashboard").addClass("active");
</script>
... ...
<%@page language="java" contentType="text/html;charset=utf-8" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%
String path = request.getContextPath();
String basePath = request.getScheme() + "://"
+ request.getServerName() + ":" + request.getServerPort()
+ path + "/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="<%=basePath %>css/bootstrap.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.main.css"/>
<link rel="stylesheet" href="<%=basePath %>css/unicorn.grey.css"/>
<link rel="stylesheet" href="<%=basePath %>css/jquery-ui.css"/>
<link rel="stylesheet" href="<%=basePath %>css/bootstrap-responsive.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/uniform.css"/>
<link rel="stylesheet" href="<%=basePath %>css/select2.css"/>
<link rel="stylesheet" href="<%=basePath %>css/font-awesome.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/dnspod_switch.css"/>
<link rel="stylesheet" href="<%=basePath %>css/ace.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/ace-rtl.min.css"/>
<link rel="stylesheet" href="<%=basePath %>css/ace-skins.min.css"/>
<script src="<%=basePath %>js/jquery-2.1.4.min.js" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap.min.js" type="text/javascript"></script>
<script src="<%=basePath %>js/typeahead-bs2.min.js" type="text/javascript"></script>
<script src="<%=basePath %>js/ace-elements.min.js" type="text/javascript"></script>
<script src="<%=basePath %>js/ace.min.js" type="text/javascript"></script>
<script src="<%=basePath %>js/layer/layer.js" type="text/javascript"></script>
<script src="<%=basePath %>/js/unicorn.js" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/moment-with-locales.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/datetimepicker/bootstrap-datetimepicker.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/global.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.pagination.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.table.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.dialog.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.panel.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.alerts.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.accordion.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.breadcrumb.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.validate.js" charset="UTF-8"
type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.form.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/bootstrap-plugin/bootstrap.select.js" charset="UTF-8" type="text/javascript"></script>
<script src="<%=basePath %>js/jquery.toaster.js" type="text/javascript"></script>
<script src="<%=basePath %>js/jtopo-0.4.8-min.js"></script>
<script src="<%=basePath %>js/toolbar.js"></script>
<script>
var contextPath = '<%=basePath %>';
</script>
<title>YOHO!运维</title>
</head>
<body style="background-color: #444444;font-size: 14px">
<!-- 头部 -->
<div id="head">
</div>
<!-- 右侧具体内容 -->
<div id="content">
<div id="breadcrumb">
<a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> Home</a> <a href="#" class="current">流量切换</a>
</div>
<div class="container-fluid">
<div class="widget-box">
<div class="panel-body">
<div class="row">
<div class="col-xs-11">
<!-- PAGE CONTENT BEGINS -->
<div class="row">
<div class="col-xs-12 col-sm-12 widget-container-span">
<div class="tabbable">
<ul class="nav nav-tabs" id="myTab">
<li class="active" style="width: 110px">
<a data-toggle="tab" href="#home">
<em class="green icon-cloud bigger-110"></em>
aws
</a>
</li>
<li style="width: 110px">
<a data-toggle="tab" href="#profile">
<em class="green icon-cloud bigger-110"></em>
qq
</a>
</li>
</ul>
<div class="tab-content">
<div id="home" class="tab-pane in active">
<button class="btn btn-sm btn-success"
onclick="reloadTable('aws')">
<em class="icon-cogs bigger-110"></em>
刷新
</button>
<button class="btn btn-sm btn-info"
onclick="switchSearch('aws')">
<em class="icon-cogs bigger-110"></em>
aws流量切换
</button>
<button class="btn btn-sm btn-danger"
onclick="commit('aws')">
<em class="icon-cogs bigger-110"></em>
提交至域名服务器
</button>
<h3 class="header smaller red"></h3>
<table id="awsDetailTable"></table>
</div>
<div id="profile" class="tab-pane">
<button class="btn btn-sm btn-success"
onclick="reloadTable('qcloud')">
<em class="icon-cogs bigger-110"></em>
刷新
</button>
<button class="btn btn-sm btn-success"
onclick="switchSearch('qcloud')">
<em class="icon-cogs bigger-110"></em>
qcloud流量切换
</button>
<button class="btn btn-sm btn-danger"
onclick="commit('qcloud')">
<em class="icon-cogs bigger-110"></em>
提交至域名服务器
</button>
<h3 class="header smaller red"></h3>
<table id="qcloudDetailTable"></table>
</div>
</div>
</div>
</div>
<!-- /span -->
</div>
<!-- /row -->
</div>
</div>
</div>
</div>
</div>
</div>
<script src="<%=basePath %>script/common/genarate_left_panel.js"></script>
<script type="text/javascript">
$("#li_switch").addClass("active open");
$("#li_switchsearch").addClass("active");
</script>
</body>
</html>
<script>
$(function () {
//加载表格
$("#awsDetailTable").table({
//title: "aws搜索流量列表",
dataType: "json",
pagination: false,
pageSize: 10,
columnAutoWidth: false,
url: contextPath + "internalDns/selectAll",
queryParams:{
domain: 'yohoops.org.',
environment: 'aws',
tag: 'search'
},
striped: true,
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [{
title: "name",
field: "name",
width: "20%"
}, {
title: "type",
field: "type",
width: "10%"
}, {
title: "value",
field: "value",
width: "30%"
}, {
title: "tag",
field: "tag",
width: "10%"
}, {
title: "domain",
field: "domain",
width: "10%"
}, {
title: "cloud",
field: "environment",
width: "10%"
}, {
title: "操作",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
$("<button onclick=\"editConfig(\'" + rowData.id + "\')\">").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
div.append("&nbsp;");
$("<button onclick=\"deleteConfig(\'" + rowData.id + "\')\">").addClass("btn btn-xs btn-danger").html("删除").appendTo(div);
return div;
}
}]
});
//加载表格
$("#qcloudDetailTable").table({
//title: "qcloud搜索流量列表",
dataType: "json",
pagination: false,
pageSize: 10,
columnAutoWidth: false,
url: contextPath + "internalDns/selectAll",
queryParams:{
domain: 'yohoops.org.',
environment: 'qcloud',
tag: 'search'
},
striped: true,
loadFilter: function (data) {
return defaultLoadFilter(data);
},
columns: [{
title: "name",
field: "name",
width: "20%"
}, {
title: "type",
field: "type",
width: "10%"
}, {
title: "value",
field: "value",
width: "30%"
}, {
title: "tag",
field: "tag",
width: "10%"
}, {
title: "domain",
field: "domain",
width: "10%"
}, {
title: "cloud",
field: "environment",
width: "10%"
}, {
title: "操作",
formatter: function (value, rowData, rowIndex) {
var div = $("<div>");
$("<button onclick=\"editConfig(\'" + rowData.id + "\')\">").addClass("btn btn-xs btn-success").html("修改").appendTo(div);
div.append("&nbsp;");
$("<button onclick=\"deleteConfig(\'" + rowData.id + "\')\">").addClass("btn btn-xs btn-danger").html("删除").appendTo(div);
return div;
}
}]
});
});
function commit(cloud) {
alert("开发中"+cloud);
}
function switchSearch(cloud) {
alert("开发中"+cloud);
}
function reloadTable(cloud){
if("aws"==cloud){
$("#awsDetailTable").table("load");
}else{
$("#qcloudDetailTable").table("load");
}
}
</script>
\ No newline at end of file
... ...
... ... @@ -92,7 +92,7 @@ innerHTML += "<li id='li_javarollbackbytime'><a id='li_javarollbackbytime_a' hre
innerHTML += "</ul></li>";
/*switch*/
innerHTML += "<li class='submenu' id='li_switch'><a id='li_switch_a' href='#'><i class='icon icon-th-list'></i> <span>关键切换</span><span class='label'>4</span></a>";
innerHTML += "<li class='submenu' id='li_switch'><a id='li_switch_a' href='#'><i class='icon icon-th-list'></i> <span>关键切换</span><span class='label'>5</span></a>";
innerHTML += "<ul>";
//innerHTML += "<ul><li id='li_nginxswitch'><a id='li_nginxswitch_a' href=''>nginx切换</a></li>";
//innerHTML += "<li id='li_luaswitch'><a id='li_luaswitch_a' href='#'>LUA切换</a></li>";
... ... @@ -103,6 +103,7 @@ innerHTML += "<li id='li_nodeMonitor'><a id='li_nodeMonitor_a' href=''><i class=
//innerHTML += "<li id='li_centerswitch'><a id='li_centerswitch_a' href='#'>双中心切换</a></li>";
innerHTML += "<li id='li_centerswitch_new'><a id='li_centerswitch_new_a' href='#'>双中心切换_新</a></li>";
innerHTML += "<li id='li_switchtopo'><a id='li_switchtopo_a' href='#'>NGINX切换</a></li>";
innerHTML += "<li id='li_switchsearch'><a id='li_switchsearch_a' href='#'>搜索流量切换</a></li>";
innerHTML += "</ul></li>";
/*manage*/
... ... @@ -211,6 +212,7 @@ document.getElementById("li_nodeMonitor_a").setAttribute("href",path+"/nodeMonit
document.getElementById("li_internalDomain_a").setAttribute("href",path+"/internalDns/toInternalDns");
document.getElementById("li_internalDomainHistory_a").setAttribute("href",path+"/internalDns/toHistory");
document.getElementById("li_switchtopo_a").setAttribute("href",path+"/topoSwitch/toTopoSwitch");
document.getElementById("li_switchsearch_a").setAttribute("href",path+"/searchSwitch/toSearchSwitch");
document.getElementById("li_centerswitch_new_a").setAttribute("href",path+"/centerSwitch/toCenterSwitchNew");
document.getElementById("li_javarollbackbytime_a").setAttribute("href",path+"/project/toRollbackByTime");
document.getElementById("li_sql_operate_a").setAttribute("href",path+"/sqlOperate/toSqlOperate");
... ...