excelImpInfo.jsp
5.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
<%@page import="net.sf.json.JSONObject"%>
<%@page import="weaver.formmode.browser.FormModeBrowserUtil"%>
<%@page import="weaver.general.Util"%>
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/formmode/checkright4setting.jsp" %>
<%
String customid = Util.null2String(request.getParameter("customid"));
String browsertype = Util.null2String(request.getParameter("browsertype"));
%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<title>导入信息</title>
<style>
a, a:visited {
outline:none;
color:#389dc1;
}
a:hover{
text-decoration:none;
}
.progress-button{
display: inline-block;
font-size:14px;
color:#fff !important;
text-decoration: none !important;
padding:8px 16px;
line-height:1;
overflow: hidden;
position:relative;
box-shadow:0 1px 1px #ccc;
border-radius:2px;
background-color: #51b7e6;
background-image:-webkit-linear-gradient(top, #51b7e6, #4dafdd);
background-image:-moz-linear-gradient(top, #51b7e6, #4dafdd);
background-image:linear-gradient(top, #51b7e6, #4dafdd);
}
.progress-button.green{
background-color: #64c896;
background-image:-webkit-linear-gradient(top, #64c896, #5fbd8e);
background-image:-moz-linear-gradient(top, #64c896, #5fbd8e);
background-image:linear-gradient(top, #64c896, #5fbd8e);
}
input[type="text"] {
-webkit-appearance: none;
font-size: 12px;
width: 80%;
outline: none;
border: 1px solid #eaeaea;
border-radius: 5px;
box-shadow: rgba(0, 0, 0, 0.05) 0 0.5rem 1rem -0.25rem;
height: 30px;
line-height: 20px;
}
#msgDiv{
height:20px;
width:50%;
color:red;
font-size:12px;
margin:80px auto 0 auto;
}
.contentDiv{
width:50%;
margin:20px auto 0 auto;
}
.inputDiv{
margin:20px 0;
}
.resultDiv{
font-size:12px;
line-height: 20px;
}
.msgitem{
margin:20px 0;
}
.label{
color: #e6537d;
}
#allKeyDiv span{
color:#2db7f5;
cursor: pointer;
margin: 5px 10px;
line-height: 25px;
}
</style>
</head>
<body>
<div id="msgDiv"></div>
<div class="contentDiv">
<div class="inputDiv">
<input type="text" id="key" placeholder="输入Key">
</div>
<a id="actionButton" onclick="getKeyInfo();" href="javascript:void(0);" class="progress-button green" >导入进度</a>
<a id="submitButton" onclick="getAllKey();" href="javascript:void(0);" class="progress-button">所有Key</a>
<div class="resultDiv">
<div class="msgitem">
<span class="label">当前导入进度:</span>
<div id="keyProgress"></div>
</div>
<div class="msgitem">
<span class="label">当前所有Key:</span>
<div id="allKeyDiv"></div>
</div>
</div>
</div>
</body>
<script src="/cloudstore/resource/pc/jquery/jquery-1.8.3.min.js"></script>
<script>
var myTimer = "";
var impindex = 0;
function getKeyInfo(){
impindex = 0;
jQuery("#msgDiv").html("");
var key = jQuery("#key").val();
if(key!=""){
stop();
myTimer = setInterval(function(){ getImpStatus(key) }, 1000);
}else{
alert("请输入Key");
}
}
function stop(){
if(myTimer!=""){
clearInterval(myTimer);
}
}
function getImpStatus(key){
$.ajax({
type: "get",
url: "/api/cube/mode/mode/excelInfo?operation=getImpStatus",
data: "key="+key,
dataType:"json",
success: function(data){
console.log(data);
if(key!=jQuery("#key").val()){
return;
}
if(data&&data.status=="1"){
var needClear = false;
if(data.d=="0"){
stop();
jQuery("#keyProgress").html("未找到相关信息");
}else{
var step = data.step;
var endtime = data.endtime;
if (step && step == 6) {
stop();
}
if (endtime && endtime != "") {
stop();
}
var htmlStr = "";
if(data){
if(data.modename){
htmlStr += "模块名称:"+data["modename"]+"<br/>";
}
if(data.lastname){
htmlStr += "导入用户:"+data["lastname"]+"<br/>";
}
if(data.msg){
htmlStr += "进度:"+data["msg"]+"<br/>";
}
if(data.step){
htmlStr += "步骤:"+data["step"]+"<br/>";
}
if(data.currentip){
htmlStr += "当前服务器ip:"+data["currentip"]+"<br/>";
}
if(data.impaddr){
htmlStr += "执行导入的服务器IP:"+data["impaddr"]+"<br/>";
}
if(data.imptime){
htmlStr += "开始时间:"+data["imptime"]+"<br/>";
}
if(data.time){
htmlStr += "耗时:"+data["time"]+"<br/>";
}
if(data.canImport){
htmlStr += "异常终止:"+(data["canImport"]=="1"?"否":"是")+"<br/>";
}
if(data.errmsg){
htmlStr += "错误信息:"+data["errmsg"]+"<br/>";
}
}
jQuery("#keyProgress").html(htmlStr);
}
}else{
stop();
}
}
});
}
function getAllKey(){
stop();
$.ajax({
type: "get",
dataType:"json",
url: "/api/cube/mode/mode/excelInfo?operation=getAllKey",
success: function(data){
var htmlStr = "";
if(data){
if(data.currentip){
htmlStr += "当前服务器ip:"+data["currentip"]+"<br/>";
}
if(data.allkey){
var allkey = data.allkey;
var s = "";
for(var i=0;i<allkey.length;i++){
if(i%5==0){
s += "<br/><span onclick='setVal(\""+allkey[i]+"\")'>"+allkey[i]+"</span>";
}else{
s += ",<span onclick='setVal(\""+allkey[i]+"\")'>"+allkey[i]+"</span>";
}
}
htmlStr += "所有Key:<br/>"+s+"<br/>";
}
}
jQuery("#allKeyDiv").html(htmlStr);
}
});
}
function setVal(v){
$("#key").val(v);
};
</script>
</html>