2019-03-01 09:23:14 +00:00
|
|
|
|
<div class="wrapper wrapper-content animated fadeInRight">
|
2018-12-11 08:37:12 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
<div class="row">
|
|
|
|
|
<div class="col-lg-12">
|
|
|
|
|
<div class="ibox float-e-margins">
|
|
|
|
|
<div class="ibox-title">
|
|
|
|
|
<h5>host list</h5>
|
|
|
|
|
|
|
|
|
|
<div class="ibox-tools">
|
|
|
|
|
<a class="collapse-link">
|
|
|
|
|
<i class="fa fa-chevron-up"></i>
|
|
|
|
|
</a>
|
|
|
|
|
<a class="close-link">
|
|
|
|
|
<i class="fa fa-times"></i>
|
|
|
|
|
</a>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="content">
|
|
|
|
|
<div class="table-responsive">
|
|
|
|
|
<div id="toolbar">
|
2019-05-10 16:29:55 +00:00
|
|
|
|
<a href="{{.web_base_url}}/index/addhost?vkey={{.task_id}}&client_id={{.client_id}}"
|
2019-03-01 09:23:14 +00:00
|
|
|
|
class="btn btn-primary dim"
|
2019-03-23 14:19:59 +00:00
|
|
|
|
type="button" langtag="info-new">新增</a>
|
2019-03-01 09:23:14 +00:00
|
|
|
|
</div>
|
|
|
|
|
<table id="taskList_table" class="table-striped table-hover"
|
|
|
|
|
data-mobile-responsive="true"></table>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
<div class="ibox-content">
|
|
|
|
|
|
|
|
|
|
<table id="table"></table>
|
|
|
|
|
|
|
|
|
|
</div>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
2019-03-01 09:23:14 +00:00
|
|
|
|
|
|
|
|
|
<script>
|
|
|
|
|
/*bootstrap table*/
|
|
|
|
|
$('#table').bootstrapTable({
|
|
|
|
|
toolbar: "#toolbar",
|
|
|
|
|
method: 'post', // 服务器数据的请求方式 get or post
|
|
|
|
|
url: window.location, // 服务器数据的加载地址
|
|
|
|
|
queryParams: function (params) {
|
|
|
|
|
return {
|
|
|
|
|
"offset": params.offset,
|
|
|
|
|
"limit": params.limit,
|
2019-03-23 14:19:59 +00:00
|
|
|
|
"search": params.search
|
2019-03-01 09:23:14 +00:00
|
|
|
|
}
|
|
|
|
|
},
|
2019-03-23 14:19:59 +00:00
|
|
|
|
search: true,
|
2019-03-01 09:23:14 +00:00
|
|
|
|
contentType: "application/x-www-form-urlencoded",
|
|
|
|
|
striped: true, // 设置为true会有隔行变色效果
|
|
|
|
|
showHeader: true,
|
|
|
|
|
showColumns: true,
|
|
|
|
|
showRefresh: true,
|
|
|
|
|
pagination: true,//分页
|
|
|
|
|
sidePagination: 'server',//服务器端分页
|
|
|
|
|
pageNumber: 1,
|
|
|
|
|
pageList: [5, 10, 20, 50],//分页步进值
|
|
|
|
|
detailView: true,
|
|
|
|
|
smartDisplay: true, // 智能显示 pagination 和 cardview 等
|
|
|
|
|
detailFormatter: function (index, row, element) {
|
2019-03-23 14:19:59 +00:00
|
|
|
|
return '<b langtag="info-export-flow">出口流量</b>:' + change(row.Flow.ExportFlow) + `       `
|
|
|
|
|
+ '<b langtag="info-inlet-flow">入口流量</b>:' + change(row.Flow.InletFlow) + `       `
|
|
|
|
|
+ '<b langtag="info-crypt">加密</b>:' + row.Client.Cnf.Crypt + `       `
|
|
|
|
|
+ '<b langtag="info-compress">压缩</b>:' + row.Client.Cnf.Compress + `       ` + "<br/><br>"
|
|
|
|
|
+ '<b langtag="info-web-auth-username">basic权限认证用户名</b>:' + row.Client.Cnf.U + `       `
|
|
|
|
|
+ '<b langtag="info-web-auth-password">basic权限认证密码</b>:' + row.Client.Cnf.P + `       ` + "<br/><br>"
|
2019-03-30 04:03:17 +00:00
|
|
|
|
+ '<b langtag="info-https-cert">cert file路径</b>:' + row.CertFilePath + `       `
|
|
|
|
|
+ '<b langtag="info-https-key">key file路径</b>:' + row.KeyFilePath + `       ` + "<br/><br>"
|
2019-03-23 14:19:59 +00:00
|
|
|
|
+ '<b langtag="info-header-change">request header修改</b>:' + row.HeaderChange + `       ` + "<br/><br>"
|
|
|
|
|
+ '<b langtag="info-host-change">request host 修改</b>:' + row.HostChange + `       `
|
2019-03-01 09:23:14 +00:00
|
|
|
|
},
|
|
|
|
|
//表格的列
|
|
|
|
|
columns: [
|
|
|
|
|
{
|
|
|
|
|
field: 'Id',//域值
|
|
|
|
|
title: 'id',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'Id',//域值
|
|
|
|
|
title: 'client id',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return row.Client.Id
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'Remark',//域值
|
|
|
|
|
title: 'remark',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'Host',//域值
|
|
|
|
|
title: 'host',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
},
|
2019-03-05 01:23:18 +00:00
|
|
|
|
{
|
|
|
|
|
field: 'Scheme',//域值
|
|
|
|
|
title: 'scheme',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-05 01:23:18 +00:00
|
|
|
|
},
|
2019-03-01 09:23:14 +00:00
|
|
|
|
{
|
|
|
|
|
field: 'Target',//域值
|
|
|
|
|
title: 'target',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-29 02:41:57 +00:00
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
return row.Target.TargetStr
|
|
|
|
|
}
|
2019-03-01 09:23:14 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'Location',//域值
|
|
|
|
|
title: 'location',//标题
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: '',//域值
|
|
|
|
|
title: 'client status',//内容
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
if (row.Client.IsConnect) {
|
|
|
|
|
return '<span class="badge badge-primary">online</span>'
|
|
|
|
|
} else {
|
|
|
|
|
return '<span class="badge badge-badge">offline</span>'
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
},
|
|
|
|
|
{
|
|
|
|
|
field: 'option',//域值
|
|
|
|
|
title: 'option',//内容
|
|
|
|
|
visible: true,//false表示不显示
|
2019-03-30 04:03:17 +00:00
|
|
|
|
|
2019-03-01 09:23:14 +00:00
|
|
|
|
formatter: function (value, row, index) {
|
|
|
|
|
btn_group = '<div class="btn-group">'
|
|
|
|
|
btn = `<button onclick="del(` + row.Id + `)" class="btn-danger"><i class="fa fa-trash"></i></button><button onclick="edit(` + row.Id + `)" class="btn-primary"><i class="fa fa-edit"></i></button></div>`
|
|
|
|
|
return btn_group + btn
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
]
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
</script>
|
2018-12-11 08:37:12 +00:00
|
|
|
|
|
|
|
|
|
<script type="text/javascript">
|
2019-02-15 14:59:28 +00:00
|
|
|
|
function del(id) {
|
2019-03-01 09:23:14 +00:00
|
|
|
|
if (confirm("Are you sure you want to delete it??")) {
|
2018-12-11 08:37:12 +00:00
|
|
|
|
$.ajax({
|
|
|
|
|
type: "POST",
|
2019-05-10 16:29:55 +00:00
|
|
|
|
url: "{{.web_base_url}}/index/delhost",
|
2019-02-15 14:59:28 +00:00
|
|
|
|
data: {"id": id},
|
2018-12-11 08:37:12 +00:00
|
|
|
|
success: function (res) {
|
|
|
|
|
alert(res.msg)
|
|
|
|
|
if (res.status) {
|
|
|
|
|
document.location.reload();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
})
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
2019-02-15 14:59:28 +00:00
|
|
|
|
function edit(id) {
|
2019-05-10 16:29:55 +00:00
|
|
|
|
window.location.href = "{{.web_base_url}}/index/edithost?id=" + id
|
2019-01-12 16:09:12 +00:00
|
|
|
|
}
|
|
|
|
|
|
2018-12-11 08:37:12 +00:00
|
|
|
|
|
|
|
|
|
</script>
|