mirror of
https://github.com/tailscale/tailscale.git
synced 2025-10-27 11:41:14 +00:00
client/web: use network profile for displaying tailnet info
Also update to use the new DisplayNameOrDefault. Updates tailscale/corp#30456 Change-Id: Ia101a4a3005adb9118051b3416f5a64a4a45987d Signed-off-by: Will Norris <will@tailscale.com>
This commit is contained in:
@@ -978,9 +978,18 @@ func (s *Server) serveGetNodeData(w http.ResponseWriter, r *http.Request) {
|
||||
data.ClientVersion = cv
|
||||
}
|
||||
|
||||
if st.CurrentTailnet != nil {
|
||||
data.TailnetName = st.CurrentTailnet.MagicDNSSuffix
|
||||
data.DomainName = st.CurrentTailnet.Name
|
||||
profile, _, err := s.lc.ProfileStatus(r.Context())
|
||||
if err != nil {
|
||||
s.logf("error fetching profiles: %v", err)
|
||||
// If for some reason we can't fetch profiles,
|
||||
// continue to use st.CurrentTailnet if set.
|
||||
if st.CurrentTailnet != nil {
|
||||
data.TailnetName = st.CurrentTailnet.MagicDNSSuffix
|
||||
data.DomainName = st.CurrentTailnet.Name
|
||||
}
|
||||
} else {
|
||||
data.TailnetName = profile.NetworkProfile.MagicDNSName
|
||||
data.DomainName = profile.NetworkProfile.DisplayNameOrDefault()
|
||||
}
|
||||
if st.Self.Tags != nil {
|
||||
data.Tags = st.Self.Tags.AsSlice()
|
||||
|
||||
Reference in New Issue
Block a user