diff --git a/app/controller/Cert.php b/app/controller/Cert.php
index de42a679..6427d9b8 100644
--- a/app/controller/Cert.php
+++ b/app/controller/Cert.php
@@ -33,13 +33,21 @@ public function account_data()
$kw = $this->request->post('kw', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('cert_account')->where('deploy', $deploy);
if (!empty($kw)) {
$select->whereLike('name|remark', '%' . $kw . '%')->whereOr('id', $kw);
}
$total = $select->count();
- $rows = $select->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'id', 'typename' => 'type', 'name' => 'name', 'remark' => 'remark', 'addtime' => 'addtime'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('id', 'desc');
+ }
+ $rows = $select->limit($offset, $limit)->select();
$list = [];
foreach ($rows as $row) {
@@ -216,6 +224,8 @@ public function order_data()
$status = input('post.status', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('cert_order')->alias('A')->leftJoin('cert_account B', 'A.aid = B.id');
if (!empty($id)) {
@@ -242,7 +252,13 @@ public function order_data()
}
}
$total = $select->count();
- $rows = $select->fieldRaw('A.*,B.type,B.remark aremark')->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'A.id', 'typename' => 'B.type', 'keytype' => 'A.keytype', 'isauto' => 'A.isauto', 'issuetime' => 'A.issuetime', 'end_day' => 'A.expiretime', 'status' => 'A.status'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
+ }
+ $rows = $select->fieldRaw('A.*,B.type,B.remark aremark')->limit($offset, $limit)->select();
$list = [];
foreach ($rows as $row) {
@@ -650,6 +666,8 @@ public function deploy_data()
$remark = input('post.remark', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('cert_deploy')->alias('A')->leftJoin('cert_account B', 'A.aid = B.id')->leftJoin('cert_order C', 'A.oid = C.id')->leftJoin('cert_account D', 'C.aid = D.id');
if (!empty($oid)) {
@@ -671,7 +689,13 @@ public function deploy_data()
$select->where('A.remark', $remark);
}
$total = $select->count();
- $rows = $select->fieldRaw('A.*,B.type,B.remark aremark,B.name aname,D.type certtype,D.id certaid')->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'A.id', 'typename' => 'B.type', 'remark' => 'A.remark', 'active' => 'A.active', 'lasttime' => 'A.lasttime', 'status' => 'A.status'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
+ }
+ $rows = $select->fieldRaw('A.*,B.type,B.remark aremark,B.name aname,D.type certtype,D.id certaid')->limit($offset, $limit)->select();
$list = [];
foreach ($rows as $row) {
@@ -862,13 +886,21 @@ public function cname_data()
$kw = $this->request->post('kw', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('cert_cname')->alias('A')->leftJoin('domain B', 'A.did = B.id');
if (!empty($kw)) {
$select->whereLike('A.domain', '%' . $kw . '%');
}
$total = $select->count();
- $rows = $select->order('A.id', 'desc')->limit($offset, $limit)->field('A.*,B.name cnamedomain')->select();
+ $allowedSort = ['id' => 'A.id', 'domain' => 'A.domain', 'status' => 'A.status', 'addtime' => 'A.addtime'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
+ }
+ $rows = $select->limit($offset, $limit)->field('A.*,B.name cnamedomain')->select();
$list = [];
foreach ($rows as $row) {
diff --git a/app/controller/Dmonitor.php b/app/controller/Dmonitor.php
index 8b0b6171..ba19d9df 100644
--- a/app/controller/Dmonitor.php
+++ b/app/controller/Dmonitor.php
@@ -43,6 +43,8 @@ public function task_data()
$kw = input('post.kw', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('dmtask')->alias('A')->join('domain B', 'A.did = B.id');
if (!empty($kw)) {
@@ -62,7 +64,13 @@ public function task_data()
$select->where('status', intval($status));
}
$total = $select->count();
- $list = $select->order('A.id', 'desc')->limit($offset, $limit)->field('A.*,B.name domain')->select()->toArray();
+ $allowedSort = ['id' => 'A.id', 'rr' => 'A.rr', 'main_value' => 'A.main_value', 'type' => 'A.type', 'checktype' => 'A.checktype', 'frequency' => 'A.frequency', 'status' => 'A.status', 'active' => 'A.active', 'checktimestr' => 'A.checktime', 'addtimestr' => 'A.addtime', 'remark' => 'A.remark'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
+ }
+ $list = $select->limit($offset, $limit)->field('A.*,B.name domain')->select()->toArray();
foreach ($list as &$row) {
$row['addtimestr'] = date('Y-m-d H:i:s', $row['addtime']);
@@ -234,13 +242,21 @@ public function tasklog_data()
$offset = input('post.offset/d');
$limit = input('post.limit/d');
$action = input('post.action/d', 0);
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('dmlog')->where('taskid', $taskid);
if ($action > 0) {
$select->where('action', $action);
}
$total = $select->count();
- $list = $select->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'id', 'action' => 'action', 'date' => 'date', 'errmsg' => 'errmsg'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('id', 'desc');
+ }
+ $list = $select->limit($offset, $limit)->select();
return json(['total' => $total, 'rows' => $list]);
}
diff --git a/app/controller/Domain.php b/app/controller/Domain.php
index 905b7118..27065b54 100644
--- a/app/controller/Domain.php
+++ b/app/controller/Domain.php
@@ -26,13 +26,21 @@ public function account_data()
$kw = $this->request->post('kw', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('account');
if (!empty($kw)) {
$select->whereLike('name|remark', '%' . $kw . '%');
}
$total = $select->count();
- $rows = $select->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'id', 'typename' => 'type', 'name' => 'name', 'remark' => 'remark', 'addtime' => 'addtime'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('id', 'desc');
+ }
+ $rows = $select->limit($offset, $limit)->select();
$list = [];
foreach ($rows as $row) {
@@ -192,7 +200,8 @@ public function domain_data()
$type = input('post.type', null, 'trim');
$status = input('post.status', null, 'trim');
$cid = input('post.cid', null, 'trim');
- $order = input('post.order', null, 'trim');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$offset = input('post.offset/d', 0);
$limit = input('post.limit/d', 10);
$id = input('post.id');
@@ -224,21 +233,11 @@ public function domain_data()
}
}
$total = $select->count();
- switch ($order) {
- case '1':
- $select->order('A.regtime', 'asc');
- break;
- case '2':
- $select->order('A.regtime', 'desc');
- break;
- case '3':
- $select->order('A.expiretime', 'asc');
- break;
- case '4':
- $select->order('A.expiretime', 'desc');
- break;
- default:
- $select->order('A.id', 'desc');
+ $allowedSort = ['id' => 'A.id', 'name' => 'A.name', 'recordcount' => 'A.recordcount', 'addtime' => 'A.addtime', 'regtime' => 'A.regtime', 'expiretime' => 'A.expiretime', 'is_notice' => 'A.is_notice', 'is_hide' => 'A.is_hide', 'is_sso' => 'A.is_sso', 'typename' => 'B.type', 'category_name' => 'A.cid', 'remark' => 'A.remark'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
}
$rows = $select->fieldRaw('A.*,B.type,B.remark aremark')->limit($offset, $limit)->select();
@@ -1392,10 +1391,18 @@ public function category_data()
if (!checkPermission(2)) return json(['total' => 0, 'rows' => []]);
$offset = input('post.offset/d', 0);
$limit = input('post.limit/d', 10);
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('domain_category');
$total = $select->count();
- $rows = $select->order('sort', 'asc')->order('id', 'desc')->limit($offset, $limit)->select()->toArray();
+ $allowedSort = ['id' => 'id', 'name' => 'name', 'remark' => 'remark', 'sort' => 'sort', 'addtime' => 'addtime'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('id', 'desc');
+ }
+ $rows = $select->limit($offset, $limit)->select()->toArray();
foreach ($rows as &$row) {
$row['domain_count'] = Db::name('domain')->where('cid', $row['id'])->count();
diff --git a/app/controller/Optimizeip.php b/app/controller/Optimizeip.php
index ac749f1d..bbe2ec11 100644
--- a/app/controller/Optimizeip.php
+++ b/app/controller/Optimizeip.php
@@ -45,6 +45,8 @@ public function opiplist_data()
$status = input('post.status', null);
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('optimizeip')->alias('A')->join('domain B', 'A.did = B.id');
if (!empty($kw)) {
@@ -58,7 +60,13 @@ public function opiplist_data()
$select->where('status', intval($status));
}
$total = $select->count();
- $list = $select->order('A.id', 'desc')->limit($offset, $limit)->field('A.*,B.name domain')->select();
+ $allowedSort = ['id' => 'A.id', 'rr' => 'A.rr', 'cdn_type' => 'A.cdn_type', 'recordnum' => 'A.recordnum', 'ip_type' => 'A.ip_type', 'active' => 'A.active', 'updatetime' => 'A.updatetime', 'status' => 'A.status'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
+ }
+ $list = $select->limit($offset, $limit)->field('A.*,B.name domain')->select();
return json(['total' => $total, 'rows' => $list]);
}
diff --git a/app/controller/Schedule.php b/app/controller/Schedule.php
index 8350be45..8311d361 100644
--- a/app/controller/Schedule.php
+++ b/app/controller/Schedule.php
@@ -24,6 +24,8 @@ public function stask_data()
$stype = input('post.stype', null);
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('sctask')->alias('A')->join('domain B', 'A.did = B.id');
if (!empty($kw)) {
@@ -41,7 +43,13 @@ public function stask_data()
$select->where('type', $stype);
}
$total = $select->count();
- $list = $select->order('A.id', 'desc')->limit($offset, $limit)->field('A.*,B.name domain')->select()->toArray();
+ $allowedSort = ['id' => 'A.id', 'rr' => 'A.rr', 'type' => 'A.type', 'switchtype' => 'A.switchtype', 'active' => 'A.active', 'updatetimestr' => 'A.updatetime', 'nexttimestr' => 'A.nexttime', 'addtimestr' => 'A.addtime', 'remark' => 'A.remark'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('A.id', 'desc');
+ }
+ $list = $select->limit($offset, $limit)->field('A.*,B.name domain')->select()->toArray();
foreach ($list as &$row) {
$row['addtimestr'] = date('Y-m-d H:i:s', $row['addtime']);
diff --git a/app/controller/User.php b/app/controller/User.php
index 91242ce8..f67d75c5 100644
--- a/app/controller/User.php
+++ b/app/controller/User.php
@@ -28,13 +28,21 @@ public function user_data()
$kw = input('post.kw', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('user');
if (!empty($kw)) {
$select->whereLike('id|username', $kw);
}
$total = $select->count();
- $rows = $select->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'id', 'username' => 'username', 'level' => 'level', 'is_api' => 'is_api', 'regtime' => 'regtime', 'lasttime' => 'lasttime', 'status' => 'status'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('id', 'desc');
+ }
+ $rows = $select->limit($offset, $limit)->select();
return json(['total' => $total, 'rows' => $rows]);
}
@@ -165,6 +173,8 @@ public function log_data()
$domain = input('post.domain', null, 'trim');
$offset = input('post.offset/d');
$limit = input('post.limit/d');
+ $sort = input('post.sortName', null, 'trim');
+ $orderDir = strtolower(input('post.sortOrder', 'desc')) === 'asc' ? 'asc' : 'desc';
$select = Db::name('log');
if ($this->request->user['type'] == 'domain') {
@@ -181,7 +191,13 @@ public function log_data()
$select->where('domain', $domain);
}
$total = $select->count();
- $rows = $select->order('id', 'desc')->limit($offset, $limit)->select();
+ $allowedSort = ['id' => 'id', 'uid' => 'uid', 'domain' => 'domain', 'action' => 'action', 'data' => 'data', 'addtime' => 'addtime'];
+ if ($sort && isset($allowedSort[$sort])) {
+ $select->order($allowedSort[$sort], $orderDir);
+ } else {
+ $select->order('id', 'desc');
+ }
+ $rows = $select->limit($offset, $limit)->select();
return json(['total' => $total, 'rows' => $rows]);
}
diff --git a/app/view/cert/certaccount.html b/app/view/cert/certaccount.html
index 4f599dc3..91869f60 100644
--- a/app/view/cert/certaccount.html
+++ b/app/view/cert/certaccount.html
@@ -34,35 +34,70 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/cert/account/data?deploy=0',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'typename',
title: '所属平台',
+ sortable: true,
formatter: function(value, row, index) {
return '
'+value;
}
},
{
field: 'name',
- title: '账户名称'
+ title: '账户名称',
+ sortable: true
},
{
field: 'remark',
- title: '备注'
+ title: '备注',
+ sortable: true
},
{
field: 'addtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/cert/certorder.html b/app/view/cert/certorder.html
index 7634f8ce..d9f2d726 100644
--- a/app/view/cert/certorder.html
+++ b/app/view/cert/certorder.html
@@ -62,6 +62,8 @@
const defaultPageSize = 10;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/cert/order/data',
@@ -69,6 +71,34 @@
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
uniqueId: 'id',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: '',
@@ -76,14 +106,16 @@
},
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'typename',
title: '证书账户',
+ sortable: true,
formatter: function(value, row, index) {
if(value){
- return '
'+value+'('+row.aid+')';
+ return '
'+value+'('+row.aid+')';
}
return '手动续期';
}
@@ -98,6 +130,7 @@
{
field: 'keytype',
title: '证书信息',
+ sortable: true,
formatter: function(value, row, index) {
return '签名算法:'+row.keytype+'('+row.keysize+')'+(row.issuer?'
颁发机构:'+row.issuer:'');
}
@@ -105,17 +138,19 @@
{
field: 'isauto',
title: '自动续签',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
- return '
';
+ return '';
}else{
- return '';
+ return '';
}
}
},
{
field: 'issuetime',
title: '签发时间',
+ sortable: true,
formatter: function(value, row, index) {
return value ? value.substring(0,10) : '暂未签发';
}
@@ -123,6 +158,7 @@
{
field: 'end_day',
title: '到期时间',
+ sortable: true,
formatter: function(value, row, index) {
if(value != null){
if(value > 7){
@@ -133,18 +169,19 @@
return '已过期';
}
}else{
- return '暂未签发';
+ return '暂未签发';
}
}
},
{
field: 'status',
title: '状态',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 4) {
- return '已吊销';
+ return '已吊销';
} else if(value == 3) {
- return '已签发';
+ return '已签发';
} else if(value == 2) {
if(row.retrytime != null){
var now = new Date().getTime();
@@ -156,7 +193,7 @@
return '正在验证';
}
}
- return '正在验证';
+ return '正在验证';
} else if(value == 1) {
if(row.retrytime != null){
var now = new Date().getTime();
@@ -168,9 +205,9 @@
return '待验证';
}
}
- return '待验证';
+ return '待验证';
} else if(value == 0) {
- return '待提交';
+ return '待提交';
} else {
var title = '失败';
if(value == -1) title = '购买证书失败';
@@ -190,7 +227,7 @@
return ''+title+''+(row.error?' ':'');
}
}
- return ''+title+''+(row.error?' ':'');
+ return ''+title+''+(row.error?' ':'');
}
}
},
diff --git a/app/view/cert/cname.html b/app/view/cert/cname.html
index 2acc283f..ff4a1aeb 100644
--- a/app/view/cert/cname.html
+++ b/app/view/cert/cname.html
@@ -81,6 +81,8 @@ 添加CNAME代理
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/cert/cname/data',
@@ -88,14 +90,44 @@ 添加CNAME代理
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
uniqueId: 'id',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'domain',
- title: '被代理域名'
+ title: '被代理域名',
+ sortable: true
},
{
field: 'host',
@@ -114,6 +146,7 @@ 添加CNAME代理
{
field: 'status',
title: '状态',
+ sortable: true,
formatter: function(value, row, index) {
var html = '';
if(value == 1) {
@@ -127,7 +160,8 @@ 添加CNAME代理
},
{
field: 'addtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/cert/deployaccount.html b/app/view/cert/deployaccount.html
index 509e8987..d7425a1e 100644
--- a/app/view/cert/deployaccount.html
+++ b/app/view/cert/deployaccount.html
@@ -34,35 +34,70 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/cert/account/data?deploy=1',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'typename',
title: '账户类型',
+ sortable: true,
formatter: function(value, row, index) {
return '
'+value;
}
},
{
field: 'name',
- title: '账户名称'
+ title: '账户名称',
+ sortable: true
},
{
field: 'remark',
- title: '备注'
+ title: '备注',
+ sortable: true
},
{
field: 'addtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/cert/deploytask.html b/app/view/cert/deploytask.html
index 17c04ff8..7f8bdefe 100644
--- a/app/view/cert/deploytask.html
+++ b/app/view/cert/deploytask.html
@@ -61,6 +61,8 @@
const defaultPageSize = 10;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/cert/deploy/data',
@@ -68,6 +70,34 @@
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
uniqueId: 'id',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: '',
@@ -75,11 +105,13 @@
},
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'typename',
title: '自动部署账户',
+ sortable: true,
formatter: function(value, row, index) {
if(!value) return '已被删除'
return '
'+(row.aremark?row.aremark:value+'('+row.aid+')')+'';
@@ -97,22 +129,25 @@
},
{
field: 'remark',
- title: '备注'
+ title: '备注',
+ sortable: true
},
{
field: 'active',
title: '任务开关',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
- return '';
+ return '';
}else{
- return '';
+ return '';
}
}
},
{
field: 'lasttime',
title: '上次执行时间',
+ sortable: true,
formatter: function(value, row, index) {
return value ? value : '暂未执行'
}
@@ -120,14 +155,15 @@
{
field: 'status',
title: '状态',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1) {
- return '已完成';
+ return '已完成';
} else if(value == 0) {
if(row.islock == 1) return '正在处理';
else return '待处理';
} else {
- return '处理失败'+(row.error?' ':'');
+ return '处理失败'+(row.error?' ':'');
}
}
},
diff --git a/app/view/dmonitor/task.html b/app/view/dmonitor/task.html
index 1691d7ce..c5dac556 100644
--- a/app/view/dmonitor/task.html
+++ b/app/view/dmonitor/task.html
@@ -52,12 +52,42 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/dmonitor/task/data',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: '',
@@ -65,11 +95,13 @@
},
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'rr',
title: '域名',
+ sortable: true,
formatter: function(value, row, index) {
return '' + value + '.' + row.domain + '';
}
@@ -77,6 +109,7 @@
{
field: 'main_value',
title: '解析记录',
+ sortable: true,
formatter: function(value, row, index) {
return value;
}
@@ -84,21 +117,23 @@
{
field: 'type',
title: '切换设置',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1) {
- return '暂停解析';
+ return '暂停解析';
} else if(value == 2) {
- return '切换备用';
+ return '切换备用';
} else if(value == 3) {
- return '条件开启';
+ return '条件开启';
} else {
- return '无操作';
+ return '无操作';
}
}
},
{
field: 'checktype',
title: '检测协议',
+ sortable: true,
formatter: function(value, row, index) {
if(row.type <= 2){
if(value == 1) {
@@ -109,13 +144,14 @@
return 'PING';
}
} else {
- return '无';
+ return '无';
}
}
},
{
field: 'frequency',
title: '检测间隔',
+ sortable: true,
formatter: function(value, row, index) {
return value + '秒';
}
@@ -123,37 +159,42 @@
{
field: 'status',
title: '健康状况',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 0) {
- return '正常';
+ return '正常';
} else {
- return '异常';
+ return '异常';
}
}
},
{
field: 'active',
title: '运行开关',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
- return '';
+ return '';
}else{
- return '';
+ return '';
}
}
},
{
field: 'checktimestr',
- title: '上次检测时间'
+ title: '上次检测时间',
+ sortable: true
},
{
field: 'addtimestr',
title: '添加时间',
+ sortable: true,
visible: false
},
{
field: 'remark',
title: '备注',
+ sortable: true,
visible: false
},
{
diff --git a/app/view/dmonitor/taskinfo.html b/app/view/dmonitor/taskinfo.html
index 57aa845d..878e702c 100644
--- a/app/view/dmonitor/taskinfo.html
+++ b/app/view/dmonitor/taskinfo.html
@@ -40,31 +40,65 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/dmonitor/task/log/data/{$info.id}',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'action',
title: '操作类型',
+ sortable: true,
formatter: function(value, row, index) {
return action_name[value];
}
},
{
field: 'date',
- title: '时间'
+ title: '时间',
+ sortable: true
},
{
field: 'errmsg',
- title: '异常原因'
+ title: '异常原因',
+ sortable: true
}
],
})
diff --git a/app/view/domain/account.html b/app/view/domain/account.html
index 0db3a416..4ca10d37 100644
--- a/app/view/domain/account.html
+++ b/app/view/domain/account.html
@@ -35,35 +35,70 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/account/data',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'typename',
title: '所属平台',
+ sortable: true,
formatter: function(value, row, index) {
return '
'+value;
}
},
{
field: 'name',
- title: '账户名称'
+ title: '账户名称',
+ sortable: true
},
{
field: 'remark',
- title: '备注'
+ title: '备注',
+ sortable: true
},
{
field: 'addtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/domain/category.html b/app/view/domain/category.html
index 99448a78..9b60dfd6 100644
--- a/app/view/domain/category.html
+++ b/app/view/domain/category.html
@@ -68,6 +68,8 @@ 域名分类管理
let defaultPageSize = getCookie('category_pagesize') ? getCookie('category_pagesize') : 10;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/domain/category/data',
@@ -75,25 +77,57 @@ 域名分类管理
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
uniqueId: 'id',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'name',
- title: '分类名称'
+ title: '分类名称',
+ sortable: true
},
{
field: 'remark',
title: '备注',
+ sortable: true,
formatter: function(value, row, index) {
return value ? value : '-';
}
},
{
field: 'sort',
- title: '排序'
+ title: '排序',
+ sortable: true
},
{
field: 'domain_count',
@@ -104,7 +138,8 @@ 域名分类管理
},
{
field: 'addtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/domain/domain.html b/app/view/domain/domain.html
index c3ae3a77..5a24982c 100644
--- a/app/view/domain/domain.html
+++ b/app/view/domain/domain.html
@@ -155,9 +155,6 @@ 修改域名配置
-
-
-
刷新
{if $user['level'] eq 2} 添加
@@ -192,6 +189,8 @@ 修改域名配置
const defaultPageSize = getCookie('domain_pagesize') ? getCookie('domain_pagesize') : 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/domain/data',
@@ -199,6 +198,34 @@ 修改域名配置
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
uniqueId: 'id',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: '',
@@ -206,11 +233,13 @@ 修改域名配置
},
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'typename',
title: '平台账户',
+ sortable: true,
formatter: function(value, row, index) {
return '
'+(row.aremark?row.aremark:value+'('+row.aid+')');
}
@@ -218,21 +247,25 @@ 修改域名配置
{
field: 'name',
title: '域名',
+ sortable: true,
formatter: function(value, row, index) {
return ''+value+'';
}
},
{
field: 'recordcount',
- title: '记录数'
+ title: '记录数',
+ sortable: true
},
{
field: 'addtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'regtime',
title: '注册时间',
+ sortable: true,
visible: false,
formatter: function(value, row, index) {
var html = '';
@@ -251,6 +284,7 @@ 修改域名配置
{
field: 'expiretime',
title: '到期时间',
+ sortable: true,
formatter: function(value, row, index) {
var html = '';
if(value == null) {
@@ -278,6 +312,7 @@ 修改域名配置
{
field: 'is_notice',
title: '到期提醒',
+ sortable: true,
formatter: function(value, row, index) {
return value==1?'是':'否';
}
@@ -285,6 +320,7 @@ 修改域名配置
{
field: 'is_hide',
title: '是否隐藏',
+ sortable: true,
visible: false,
formatter: function(value, row, index) {
return value==1?'是':'否';
@@ -293,6 +329,7 @@ 修改域名配置
{
field: 'is_sso',
title: '对接开关',
+ sortable: true,
visible: false,
formatter: function(value, row, index) {
return value==1?'是':'否';
@@ -301,13 +338,15 @@ 修改域名配置
{
field: 'category_name',
title: '分类',
+ sortable: true,
formatter: function(value, row, index) {
return value ? '' + value + '' : '-';
}
},
{
field: 'remark',
- title: '备注'
+ title: '备注',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/optimizeip/opiplist.html b/app/view/optimizeip/opiplist.html
index 8a479455..f0e921be 100644
--- a/app/view/optimizeip/opiplist.html
+++ b/app/view/optimizeip/opiplist.html
@@ -47,20 +47,52 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/optimizeip/opiplist/data',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'rr',
title: '域名',
+ sortable: true,
formatter: function(value, row, index) {
return '' + value + '.' + row.domain + '';
}
@@ -68,23 +100,25 @@
{
field: 'cdn_type',
title: 'CDN运营商',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
- return 'CloudFlare';
+ return 'CloudFlare';
}else if(value == 2){
- return 'CloudFront';
+ return 'CloudFront';
}else if(value == 3){
- return 'Gcore';
+ return 'Gcore';
}else if(value == 4){
- return 'EdgeOne';
+ return 'EdgeOne';
}else{
- return '未知';
+ return '未知';
}
}
},
{
field: 'recordnum',
title: '解析数量',
+ sortable: true,
formatter: function(value, row, index) {
return ''+value+'';
}
@@ -92,6 +126,7 @@
{
field: 'ip_type',
title: '解析IP类型',
+ sortable: true,
formatter: function(value, row, index) {
var value = value.split(',')
value.forEach((element, index) => {
@@ -104,17 +139,19 @@
{
field: 'active',
title: '任务开关',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
- return '';
+ return '';
}else{
- return '';
+ return '';
}
}
},
{
field: 'updatetime',
title: '上次更新时间',
+ sortable: true,
formatter: function(value, row, index) {
return value ? value : '无';
}
@@ -122,13 +159,14 @@
{
field: 'status',
title: '上次更新结果',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1) {
- return '成功';
+ return '成功';
} else if(value == 2) {
- return '失败 ';
+ return '失败 ';
} else {
- return '未运行';
+ return '未运行';
}
}
},
diff --git a/app/view/schedule/stask.html b/app/view/schedule/stask.html
index 82a28245..e898d729 100644
--- a/app/view/schedule/stask.html
+++ b/app/view/schedule/stask.html
@@ -52,12 +52,42 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/schedule/stask/data',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: '',
@@ -65,11 +95,13 @@
},
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'rr',
title: '域名',
+ sortable: true,
formatter: function(value, row, index) {
return '' + value + '.' + row.domain + '';
}
@@ -77,6 +109,7 @@
{
field: 'type',
title: '时间设置',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
var text = '周期执行 ';
@@ -97,46 +130,52 @@
{
field: 'switchtype',
title: '切换设置',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1) {
- return '启用解析';
+ return '启用解析';
} else if(value == 2) {
- return '暂停解析';
+ return '暂停解析';
} else if(value == 3) {
- return '删除解析';
+ return '删除解析';
} else {
- return '修改解析['+row.value+']';
+ return '修改解析['+row.value+']';
}
}
},
{
field: 'active',
title: '运行开关',
+ sortable: true,
formatter: function(value, row, index) {
if(value == 1){
- return '';
+ return '';
}else{
- return '';
+ return '';
}
}
},
{
field: 'updatetimestr',
- title: '上次切换时间'
+ title: '上次切换时间',
+ sortable: true
},
{
field: 'nexttimestr',
title: '下次切换时间',
+ sortable: true,
visible: false
},
{
field: 'addtimestr',
title: '添加时间',
+ sortable: true,
visible: false
},
{
field: 'remark',
- title: '备注'
+ title: '备注',
+ sortable: true
},
{
field: 'action',
diff --git a/app/view/user/log.html b/app/view/user/log.html
index 4cf9886a..e46a0a26 100644
--- a/app/view/user/log.html
+++ b/app/view/user/log.html
@@ -36,39 +36,75 @@
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/log/data',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'ID'
+ title: 'ID',
+ sortable: true
},
{
field: 'uid',
title: 'UID',
+ sortable: true,
formatter: function(value, row, index) {
return value>0?''+value+'':'管理员';
}
},
{
field: 'domain',
- title: '域名'
+ title: '域名',
+ sortable: true
},
{
field: 'action',
- title: '操作类型'
+ title: '操作类型',
+ sortable: true
},
{
field: 'data',
- title: '操作详情'
+ title: '操作详情',
+ sortable: true
},
{
field: 'addtime',
- title: '时间'
+ title: '时间',
+ sortable: true
}
],
})
diff --git a/app/view/user/user.html b/app/view/user/user.html
index 25e83ff6..a7315868 100644
--- a/app/view/user/user.html
+++ b/app/view/user/user.html
@@ -120,24 +120,57 @@ 用户修改/添加
const defaultPageSize = 15;
const pageNumber = typeof window.$_GET['pageNumber'] != 'undefined' ? parseInt(window.$_GET['pageNumber']) : 1;
const pageSize = typeof window.$_GET['pageSize'] != 'undefined' ? parseInt(window.$_GET['pageSize']) : defaultPageSize;
+ var urlSort = typeof window.$_GET['sortName'] != 'undefined' ? window.$_GET['sortName'] : undefined;
+ var urlOrder = typeof window.$_GET['sortOrder'] != 'undefined' ? window.$_GET['sortOrder'] : undefined;
$("#listTable").bootstrapTable({
url: '/user/data',
pageNumber: pageNumber,
pageSize: pageSize,
classes: 'table table-striped table-hover table-bordered',
+ sortReset: false,
+ sortName: urlSort,
+ sortOrder: urlOrder,
+ onSort: function(name, order) {
+ var $table = $('#listTable');
+ if (!name) {
+ $table.data('_sortClicks', null);
+ return;
+ }
+ var clicks = $table.data('_sortClicks') || {};
+ if (clicks._last !== name) {
+ clicks = {_last: name};
+ clicks[name] = 1;
+ this.sortOrder = 'desc';
+ } else {
+ clicks[name] = (clicks[name] || 0) + 1;
+ if (clicks[name] === 1) {
+ this.sortOrder = 'desc';
+ } else if (clicks[name] === 2) {
+ this.sortOrder = 'asc';
+ } else {
+ this.sortName = undefined;
+ this.sortOrder = undefined;
+ clicks = {};
+ }
+ }
+ $table.data('_sortClicks', clicks);
+ },
columns: [
{
field: 'id',
- title: 'UID'
+ title: 'UID',
+ sortable: true
},
{
field: 'username',
- title: '用户名'
+ title: '用户名',
+ sortable: true
},
{
field: 'level',
title: '用户等级',
+ sortable: true,
formatter: function(value, row, index) {
switch(value){
case 1: return '普通用户';break;
@@ -148,6 +181,7 @@ 用户修改/添加
{
field: 'is_api',
title: 'API接口',
+ sortable: true,
formatter: function(value, row, index) {
switch(value){
case 0: return '关闭';break;
@@ -157,15 +191,18 @@ 用户修改/添加
},
{
field: 'regtime',
- title: '添加时间'
+ title: '添加时间',
+ sortable: true
},
{
field: 'lasttime',
- title: '上次登录时间'
+ title: '上次登录时间',
+ sortable: true
},
{
field: 'status',
title: '状态',
+ sortable: true,
formatter: function(value, row, index) {
switch(value){
case 0: return '封禁';break;