...
|
...
|
@@ -34,20 +34,6 @@ |
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
var javaApiDatas = {
|
|
|
"gateway": {},
|
|
|
"order": {},
|
|
|
"promotion": {},
|
|
|
"product": {},
|
|
|
"message": {},
|
|
|
"sns": {},
|
|
|
"user": {},
|
|
|
"resources": {},
|
|
|
"activity": {},
|
|
|
"union": {},
|
|
|
"browser": {},
|
|
|
"wechat": {}
|
|
|
};
|
|
|
|
|
|
var getJavaAppType = function () {
|
|
|
$.ajax({
|
...
|
...
|
@@ -75,18 +61,32 @@ |
|
|
var api_info_item_panel = $(' <div class="panel panel-default">');
|
|
|
var api_info_item_panel_title = $('<div class="panel-heading">' + val.typeName + '</div>');
|
|
|
var api_info_item_panel_body = $('<div class="panel-body">');
|
|
|
api_info_item_panel_body.append('<h3><span class="label label-default">AWS</span> <span class="label label-default">QCloud</span> </h3>')
|
|
|
api_info_item_panel_body.append('<h5 >更新时间:</h5>');
|
|
|
|
|
|
api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_1_' + val.typeId + '">AWS <span class="badge"></span></button>');
|
|
|
api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_2_' + val.typeId + '">QCloud <span class="badge"></span></button>');
|
|
|
api_info_item_panel_body.append('<button class="btn_java_api btn btn-lg btn-default" id="btn_3_' + val.typeId + '">其他 <span class="badge"></span></button>');
|
|
|
api_info_item_panel.append(api_info_item_panel_title)
|
|
|
.append(api_info_item_panel_body);
|
|
|
api_info_item.append(api_info_item_panel);
|
|
|
div_dash.append(api_info_item);
|
|
|
});
|
|
|
|
|
|
$(".btn_java_api").on("click", function () {
|
|
|
console.info(this);
|
|
|
var url = contextPath + "?page_url=jsp/javaapi/javaApiList.jsp&page_type=javaApi";
|
|
|
var api_type = $(this).attr("id").split("_")[2];
|
|
|
url += "&api_type=" + api_type;
|
|
|
window.location.href = url;
|
|
|
});
|
|
|
|
|
|
timer();
|
|
|
|
|
|
};
|
|
|
|
|
|
var refreshDashBoard=function(){
|
|
|
var refreshDashBoard = function () {
|
|
|
$.ajax({
|
|
|
url: contextPath + "/javaapi",
|
|
|
url: contextPath + "/javaApi/allStatus",
|
|
|
type: 'get',
|
|
|
success: function (data) {
|
|
|
if (!data || data.code != 200) {
|
...
|
...
|
@@ -94,28 +94,40 @@ |
|
|
return;
|
|
|
}
|
|
|
console.info(data.data);
|
|
|
initDashBoard(data.data);
|
|
|
|
|
|
$.each(data.data, function (idx, val) {
|
|
|
console.log($("#btn_" + val.cloudType + "_" + val.serviceType));
|
|
|
var btn = $("#btn_" + val.cloudType + "_" + val.serviceType);
|
|
|
if (val.errNum > 0) {
|
|
|
$(btn.children("span")[0]).html(val.errNum)
|
|
|
btn.removeClass("btn-success");
|
|
|
btn.addClass("btn-danger");
|
|
|
} else {
|
|
|
$(btn.children("span")[0]).html()
|
|
|
btn.removeClass("btn-danger");
|
|
|
btn.addClass("btn-success");
|
|
|
}
|
|
|
});
|
|
|
|
|
|
},
|
|
|
error: function (data) {
|
|
|
$.toaster('获取java服务类型失败', '警告', 'warning');
|
|
|
|
|
|
}
|
|
|
|
|
|
});
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
function timer() {
|
|
|
refreshDashBoard();
|
|
|
setTimeout("timer()", 30000);
|
|
|
}
|
|
|
timer();
|
|
|
};
|
|
|
|
|
|
|
|
|
$(function () {
|
|
|
getJavaAppType();
|
|
|
|
|
|
|
|
|
});
|
|
|
|
|
|
|
...
|
...
|
|