diff --git a/app/controller/Domain.php b/app/controller/Domain.php index 913b55b..425d25a 100644 --- a/app/controller/Domain.php +++ b/app/controller/Domain.php @@ -457,6 +457,9 @@ class Domain extends BaseController View::assign('recordLine', $recordLineArr); View::assign('minTTL', $minTTL ? $minTTL : 1); View::assign('dnsconfig', $dnsconfig); + if ($dnstype == 'qingcloud') { + return view('qingcloud'); + } return view(); } diff --git a/app/lib/DnsHelper.php b/app/lib/DnsHelper.php index 5402d5e..b2d06f5 100644 --- a/app/lib/DnsHelper.php +++ b/app/lib/DnsHelper.php @@ -287,6 +287,41 @@ class DnsHelper 'page' => false, 'add' => true, ], + 'qingcloud' => [ + 'name' => '青云', + 'icon' => 'qingcloud.ico', + 'note' => '', + 'config' => [ + 'access_key_id' => [ + 'name' => 'Access Key ID', + 'type' => 'input', + 'placeholder' => '', + 'required' => true, + ], + 'secret_access_key' => [ + 'name' => 'Secret Access Key', + 'type' => 'input', + 'placeholder' => '', + 'required' => true, + ], + 'proxy' => [ + 'name' => '使用代理服务器', + 'type' => 'radio', + 'options' => [ + '0' => '否', + '1' => '是', + ], + 'value' => '0' + ], + ], + 'remark' => 0, + 'status' => true, + 'redirect' => false, + 'log' => false, + 'weight' => true, + 'page' => false, + 'add' => true, + ], 'bt' => [ 'name' => '宝塔域名', 'icon' => 'bt.png', @@ -339,6 +374,15 @@ class DnsHelper 'placeholder' => '', 'required' => true, ], + 'auth' => [ + 'name' => '认证方式', + 'type' => 'radio', + 'options' => [ + '0' => 'API密钥', + '1' => 'API令牌', + ], + 'value' => '0' + ], 'apikey' => [ 'name' => 'API密钥/令牌', 'type' => 'input', diff --git a/app/lib/dns/cloudflare.php b/app/lib/dns/cloudflare.php index 38591fa..013d7fb 100644 --- a/app/lib/dns/cloudflare.php +++ b/app/lib/dns/cloudflare.php @@ -8,6 +8,7 @@ class cloudflare implements DnsInterface { private $Email; private $ApiKey; + private $auth; private $baseUrl = 'https://api.cloudflare.com/client/v4'; private $error; private $domain; @@ -21,6 +22,7 @@ class cloudflare implements DnsInterface $this->domain = $config['domain']; $this->domainid = $config['domainid']; $this->proxy = isset($config['proxy']) ? $config['proxy'] == 1 : false; + $this->auth = isset($config['auth']) ? intval($config['auth']) : (preg_match('/^[0-9a-f]+$/i', $this->ApiKey) ? 0 : 1); } public function getError() @@ -75,7 +77,7 @@ class cloudflare implements DnsInterface if ($data) { $list = []; foreach ($data['result'] as $row) { - $name = $this->domain == $row['name'] ? '@' : str_replace('.'.$this->domain, '', $row['name']); + $name = $this->domain == $row['name'] ? '@' : substr($row['name'], 0, -(strlen($this->domain) + 1)); $status = str_ends_with($name, '_pause') ? '0' : '1'; $name = $status == '0' ? substr($name, 0, -6) : $name; if ($row['type'] == 'SRV' && isset($row['priority'])) { @@ -112,7 +114,7 @@ class cloudflare implements DnsInterface { $data = $this->send_reuqest('GET', '/zones/'.$this->domainid.'/dns_records/'.$RecordId); if ($data) { - $name = $this->domain == $data['result']['name'] ? '@' : str_replace('.' . $this->domain, '', $data['result']['name']); + $name = $this->domain == $data['result']['name'] ? '@' : substr($data['result']['name'], 0, -(strlen($this->domain) + 1)); $status = str_ends_with($name, '_pause') ? '0' : '1'; $name = $status == '0' ? substr($name, 0, -6) : $name; if ($data['result']['type'] == 'SRV' && isset($data['result']['priority'])) { @@ -263,14 +265,14 @@ class cloudflare implements DnsInterface { $url = $this->baseUrl . $path; - if (preg_match('/^[0-9a-f]+$/i', $this->ApiKey)) { + if ($this->auth == 0) { $headers = [ - 'X-Auth-Email: ' . $this->Email, - 'X-Auth-Key: ' . $this->ApiKey, + 'X-Auth-Email' => $this->Email, + 'X-Auth-Key' => $this->ApiKey, ]; } else { $headers = [ - 'Authorization: Bearer ' . $this->ApiKey, + 'Authorization' => 'Bearer ' . $this->ApiKey, ]; } @@ -281,39 +283,17 @@ class cloudflare implements DnsInterface } } else { $body = json_encode($params); - $headers[] = 'Content-Type: application/json'; + $headers['Content-Type'] = 'application/json'; } - $ch = curl_init($url); - if ($this->proxy) { - curl_set_proxy($ch); + try { + $response = http_request($url, $body, null, null, $headers, $this->proxy, $method); + } catch (\Exception $e) { + $this->setError($e->getMessage()); + return false; } - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_HTTPHEADER, $headers); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, 10); - if ($method == 'POST') { - curl_setopt($ch, CURLOPT_POST, true); - curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - } elseif ($method == 'PUT') { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PUT'); - curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - } elseif ($method == 'PATCH') { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'PATCH'); - curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - } elseif ($method == 'DELETE') { - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, 'DELETE'); - } - $response = curl_exec($ch); - $errno = curl_errno($ch); - if ($errno) { - $this->setError('Curl error: ' . curl_error($ch)); - } - curl_close($ch); - if ($errno) return false; - $arr = json_decode($response, true); + $arr = json_decode($response['body'], true); if ($arr) { if ($arr['success']) { return $arr; diff --git a/app/lib/dns/dnsla.php b/app/lib/dns/dnsla.php index e2d9d21..c57c8e2 100644 --- a/app/lib/dns/dnsla.php +++ b/app/lib/dns/dnsla.php @@ -235,7 +235,10 @@ class dnsla implements DnsInterface private function execute($method, $path, $params = null) { $token = base64_encode($this->apiid.':'.$this->apisecret); - $header = ['Authorization: Basic '.$token, 'Content-Type: application/json; charset=utf-8']; + $header = [ + 'Authorization' => 'Basic '.$token, + 'Content-Type' => 'application/json; charset=utf-8' + ]; if ($method == 'POST' || $method == 'PUT') { $response = $this->curl($method, $path, $header, json_encode($params)); } else { @@ -264,34 +267,19 @@ class dnsla implements DnsInterface private function curl($method, $path, $header, $body = null) { $url = $this->baseUrl . $path; - $ch = curl_init($url); - if ($this->proxy) { - curl_set_proxy($ch); + try { + $response = http_request($url, $body, null, null, $header, $this->proxy, $method); + } catch (\Exception $e) { + $this->setError($e->getMessage()); + return false; } - curl_setopt($ch, CURLOPT_SSL_VERIFYPEER, false); - curl_setopt($ch, CURLOPT_SSL_VERIFYHOST, false); - curl_setopt($ch, CURLOPT_HTTPHEADER, $header); - curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); - curl_setopt($ch, CURLOPT_TIMEOUT, 10); - curl_setopt($ch, CURLOPT_CUSTOMREQUEST, $method); - if ($body) { - curl_setopt($ch, CURLOPT_POSTFIELDS, $body); - } - $response = curl_exec($ch); - $errno = curl_errno($ch); - if ($errno) { - $this->setError('Curl error: ' . curl_error($ch)); - } - $httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE); - curl_close($ch); - if ($errno) return false; - if ($httpCode == 200) { - return $response; - } elseif ($httpCode == 401) { + if ($response['code'] == 200) { + return $response['body']; + } elseif ($response['code'] == 401) { $this->setError('认证失败'); return false; } else { - $this->setError('http code: '.$httpCode); + $this->setError('http code: '.$response['code']); return false; } } diff --git a/app/lib/dns/namesilo.php b/app/lib/dns/namesilo.php index 08fd09d..955d37b 100644 --- a/app/lib/dns/namesilo.php +++ b/app/lib/dns/namesilo.php @@ -63,11 +63,10 @@ class namesilo implements DnsInterface if ($data) { $list = []; foreach ($data['resource_record'] as $row) { - $name = $row['host'] == $this->domain ? '@' : str_replace('.'.$this->domain, '', $row['host']); $list[] = [ 'RecordId' => $row['record_id'], 'Domain' => $this->domain, - 'Name' => $name, + 'Name' => $row['host'], 'Type' => $row['type'], 'Value' => $row['value'], 'Line' => 'default', diff --git a/app/lib/dns/qingcloud.php b/app/lib/dns/qingcloud.php new file mode 100644 index 0000000..789a01c --- /dev/null +++ b/app/lib/dns/qingcloud.php @@ -0,0 +1,386 @@ +access_key_id = $config['access_key_id']; + $this->secret_access_key = $config['secret_access_key']; + $this->domain = $config['domain']; + $this->domainid = $config['domainid']; + $this->proxy = isset($config['proxy']) ? $config['proxy'] == 1 : false; + } + + public function getError() + { + return $this->error; + } + + public function check() + { + if ($this->getDomainList() != false) { + return true; + } + return false; + } + + //获取域名列表 + public function getDomainList($KeyWord = null, $PageNumber = 1, $PageSize = 20) + { + $offset = ($PageNumber - 1) * $PageSize; + $param = ['offset' => $offset, 'limit' => $PageSize]; + if (!empty($KeyWord)) { + $param['zone_name'] = $KeyWord; + } + $data = $this->execute('GET', '/v1/user/zones', $param); + if ($data) { + $list = []; + foreach ($data['zones'] as $row) { + $list[] = [ + 'DomainId' => $row['zone_name'], + 'Domain' => rtrim($row['zone_name'], '.'), + 'RecordCount' => 0, + ]; + } + return ['total' => $data['total_count'], 'list' => $list]; + } + return false; + } + + //获取解析记录列表 + public function getDomainRecords($PageNumber = 1, $PageSize = 20, $KeyWord = null, $SubDomain = null, $Value = null, $Type = null, $Line = null, $Status = null) + { + if ($SubDomain) { + return $this->getHostRecords($SubDomain); + } + $param = ['zone_name' => $this->domainid, 'offset' => 0, 'limit' => 100]; + if (!isNullOrEmpty($KeyWord)) { + $param['search_word'] = $KeyWord; + } + $data = $this->execute('GET', '/v1/dns/host/', $param); + if ($data) { + $list = []; + foreach ($data['domains'] as $row) { + $name = substr($row['domain_name'], 0, -(strlen($row['zone_name']) + 1)); + if ($name == '') $name = '@'; + $list[] = [ + 'RecordId' => $row['domain_name'], + 'Domain' => $this->domain, + 'Name' => $name, + 'Type' => null, + 'Value' => null, + 'Line' => null, + 'TTL' => null, + 'MX' => null, + 'Status' => $row['status'] == 'enabled' ? '0' : '1', + 'Weight' => null, + 'Remark' => $row['description'], + 'UpdateTime' => $row['create_time'], + 'Count' => $row['count'], + ]; + } + return ['total' => $data['total_count'], 'list' => $list]; + } + return false; + } + + private function getHostRecords($SubDomain) + { + $param = ['zone_name' => $this->domainid, 'domain_name' => $SubDomain]; + $data = $this->execute('GET', '/v1/dns/host_info/', $param); + if ($data) { + $list = []; + foreach ($data['records'] as $record) { + $name = substr($record['domain_name'], 0, -(strlen($record['zone_name']) + 1)); + if ($name == '') $name = '@'; + foreach ($record['record'] as $record_group) { + foreach ($record_group['data'] as $row) { + $mx = null; + if ($record['rd_type'] == 'MX') { + $value = explode(' ', $row['value'], 2); + $row['value'] = isset($value[1]) ? $value[1] : ''; + $mx = intval($value[0]); + } + if ($record['rd_type'] == 'TXT') { + $row['value'] = trim($row['value'], '"'); + } + $list[] = [ + 'RecordId' => $record['domain_record_id'].'_'.$row['record_value_id'], + 'Domain' => $record['domain_name'], + 'Name' => $name, + 'Type' => $record['rd_type'], + 'Mode' => $record['mode'], + 'Value' => $row['value'], + 'Line' => $record['view_id'], + 'TTL' => $record['ttl'], + 'MX' => $mx, + 'Status' => $row['status'] == 1 ? '1' : '0', + 'Weight' => $record_group['weight'] > 0 ? $record_group['weight'] : null, + 'Remark' => null, + 'UpdateTime' => $record['create_time'], + ]; + } + } + } + return ['total' => $data['total_count'], 'list' => $list]; + } + return false; + } + + //获取子域名解析记录列表 + public function getSubDomainRecords($SubDomain, $PageNumber = 1, $PageSize = 20, $Type = null, $Line = null) + { + $SubDomain = $this->getHost($SubDomain); + return $this->getDomainRecords($PageNumber, $PageSize, null, $SubDomain, null, $Type, $Line); + } + + //获取解析记录详细信息 + public function getDomainRecordInfo($RecordId) + { + return false; + } + + //添加解析记录 + public function addDomainRecord($Name, $Type, $Value, $Line = '0', $TTL = 600, $MX = 1, $Weight = null, $Remark = null) + { + $mode = input('post.mode', '1'); + + if ($Type == 'MX') { + $Value = intval($MX).' '.$Value; + } elseif ($Type == 'TXT') { + $Value = '"'.$Value.'"'; + } + + $values = []; + foreach (explode(',', $Value) as $val) { + $values[] = ['value' => trim($val), 'status' => 1]; + } + if (($Type == 'A' || $Type == 'CNAME') && $mode == '3') $Weight = intval($Weight); + else $Weight = 0; + $record = [['weight' => $Weight, 'values' => $values]]; + + $param = ['zone_name' => $this->domainid, 'domain_name' => $Name, 'view_id' => intval($Line), 'type' => $Type, 'ttl' => intval($TTL), 'record' => json_encode($record), 'mode' => intval($mode), 'auto_merge' => 2]; + $data = $this->execute('POST', '/v1/record/', $param); + return is_array($data) ? $data['domain_record_id'] : false; + } + + //修改解析记录 + public function updateDomainRecord($RecordId, $Name, $Type, $Value, $Line = '0', $TTL = 600, $MX = 1, $Weight = null, $Remark = null) + { + $mode = input('post.mode', '1'); + + if ($Type == 'MX') { + $Value = intval($MX).' '.$Value; + } elseif ($Type == 'TXT') { + $Value = '"'.$Value.'"'; + } + + $recordId = explode('_', $RecordId); + $domain_record_id = $recordId[0]; + $record_value_id = $recordId[1]; + $data = $this->execute('GET', '/v1/dr_id/'.$domain_record_id); + if (!$data) return false; + + if (($Type == 'A' || $Type == 'CNAME') && $mode == '3') $Weight = intval($Weight); + else $Weight = 0; + $record = []; + foreach ($data['data']['record'] as $record_group) { + $values = []; + $flag = false; + foreach ($record_group['data'] as $row) { + if ($row['record_value_id'] == $record_value_id) { + $row['value'] = $Value; + $flag = true; + } + $values[] = ['value' => $row['value'], 'status' => $row['status']]; + } + if (count($values) > 0) { + $record[] = ['weight' => $flag ? $Weight : $record_group['weight'], 'values' => $values]; + } + } + + $param = ['zone_name' => $this->domainid, 'domain_name' => $Name, 'view_id' => intval($Line), 'type' => $Type, 'ttl' => intval($TTL), 'record' => json_encode($record), 'mode' => intval($mode)]; + $data = $this->execute('POST', '/v1/dr_id/'.$domain_record_id, $param); + return $data !== false; + } + + //修改解析记录备注 + public function updateDomainRecordRemark($RecordId, $Remark) + { + $param = ['zone_name' => $this->domainid, 'domain_name' => $RecordId, 'description' => $Remark]; + $data = $this->execute('POST', '/v1/dns/host/', $param); + return $data !== false; + } + + //删除解析记录 + public function deleteDomainRecord($RecordId) + { + if (strpos($RecordId, $this->domainid) !== false) { + $param = ['domain_names' => json_encode([$RecordId]), 'zone_name' => $this->domainid]; + $data = $this->execute('DELETE', '/v1/domain/', $param); + return $data !== false; + } + + $recordId = explode('_', $RecordId); + $domain_record_id = $recordId[0]; + $record_value_id = $recordId[1]; + $data = $this->execute('GET', '/v1/dr_id/'.$domain_record_id); + if (!$data) return false; + + $record = []; + foreach ($data['data']['record'] as $record_group) { + $values = []; + foreach ($record_group['data'] as $row) { + if ($row['record_value_id'] == $record_value_id) { + continue; + } + $values[] = ['value' => $row['value'], 'status' => $row['status']]; + } + if (count($values) > 0) { + $record[] = ['weight' => $record_group['weight'], 'values' => $values]; + } + } + + if (count($record) == 0) { + $param = ['ids' => json_encode([$domain_record_id]), 'target' => 'record', 'action' => 'delete']; + $data = $this->execute('POST', '/v1/change_record_status/', $param); + return $data !== false; + } + + $name = substr($data['data']['domain_name'], 0, -(strlen($data['data']['zone_name']) + 1)); + if ($name == '') $name = '@'; + $param = ['zone_name' => $this->domainid, 'domain_name' => $name, 'view_id' => $data['data']['view_id'], 'type' => $data['data']['rd_type'], 'ttl' => $data['data']['ttl'], 'record' => json_encode($record), 'mode' => $data['data']['mode']]; + $data = $this->execute('POST', '/v1/dr_id/'.$domain_record_id, $param); + return $data !== false; + } + + //设置解析记录状态 + public function setDomainRecordStatus($RecordId, $Status) + { + $recordId = explode('_', $RecordId); + $record_value_id = $recordId[1]; + $param = ['ids' => json_encode([$record_value_id]), 'target' => 'value', 'action' => $Status == '0' ? 'stop' : 'enable']; + $data = $this->execute('POST', '/v1/change_record_status/', $param); + return $data !== false; + } + + //获取解析记录操作日志 + public function getDomainRecordLog($PageNumber = 1, $PageSize = 20, $KeyWord = null, $StartDate = null, $endDate = null) + { + return false; + } + + //获取解析线路列表 + public function getRecordLine() + { + $param = ['zone_name' => $this->domainid, 'type' => 'GET_FULL']; + $data = $this->execute('GET', '/v1/zone/view/', $param); + if ($data) { + $list = []; + foreach ($data['zone_views'] as $row) { + if ($row['name'] == '*') $row['name'] = '默认'; + $list[$row['id']] = ['name' => $row['name'], 'parent' => null]; + } + return $list; + } + return false; + } + + //获取域名信息 + public function getDomainInfo() + { + return false; + } + + //获取域名最低TTL + public function getMinTTL() + { + return 60; + } + + public function addDomain($Domain) + { + $param = ['zone_name' => $Domain]; + $data = $this->execute('POST', '/v1/zone/', $param); + if ($data) { + return ['id' => $data['zone_name'], 'name' => $Domain]; + } + return false; + } + + private function getHost($Name) + { + if ($Name == '@' || $Name == '') $Name = ''; + else $Name .= '.'; + $Name .= $this->domain . '.'; + return $Name; + } + + private function execute($method, $path, $params = null) + { + $date = gmdate('D, d M Y H:i:s \G\M\T'); + $string_to_sign = $method."\n".$date."\n".$path; + if($method == 'GET' && $params){ + ksort($params); + $string_to_sign .= '?'.http_build_query($params); + } + $signature = base64_encode(hash_hmac('sha256', $string_to_sign, $this->secret_access_key, true)); + $authorization = 'QC-HMAC-SHA256 '.$this->access_key_id.':'.$signature; + $header = [ + 'Authorization' => $authorization, + 'Date' => $date, + ]; + if ($method == 'POST' || $method == 'PUT' || $method == 'DELETE') { + $header['Content-Type'] = 'application/json; charset=utf-8'; + $response = $this->curl($method, $path, $header, json_encode($params)); + } else { + if ($params) { + $path .= '?'.http_build_query($params); + } + $response = $this->curl($method, $path, $header); + } + $arr = json_decode($response['body'], true); + if (isset($arr['code']) && $arr['code'] == 0 || isset($arr['domains']) || $method == 'DELETE' && $response['code'] == 204) { + return $arr; + } elseif(isset($arr['message'])) { + $this->setError($arr['message']); + return false; + } elseif(isset($arr['msg'])) { + $this->setError($arr['msg']); + return false; + } else { + $this->setError('返回数据解析失败'); + return false; + } + } + + private function curl($method, $path, $header, $body = null) + { + $url = $this->baseUrl . $path; + try { + $response = http_request($url, $body, null, null, $header, $this->proxy, $method); + } catch (\Exception $e) { + $this->setError($e->getMessage()); + return false; + } + return $response; + } + + private function setError($message) + { + $this->error = $message; + //file_put_contents('logs.txt',date('H:i:s').' '.$message."\r\n", FILE_APPEND); + } +} diff --git a/app/view/domain/account.html b/app/view/domain/account.html index e5e66fe..47cb63c 100644 --- a/app/view/domain/account.html +++ b/app/view/domain/account.html @@ -76,9 +76,7 @@ $(document).ready(function(){ }) }) function delItem(id) { - var confirmobj = layer.confirm('确定要删除此域名账户吗?', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('确定要删除此域名账户吗?', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -95,8 +93,6 @@ function delItem(id) { } } }); - }, function(){ - layer.close(confirmobj); }); } diff --git a/app/view/domain/domain.html b/app/view/domain/domain.html index 65e860a..4ec97ff 100644 --- a/app/view/domain/domain.html +++ b/app/view/domain/domain.html @@ -428,9 +428,7 @@ function saveEdit(){ }); } function delItem(id) { - var confirmobj = layer.confirm('确定要删除此域名吗?删除域名不会影响已添加的解析', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('确定要删除此域名吗?删除域名不会影响已添加的解析', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -447,8 +445,6 @@ function delItem(id) { } } }); - }, function(){ - layer.close(confirmobj); }); } function getDomainList(){ @@ -517,9 +513,7 @@ function operation(action){ window.location.href = '/record/batchedit'; return; }else if(action == 'delete'){ - var confirmobj = layer.confirm('确定要删除所选域名吗?', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('确定要删除所选域名吗?', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -537,13 +531,9 @@ function operation(action){ } } }); - }, function(){ - layer.close(confirmobj); }); }else if(action == 'updateexpire'){ - var confirmobj = layer.confirm('提交后将异步刷新所选域名的到期时间', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('提交后将异步刷新所选域名的到期时间', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -561,8 +551,6 @@ function operation(action){ } } }); - }, function(){ - layer.close(confirmobj); }); }else{ var is_notice = action == 'opennotice' ? 1 : 0; diff --git a/app/view/domain/qingcloud.html b/app/view/domain/qingcloud.html new file mode 100644 index 0000000..c8d121f --- /dev/null +++ b/app/view/domain/qingcloud.html @@ -0,0 +1,493 @@ +{extend name="common/layout" /} +{block name="title"}解析管理 - {$domainName}{/block} +{block name="main"} + +
+ +
+
+
+

{if request()->user['type'] eq 'user'} 返回{/if}{$domainName}

+
+
+ +
+
+ + +
+ + + +
+ + +
+
+ + +
+
+
+ + + + + + + + + + + + + + + + + + + +
主机记录线路类型记录类型模式记录值TTL状态操作
+
+ +
+
+
+
+{/block} +{block name="script"} + + + + +{/block} \ No newline at end of file diff --git a/app/view/domain/record.html b/app/view/domain/record.html index 10726b3..e013e5d 100644 --- a/app/view/domain/record.html +++ b/app/view/domain/record.html @@ -292,7 +292,6 @@ $(document).ready(function(){ formatter: function(value, row, index) { var copyId = 'copy-value-' + row.RecordId; if(row.Type == 'MX') { - // 只复制 mx.yandex.net,按钮在其右侧,优先级单独显示 return ''+value+'' + '' + ' | '+row.MX+''; @@ -349,10 +348,12 @@ $(document).ready(function(){ if(dnsconfig.remark == 1){ html += '备注  '; } - if(row.Name === "@") var domain = "{$domainName}"; - else var domain = row.Name + ".{$domainName}"; - domain = domain.replace(/\*/g, 'www'); - html += ''; + if(row.Type == 'A' || row.Type == 'CNAME' || row.Type == 'AAAA' || row.Type == 'REDIRECT_URL' || row.Type == 'FORWARD_URL'){ + if(row.Name === "@") var domain = "{$domainName}"; + else var domain = row.Name + ".{$domainName}"; + domain = domain.replace(/\*/g, 'www'); + html += ''; + } return html; } }, @@ -511,9 +512,7 @@ function setStatus(recordid, status){ } function delItem(recordid) { var row = $("#listTable").bootstrapTable('getRowByUniqueId', recordid); - var confirmobj = layer.confirm('确定要删除此解析记录吗?', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('确定要删除此解析记录吗?', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -531,8 +530,6 @@ function delItem(recordid) { } } }); - }, function(){ - layer.close(confirmobj); }); } function setRemark(recordid) { @@ -587,9 +584,7 @@ function operation(action){ return; } - var confirmobj = layer.confirm('确定要'+(action=='open'?'启用':(action=='pause'?'暂停':'删除'))+'所选记录吗?', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('确定要'+(action=='open'?'启用':(action=='pause'?'暂停':'删除'))+'所选记录吗?', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -607,8 +602,6 @@ function operation(action){ } } }); - }, function(){ - layer.close(confirmobj); }); } function batch_edit(records){ diff --git a/app/view/user/user.html b/app/view/user/user.html index b92cf99..25e83ff 100644 --- a/app/view/user/user.html +++ b/app/view/user/user.html @@ -279,9 +279,7 @@ function setStatus(id,status) { }); } function delItem(id) { - var confirmobj = layer.confirm('确定要删除此用户吗?', { - btn: ['确定','取消'] - }, function(){ + layer.confirm('确定要删除此用户吗?', {title: '提示', icon: 0}, function(){ var ii = layer.load(2); $.ajax({ type : 'POST', @@ -298,8 +296,6 @@ function delItem(id) { } } }); - }, function(){ - layer.close(confirmobj); }); } var CreatePassword = function (len) diff --git a/public/static/images/qingcloud.ico b/public/static/images/qingcloud.ico new file mode 100644 index 0000000..5c84efa Binary files /dev/null and b/public/static/images/qingcloud.ico differ