2018-12-11 08:37:12 +00:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-md-12">
|
|
|
|
|
<div class="tile">
|
|
|
|
|
<div class="tile-body">
|
|
|
|
|
<table class="table table-hover table-bordered" id="sampleTable">
|
|
|
|
|
<thead>
|
|
|
|
|
<tr>
|
2019-01-25 04:10:12 +00:00
|
|
|
|
<th>客户端id</th>
|
|
|
|
|
<th>备注</th>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
<th>host</th>
|
|
|
|
|
<th>内网目标</th>
|
2019-01-25 04:10:12 +00:00
|
|
|
|
<th>host改写</th>
|
2019-01-26 09:27:28 +00:00
|
|
|
|
<th>压缩方式</th>
|
|
|
|
|
<th>加密</th>
|
|
|
|
|
<th>多路复用</th>
|
|
|
|
|
<th>用户名</th>
|
|
|
|
|
<th>密码</th>
|
2019-01-25 04:10:12 +00:00
|
|
|
|
<th>出口流量</th>
|
|
|
|
|
<th>入口流量</th>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
<th>操作</th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
|
|
|
|
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</main>
|
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
|
|
|
|
function del(host) {
|
|
|
|
|
if (confirm("确定要删除数据吗?")) {
|
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
|
|
|
|
url: "/index/delhost",
|
|
|
|
|
data: {"host": host},
|
|
|
|
|
success: function (res) {
|
|
|
|
|
alert(res.msg)
|
|
|
|
|
if (res.status) {
|
|
|
|
|
document.location.reload();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function add() {
|
2019-01-25 04:10:12 +00:00
|
|
|
|
window.location.href = "/index/addhost?vkey={{.task_id}}&client_id={{.client_id}}"
|
2018-12-11 08:37:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2019-01-12 16:09:12 +00:00
|
|
|
|
function edit(host) {
|
|
|
|
|
window.location.href = "/index/edithost?host=" + host
|
|
|
|
|
}
|
|
|
|
|
|
2018-12-11 08:37:12 +00:00
|
|
|
|
$(document).ready(function () {
|
|
|
|
|
var table = $('#sampleTable').DataTable({
|
2019-01-25 04:10:12 +00:00
|
|
|
|
responsive: {
|
|
|
|
|
details: {
|
|
|
|
|
display: $.fn.dataTable.Responsive.display.childRowImmediate
|
|
|
|
|
}
|
|
|
|
|
},
|
2018-12-11 08:37:12 +00:00
|
|
|
|
dom: 'Bfrtip',
|
|
|
|
|
processing: true,
|
|
|
|
|
serverSide: true,
|
|
|
|
|
autoWidth: false,
|
|
|
|
|
ordering: false,
|
|
|
|
|
ajax: {
|
|
|
|
|
url: window.location,
|
|
|
|
|
type: 'POST'
|
|
|
|
|
},
|
|
|
|
|
dom: '<"top"fl><"toolbar">rt<"bottom"ip><"clear">',
|
|
|
|
|
columns: [ //这个是显示到界面上的个数据 格式为 {data:'显示的字段名'}
|
2019-01-26 09:27:28 +00:00
|
|
|
|
{data: 'Remark'},
|
2019-01-25 04:10:12 +00:00
|
|
|
|
{data: 'Remark'},
|
2018-12-11 08:37:12 +00:00
|
|
|
|
{data: 'Host'},
|
|
|
|
|
{data: 'Target'},
|
2019-01-25 04:10:12 +00:00
|
|
|
|
{data: 'HostChange'},
|
|
|
|
|
{data: 'HostChange'},
|
|
|
|
|
{data: 'HostChange'},
|
2019-01-26 09:27:28 +00:00
|
|
|
|
{data: 'HostChange'},
|
|
|
|
|
{data: 'HostChange'},
|
|
|
|
|
{data: 'HostChange'},
|
|
|
|
|
{data: 'HostChange'},
|
|
|
|
|
{data: 'HostChange'},
|
2018-12-11 08:37:12 +00:00
|
|
|
|
{data: 'Target'},
|
|
|
|
|
],
|
|
|
|
|
bFilter: false,
|
|
|
|
|
columnDefs: [{
|
|
|
|
|
targets: -1,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
|
|
|
|
|
return '<div class="btn-group" role="group" aria-label="..."> ' +
|
|
|
|
|
'<button onclick="del(\'' + row.Host + '\')" type="button" class="btn btn-danger btn-sm">删除</button>' +
|
2019-01-12 16:09:12 +00:00
|
|
|
|
'<button onclick="edit(\'' + row.Host + '\')" type="button" class="btn btn-primary btn-sm">编辑查看</button> '
|
|
|
|
|
+ ' </div>'
|
2018-12-11 08:37:12 +00:00
|
|
|
|
}
|
2019-01-25 04:10:12 +00:00
|
|
|
|
},
|
2019-01-26 09:27:28 +00:00
|
|
|
|
{
|
2019-01-28 06:45:55 +00:00
|
|
|
|
targets: 0,
|
2019-01-26 09:27:28 +00:00
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
return row.Client.Id
|
|
|
|
|
}
|
|
|
|
|
},
|
2019-01-25 04:10:12 +00:00
|
|
|
|
{
|
|
|
|
|
targets: -2,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
return change(row.Flow.InletFlow)
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
targets: -3,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
return change(row.Flow.ExportFlow)
|
|
|
|
|
}
|
2019-01-26 09:27:28 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
targets: -4,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
return row.Client.Cnf.P
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
targets: -5,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
return row.Client.Cnf.U
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
targets: -6,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
if (row.Client.Cnf.Mux == "0") {
|
|
|
|
|
return "不启用"
|
|
|
|
|
} else {
|
|
|
|
|
return "启用"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
{
|
|
|
|
|
targets: -7,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
if (row.Client.Cnf.Crypt == "0") {
|
|
|
|
|
return "不加密"
|
|
|
|
|
} else {
|
|
|
|
|
return "加密"
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
,
|
|
|
|
|
{
|
|
|
|
|
targets: -8,
|
|
|
|
|
render: function (data, type, row, meta) {
|
|
|
|
|
return row.Client.Cnf.Compress
|
|
|
|
|
}
|
2019-01-25 04:10:12 +00:00
|
|
|
|
}
|
2018-12-11 08:37:12 +00:00
|
|
|
|
],
|
|
|
|
|
buttons: []
|
|
|
|
|
});
|
|
|
|
|
$("#sampleTable_length").html('<button class="btn btn-primary" onclick="add()" type="button">新增</button>')
|
|
|
|
|
})
|
|
|
|
|
;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|