mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2026-04-24 13:55:18 +08:00
[域名服务]实现基本的线路配置
This commit is contained in:
@@ -53,6 +53,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
Value string
|
||||
Ttl int32
|
||||
Description string
|
||||
RouteIds []int64
|
||||
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
@@ -69,7 +70,7 @@ func (this *CreatePopupAction) RunPost(params struct {
|
||||
Type: params.Type,
|
||||
Value: params.Value,
|
||||
Ttl: params.Ttl,
|
||||
NsRouteIds: nil, // TODO 等待实现
|
||||
NsRouteIds: params.RouteIds,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
@@ -4,6 +4,7 @@ package records
|
||||
|
||||
import (
|
||||
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/dnsconfigs"
|
||||
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||||
"github.com/iwind/TeaGo/maps"
|
||||
)
|
||||
@@ -20,7 +21,7 @@ func (this *IndexAction) RunGet(params struct {
|
||||
DomainId int64
|
||||
Type string
|
||||
Keyword string
|
||||
RouteId int64 // TODO
|
||||
RouteId int64
|
||||
}) {
|
||||
this.Data["type"] = params.Type
|
||||
this.Data["keyword"] = params.Keyword
|
||||
@@ -92,5 +93,8 @@ func (this *IndexAction) RunGet(params struct {
|
||||
}
|
||||
this.Data["records"] = recordMaps
|
||||
|
||||
// 所有记录类型
|
||||
this.Data["types"] = dnsconfigs.FindAllRecordTypeDefinitions()
|
||||
|
||||
this.Show()
|
||||
}
|
||||
|
||||
@@ -32,6 +32,11 @@ func (this *UpdatePopupAction) RunGet(params struct {
|
||||
return
|
||||
}
|
||||
|
||||
routeIds := []int64{}
|
||||
for _, route := range record.NsRoutes {
|
||||
routeIds = append(routeIds, route.Id)
|
||||
}
|
||||
|
||||
this.Data["record"] = maps.Map{
|
||||
"id": record.Id,
|
||||
"name": record.Name,
|
||||
@@ -40,6 +45,7 @@ func (this *UpdatePopupAction) RunGet(params struct {
|
||||
"ttl": record.Ttl,
|
||||
"weight": record.Weight,
|
||||
"description": record.Description,
|
||||
"routeIds": routeIds,
|
||||
}
|
||||
|
||||
// 域名信息
|
||||
@@ -74,6 +80,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
Value string
|
||||
Ttl int32
|
||||
Description string
|
||||
RouteIds []int64
|
||||
|
||||
Must *actions.Must
|
||||
CSRF *actionutils.CSRF
|
||||
@@ -87,7 +94,7 @@ func (this *UpdatePopupAction) RunPost(params struct {
|
||||
Type: params.Type,
|
||||
Value: params.Value,
|
||||
Ttl: params.Ttl,
|
||||
NsRouteIds: nil, // TODO 等待实现
|
||||
NsRouteIds: params.RouteIds,
|
||||
})
|
||||
if err != nil {
|
||||
this.ErrorPage(err)
|
||||
|
||||
Reference in New Issue
Block a user