mirror of
https://github.com/TeaOSLab/EdgeAdmin.git
synced 2025-11-19 15:30:25 +08:00
34 lines
738 B
Go
34 lines
738 B
Go
|
|
package dns
|
||
|
|
|
||
|
|
import (
|
||
|
|
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
|
||
|
|
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
|
||
|
|
)
|
||
|
|
|
||
|
|
type IndexAction struct {
|
||
|
|
actionutils.ParentAction
|
||
|
|
}
|
||
|
|
|
||
|
|
func (this *IndexAction) Init() {
|
||
|
|
this.Nav("", "setting", "index")
|
||
|
|
this.SecondMenu("dns")
|
||
|
|
}
|
||
|
|
|
||
|
|
func (this *IndexAction) RunGet(params struct {
|
||
|
|
ServerId int64
|
||
|
|
}) {
|
||
|
|
dnsInfoResp, err := this.RPC().ServerRPC().FindEnabledServerDNS(this.AdminContext(), &pb.FindEnabledServerDNSRequest{ServerId: params.ServerId})
|
||
|
|
if err != nil {
|
||
|
|
this.ErrorPage(err)
|
||
|
|
return
|
||
|
|
}
|
||
|
|
this.Data["dnsName"] = dnsInfoResp.DnsName
|
||
|
|
if dnsInfoResp.Domain != nil {
|
||
|
|
this.Data["dnsDomain"] = dnsInfoResp.Domain.Name
|
||
|
|
} else {
|
||
|
|
this.Data["dnsDomain"] = ""
|
||
|
|
}
|
||
|
|
|
||
|
|
this.Show()
|
||
|
|
}
|