diff --git a/internal/web/actions/default/dns/clusters/cluster.go b/internal/web/actions/default/dns/clusters/cluster.go
index 86467f34..0fbc6100 100644
--- a/internal/web/actions/default/dns/clusters/cluster.go
+++ b/internal/web/actions/default/dns/clusters/cluster.go
@@ -5,6 +5,7 @@ import (
"github.com/TeaOSLab/EdgeAdmin/internal/web/actions/actionutils"
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/iwind/TeaGo/maps"
+ timeutil "github.com/iwind/TeaGo/utils/time"
)
type ClusterAction struct {
@@ -209,5 +210,60 @@ func (this *ClusterAction) RunGet(params struct {
}
this.Data["issues"] = issueMaps
+ // 当前正在执行的任务
+ resp, err := this.RPC().DNSTaskRPC().FindAllDoingDNSTasks(this.AdminContext(), &pb.FindAllDoingDNSTasksRequest{
+ NodeClusterId: params.ClusterId,
+ })
+ if err != nil {
+ this.ErrorPage(err)
+ return
+ }
+ taskMaps := []maps.Map{}
+ for _, task := range resp.DnsTasks {
+ var clusterMap maps.Map = nil
+ var nodeMap maps.Map = nil
+ var serverMap maps.Map = nil
+ var domainMap maps.Map = nil
+
+ if task.NodeCluster != nil {
+ clusterMap = maps.Map{
+ "id": task.NodeCluster.Id,
+ "name": task.NodeCluster.Name,
+ }
+ }
+ if task.Node != nil {
+ nodeMap = maps.Map{
+ "id": task.Node.Id,
+ "name": task.Node.Name,
+ }
+ }
+ if task.Server != nil {
+ serverMap = maps.Map{
+ "id": task.Server.Id,
+ "name": task.Server.Name,
+ }
+ }
+ if task.DnsDomain != nil {
+ domainMap = maps.Map{
+ "id": task.DnsDomain.Id,
+ "name": task.DnsDomain.Name,
+ }
+ }
+
+ taskMaps = append(taskMaps, maps.Map{
+ "id": task.Id,
+ "type": task.Type,
+ "isDone": task.IsDone,
+ "isOk": task.IsOk,
+ "error": task.Error,
+ "updatedTime": timeutil.FormatTime("Y-m-d H:i:s", task.UpdatedAt),
+ "cluster": clusterMap,
+ "node": nodeMap,
+ "server": serverMap,
+ "domain": domainMap,
+ })
+ }
+ this.Data["tasks"] = taskMaps
+
this.Show()
}
diff --git a/web/public/js/components/common/links.js b/web/public/js/components/common/links.js
index 33eee44b..f2ef8ad7 100644
--- a/web/public/js/components/common/links.js
+++ b/web/public/js/components/common/links.js
@@ -1,12 +1,12 @@
// 使用Icon的链接方式
Vue.component("link-icon", {
- props: ["href", "title"],
+ props: ["href", "title", "target"],
data: function () {
return {
vTitle: (this.title == null) ? "打开链接" : this.title
}
},
- template: `
暂时没有需要设置的DNS记录。
|
- {{task.cluster.name}}
+ {{task.cluster.name}}
+ |