Use consistent function for server name

This commit is contained in:
Jamie Cameron
2022-02-20 20:04:26 -08:00
parent 0176449a81
commit c8d3e737bd
3 changed files with 10 additions and 4 deletions

View File

@ -109,7 +109,10 @@ elsif ($uconfig{'home_style'} == 3) {
sub server_name
{
my ($server) = @_;
return $server->{'desc'} || $server->{'host'};
my @w;
push(@w, $server->{'host'} || &get_system_hostname());
push(@w, "(".$server->{'desc'}.")") if ($server->{'desc'});
return join(" ", @w);
}
# supports_gothers(&server)

View File

@ -24,8 +24,7 @@ foreach $h (@hosts) {
local ($s) = grep { $_->{'id'} == $h->{'id'} } @servers;
next if (!$s);
local ($link) = $config{'conf_host_links'} ? "edit_host.cgi?id=$h->{'id'}" : "#";
push(@titles, $s->{'desc'} ? $s->{'desc'}
: "$s->{'host'}:$s->{'port'}");
push(@titles, &server_name($s));
push(@links, $link);
push(@icons, &get_webprefix()."/servers/images/".
$s->{'type'}.".gif");
@ -151,6 +150,8 @@ if (@hosts) {
&ui_textbox("what", undef, 15));
}
print &ui_buttons_hr();
if ($config{'conf_add_user'}) {
print &ui_buttons_row("user_form.cgi",
$text{'index_newuser'},
@ -165,6 +166,8 @@ if (@hosts) {
[ [ "new", 1 ] ]);
}
print &ui_buttons_hr();
if ($config{'conf_allow_refresh'}) {
print &ui_buttons_row("refresh.cgi",
$text{'index_refresh'}, undef, undef,

View File

@ -5,7 +5,7 @@ index_add=Add server
index_gadd=Add servers in group
index_users=Users and Groups
index_return=servers list
index_refresh=Refresh user and group lists
index_refresh=Refresh user and group lists on
index_finduser=Find users whose
index_findgroup=Find groups whose
index_newuser=Add User