增加配置同步信息界面,配置同步过程中,不允许用户操作业务配置。

This commit is contained in:
zhangwei
2018-11-30 18:12:26 +08:00
parent a2266e45d6
commit 80b79208e4
4 changed files with 146 additions and 41 deletions

View File

@@ -0,0 +1,44 @@
<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/include/taglib.jsp"%>
<html>
<head>
<title></title>
<script type="text/javascript">
$(document) .ready(function() {
top.$.jBox.closeTip();
$("#cfgFrom").validate({
submitHandler : function(form) {
top.$.jBox.tip("The system is being maintained and temporarily inaccessible.",'loading',{opacity:0.5,persistent:true});
form.submit();
},
})
})
</script>
</head>
<body>
<form id="cfgFrom" action="${ctx}/config/synchronization/configSync?cmd=1" method="post" class="form-horizontal">
<div class="page-content">
<h3 class="page-title">
<c:forEach items="${fns:getDictList('currrent_sync_status') }" var="dict">
${dict.itemDesc }
</c:forEach>
</h3>
<h2 class="page-title">
<c:forEach items="${fns:getDictList('currrent_sync_status') }" var="dict">
同步状态:
<c:if test="${dict.itemValue eq '0' }">开始</c:if>
<c:if test="${dict.itemValue eq '1' }">初始化</c:if>
<c:if test="${dict.itemValue eq '2' }">进行中</c:if>
<c:if test="${dict.itemValue eq '3' }">结束</c:if>
<c:if test="${dict.itemValue eq '-1' }">服务端同步失败</c:if>
<c:if test="${dict.itemValue eq '-2' }">界面端同步失败</c:if>
</c:forEach>
</h2>
<button id="save" type="submit" class="btn green">
配置同步
</button>
</div>
</form>
</body>
</html>

View File

@@ -1,6 +1,6 @@
$(function(){
// var leff =$("span[class~='le-ca-fo']").attr("data-original-title")
getConfigSyncStatus();
$("#contentTable").not(".logTb").find("tbody tr").each(function(i){
if($(this).find("input[type='checkbox']").attr("value")==3){
var ids = $(this).find("input").attr("id");
@@ -1551,6 +1551,41 @@ function openHelp(url){
title: "online help", buttons:{ "close":true}
});
}
//查询系统当前是否在进行配置同步,如果正在同步,界面不允许配置操作
function getConfigSyncStatus(){
var currentStatus = getSyncStatus();
//3成功-1服务端同步失败-2界面端同步失败
if(currentStatus!=3 && currentStatus!=-1 && currentStatus!=-2){
$.jBox.defaults = {
id:'syncStatusTip',
zIndex: 9999
};
var tipId = top.$.jBox.tip("The system is being maintained and temporarily inaccessible.",'loading',{opacity:0.5,persistent:true});
var t1 = setInterval(function() {
currentStatus = getSyncStatus();
alert(currentStatus);
if(currentStatus==3 || currentStatus==-1 || currentStatus==-2){//3表示同步完成-1表示服务端同步失败-2表示界面端同步失败
window.clearInterval(t1);
top.$.jBox.closeTip('syncStatusTip');
}
},5000);
}
}
function getSyncStatus(){
//获取当前是否有配置同步任务
var currentStatus = 3;
var pathName = window.document.location.pathname.substring(0,window.document.location.pathname.lastIndexOf("/nis")+4);
$.ajax({
type:'get',
async:false,
url:pathName+'/config/synchronization/getStatus',
dataType:"json",
success:function(data){
currentStatus = data.status;
}
});
return currentStatus;
}
function heightDiv(type){
var hei=document.documentElement.clientHeight;
hei=hei-91;