-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvistor.html
369 lines (339 loc) · 14.6 KB
/
vistor.html
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
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="renderer" content="webkit">
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1,firefox=1">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>DNSLog平台-游客</title>
<link rel="icon" href="img/htlog.jpg" type="image/x-icon"/>
<link rel="stylesheet" href="layui/css/layui.css">
<script src="layui/layui.js"></script>
<script src="layui/css.js"></script>
</head>
<body class="layui-layout-body">
<div class="layui-layout layui-layout-admin">
<div class="layui-header" style="background-color: #3F3F3F">
<div class="layui-logo">DNSLog平台</div>
<!-- 头部区域(可配合layui已有的水平导航) -->
<ul class="layui-nav layui-layout-left" lay-filter="manage">
<li class="layui-nav-item"><a href="javascript:;" lay-id="1" class="dashboard">控制面板</a></li>
<li class="layui-nav-item">
<a href="javascript:;">其它系统</a>
<dl class="layui-nav-child">
<dd><a href="javascript:;">邮件管理</a></dd>
<dd><a href="javascript:;">消息管理</a></dd>
<dd><a href="javascript:;">授权管理</a></dd>
</dl>
</li>
</ul>
<ul class="layui-nav layui-layout-right">
<li class="layui-nav-item">
<a href="javascript:;">
<img src="img/htlog.jpg" class="layui-nav-img">
DNSLog
</a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" id="profile_info">游客信息</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href="javascript:;">退出</a></li>
</ul>
</div>
<div class="layui-side" style="background-color: #3F3F3F">
<div class="layui-side-scroll" style="background-color: #3F3F3F">
<!-- 左侧导航区域(可配合layui已有的垂直导航) -->
<ul class="layui-nav layui-nav-tree" lay-filter="tab-switch" style="background-color: #3F3F3F">
<li class="layui-nav-item layui-nav-itemed">
<a class="" href="javascript:;">记录查询</a>
<dl class="layui-nav-child">
<dd><a href="javascript:;" lay-id="l1">DNS记录</a></dd>
<dd><a href="javascript:;" lay-id="l2" class="layui-disabled" style="background-color: darkgray;">HTTP记录</a></dd>
<dd><a href="javascript:;" lay-id="l3" class="layui-disabled" style="background-color: darkgray;">TCP记录</a></dd>
</dl>
</li>
<li class="layui-nav-item"><a href="javascript:;" class="layui-disabled">API</a></li>
</ul>
</div>
</div>
<div class="layui-body">
<!-- 内容主体区域 -->
<!--面包屑页面-->
<div lay-filter="bread" style="padding: 15px 15px;">
<span class="layui-breadcrumb" lay-separator=">">
<a href="">DNSLog平台</a>
<a><cite id="cite">游客信息</cite></a>
</span>
</div>
<!--表格页面-->
<div class="layui-tab layui-hide" lay-allowClose="true" lay-filter="tab-title">
<ul class="layui-tab-title" id="laytab">
<li class="layui-this" lay-id="l1" id="d1">DNS记录</li>
<li lay-id="l2" id="h1" class="layui-disabled">HTTP记录</li>
<li lay-id="l3" id="t1" class="layui-disabled">TCP记录</li>
</ul>
<div class="layui-tab-content">
<div id="dns-tab" class="layui-tab-item layui-show">
<table id="dns-tab-content" class="layui-hide" lay-filter="dns"></table>
</div>
<div id="http-tab" class="layui-tab-item">
<table id="http-tab-content" class="layui-hide" lay-filter="http"></table>
</div>
<div id="tcp-tab" class="layui-tab-item">
<table id="tcp-tab-content" class="layui-hide" lay-filter="tcp"></table>
</div>
</div>
</div>
<!--用户信息页面-->
<div id="profile" class="layui-collapse layui-show">
<div class="layui-colla-item">
<h2 class="layui-colla-title">
<i class="layui-icon layui-icon-username"></i>用户名
</h2>
<div class="layui-colla-content layui-show" th:text="${name}">
loading...
</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">
<i class="layui-icon layui-icon-component"></i>用户邮箱
</h2>
<div class="layui-colla-content layui-show" th:text="${email}">loading...</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">
<i class="layui-icon layui-icon-senior"></i>用户级别
</h2>
<div class="layui-colla-content layui-show" th:text="${senior}">loading...</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">
<i class="layui-icon layui-icon-website"></i>根域名
</h2>
<div class="layui-colla-content layui-show" th:text="${nsname}">loading...</div>
</div>
<div class="layui-colla-item">
<h2 class="layui-colla-title">
<i class="layui-icon layui-icon-auz"></i>API KEY
</h2>
<div class="layui-colla-content layui-show layui-disabled">不可用</div>
</div>
</div>
</div>
<div class="layui-footer">
<!-- 底部固定区域 -->
© return.cf - 底部固定区域
</div>
</div>
<script type="text/html" id="toolbar1">
<div class="layui-inline" style="float: left;">
<input class="layui-input" style="height: 30px;" name="query" id="dnsReload" autocomplete="off" placeholder="请输入内容...">
</div>
<div class="layui-btn-container">
<button class="layui-btn layui-btn-sm" id="dnsContent" data-type="reload">
<i class="layui-icon"></i>搜索
</button>
</div>
</script>
<script type="text/html" id="dnsAction">
<a class="layui-btn layui-btn-xs" lay-event="view">查看</a>
<a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<script>
layui.use(['table','element','jquery'], function () {
var element = layui.element;
var $ = layui.jquery;
var table1 = layui.table;
//第一个实例
table1.render({
elem: '#dns-tab-content'
, height: 'full-250'
, cellMinWidth: 100
//,limit: 30
, toolbar: '#toolbar1'
, id: 'dnseditor'
, method: 'POST'
, url: 'dns' //数据接口
, page: true //开启分页
, limits: [10, 20, 30, 40, 50, 60, 70, 80, 90, 100, 150, 200]
, title: 'DNS查询记录信息'
, cols: [[ //表头
{type: 'checkbox', fixed: 'left'}
, {field: 'id', title: '序号', width: 80, sort: true, fixed: 'left'}
, {field: 'content', title: '查询内容', edit: 'text'}
, {field: 'remote_addr', title: '请求来源', sort: true, edit: 'text'}
, {field: 'date', title: '请求时间', edit: 'text'}
, {fixed: 'right', title: '操作', toolbar: '#dnsAction', width: 120}
]]
});
//表格无条件重载
function table_reload(table_name,reload_id,reload_url){
table_name.reload(reload_id, {
page: {
curr: 1 //重新从第 1 页开始
}
, url: reload_url
});
}
//表格查询按条件重载
function getquery(tablename,id,v,url){
tablename.reload(id, {
page: {
curr: 1 //重新从第 1 页开始
}
, method: 'POST'
, url: url
, where: {
v: v
}
,parseData: function (response) {
if(response['count']==0){
layer.alert(response['data']);
return {
"code": response['code'],
}
}
}
});
}
//监听行工具事件
table1.on('tool(dns-tab-content)', function (obj) {
var data = obj.data;
if (obj.event === 'del') {
layer.confirm('删除需谨慎', function (index) {
var id = data.id;
obj.del();
$.post(
'dnsdel',
{
id: id
},
function (res,status) {
if (res['msg'] == "success" && status == "success") {
layer.confirm(res['data']);
//table_reload(table1,'editor','user');
}
}
);
layer.close(index);
});
} else if (obj.event === 'view') {
layer.alert(JSON.stringify(data));
}
});
//监听单元格编辑
table1.on('edit(dns-tab-content)', function (obj) {
var value = obj.value //得到修改后的值
, data = obj.data //得到所在行所有键值
, field = obj.field; //得到字段
layer.confirm('确定修改吗', function (index) {
$.post(
"dnsupdate",
{
id: data.id,
f: field,
v: value,
},
function (res, status) {
if (res['code'] == 0 && status == "success") {
layer.msg('[ID: ' + data.id + '] ' + field + ' 字段更改为:' + value);
}
}
);
layer.close(index);
});
});
//监听搜索
var active1 = {
reload: function () {
//alert(JSON.stringify(data));
var query = $('#dnsReload').val();
var queryData = filterXSS(query);
if (queryData == "") {
layer.msg("请输入搜索内容");
table_reload(table1,'dnseditor','dns');
} else {
getquery(table1,'dnseditor',queryData,'dnsquery');
layer.msg(queryData);
}
$('#dnsReload').attr("value",queryData);
}
};
$(document).on('click', '#dnsContent', function () {
var type1 = $(this).data('type');
active1[type1] ? active1[type1].call(this) : '';
});
var tab = $("#laytab");
var dnstab = $("#d1");
var tabcontent = $(".layui-tab-content");
var dnstable = $("#dns-tab");
//监听tab选项卡删除事件
$(".layui-tab").on("click",function(e){
if($(e.target).is(".layui-tab-close")){
var tid=$(e.target).parent().attr("lay-id");
layer.msg(tid);
switch(tid){
case "l1":
$("#d1").remove();
$("#dns-tab").remove();
break;
case "l2":
layer.msg("您还没有注册");
break;
case "l3":
layer.msg("您还没有注册");
break;
}
}
});
//监听左侧导航栏事件
element.on('nav(tab-switch)', function (elem) {
var lid = elem.attr('lay-id');
element.tabChange('tab-title', lid);
switch(lid){
case "l1":
var exist = $("#d1").length;
$("#profile").removeClass("layui-show").addClass("layui-hide");
$(".layui-tab").removeClass("layui-hide");
$("#cite")[0].innerText="DNS记录";
if (exist == 0) {
$("#laytab").attr("class","layui-tab-title");
tab.prepend(dnstab);
tabcontent.prepend(dnstable);
$("#d1").attr("class","layui-this");
$("#dns-tab").attr("class","layui-tab-item layui-show");
$("#h1").attr("class","");
$("#http-tab").attr("class","layui-tab-item");
$("#t1").attr("class","");
$("#tcp-tab").attr("class","layui-tab-item");
table_reload(table1,'dnseditor','dns');
}
break;
case "l2":
layer.msg("注册后才能使用");
$("#cite")[0].innerText="HTTP记录";
break;
case "l3":
layer.msg("注册后才能使用");
$("#cite")[0].innerText="TCP记录";
break;
}
});
$(document).on('mouseenter','td',function(){
var text = $(this).text();
$(this).attr("title",text);
});
$(document).on("click",'#profile_info',function () {
$(".layui-tab").addClass("layui-hide");
$("#profile").removeClass("layui-hide").addClass("layui-show");
$("#cite")[0].innerText="游客信息";
});
$(document).on("click",'.dashboard',function () {
$("#profile").removeClass("layui-show").addClass("layui-hide");
$(".layui-tab").removeClass("layui-hide");
$("#cite")[0].innerText="控制面板";
});
});
</script>
</body>
</html>