批量添加解析支持设置备注

This commit is contained in:
net909 2026-01-22 21:43:22 +08:00
parent e56122d7d0
commit 70d3922013
4 changed files with 13 additions and 5 deletions

View File

@ -837,6 +837,7 @@ class Domain extends BaseController
$line = input('post.line', null, 'trim');
$ttl = input('post.ttl/d', 600);
$mx = input('post.mx/d', 1);
$remark = input('post.remark', null, 'trim');
$recordlist = explode("\n", $record);
if (empty($record) || empty($recordlist)) {
@ -858,7 +859,7 @@ class Domain extends BaseController
$arr = explode(' ', $record);
if (empty($record) || empty($arr[0]) || empty($arr[1])) continue;
$thistype = empty($type) ? getDnsType($arr[1]) : $type;
$recordid = $dns->addDomainRecord($arr[0], $thistype, $arr[1], $line, $ttl, $mx);
$recordid = $dns->addDomainRecord($arr[0], $thistype, $arr[1], $line, $ttl, $mx, null, $remark);
if ($recordid) {
$this->add_log($drow['name'], '添加解析', $arr[0].' ['.$thistype.'] '.$arr[1].' (线路:'.$line.' TTL:'.$ttl.')');
$success++;

View File

@ -54,8 +54,6 @@ class Index extends BaseController
if (config('app.dbversion') && config_get('version') != config('app.dbversion')) {
$this->db_update();
config_set('version', config('app.dbversion'));
Cache::clear();
}
$tmp = 'version()';
@ -87,8 +85,9 @@ class Index extends BaseController
} catch (Exception $e) {
}
}
if(Db::name('account')->count() > 0 && Db::name('account')->whereNotNull('config')->count() == 0) {
config_set('version', config('app.dbversion'));
Cache::clear();
if(Db::name('account')->count() > 0 && Db::name('account')->whereNotNull('config')->count() == 0) {
$accounts = Db::name('account')->select();
foreach ($accounts as $account) {
if (!empty($account['config']) || !isset(\app\lib\DnsHelper::$dns_config[$account['type']])) continue;

View File

@ -880,7 +880,9 @@ class DeployHelper
sudo visudo<br/>
#在文件最后一行增加以下内容需要将username替换成自己的用户名<br/>
username ALL=(ALL) NOPASSWD: NOPASSWD: ALL<br/>
ctrl+x 保存退出',
ctrl+x 保存退出<br/>
sudo mkdir -p /home/<用户名><br/>
sudo chown -R <用户名>: /home/<用户名><br/>',
'tasknote' => '系统会根据关联SSL证书的域名自动更新对应证书',
'inputs' => [
'host' => [

View File

@ -48,6 +48,12 @@
<input type="text" class="form-control" name="ttl" value="600" placeholder="指解析结果在DNS服务器中的缓存时间" required min="{$minTTL}">
</div>
</div>
{if $dnsconfig.remark == 2}<div class="form-group">
<label class="col-sm-3 control-label no-padding-right">备注</label>
<div class="col-sm-6">
<input type="text" class="form-control" name="remark" placeholder="">
</div>
</div>{/if}
<div class="form-group">
<div class="col-sm-offset-3 col-sm-6"><button type="button" class="btn btn-primary" onclick="save()">添加</button></div>
</div>