提示已经有服务分组配置时加入分组链接

This commit is contained in:
GoEdgeLab
2021-09-22 19:46:22 +08:00
parent 765b030477
commit cfa1d11507
2 changed files with 12 additions and 1 deletions

View File

@@ -6,6 +6,7 @@ import (
"github.com/TeaOSLab/EdgeCommon/pkg/rpc/pb"
"github.com/TeaOSLab/EdgeCommon/pkg/serverconfigs"
"github.com/iwind/TeaGo/maps"
"github.com/iwind/TeaGo/types"
)
// IndexAction 源站列表
@@ -34,13 +35,23 @@ func (this *IndexAction) RunGet(params struct {
return
}
this.Data["hasGroupConfig"] = false
this.Data["groupSettingURL"] = ""
switch serverType {
case serverconfigs.ServerTypeHTTPWeb, serverconfigs.ServerTypeHTTPProxy:
this.Data["hasGroupConfig"] = groupResp.HasHTTPReverseProxy
if groupResp.ServerGroupId > 0 {
this.Data["groupSettingURL"] = "/servers/groups/group/settings/httpReverseProxy?groupId=" + types.String(groupResp.ServerGroupId)
}
case serverconfigs.ServerTypeTCPProxy:
this.Data["hasGroupConfig"] = groupResp.HasTCPReverseProxy
if groupResp.ServerGroupId > 0 {
this.Data["groupSettingURL"] = "/servers/groups/group/settings/tcpReverseProxy?groupId=" + types.String(groupResp.ServerGroupId)
}
case serverconfigs.ServerTypeUDPProxy:
this.Data["hasGroupConfig"] = groupResp.HasUDPReverseProxy
if groupResp.ServerGroupId > 0 {
this.Data["groupSettingURL"] = "/servers/groups/group/settings/udpReverseProxy?groupId=" + types.String(groupResp.ServerGroupId)
}
}
// 当前服务的配置

View File

@@ -6,7 +6,7 @@
<div v-if="hasGroupConfig">
<div class="margin"></div>
<warning-message>由于已经在当前服务分组中进行了对应的配置,在这里的配置将不会生效。</warning-message>
<warning-message>由于已经在当前<a :href="groupSettingURL">服务分组</a>中进行了对应的配置,在这里的配置将不会生效。</warning-message>
</div>
<div :class="{'opacity-mask': hasGroupConfig}">