mirror of
https://github.com/lwch/natpass.git
synced 2024-04-21 12:41:54 +00:00
dashboard页面支持隧道类型筛选
This commit is contained in:
+6
-1
@@ -57,4 +57,9 @@
|
||||
|
||||
1. vnc页面支持滚动
|
||||
2. go版本升级到1.17.3
|
||||
3. 文档补全
|
||||
3. 文档补全
|
||||
|
||||
# v0.6.3
|
||||
|
||||
1. bootstrap降版到4.6.1
|
||||
2. dashboard页面支持隧道类型筛选
|
||||
@@ -3,6 +3,15 @@
|
||||
<script src="/js/index.js"></script>
|
||||
{{template "aside" .}}
|
||||
<script>aside.active_dashboard();</script>
|
||||
<style>
|
||||
#label-tunnel-type {
|
||||
margin-right: 5px;
|
||||
}
|
||||
#tunnel-type {
|
||||
width: 200px;
|
||||
display: inline-block;
|
||||
}
|
||||
</style>
|
||||
<div class="content-wrapper">
|
||||
<div class="content-header">
|
||||
<div class="container-fluid">
|
||||
@@ -25,7 +34,16 @@
|
||||
<div class="card-header">
|
||||
<h3 class="card-title">隧道列表</h3>
|
||||
</div>
|
||||
<div class="card-body p-0">
|
||||
<div class="card-body">
|
||||
<div class="form-group">
|
||||
<label id="label-tunnel-type" for="tunnel-type">类型:</label>
|
||||
<select id="tunnel-type" class="form-control">
|
||||
<option value="all">全部</option>
|
||||
<option value="reverse">reverse</option>
|
||||
<option value="shell">shell</option>
|
||||
<option value="vnc">vnc</option>
|
||||
</select>
|
||||
</div>
|
||||
<table id="tunnels" class="table table-hover">
|
||||
<thead><tr>
|
||||
<th>名称</th>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
var page = {
|
||||
init: function() {
|
||||
$('#tunnel-type').change(page.render);
|
||||
page.render();
|
||||
setInterval(page.render, 5000);
|
||||
},
|
||||
@@ -19,7 +20,11 @@ var page = {
|
||||
render_tunnels: function() {
|
||||
$.get('/api/tunnels', function(ret) {
|
||||
$('#tunnels tbody').empty();
|
||||
var type = $('#tunnel-type').val();
|
||||
$.each(ret, function(_, tunnel) {
|
||||
if (type != 'all' && tunnel.type != type) {
|
||||
return;
|
||||
}
|
||||
var send_bytes = 0;
|
||||
var send_packet = 0;
|
||||
var recv_bytes = 0;
|
||||
|
||||
Reference in New Issue
Block a user