diff --git a/config/config.go b/config/config.go
index 5a5b741fc..23a08e982 100755
--- a/config/config.go
+++ b/config/config.go
@@ -25,6 +25,7 @@ var Ipv6Reg = regexp.MustCompile(`((([0-9A-Fa-f]{1,4}:){7}([0-9A-Fa-f]{1,4}|:))|
// DnsConfig 配置
type DnsConfig struct {
+ Name string
Ipv4 struct {
Enable bool
// 获取IP类型 url/netInterface
diff --git a/static/constant.js b/static/constant.js
index 3cab303e7..1a34e02d0 100644
--- a/static/constant.js
+++ b/static/constant.js
@@ -173,6 +173,8 @@ const I18N_MAP = {
'Save': 'Save',
'Config:': 'Config:',
'Add': 'Add',
+ 'Rename': 'Rename',
+ 'RenameHelp': 'Enter a new name:',
'Delete': 'Delete',
'DNS Provider': 'DNS Provider',
'Create AccessKey': 'Create AccessKey',
@@ -234,6 +236,8 @@ const I18N_MAP = {
'Save': '保存',
'Config:': '配置切换:',
'Add': '添加',
+ 'Rename': '重命名',
+ 'RenameHelp': '输入新名称:',
'Delete': '删除',
'DNS Provider': 'DNS服务商',
'Create AccessKey': '创建 AccessKey',
diff --git a/web/save.go b/web/save.go
index c602afd6a..d29111eb7 100755
--- a/web/save.go
+++ b/web/save.go
@@ -92,7 +92,7 @@ func checkAndSave(request *http.Request) string {
if v == empty {
continue
}
- dnsConf := config.DnsConfig{TTL: v.TTL}
+ dnsConf := config.DnsConfig{Name: v.Name, TTL: v.TTL}
// 覆盖以前的配置
dnsConf.DNS.Name = v.DnsName
dnsConf.DNS.ID = strings.TrimSpace(v.DnsID)
diff --git a/web/writing.go b/web/writing.go
index fcf891af9..4228e068e 100755
--- a/web/writing.go
+++ b/web/writing.go
@@ -19,6 +19,7 @@ const VersionEnv = "DDNS_GO_VERSION"
// js中的dns配置
type dnsConf4JS struct {
+ Name string
DnsName string
DnsID string
DnsSecret string
@@ -84,6 +85,7 @@ func getDnsConfStr(dnsConf []config.DnsConfig) string {
// 已存在配置文件,隐藏真实的ID、Secret
idHide, secretHide := getHideIDSecret(&conf)
dnsConfArray = append(dnsConfArray, dnsConf4JS{
+ Name: conf.Name,
DnsName: conf.DNS.Name,
DnsID: idHide,
DnsSecret: secretHide,
diff --git a/web/writing.html b/web/writing.html
index 64cd1f668..b6a21a3cc 100755
--- a/web/writing.html
+++ b/web/writing.html
@@ -77,15 +77,21 @@
+