mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-05-12 00:06:27 +02:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
949b52722a | ||
|
|
1c504f3b04 | ||
|
|
8e4fd32f8c | ||
|
|
5cd6b108f0 |
@@ -2,7 +2,6 @@ APP_DEBUG = false
|
||||
|
||||
[APP]
|
||||
DEFAULT_TIMEZONE = Asia/Shanghai
|
||||
SYS_KEY = {syskey}
|
||||
|
||||
[DATABASE]
|
||||
TYPE = mysql
|
||||
|
||||
14
README.md
14
README.md
@@ -83,6 +83,20 @@ location / {
|
||||
</IfModule>
|
||||
```
|
||||
|
||||
### Docker部署方法
|
||||
|
||||
首先需要安装Docker,然后执行以下命令拉取镜像并启动(启动后监听8081端口):
|
||||
|
||||
```
|
||||
docker run --name dnsmgr -dit -p 8081:80 -v /var/dnsmgr:/app/www netcccyun/dnsmgr
|
||||
```
|
||||
|
||||
访问并安装好后如果容灾切换未自动启动,重启容器即可:
|
||||
|
||||
```
|
||||
docker restart dnsmgr
|
||||
```
|
||||
|
||||
### 版权信息
|
||||
|
||||
版权所有Copyright © 2023~2024 by 消失的彩虹海(https://blog.cccyun.cn)
|
||||
|
||||
@@ -47,7 +47,7 @@ class Auth extends BaseController
|
||||
DB::name('user')->where('id', $user['id'])->update(['lasttime' => date("Y-m-d H:i:s")]);
|
||||
$session = md5($user['id'].$user['password']);
|
||||
$expiretime = time()+2562000;
|
||||
$token = authcode("user\t{$user['id']}\t{$session}\t{$expiretime}", 'ENCODE', env('app.sys_key'));
|
||||
$token = authcode("user\t{$user['id']}\t{$session}\t{$expiretime}", 'ENCODE', config_get('sys_key'));
|
||||
cookie('user_token', $token, ['expire' => $expiretime, 'httponly' => true]);
|
||||
if (file_exists($login_limit_file)) {
|
||||
unlink($login_limit_file);
|
||||
@@ -93,7 +93,7 @@ class Auth extends BaseController
|
||||
if($timestamp < time()-300 || $timestamp > time()+300){
|
||||
return $this->alert('error', '时间戳无效');
|
||||
}
|
||||
if(md5(env('app.sys_key').$domain.$timestamp.$token.env('app.sys_key')) !== $sign){
|
||||
if(md5(config_get('sys_key').$domain.$timestamp.$token.config_get('sys_key')) !== $sign){
|
||||
return $this->alert('error', '签名错误');
|
||||
}
|
||||
if($token != cache('quicklogin_'.$domain)){
|
||||
@@ -111,7 +111,7 @@ class Auth extends BaseController
|
||||
|
||||
$session = md5($row['id'].$row['name']);
|
||||
$expiretime = time()+2562000;
|
||||
$token = authcode("domain\t{$row['id']}\t{$session}\t{$expiretime}", 'ENCODE', env('app.sys_key'));
|
||||
$token = authcode("domain\t{$row['id']}\t{$session}\t{$expiretime}", 'ENCODE', config_get('sys_key'));
|
||||
cookie('user_token', $token, ['expire' => $expiretime, 'httponly' => true]);
|
||||
return redirect('/record/'.$row['id']);
|
||||
}
|
||||
|
||||
@@ -291,7 +291,7 @@ class Domain extends BaseController
|
||||
$token = getSid();
|
||||
cache('quicklogin_'.$drow['name'], $token, 3600);
|
||||
$timestamp = time();
|
||||
$sign = md5(env('app.sys_key').$drow['name'].$timestamp.$token.env('app.sys_key'));
|
||||
$sign = md5(config_get('sys_key').$drow['name'].$timestamp.$token.config_get('sys_key'));
|
||||
$drow['loginurl'] = request()->root(true).'/quicklogin?domain='.$drow['name'].'×tamp='.$timestamp.'&token='.$token.'&sign='.$sign;
|
||||
}
|
||||
|
||||
@@ -329,6 +329,7 @@ class Domain extends BaseController
|
||||
$id = input('param.id/d');
|
||||
$keyword = input('post.keyword', null, 'trim');
|
||||
$subdomain = input('post.subdomain', null, 'trim');
|
||||
$value = input('post.value', null, 'trim');
|
||||
$type = input('post.type', null, 'trim');
|
||||
$line = input('post.line', null, 'trim');
|
||||
$status = input('post.status', null, 'trim');
|
||||
@@ -347,10 +348,10 @@ class Domain extends BaseController
|
||||
if(!checkPermission(0, $drow['name'])) return json(['total'=>0, 'rows'=>[]]);
|
||||
|
||||
$dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']);
|
||||
$domainRecords = $dns->getDomainRecords($page, $limit, $keyword, $subdomain, $type, $line, $status);
|
||||
$domainRecords = $dns->getDomainRecords($page, $limit, $keyword, $subdomain, $value, $type, $line, $status);
|
||||
if(!$domainRecords) return json(['total'=>0, 'rows'=>[]]);
|
||||
|
||||
if($domainRecords['total'] != $drow['recordcount']){
|
||||
if(empty($keyword) && empty($subdomain) && empty($type) && empty($line) && empty($status) && empty($value) && $domainRecords['total'] != $drow['recordcount']){
|
||||
Db::name('domain')->where('id', $id)->update(['recordcount'=>$domainRecords['total']]);
|
||||
}
|
||||
|
||||
|
||||
@@ -29,7 +29,7 @@ class Install extends BaseController
|
||||
}
|
||||
|
||||
$configdata = file_get_contents(app()->getRootPath().'.example.env');
|
||||
$configdata = str_replace(['{syskey}','{dbhost}','{dbname}','{dbuser}','{dbpwd}','{dbport}','{dbprefix}'], [random(16), $mysql_host, $mysql_name, $mysql_user, $mysql_pwd, $mysql_port, $mysql_prefix], $configdata);
|
||||
$configdata = str_replace(['{dbhost}','{dbname}','{dbuser}','{dbpwd}','{dbport}','{dbprefix}'], [$mysql_host, $mysql_name, $mysql_user, $mysql_pwd, $mysql_port, $mysql_prefix], $configdata);
|
||||
|
||||
try{
|
||||
$DB=new PDO("mysql:host=".$mysql_host.";dbname=".$mysql_name.";port=".$mysql_port,$mysql_user,$mysql_pwd);
|
||||
@@ -53,6 +53,7 @@ class Install extends BaseController
|
||||
$sqls=explode(';', $sqls);
|
||||
|
||||
$password = password_hash($admin_password, PASSWORD_DEFAULT);
|
||||
$sqls[]="REPLACE INTO `".$mysql_prefix."config` VALUES ('sys_key', '".random(16)."')";
|
||||
$sqls[]="INSERT INTO `".$mysql_prefix."user` (`username`,`password`,`level`,`regtime`,`lasttime`,`status`) VALUES ('".addslashes($admin_username)."', '$password', 2, NOW(), NOW(), 1)";
|
||||
|
||||
$success=0;$error=0;$errorMsg=null;
|
||||
|
||||
@@ -10,7 +10,7 @@ interface DnsInterface
|
||||
|
||||
function getDomainList($KeyWord=null, $PageNumber=1, $PageSize=20);
|
||||
|
||||
function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null);
|
||||
function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null);
|
||||
|
||||
function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null);
|
||||
|
||||
|
||||
@@ -49,10 +49,10 @@ class aliyun implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
$param = ['Action' => 'DescribeDomainRecords', 'DomainName' => $this->domain, 'PageNumber' => $PageNumber, 'PageSize' => $PageSize];
|
||||
if(!empty($SubDomain) || !empty($Type) || !empty($Line)){
|
||||
$param += ['SearchMode' => 'ADVANCED', 'RRKeyWord' => $SubDomain, 'ValueKeyWord' => $KeyWord, 'Type' => $Type, 'Line' => $Line, 'ValueKeyWord' => $KeyWord];
|
||||
if(!empty($SubDomain) || !empty($Type) || !empty($Line) || !empty($Value)){
|
||||
$param += ['SearchMode' => 'ADVANCED', 'RRKeyWord' => $SubDomain, 'ValueKeyWord' => $Value, 'Type' => $Type, 'Line' => $Line];
|
||||
}elseif(!empty($KeyWord)){
|
||||
$param += ['KeyWord' => $KeyWord];
|
||||
}
|
||||
|
||||
@@ -48,7 +48,7 @@ class baidu implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
$marker = cookie('baidu_record_marker');
|
||||
$query = ['rr' => $KeyWord];
|
||||
if(!isNullOrEmpty(($SubDomain))){
|
||||
@@ -81,7 +81,7 @@ class baidu implements DnsInterface {
|
||||
//获取子域名解析记录列表
|
||||
public function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null){
|
||||
if($SubDomain == '')$SubDomain='@';
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, $Type, $Line);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line);
|
||||
}
|
||||
|
||||
//获取解析记录详细信息
|
||||
|
||||
@@ -48,7 +48,12 @@ class cloudflare implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
if(!isNullOrEmpty($SubDomain)){
|
||||
if($SubDomain == '@')$SubDomain=$this->domain;
|
||||
else $SubDomain .= '.'.$this->domain;
|
||||
}
|
||||
if(!isNullOrEmpty($Value)) $KeyWord = $Value;
|
||||
$param = ['name' => $SubDomain, 'type' => $Type, 'search' => $KeyWord, 'page' => $PageNumber, 'per_page' => $PageSize];
|
||||
if(!isNullOrEmpty($Line)){
|
||||
$param['proxied'] = $Line == '1' ? 'true' : 'false';
|
||||
@@ -80,9 +85,7 @@ class cloudflare implements DnsInterface {
|
||||
|
||||
//获取子域名解析记录列表
|
||||
public function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null){
|
||||
if($SubDomain == '@')$SubDomain=$this->domain;
|
||||
else $SubDomain .= '.'.$this->domain;
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, $Type, $Line);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line);
|
||||
}
|
||||
|
||||
//获取解析记录详细信息
|
||||
|
||||
@@ -49,7 +49,7 @@ class dnsla implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
$param = ['domainId' => $this->domainid, 'pageIndex' => $PageNumber, 'pageSize' => $PageSize];
|
||||
if(!isNullOrEmpty(($KeyWord))){
|
||||
$param['host'] = $KeyWord;
|
||||
@@ -63,6 +63,9 @@ class dnsla implements DnsInterface {
|
||||
if(!isNullOrEmpty(($SubDomain))){
|
||||
$param['host'] = $SubDomain;
|
||||
}
|
||||
if(!isNullOrEmpty(($Value))){
|
||||
$param['data'] = $Value;
|
||||
}
|
||||
$data = $this->execute('GET', '/api/recordList', $param);
|
||||
if($data){
|
||||
$list = [];
|
||||
@@ -90,7 +93,7 @@ class dnsla implements DnsInterface {
|
||||
//获取子域名解析记录列表
|
||||
public function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null){
|
||||
if($SubDomain == '')$SubDomain='@';
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, $Type, $Line);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line);
|
||||
}
|
||||
|
||||
//获取解析记录详细信息
|
||||
|
||||
@@ -51,12 +51,18 @@ class dnspod implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
$offset = ($PageNumber-1)*$PageSize;
|
||||
if(!isNullOrEmpty($Status)){
|
||||
if(!isNullOrEmpty($Status) || !isNullOrEmpty($Value)){
|
||||
$action = 'DescribeRecordFilterList';
|
||||
$Status = $Status == '1' ? 'ENABLE' : 'DISABLE';
|
||||
$param = ['Domain' => $this->domain, 'Subdomain' => $SubDomain, 'Keyword' => $KeyWord, 'Offset' => $offset, 'Limit' => $PageSize, 'RecordStatus' => [$Status]];
|
||||
$param = ['Domain' => $this->domain, 'Offset' => $offset, 'Limit' => $PageSize, 'RecordValue' => $Value];
|
||||
if(!isNullOrEmpty($SubDomain)) $param['SubDomain'] = $SubDomain;
|
||||
if(!isNullOrEmpty($KeyWord)) $param['Keyword'] = $KeyWord;
|
||||
if(!isNullOrEmpty($Value)) $param['RecordValue'] = $Value;
|
||||
if(!isNullOrEmpty($Status)){
|
||||
$Status = $Status == '1' ? 'ENABLE' : 'DISABLE';
|
||||
$param['RecordStatus'] = [$Status];
|
||||
}
|
||||
if(!isNullOrEmpty($Type)) $param['RecordType'] = [$this->convertType($Type)];
|
||||
if(!isNullOrEmpty($Line)) $param['RecordLine'] = [$Line];
|
||||
}else{
|
||||
@@ -93,7 +99,7 @@ class dnspod implements DnsInterface {
|
||||
//获取子域名解析记录列表
|
||||
public function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null){
|
||||
if($SubDomain == '')$SubDomain='@';
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, $Type, $Line);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line);
|
||||
}
|
||||
|
||||
//获取解析记录详细信息
|
||||
|
||||
@@ -49,10 +49,15 @@ class huawei implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
$offset = ($PageNumber-1)*$PageSize;
|
||||
$query = ['type' => $Type, 'line_id' => $Line, 'name' => $KeyWord, 'status' => $Status, 'offset' => $offset, 'limit' => $PageSize];
|
||||
if(!isNullOrEmpty(($SubDomain))){
|
||||
$query = ['type' => $Type, 'line_id' => $Line, 'name' => $KeyWord, 'offset' => $offset, 'limit' => $PageSize];
|
||||
if(!isNullOrEmpty($Status)){
|
||||
$Status = $Status == '1' ? 'ACTIVE' : 'DISABLE';
|
||||
$query['status'] = $Status;
|
||||
}
|
||||
if(!isNullOrEmpty($SubDomain)){
|
||||
$SubDomain = $this->getHost($SubDomain);
|
||||
$query['name'] = $SubDomain;
|
||||
$query['search_mode'] = 'equal';
|
||||
}
|
||||
@@ -83,8 +88,7 @@ class huawei implements DnsInterface {
|
||||
|
||||
//获取子域名解析记录列表
|
||||
public function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null){
|
||||
$SubDomain = $this->getHost($SubDomain);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, $Type, $Line);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line);
|
||||
}
|
||||
|
||||
//获取解析记录详细信息
|
||||
|
||||
@@ -50,8 +50,8 @@ class west implements DnsInterface {
|
||||
}
|
||||
|
||||
//获取解析记录列表
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Type = null, $Line = null, $Status = null){
|
||||
$param = ['act' => 'getdnsrecord', 'domain' => $this->domain, 'type' => $Type, 'line' => $Line, 'host' => $KeyWord, 'pageno' => $PageNumber, 'limit' => $PageSize];
|
||||
public function getDomainRecords($PageNumber=1, $PageSize=20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null){
|
||||
$param = ['act' => 'getdnsrecord', 'domain' => $this->domain, 'type' => $Type, 'line' => $Line, 'host' => $KeyWord, 'value' => $Value, 'pageno' => $PageNumber, 'limit' => $PageSize];
|
||||
if(!isNullOrEmpty(($SubDomain))){
|
||||
$param['host'] = $SubDomain;
|
||||
}
|
||||
@@ -82,7 +82,7 @@ class west implements DnsInterface {
|
||||
//获取子域名解析记录列表
|
||||
public function getSubDomainRecords($SubDomain, $PageNumber=1, $PageSize=20, $Type = null, $Line = null){
|
||||
if($SubDomain == '')$SubDomain='@';
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, $Type, $Line);
|
||||
return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line);
|
||||
}
|
||||
|
||||
//获取解析记录详细信息
|
||||
|
||||
@@ -12,8 +12,8 @@ class AuthUser
|
||||
$islogin = false;
|
||||
$cookie = cookie('user_token');
|
||||
$user = null;
|
||||
if($cookie){
|
||||
$token=authcode($cookie, 'DECODE', env('app.sys_key'));
|
||||
if($cookie && config_get('sys_key')){
|
||||
$token=authcode($cookie, 'DECODE', config_get('sys_key'));
|
||||
if($token){
|
||||
list($type, $uid, $sid, $expiretime) = explode("\t", $token);
|
||||
if($type == 'user'){
|
||||
|
||||
@@ -6,6 +6,7 @@ namespace app\middleware;
|
||||
use Exception;
|
||||
use think\facade\Db;
|
||||
use think\facade\Config;
|
||||
use think\facade\Cache;
|
||||
|
||||
class LoadConfig
|
||||
{
|
||||
@@ -31,6 +32,11 @@ class LoadConfig
|
||||
|
||||
try{
|
||||
$res = Db::name('config')->cache('configs',0)->column('value','key');
|
||||
if(empty($res['sys_key']) && !empty(env('app.sys_key'))){
|
||||
config_set('sys_key', env('app.sys_key'));
|
||||
Cache::delete('configs');
|
||||
$res['sys_key'] = env('app.sys_key');
|
||||
}
|
||||
Config::set($res, 'sys');
|
||||
}catch(Exception $e){
|
||||
if(!strpos($e->getMessage(), 'doesn\'t exist')){
|
||||
|
||||
@@ -147,7 +147,6 @@ new Vue({
|
||||
{value:0, label:'无操作'},
|
||||
{value:1, label:'暂停解析'},
|
||||
{value:2, label:'切换备用解析'},
|
||||
{value:3, label:'条件开启解析'},
|
||||
],
|
||||
checktypeList: [
|
||||
{value:0, label:'PING', disabled: support_ping=='0'},
|
||||
|
||||
@@ -266,6 +266,7 @@ function editframe(id){
|
||||
$("#form-store2 input[name=id]").val(data.data.id);
|
||||
$("#form-store2 select[name=is_hide]").val(data.data.is_hide);
|
||||
$("#form-store2 select[name=is_sso]").val(data.data.is_sso);
|
||||
$("#form-store2 input[name=remark]").val(data.data.remark);
|
||||
}else{
|
||||
layer.alert(data.msg, {icon: 2})
|
||||
}
|
||||
|
||||
@@ -159,6 +159,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
|
||||
<div class="panel-body">
|
||||
|
||||
<form onsubmit="return searchSubmit()" method="GET" class="form-inline" id="searchToolbar">
|
||||
<div id="searchbox1">
|
||||
<div class="form-group">
|
||||
<label>搜索</label>
|
||||
<input type="text" class="form-control" name="keyword" placeholder="输入关键字">
|
||||
@@ -177,6 +178,39 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
|
||||
<button type="button" class="btn btn-default dropdown-toggle" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false">日志 <span class="caret"></span></button>
|
||||
<ul class="dropdown-menu"><li><a href="/log?domain={$domainName}">本站日志</a></li>{if $dnsconfig.log}<li><a href="/record/log/{$domainId}">域名日志</a></li>{/if}</ul>
|
||||
</div>
|
||||
<a href="javascript:advanceSearch()" class="btn"><i class="fa fa-angle-down"></i> 高级搜索</a>
|
||||
</div>
|
||||
<div id="searchbox2" style="display:none">
|
||||
<div class="form-group">
|
||||
<select name="type" class="form-control"><option value="">全部类型</option>
|
||||
<option value="A">A</option>
|
||||
<option value="CNAME">CNAME</option>
|
||||
<option value="AAAA">AAAA</option>
|
||||
<option value="NS">NS</option>
|
||||
<option value="MX">MX</option>
|
||||
<option value="SRV">SRV</option>
|
||||
<option value="TXT">TXT</option>
|
||||
<option value="CAA">CAA</option>
|
||||
{if $dnsconfig.redirect}<option value="REDIRECT_URL">显性URL</option>
|
||||
<option value="FORWARD_URL">隐性URL</option>{/if}
|
||||
</select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="subdomain" placeholder="输入主机记录">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="line" class="form-control"><option value="">全部线路</option></select>
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="value" placeholder="输入记录值">
|
||||
</div>
|
||||
<div class="form-group">
|
||||
<select name="status" class="form-control"><option value="">所有状态</option><option value="1">启用</option><option value="0">暂停</option></select>
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-search"></i> 搜索</button>
|
||||
<a href="javascript:searchClear()" class="btn btn-default" title="刷新解析记录列表"><i class="fa fa-refresh"></i> 刷新</a>
|
||||
<a href="javascript:advanceSearch()" class="btn"><i class="fa fa-angle-up"></i> 收起</a>
|
||||
</div>
|
||||
</form>
|
||||
|
||||
<table id="listTable">
|
||||
@@ -191,7 +225,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
|
||||
<script src="{$cdnpublic}bootstrap-table/1.20.2/bootstrap-table.min.js"></script>
|
||||
<script src="{$cdnpublic}bootstrap-table/1.20.2/extensions/page-jump-to/bootstrap-table-page-jump-to.min.js"></script>
|
||||
<script src="/static/js/bootstrapValidator.min.js"></script>
|
||||
<script src="/static/js/custom.js?v=1001"></script>
|
||||
<script src="/static/js/custom.js?v=1002"></script>
|
||||
<script>
|
||||
var recordLine = {$recordLine|json_encode|raw};
|
||||
var dnsconfig = {$dnsconfig|json_encode|raw};
|
||||
@@ -308,6 +342,12 @@ $(document).ready(function(){
|
||||
|
||||
$("#form-store").bootstrapValidator();
|
||||
$("#form-store2").bootstrapValidator();
|
||||
|
||||
$.each(recordLine, function(index, item){
|
||||
if(item.parent == null){
|
||||
$("#searchToolbar select[name='line']").append('<option value="'+item.id+'">'+item.name+'</option>');
|
||||
}
|
||||
})
|
||||
})
|
||||
function initLine(option, elem){
|
||||
option = option || '';
|
||||
@@ -644,5 +684,20 @@ function batch_edit_remark(recordids) {
|
||||
}
|
||||
});
|
||||
}
|
||||
function advanceSearch(){
|
||||
$('#searchToolbar').find('input[name]').each(function() {
|
||||
$(this).val('');
|
||||
});
|
||||
$('#searchToolbar').find('select[name]').each(function() {
|
||||
$(this).find('option:first').prop("selected", 'selected');
|
||||
});
|
||||
if($("#searchbox1").is(":visible")){
|
||||
$("#searchbox1").slideUp();
|
||||
$("#searchbox2").slideDown();
|
||||
}else{
|
||||
$("#searchbox2").slideUp();
|
||||
$("#searchbox1").slideDown();
|
||||
}
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
@@ -1,23 +0,0 @@
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="UTF-8">
|
||||
<meta id="viewport" name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
|
||||
<title>抱歉,出错了</title>
|
||||
<link href="//res.wx.qq.com/open/libs/weui/0.4.3/weui.css" rel="stylesheet">
|
||||
<style>.page{position:absolute;top:0;right:0;bottom:0;left:0;overflow-y:auto;-webkit-overflow-scrolling:touch;box-sizing:border-box}</style>
|
||||
</head>
|
||||
<body>
|
||||
<div class="weui_msg">
|
||||
<div class="weui_icon_area"><i class="weui_icon_info weui_icon_msg"></i></div>
|
||||
<div class="weui_text_area">
|
||||
<h4 class="weui_msg_title">{$errmsg}</h4>
|
||||
</div>
|
||||
</div>
|
||||
<script>
|
||||
document.body.addEventListener('touchmove', function (event) {
|
||||
event.preventDefault();
|
||||
},{ passive: false });
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
||||
@@ -31,7 +31,7 @@ return [
|
||||
'show_error_msg' => true,
|
||||
'exception_tmpl' => \think\facade\App::getAppPath() . 'view/exception.tpl',
|
||||
|
||||
'version' => '1007',
|
||||
'version' => '1009',
|
||||
|
||||
'dbversion' => '1007'
|
||||
];
|
||||
|
||||
@@ -15,7 +15,7 @@ if (parameter_str !== undefined) {
|
||||
}
|
||||
|
||||
function searchSubmit(){
|
||||
$('#listTable').bootstrapTable('refresh');
|
||||
$('#listTable').bootstrapTable('selectPage', 1);
|
||||
return false;
|
||||
}
|
||||
function searchClear(){
|
||||
@@ -25,7 +25,7 @@ function searchClear(){
|
||||
$('#searchToolbar').find('select[name]').each(function() {
|
||||
$(this).find('option:first').prop("selected", 'selected');
|
||||
});
|
||||
$('#listTable').bootstrapTable('refresh');
|
||||
$('#listTable').bootstrapTable('selectPage', 1);
|
||||
}
|
||||
function updateToolbar(){
|
||||
$('#searchToolbar').find(':input[name]').each(function() {
|
||||
@@ -67,6 +67,7 @@ if (typeof $.fn.bootstrapTable !== "undefined") {
|
||||
queryParamsType: '',
|
||||
queryParams: function(params) {
|
||||
$('#searchToolbar').find(':input[name]').each(function() {
|
||||
if(!$(this).is(":visible")) return;
|
||||
params[$(this).attr('name')] = $(this).val()
|
||||
})
|
||||
updateQueryStr(params);
|
||||
|
||||
Reference in New Issue
Block a user