mirror of
https://github.com/netcccyun/dnsmgr.git
synced 2026-07-12 18:54:29 +08:00
Cloudflare增强添加DCV 委派+优化,添加快速解析功能,已有解析记录和智能批量添加 (#442)
* Update RewriteRule in .htaccess for cleaner routing 修复Apache环境下路由重写规则 废弃旧版 index.php/$1 写法,改用兼容新版PHP的PATH_INFO传参方式 解决访问时报错 No input file specified. 问题 * Add files via upload 1.添加DCV 委派一键添加CNAME 2.添加证书验证方法和最低 TLS 版本 3.添加批量添加 修改 删除 4.修复华为云一键txt解析失败(我没其他dns, 其他的需关注) 5.Cloudflare增强改Cloudflare自定义主机名 * 1.添加快速解析 2.Cloudflare自定义主机名添加搜索功能 * Add files via upload 1.Cloudflare自定义主机名自动获取默认线路(支持所有dns,华为云退回之前) 2.优化手机上显示问题 3.一键添加 DCV 委派支持选择要写入的解析域名 * 优化手机显示 * 添加1. 批量 DCV 委派 2. 批量主机名 TXT 验证 3. 批量证书 TXT 验证 4. 批量刷新验证 1. 批量 DCV 委派 2. 批量主机名 TXT 验证 3. 批量证书 TXT 验证 4. 批量刷新验证 * 快速解析改名智能解析,添加已有解析记录和智能批量添加 * 快速解析改名智能解析,添加已有解析记录和智能批量添加 * 由于之前复制保存的,代码有些差异 * 修复已有解析记录的备注功能 * 备注按dns显示 * 修复记录值过长无法复制,优化显示 * 优化显示
This commit is contained in:
@@ -1005,6 +1005,68 @@ class Domain extends BaseController
|
||||
return view('log');
|
||||
}
|
||||
|
||||
public function smartparse()
|
||||
{
|
||||
if (request()->user['type'] == 'domain') {
|
||||
return redirect('/record/' . request()->user['id']);
|
||||
}
|
||||
|
||||
$list = Db::name('domain')->alias('A')->join('account B', 'A.aid = B.id')
|
||||
->field('A.id, A.name, A.aid, B.type')
|
||||
->order('A.name', 'asc')
|
||||
->select();
|
||||
|
||||
$domainList = [];
|
||||
foreach ($list as $row) {
|
||||
if (request()->user['level'] == 1 && !in_array($row['name'], request()->user['permission'])) {
|
||||
continue;
|
||||
}
|
||||
$dnsTypeName = isset(DnsHelper::$dns_config[$row['type']]) ? DnsHelper::$dns_config[$row['type']]['name'] : $row['type'];
|
||||
$domainList[] = [
|
||||
'id' => $row['id'],
|
||||
'name' => $row['name'],
|
||||
'dnsType' => $dnsTypeName
|
||||
];
|
||||
}
|
||||
|
||||
View::assign('domainList', $domainList);
|
||||
return view();
|
||||
}
|
||||
|
||||
public function quickinfo()
|
||||
{
|
||||
$id = input('param.id/d');
|
||||
$drow = Db::name('domain')->where('id', $id)->find();
|
||||
if (!$drow) {
|
||||
return json(['code' => -1, 'msg' => '域名不存在']);
|
||||
}
|
||||
if (!checkPermission(0, $drow['name'])) return json(['code' => -1, 'msg' => '无权限']);
|
||||
|
||||
try {
|
||||
list($recordLine, $minTTL) = $this->get_line_and_ttl($drow);
|
||||
|
||||
$recordLineArr = [];
|
||||
foreach ($recordLine as $key => $item) {
|
||||
$recordLineArr[] = ['id' => strval($key), 'name' => $item['name'], 'parent' => $item['parent']];
|
||||
}
|
||||
|
||||
$dnstype = Db::name('account')->where('id', $drow['aid'])->value('type');
|
||||
$dnsconfig = DnsHelper::$dns_config[$dnstype];
|
||||
|
||||
return json([
|
||||
'code' => 0,
|
||||
'data' => [
|
||||
'recordLine' => $recordLineArr,
|
||||
'minTTL' => $minTTL ? $minTTL : 1,
|
||||
'weight' => $dnsconfig['weight'] ?? false,
|
||||
'remark' => $dnsconfig['remark'] ?? 0
|
||||
]
|
||||
]);
|
||||
} catch (Exception $e) {
|
||||
return json(['code' => -1, 'msg' => $e->getMessage()]);
|
||||
}
|
||||
}
|
||||
|
||||
private function add_log($domain, $action, $data)
|
||||
{
|
||||
if (strlen($data) > 500) $data = substr($data, 0, 500);
|
||||
|
||||
Reference in New Issue
Block a user