Project

General

Profile

« Previous | Next » 

Revision 230547af

Added by NOYB NOYB over 8 years ago

Services - Status Icon - Sort Order

Make status column sort order work correctly with the icons.
Also refactor get_service_status_icon() output string construction to be cleaner and clearer.

(2.4, 2.3)

(cherry picked from commit 446505a9f9be7f43e4515658f1a5444bc3732a3f)

View differences:

src/etc/inc/service-utils.inc
478 478
	}
479 479
	$fa_size = ($smallicon) ? "fa-1x" : "fa-lg";
480 480

  
481
	$spacer = ($withthumbs || $withtext) ? " " : "";
482 481
	if ($title == "state") {
483
		$output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"{$statustext}\"></i>{$spacer}";
482
		$title = $statustext;
484 483
	} elseif ($title == "service_state") {
485
		$output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"" . sprintf(gettext('%1$s Service is %2$s'), $service["name"], $statustext) . "\"></i>{$spacer}";
484
		$title = sprintf(gettext('%1$s Service is %2$s'), $service["name"], $statustext);
486 485
	} elseif ($title == "description_state") {
487
		$output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"" . sprintf(gettext('%1$s Service is %2$s'), $service["description"], $statustext) . "\"></i>{$spacer}";
486
		$title = sprintf(gettext('%1$s Service is %2$s'), $service["description"], $statustext);
488 487
	} elseif ($title == "description_service_state") {
489
		$output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"" . sprintf(gettext('%1$s, %2$s Service is %3$s'), $service["description"], $service["name"], $statustext) . "\"></i>{$spacer}";
488
		$title = sprintf(gettext('%1$s, %2$s Service is %3$s'), $service["description"], $service["name"], $statustext);
490 489
	}
491 490

  
491
	$spacer = ($withthumbs || $withtext) ? " " : "";
492

  
493
	$output = "<i class=\"{$text_class} {$fa_class} {$fa_size}\" title=\"{$title}\"><span style=\"display: none\">{$statustext}</span></i>{$spacer}";
494

  
492 495
	$spacer = ($withtext) ? " " : "";
493 496
	if ($withthumbs) {
494 497
		$output .= "<i class=\"{$text_class} {$fa_class_thumbs} {$fa_size}\" title=\"{$Thumbs_UpDown}\"></i>{$spacer}";

Also available in: Unified diff