Skip to content

Commit

Permalink
Fixes #37231 - Handle incorrect domain setting display
Browse files Browse the repository at this point in the history
  • Loading branch information
Dyrkon authored and stejskalleos committed Mar 27, 2024
1 parent c9ce7c6 commit 1970292
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion app/helpers/fact_values_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ def fact_breadcrumbs
url: (fact_values_path if authorized_for(hash_for_fact_values_path)),
},
{
caption: params[:host_id],
caption: Setting[:display_fqdn_for_hosts] ? params[:host_id].split('.')[0] : params[:host_id],
},
],
resource_url: api_hosts_path(thin: true),
Expand Down
7 changes: 2 additions & 5 deletions app/models/host/base.rb
Original file line number Diff line number Diff line change
Expand Up @@ -370,11 +370,8 @@ def render_template(template:, **params)
end

def to_label
if Setting[:display_fqdn_for_hosts]
name
else
name.split('.')[0]
end
return name if Setting[:display_fqdn_for_hosts]
name.split('.')[0]
end

private
Expand Down

0 comments on commit 1970292

Please sign in to comment.