dashboard页面支持隧道类型筛选

This commit is contained in:
lwch
2021-11-18 15:24:26 +08:00
parent 8570519264
commit 4ce221eeae
3 changed files with 30 additions and 2 deletions
+6 -1
View File
@@ -57,4 +57,9 @@
1. vnc页面支持滚动
2. go版本升级到1.17.3
3. 文档补全
3. 文档补全
# v0.6.3
1. bootstrap降版到4.6.1
2. dashboard页面支持隧道类型筛选
+19 -1
View File
@@ -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>
+5
View File
@@ -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;