diff --git a/app/controller/Domain.php b/app/controller/Domain.php index 565c613..9542739 100644 --- a/app/controller/Domain.php +++ b/app/controller/Domain.php @@ -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']]); } diff --git a/app/lib/DnsInterface.php b/app/lib/DnsInterface.php index 0cc915f..4e64771 100644 --- a/app/lib/DnsInterface.php +++ b/app/lib/DnsInterface.php @@ -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); diff --git a/app/lib/dns/aliyun.php b/app/lib/dns/aliyun.php index de76963..0794c17 100644 --- a/app/lib/dns/aliyun.php +++ b/app/lib/dns/aliyun.php @@ -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]; } diff --git a/app/lib/dns/baidu.php b/app/lib/dns/baidu.php index d3d34f0..f9f40ae 100644 --- a/app/lib/dns/baidu.php +++ b/app/lib/dns/baidu.php @@ -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); } //获取解析记录详细信息 diff --git a/app/lib/dns/cloudflare.php b/app/lib/dns/cloudflare.php index 1cf2895..02a983a 100644 --- a/app/lib/dns/cloudflare.php +++ b/app/lib/dns/cloudflare.php @@ -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); } //获取解析记录详细信息 diff --git a/app/lib/dns/dnsla.php b/app/lib/dns/dnsla.php index 21dad00..c8d13da 100644 --- a/app/lib/dns/dnsla.php +++ b/app/lib/dns/dnsla.php @@ -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); } //获取解析记录详细信息 diff --git a/app/lib/dns/dnspod.php b/app/lib/dns/dnspod.php index 945ef35..7f2af1d 100644 --- a/app/lib/dns/dnspod.php +++ b/app/lib/dns/dnspod.php @@ -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); } //获取解析记录详细信息 diff --git a/app/lib/dns/huawei.php b/app/lib/dns/huawei.php index 148dd57..446a7b9 100644 --- a/app/lib/dns/huawei.php +++ b/app/lib/dns/huawei.php @@ -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); } //获取解析记录详细信息 diff --git a/app/lib/dns/west.php b/app/lib/dns/west.php index c0d5857..cb6aaac 100644 --- a/app/lib/dns/west.php +++ b/app/lib/dns/west.php @@ -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); } //获取解析记录详细信息 diff --git a/app/view/dmonitor/taskform.html b/app/view/dmonitor/taskform.html index dd6541c..640864f 100644 --- a/app/view/dmonitor/taskform.html +++ b/app/view/dmonitor/taskform.html @@ -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'}, diff --git a/app/view/domain/domain.html b/app/view/domain/domain.html index bb223c3..9ea2bc7 100644 --- a/app/view/domain/domain.html +++ b/app/view/domain/domain.html @@ -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}) } diff --git a/app/view/domain/record.html b/app/view/domain/record.html index 1b93a21..39149fb 100644 --- a/app/view/domain/record.html +++ b/app/view/domain/record.html @@ -159,6 +159,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
+
@@ -177,6 +178,39 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
+ 高级搜索 +
+
@@ -191,7 +225,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px; - + {/block} \ No newline at end of file diff --git a/config/app.php b/config/app.php index 0042d84..8677889 100644 --- a/config/app.php +++ b/config/app.php @@ -31,7 +31,7 @@ return [ 'show_error_msg' => true, 'exception_tmpl' => \think\facade\App::getAppPath() . 'view/exception.tpl', - 'version' => '1007', + 'version' => '1009', 'dbversion' => '1007' ]; diff --git a/public/static/js/custom.js b/public/static/js/custom.js index edc2bf4..99d507a 100644 --- a/public/static/js/custom.js +++ b/public/static/js/custom.js @@ -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);