Rename sub name to be more intuitive

This commit is contained in:
Ilia Rostovtsev
2020-01-18 14:29:40 +03:00
parent 4bd15b01dd
commit a7b4847480
3 changed files with 9 additions and 9 deletions

File diff suppressed because one or more lines are too long

View File

@@ -34,12 +34,12 @@ sub list_system_info
my $free_percent_html;
if ($free_percent > 49) {
$free_percent_html = ui_text_type("$free_percent%", 'success');
$free_percent_html = ui_text_color("$free_percent%", 'success');
} elsif ($free_percent > 9) {
$free_percent_html = ui_text_type("$free_percent%", 'warn');
$free_percent_html = ui_text_color("$free_percent%", 'warn');
} else {
$open = 1;
$free_percent_html = ui_text_type("$free_percent%", 'danger');
$free_percent_html = ui_text_color("$free_percent%", 'danger');
}
$html .= ui_columns_row([$dir, $type, $free_percent_html . " ($free_nice)", $total_nice, $dev_id,]);
}

View File

@@ -2448,7 +2448,7 @@ $rv .= "</center>\n";
return $rv;
}
=head2 ui_text_type(text, type)
=head2 ui_text_color(text, type)
Returns HTML for a text string, with its color determined by $type.
@@ -2458,13 +2458,13 @@ Returns HTML for a text string, with its color determined by $type.
=cut
sub ui_text_type
sub ui_text_color
{
my ($text, $type) = @_;
my ($rv, $color);
if (defined (&theme_ui_text_type)) {
return &theme_ui_text_type(@_);
if (defined (&theme_ui_text_color)) {
return &theme_ui_text_color(@_);
}
if ($type eq "success") { $color = "3c763d"; }
@@ -2472,7 +2472,7 @@ elsif ($type eq "info") { $color = "31708f"; }
elsif ($type eq "warn") { $color = "8a6d3b"; }
elsif ($type eq "danger") { $color = "a94442"; }
$rv .= "<span class='ui_text_type text_type_$type' style='color: #$color'>$text</span>\n";
$rv .= "<span class='ui_text_color text_type_$type' style='color: #$color'>$text</span>\n";
return $rv;
}