diff options
Diffstat (limited to 'src/usr/local/www/status_services.php')
-rwxr-xr-x | src/usr/local/www/status_services.php | 102 |
1 files changed, 59 insertions, 43 deletions
diff --git a/src/usr/local/www/status_services.php b/src/usr/local/www/status_services.php index ac13b32..3dcf4cf 100755 --- a/src/usr/local/www/status_services.php +++ b/src/usr/local/www/status_services.php @@ -59,6 +59,7 @@ if (!empty($service_name)) { $savemsg = service_control_stop($service_name, $_GET); break; } + sleep(5); } @@ -70,66 +71,81 @@ if ($_GET['batch']) { $pgtitle = array(gettext("Status"), gettext("Services")); include("head.inc"); -?> +if ($savemsg) + print_info_box($savemsg, 'success'); -<body link="#0000CC" vlink="#0000CC" alink="#0000CC"> -<?php -include("fbegin.inc"); +$services = get_services(); + +if (count($services) > 0) { ?> <form action="status_services.php" method="post"> -<?php if ($savemsg) print_info_box($savemsg); ?> - -<div id="boxarea"> -<table class="tabcont sortable" width="100%" border="0" cellpadding="0" cellspacing="0" summary="status services"> - <thead> - <tr> - <td class="listhdrr" align="center"><?=gettext("Service");?></td> - <td class="listhdrr" align="center"><?=gettext("Description");?></td> - <td class="listhdrr" align="center"><?=gettext("Status");?></td> - </tr> - </thead> - <tbody> + <div class="panel-body panel-default"> + <div class="table-responsive"> + <table class="table table-striped table-hover table-condensed"> + <thead> + <tr> + <th><?=gettext("Service")?></th> + <th><?=gettext("Description")?></th> + <th><?=gettext("Status")?></th> + <th><?=gettext("Actions")?></th> + </tr> + </thead> + <tbody> <?php -$services = get_services(); - -if (count($services) > 0) { uasort($services, "service_name_compare"); - foreach ($services as $service) { - if (empty($service['name'])) { + + foreach($services as $service) { + if (empty($service['name'])) continue; - } - if (empty($service['description'])) { + + if (empty($service['description'])) $service['description'] = get_pkg_descr($service['name']); - } - echo "<tr><td class=\"listlr\" width=\"20%\">" . $service['name'] . "</td>\n"; - echo "<td class=\"listr\" width=\"55%\">" . $service['description'] . "</td>\n"; +?> + <tr> + <td> + <?=$service['name']?> + </td> + + <td> + <?=$service['description']?> + </td> +<?php // if service is running then listr else listbg $bgclass = null; - if (get_service_status($service)) { - $bgclass = "listr"; - } else { - $bgclass = "listbg"; - } - echo "<td class=\"" . $bgclass . "\" align=\"center\">" . get_service_status_icon($service, true, true) . "</td>\n"; - echo "<td valign=\"middle\" class=\"list nowrap\">" . get_service_control_links($service); + $running = false; + + if (get_service_status($service)) + $running = true; +?> + <td> + <?=$running ? '<font color="green">Running</font>':'<font color="red">Stopped</font>'?> + </td> + <td> + <?=get_service_control_links($service)?> + +<?php $scut = get_shortcut_by_service_name($service['name']); + if (!empty($scut)) { echo get_shortcut_main_link($scut, true, $service); echo get_shortcut_status_link($scut, true, $service); echo get_shortcut_log_link($scut, true); } - echo "</td></tr>\n"; +?> + </td> + </tr> +<?php } +?> + </tbody> + </table> + </div> + </div> +</form> +<?php } else { - echo "<tr><td colspan=\"3\" align=\"center\">" . gettext("No services found") . " . </td></tr>\n"; + print_info_box(gettext("No services found"), 'danger'); } -?> - </tbody> -</table> -</div> -</form> -<?php include("fend.inc"); ?> -</body> -</html> +include("foot.inc");
\ No newline at end of file |