mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-02-28 10:37:27 +08:00
增加腾讯云DNS域名别名管理、修复主域名判断
This commit is contained in:
parent
3ea41c1c8b
commit
780e01ce4f
@ -302,10 +302,12 @@ function getMainDomain($host)
|
||||
$domains = config('temp.domains');
|
||||
if (!$domains) {
|
||||
$domains = Db::name('domain')->column('name');
|
||||
$domains_alias = Db::name('domain_alias')->column('name');
|
||||
$domains = array_merge($domains, $domains_alias);
|
||||
config(['domains'=>$domains], 'temp');
|
||||
}
|
||||
foreach ($domains as $domain) {
|
||||
if (str_ends_with($host, $domain)) {
|
||||
if ($host === $domain || str_ends_with($host, '.' . $domain)) {
|
||||
return $domain;
|
||||
}
|
||||
}
|
||||
|
||||
@ -505,9 +505,12 @@ class Cert extends BaseController
|
||||
$mainDomain = getMainDomain($domain);
|
||||
$drow = Db::name('domain')->where('name', $mainDomain)->find();
|
||||
if (!$drow) {
|
||||
if (substr($domain, 0, 2) == '*.') $domain = substr($domain, 2);
|
||||
if (!$cname || !Db::name('cert_cname')->where('domain', $domain)->where('status', 1)->find()) {
|
||||
return ['code' => -1, 'msg' => '域名' . $domain . '未在本系统添加'];
|
||||
$drow = Db::name('domain_alias')->alias('A')->join('domain B', 'A.did = B.id')->where('A.name', $mainDomain)->find();
|
||||
if (!$drow) {
|
||||
if (substr($domain, 0, 2) == '*.') $domain = substr($domain, 2);
|
||||
if (!$cname || !Db::name('cert_cname')->where('domain', $domain)->where('status', 1)->find()) {
|
||||
return ['code' => -1, 'msg' => '域名' . $domain . '未在本系统添加'];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -305,6 +305,7 @@ class Domain extends BaseController
|
||||
if (!checkPermission(2)) return $this->alert('error', '无权限');
|
||||
$id = input('post.id/d');
|
||||
Db::name('domain')->where('id', $id)->delete();
|
||||
Db::name('domain_alias')->where('did', $id)->delete();
|
||||
Db::name('dmtask')->where('did', $id)->delete();
|
||||
Db::name('optimizeip')->where('did', $id)->delete();
|
||||
Db::name('sctask')->where('did', $id)->delete();
|
||||
@ -1106,8 +1107,87 @@ class Domain extends BaseController
|
||||
|
||||
$dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']);
|
||||
$domainRecords = $dns->getWeightSubDomains($page, $limit, $keyword);
|
||||
if (!$domainRecords) return json(['total' => 0, 'rows' => []]);
|
||||
return json(['total' => $domainRecords['total'], 'rows' => $domainRecords['list']]);
|
||||
}
|
||||
|
||||
public function alias()
|
||||
{
|
||||
$id = input('param.id/d');
|
||||
$drow = Db::name('domain')->where('id', $id)->find();
|
||||
if (!$drow) {
|
||||
return $this->alert('error', '域名不存在');
|
||||
}
|
||||
if (!checkPermission(0, $drow['name'])) return $this->alert('error', '无权限');
|
||||
if (request()->isAjax()) {
|
||||
$act = input('param.act');
|
||||
if ($act == 'add') {
|
||||
$alias = input('post.alias', null, 'trim');
|
||||
if (empty($alias)) {
|
||||
return json(['code' => -1, 'msg' => '参数不能为空']);
|
||||
}
|
||||
$dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']);
|
||||
if ($dns->addDomainAlias($alias)) {
|
||||
return json(['code' => 0, 'msg' => '添加域名别名成功']);
|
||||
} else {
|
||||
return json(['code' => -1, 'msg' => '添加域名别名失败,' . $dns->getError()]);
|
||||
}
|
||||
} elseif ($act == 'delete') {
|
||||
$alias_id = input('post.alias_id/d');
|
||||
if (empty($alias_id)) {
|
||||
return json(['code' => -1, 'msg' => '参数不能为空']);
|
||||
}
|
||||
$dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']);
|
||||
if ($dns->deleteDomainAlias($alias_id)) {
|
||||
return json(['code' => 0, 'msg' => '删除域名别名成功']);
|
||||
} else {
|
||||
return json(['code' => -1, 'msg' => '删除域名别名失败,' . $dns->getError()]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$dns = DnsHelper::getModel($drow['aid'], $drow['name'], $drow['thirdid']);
|
||||
$domainAliasList = $dns->domainAliasList() ?? [];
|
||||
|
||||
$this->updateAliasList($id, $domainAliasList);
|
||||
|
||||
View::assign('domainId', $id);
|
||||
View::assign('domainName', $drow['name']);
|
||||
View::assign('domainAliasList', $domainAliasList);
|
||||
return view();
|
||||
}
|
||||
|
||||
private function updateAliasList($id, $domainAliasList)
|
||||
{
|
||||
$domainAliases = array_column($domainAliasList, 'DomainAlias');
|
||||
$addList = [];
|
||||
$deleteList = [];
|
||||
$existList = Db::name('domain_alias')->where('did', $id)->select()->toArray();
|
||||
$existAliases = array_column($existList, 'name');
|
||||
foreach ($existList as $item) {
|
||||
if (!in_array($item['name'], $domainAliases)) {
|
||||
$deleteList[] = $item['id'];
|
||||
}
|
||||
}
|
||||
foreach ($domainAliases as $item) {
|
||||
if (!in_array($item, $existAliases)) {
|
||||
$addList[] = $item;
|
||||
}
|
||||
}
|
||||
if (!empty($deleteList)) {
|
||||
Db::name('domain_alias')->where('id', 'in', $deleteList)->delete();
|
||||
}
|
||||
if (!empty($addList)) {
|
||||
$dataList = [];
|
||||
foreach ($addList as $item) {
|
||||
$dataList[] = [
|
||||
'did' => $id,
|
||||
'name' => $item,
|
||||
];
|
||||
}
|
||||
Db::name('domain_alias')->insertAll($dataList);
|
||||
}
|
||||
}
|
||||
|
||||
public function expire_notice()
|
||||
{
|
||||
|
||||
@ -66,11 +66,11 @@ class aliyun implements DeployInterface
|
||||
$this->deploy_alb($cert_id, $config);
|
||||
} elseif ($config['product'] == 'nlb') {
|
||||
$this->deploy_nlb($cert_id, $config);
|
||||
} elseif($config['product'] == 'esa_saas'){
|
||||
} elseif ($config['product'] == 'esa_saas') {
|
||||
$this->deploy_esa_saas($cert_id, $config);
|
||||
} elseif ($config['product'] == 'ga') {
|
||||
$this->deploy_ga($cert_id, $config);
|
||||
}elseif ($config['product'] == 'upload') {
|
||||
} elseif ($config['product'] == 'upload') {
|
||||
} else {
|
||||
throw new Exception('未知的产品类型');
|
||||
}
|
||||
@ -196,7 +196,7 @@ class aliyun implements DeployInterface
|
||||
$this->log('成功查询到' . $data['TotalCount'] . '个ESA站点');
|
||||
$site_id = $data['Sites'][0]['SiteId'];
|
||||
// 查询对应的saas域名
|
||||
$param =[
|
||||
$param = [
|
||||
'Action' => 'ListCustomHostnames',
|
||||
'SiteName' => $saas_sitename,
|
||||
'SiteId' => $site_id,
|
||||
@ -212,18 +212,18 @@ class aliyun implements DeployInterface
|
||||
|
||||
$param = [
|
||||
'Action' => 'UpdateCustomHostname',
|
||||
'HostnameId'=> $saas_hostname_id,
|
||||
'HostnameId' => $saas_hostname_id,
|
||||
'SslFlag' => 'on',
|
||||
'CertType' => 'cas',
|
||||
'CasId' => $cas_id,
|
||||
'CasRegion' => $config['region'],
|
||||
];
|
||||
$this->log('ESA SAAS站点部署参数 ' . json_encode($param));
|
||||
try{
|
||||
try {
|
||||
$saas_deploy_result = $client->request($param);
|
||||
$this->log('ESA SAAS站点部署结果 ' . json_encode($saas_deploy_result));
|
||||
}catch(Exception $e){
|
||||
throw new Exception('部署失败:' . $e->getMessage());
|
||||
} catch (Exception $e) {
|
||||
throw new Exception('部署失败:' . $e->getMessage());
|
||||
}
|
||||
$this->log('ESA SAAS站点 ' . $saas_sitename . ' 证书添加成功!');
|
||||
}
|
||||
|
||||
@ -327,6 +327,44 @@ class dnspod implements DnsInterface
|
||||
return false;
|
||||
}
|
||||
|
||||
//域名别名列表
|
||||
public function domainAliasList()
|
||||
{
|
||||
$action = 'DescribeDomainAliasList';
|
||||
$param = [
|
||||
'Domain' => $this->domain,
|
||||
];
|
||||
$data = $this->send_request($action, $param);
|
||||
if ($data) {
|
||||
return $data['DomainAliasList'];
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
//添加域名别名
|
||||
public function addDomainAlias($alias)
|
||||
{
|
||||
$action = 'CreateDomainAlias';
|
||||
$param = [
|
||||
'Domain' => $this->domain,
|
||||
'DomainAlias' => $alias,
|
||||
];
|
||||
$data = $this->send_request($action, $param);
|
||||
return is_array($data);
|
||||
}
|
||||
|
||||
//删除域名别名
|
||||
public function deleteDomainAlias($id)
|
||||
{
|
||||
$action = 'DeleteDomainAlias';
|
||||
$param = [
|
||||
'Domain' => $this->domain,
|
||||
'DomainAliasId' => $id,
|
||||
];
|
||||
$data = $this->send_request($action, $param);
|
||||
return is_array($data);
|
||||
}
|
||||
|
||||
private function convertLineCode($line)
|
||||
{
|
||||
$convert_dict = ['default' => '0', 'unicom' => '10=1', 'telecom' => '10=0', 'mobile' => '10=3', 'edu' => '10=2', 'oversea' => '3=0', 'btvn' => '10=22', 'search' => '80=0', 'internal' => '7=0'];
|
||||
|
||||
@ -79,7 +79,6 @@ class huawei implements DnsInterface
|
||||
foreach ($data['recordsets'] as $row) {
|
||||
$name = substr($row['name'], 0, -(strlen($row['zone_name']) + 1));
|
||||
if ($name == '') $name = '@';
|
||||
if ($row['type'] == 'MX') list($row['mx'], $row['records']) = explode(' ', $row['records'][0]);
|
||||
$list[] = [
|
||||
'RecordId' => $row['id'],
|
||||
'Domain' => rtrim($row['zone_name'], '.'),
|
||||
@ -113,7 +112,6 @@ class huawei implements DnsInterface
|
||||
if ($data) {
|
||||
$name = substr($data['name'], 0, -(strlen($data['zone_name']) + 1));
|
||||
if ($name == '') $name = '@';
|
||||
if ($data['type'] == 'MX') list($data['mx'], $data['records']) = explode(' ', $data['records'][0]);
|
||||
return [
|
||||
'RecordId' => $data['id'],
|
||||
'Domain' => rtrim($data['zone_name'], '.'),
|
||||
@ -139,7 +137,6 @@ class huawei implements DnsInterface
|
||||
if ($Type == 'TXT' && substr($Value, 0, 1) != '"') $Value = '"' . $Value . '"';
|
||||
$records = array_reverse(explode(',', $Value));
|
||||
$params = ['name' => $Name, 'type' => $this->convertType($Type), 'records' => $records, 'line' => $Line, 'ttl' => intval($TTL), 'description' => $Remark];
|
||||
if ($Type == 'MX') $params['records'][0] = intval($MX) . ' ' . $Value;
|
||||
if ($Weight > 0) $params['weight'] = intval($Weight);
|
||||
$data = $this->send_request('POST', '/v2.1/zones/'.$this->domainid.'/recordsets', null, $params);
|
||||
return is_array($data) ? $data['id'] : false;
|
||||
@ -152,7 +149,6 @@ class huawei implements DnsInterface
|
||||
if ($Type == 'TXT' && substr($Value, 0, 1) != '"') $Value = '"' . $Value . '"';
|
||||
$records = array_reverse(explode(',', $Value));
|
||||
$params = ['name' => $Name, 'type' => $this->convertType($Type), 'records' => $records, 'line' => $Line, 'ttl' => intval($TTL), 'description' => $Remark];
|
||||
if ($Type == 'MX') $params['records'][0] = intval($MX) . ' ' . $Value;
|
||||
if ($Weight > 0) $params['weight'] = intval($Weight);
|
||||
$data = $this->send_request('PUT', '/v2.1/zones/'.$this->domainid.'/recordsets/'.$RecordId, null, $params);
|
||||
return is_array($data);
|
||||
|
||||
@ -99,7 +99,7 @@ class CertDeployService
|
||||
if (!empty($error) && strlen($error) > 300) {
|
||||
$error = mb_strcut($error, 0, 300);
|
||||
}
|
||||
$update = ['status' => $status, 'error' => $error, 'retrytime' => $retrytime];
|
||||
$update = ['status' => $status, 'error' => $error ? str_replace(["\r", "\n"], '', $error) : null, 'retrytime' => $retrytime];
|
||||
if ($status == 1){
|
||||
$update['retry'] = 0;
|
||||
$update['lasttime'] = date('Y-m-d H:i:s');
|
||||
|
||||
@ -22,6 +22,7 @@ class CertOrderService
|
||||
private $dnsList;
|
||||
private $domainList;
|
||||
private $cnameDomainList = [];
|
||||
private $domainsAliasList = [];
|
||||
|
||||
// 订单状态:0:待提交 1:待验证 2:正在验证 3:已签发 4:已吊销 -1:购买证书失败 -2:创建订单失败 -3:添加DNS失败 -4:验证DNS失败 -5:验证订单失败 -6:订单验证未通过 -7:签发证书失败
|
||||
public function __construct($oid)
|
||||
@ -72,6 +73,12 @@ class CertOrderService
|
||||
if (!$drow && preg_match('/^xn--/', $mainDomain)) {
|
||||
$drow = Db::name('domain')->where('name', idn_to_utf8($mainDomain))->find();
|
||||
}
|
||||
if (!$drow) {
|
||||
$drow = Db::name('domain_alias')->alias('A')->join('domain B', 'A.did = B.id')->where('A.name', $mainDomain)->field('A.name as alias,B.name as maindomain')->find();
|
||||
if ($drow) {
|
||||
$this->domainsAliasList[$drow['alias']] = $drow['maindomain'];
|
||||
}
|
||||
}
|
||||
if (!$drow) {
|
||||
if (substr($domain, 0, 2) == '*.') $domain = substr($domain, 2);
|
||||
$cname_row = Db::name('cert_cname')->where('domain', $domain)->where('status', 1)->find();
|
||||
@ -181,7 +188,7 @@ class CertOrderService
|
||||
if (!empty($error) && strlen($error) > 300) {
|
||||
$error = mb_strcut($error, 0, 300);
|
||||
}
|
||||
$update = ['status' => $status, 'error' => $error, 'updatetime' => date('Y-m-d H:i:s'), 'retrytime' => $retrytime];
|
||||
$update = ['status' => $status, 'error' => $error ? str_replace(["\r", "\n"], '', $error) : null, 'updatetime' => date('Y-m-d H:i:s'), 'retrytime' => $retrytime];
|
||||
$res = Db::name('cert_order')->where('id', $this->order['id'])->data($update);
|
||||
if ($status < 0 || $retrytime) {
|
||||
$this->order['retry']++;
|
||||
@ -261,6 +268,18 @@ class CertOrderService
|
||||
$this->saveResult(-2, $e->getMessage());
|
||||
throw $e;
|
||||
}
|
||||
|
||||
foreach ($this->domainsAliasList as $alias => $mainDomain) {
|
||||
if (isset($this->dnsList[$alias])) {
|
||||
if (!isset($this->dnsList[$mainDomain])) {
|
||||
$this->dnsList[$mainDomain] = $this->dnsList[$alias];
|
||||
} else {
|
||||
$this->dnsList[$mainDomain] = array_merge($this->dnsList[$mainDomain], $this->dnsList[$alias]);
|
||||
}
|
||||
unset($this->dnsList[$alias]);
|
||||
}
|
||||
}
|
||||
|
||||
Db::name('cert_order')->where('id', $this->order['id'])->update(['info' => json_encode($this->info), 'dns' => json_encode($this->dnsList)]);
|
||||
|
||||
if (!empty($this->dnsList)) {
|
||||
|
||||
@ -251,4 +251,14 @@ CREATE TABLE `dnsmgr_sctask` (
|
||||
`remark` varchar(100) DEFAULT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `did` (`did`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
|
||||
DROP TABLE IF EXISTS `dnsmgr_domain_alias`;
|
||||
CREATE TABLE `dnsmgr_domain_alias` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`did` int(11) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `did` (`did`),
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
@ -189,4 +189,13 @@ CREATE TABLE IF NOT EXISTS `dnsmgr_sctask` (
|
||||
|
||||
ALTER TABLE `dnsmgr_account`
|
||||
ADD COLUMN `config` text DEFAULT NULL,
|
||||
CHANGE COLUMN `ak` `name` varchar(255) NOT NULL;
|
||||
CHANGE COLUMN `ak` `name` varchar(255) NOT NULL;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `dnsmgr_domain_alias` (
|
||||
`id` int(11) unsigned NOT NULL auto_increment,
|
||||
`did` int(11) unsigned NOT NULL,
|
||||
`name` varchar(255) NOT NULL,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `did` (`did`),
|
||||
KEY `name` (`name`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;
|
||||
132
app/view/domain/alias.html
Normal file
132
app/view/domain/alias.html
Normal file
@ -0,0 +1,132 @@
|
||||
{extend name="common/layout" /}
|
||||
{block name="title"}域名别名 - {$domainName}{/block}
|
||||
{block name="main"}
|
||||
<style>
|
||||
.table-bordered>tbody>tr>td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:200px;vertical-align:middle;}
|
||||
</style>
|
||||
<div class="row">
|
||||
<div class="col-xs-12 center-block" style="float: none;">
|
||||
<div class="panel panel-default">
|
||||
<div class="panel-heading"><h3 class="panel-title"><a href="/record/{$domainId}" class="btn btn-sm btn-default pull-right" style="margin-top:-6px"><i class="fa fa-reply fa-fw"></i> 返回</a>域名别名 - {$domainName}</h3></div>
|
||||
<div class="panel-body">
|
||||
|
||||
<div class="alert alert-info">
|
||||
<i class="fa fa-info-circle"></i> 域名别名使用完全相同的解析记录,免除重复操作,仅支持专业版及以上套餐
|
||||
</div>
|
||||
|
||||
<form id="form-add" class="form-inline" onsubmit="return addAlias()">
|
||||
<div class="form-group">
|
||||
<input type="text" class="form-control" name="alias" id="aliasInput" placeholder="请输入想要绑定的别名" required style="min-width:280px;">
|
||||
</div>
|
||||
<button type="submit" class="btn btn-primary"><i class="fa fa-plus"></i> 添加别名</button>
|
||||
</form>
|
||||
|
||||
<hr/>
|
||||
|
||||
<table id="listTable" class="table table-striped table-hover table-bordered">
|
||||
<thead>
|
||||
<tr>
|
||||
<th>域名别名</th>
|
||||
<th>域名状态</th>
|
||||
<th>操作</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{volist name="domainAliasList" id="item"}
|
||||
<tr data-id="{$item.Id}">
|
||||
<td>{$item.DomainAlias}</td>
|
||||
<td>
|
||||
{if isset($item.Status)}
|
||||
{if $item.Status == '2'}
|
||||
<font color="green"><i class="fa fa-check-circle"></i> 正常</font>
|
||||
{elseif $item.Status == '3'}
|
||||
<font color="red"><i class="fa fa-ban"></i> 封禁</font>
|
||||
{else/}
|
||||
<font color="#b5bbc8"><i class="fa fa-pause-circle"></i> DNS不正确</font>
|
||||
{/if}
|
||||
{else/}
|
||||
-
|
||||
{/if}
|
||||
</td>
|
||||
<td>
|
||||
<a href="javascript:delAlias({$item.Id})" class="btn btn-danger btn-xs"><i class="fa fa-trash"></i> 删除</a>
|
||||
</td>
|
||||
</tr>
|
||||
{/volist}
|
||||
{empty name="domainAliasList"}
|
||||
<tr><td colspan="3" class="text-center text-muted">暂无域名别名</td></tr>
|
||||
{/empty}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{/block}
|
||||
{block name="script"}
|
||||
<script src="/static/js/layer/layer.js"></script>
|
||||
<script src="/static/js/custom.js"></script>
|
||||
<script>
|
||||
var domainId = {$domainId};
|
||||
|
||||
function addAlias() {
|
||||
var alias = $("#aliasInput").val().trim();
|
||||
if (!alias) {
|
||||
layer.msg('请输入想要绑定的别名');
|
||||
return false;
|
||||
}
|
||||
var ii = layer.load(2);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/record/alias/' + domainId + '?act=add',
|
||||
data: { alias: alias },
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
layer.close(ii);
|
||||
if (data.code == 0) {
|
||||
layer.alert(data.msg, { icon: 1 }, function() {
|
||||
layer.closeAll();
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.alert(data.msg || '添加失败', { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
layer.close(ii);
|
||||
layer.alert('网络请求失败', { icon: 2 });
|
||||
}
|
||||
});
|
||||
return false;
|
||||
}
|
||||
|
||||
function delAlias(id) {
|
||||
layer.confirm('确定要删除该域名别名吗?', { icon: 3, title: '提示' }, function(idx) {
|
||||
var ii = layer.load(2);
|
||||
$.ajax({
|
||||
type: 'POST',
|
||||
url: '/record/alias/' + domainId + '?act=delete',
|
||||
data: { alias_id: id },
|
||||
dataType: 'json',
|
||||
success: function(data) {
|
||||
layer.close(ii);
|
||||
layer.close(idx);
|
||||
if (data.code == 0) {
|
||||
layer.alert(data.msg, { icon: 1 }, function() {
|
||||
layer.closeAll();
|
||||
location.reload();
|
||||
});
|
||||
} else {
|
||||
layer.alert(data.msg || '删除失败', { icon: 2 });
|
||||
}
|
||||
},
|
||||
error: function() {
|
||||
layer.close(ii);
|
||||
layer.close(idx);
|
||||
layer.alert('网络请求失败', { icon: 2 });
|
||||
}
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
{/block}
|
||||
@ -95,6 +95,7 @@ new Vue({
|
||||
},
|
||||
async getDomainList(){
|
||||
this.domainList = [];
|
||||
this.page = 1;
|
||||
while(true){
|
||||
try{
|
||||
layer.msg('正在获取第'+this.page+'页域名', {icon: 16, shade: 0.01});
|
||||
|
||||
@ -55,12 +55,12 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
|
||||
<input type="text" class="form-control" name="value" placeholder="输入记录值" required>
|
||||
</div>
|
||||
</div>
|
||||
<div class="form-group" style="display:none" id="mx_type">
|
||||
{if $dnsconfig.type!='huawei'}<div class="form-group" style="display:none" id="mx_type">
|
||||
<label class="col-sm-3 control-label no-padding-right">MX优先级</label>
|
||||
<div class="col-sm-9">
|
||||
<input type="text" class="form-control" name="mx" value="10">
|
||||
</div>
|
||||
</div>
|
||||
</div>{/if}
|
||||
<div class="form-group">
|
||||
<label class="col-sm-3 control-label no-padding-right">TTL</label>
|
||||
<div class="col-sm-9">
|
||||
@ -184,6 +184,7 @@ td{overflow: hidden;text-overflow: ellipsis;white-space: nowrap;max-width:360px;
|
||||
<a href="javascript:searchClear()" class="btn btn-default" title="刷新解析记录列表"><i class="fa fa-refresh"></i> 刷新</a>
|
||||
<a href="javascript:addframe()" class="btn btn-success"><i class="fa fa-plus"></i> 添加记录</a>
|
||||
{if $dnsconfig.type=='aliyun'}<a href="/record/weight/{$domainId}" class="btn btn-default">权重配置</a>{/if}
|
||||
{if $dnsconfig.type=='dnspod'}<a href="/record/alias/{$domainId}" class="btn btn-default">域名别名</a>{/if}
|
||||
<div class="btn-group" role="group">
|
||||
<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="/record/batchadd/{$domainId}">添加</a></li><li><a href="javascript:operation('open')">启用</a></li><li><a href="javascript:operation('pause')">暂停</a></li><li><a href="javascript:operation('edit')">修改记录</a></li><li><a href="javascript:operation('editline')">修改线路</a></li>{if $dnsconfig.remark == 1}<li><a href="javascript:operation('editremark')">修改备注</a></li>{/if}<li><a href="javascript:operation('delete')">删除</a></li></ul>
|
||||
@ -291,7 +292,7 @@ $(document).ready(function(){
|
||||
title: '记录值',
|
||||
formatter: function(value, row, index) {
|
||||
var copyId = 'copy-value-' + row.RecordId;
|
||||
if(row.Type == 'MX') {
|
||||
if(row.Type == 'MX' && dnsconfig.type!='huawei') {
|
||||
return '<span id="'+copyId+'" data-value="'+htmlEscape(value)+'">'+value+'</span>'
|
||||
+ '<a href="javascript:void(0);" title="复制记录值" onclick="copyToClipboard(null, \'#'+copyId+'\')" style="padding-left:6px;"><i class=\"fa fa-copy\"></i></a>'
|
||||
+ '<span class="mx-priority"> | '+row.MX+'</span>';
|
||||
|
||||
@ -74,6 +74,7 @@ Route::group(function () {
|
||||
Route::post('/record/list', 'domain/record_list');
|
||||
Route::post('/record/weight/data/:id', 'domain/weight_data');
|
||||
Route::any('/record/weight/:id', 'domain/weight');
|
||||
Route::any('/record/alias/:id', 'domain/alias');
|
||||
Route::get('/record/:id', 'domain/record');
|
||||
|
||||
Route::get('/dmonitor/overview', 'dmonitor/overview');
|
||||
|
||||
Loading…
Reference in New Issue
Block a user