增加 web_base_url 配置, 用于配置 web 后台可置于代理子路径下

This commit is contained in:
涵曦
2019-05-10 16:29:55 +00:00
parent 4b7b2f4c27
commit 383dbd1b7b
21 changed files with 124 additions and 73 deletions

View File

@@ -20,7 +20,7 @@
<div class="table-responsive">
<div id="toolbar">
<a href="/client/add" class="btn btn-primary dim" type="button" langtag="info-new">新增</a>
<a href="{{.web_base_url}}/client/add" class="btn btn-primary dim" type="button" langtag="info-new">新增</a>
</div>
<table id="taskList_table" class="table-striped table-hover"
data-mobile-responsive="true"></table>
@@ -42,7 +42,7 @@
if (confirm("Are you sure you want to delete it")) {
$.ajax({
type: "POST",
url: "/client/del",
url: "{{.web_base_url}}/client/del",
data: {"id": id},
success: function (res) {
alert(res.msg)
@@ -58,7 +58,7 @@
if (confirm("Are you sure you want to start it")) {
$.ajax({
type: "POST",
url: "/client/changestatus",
url: "{{.web_base_url}}/client/changestatus",
data: {"id": id, "status": 1},
success: function (res) {
alert(res.msg)
@@ -74,7 +74,7 @@
if (confirm("Are you sure you want to stop it")) {
$.ajax({
type: "POST",
url: "/client/changestatus",
url: "{{.web_base_url}}/client/changestatus",
data: {
"id": id, "status": 0
},
@@ -90,26 +90,26 @@
}
function edit(id) {
window.location.href = "/client/edit?id=" + id
window.location.href = "{{.web_base_url}}/client/edit?id=" + id
}
function add() {
window.location.href = "/client/add"
window.location.href = "{{.web_base_url}}/client/add"
}
function tunnel(id) {
window.location.href = "/index/all?client_id=" + id
window.location.href = "{{.web_base_url}}/index/all?client_id=" + id
}
function host(id) {
window.location.href = "/index/hostlist?client_id=" + id
window.location.href = "{{.web_base_url}}/index/hostlist?client_id=" + id
}
/*bootstrap table*/
$('#table').bootstrapTable({
toolbar: "#toolbar",
method: 'post', // 服务器数据的请求方式 get or post
url: "/client/list", // 服务器数据的加载地址
url: "{{.web_base_url}}/client/list", // 服务器数据的加载地址
contentType: "application/x-www-form-urlencoded",
striped: true, // 设置为true会有隔行变色效果
search: true,