Menu -> Status -> Services change 'pid file' to 'pid', and add 'file'.
This commit is contained in:
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
Portions created by the Initial Developer are Copyright (C) 2008-2014
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -212,17 +212,23 @@ if (count($_POST)>0 && strlen($_POST["persistformvar"]) == 0) {
|
|||||||
echo "<td class='vtable' align='left'>\n";
|
echo "<td class='vtable' align='left'>\n";
|
||||||
echo " <select class='formfld' name='service_type'>\n";
|
echo " <select class='formfld' name='service_type'>\n";
|
||||||
echo " <option value=''></option>\n";
|
echo " <option value=''></option>\n";
|
||||||
if ($service_type == "pid_file") {
|
if ($service_type == "pid" || $service_type == "pid_file") {
|
||||||
echo " <option value='pid_file' SELECTED >pid file</option>\n";
|
echo " <option value='pid' selected='selected'>pid</option>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " <option value='pid_file'>pid file</option>\n";
|
echo " <option value='pid'>pid</option>\n";
|
||||||
}
|
}
|
||||||
if ($service_type == "php") {
|
//if ($service_type == "php") {
|
||||||
echo " <option value='php' SELECTED >php</option>\n";
|
// echo " <option value='php' selected='selected'>php</option>\n";
|
||||||
|
//}
|
||||||
|
//else {
|
||||||
|
// echo " <option value='php'>php</option>\n";
|
||||||
|
//}
|
||||||
|
if ($service_type == "file") {
|
||||||
|
echo " <option value='file' selected='selected'>file</option>\n";
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
echo " <option value='php'>php</option>\n";
|
echo " <option value='file'>file</option>\n";
|
||||||
}
|
}
|
||||||
echo " </select>\n";
|
echo " </select>\n";
|
||||||
echo "<br />\n";
|
echo "<br />\n";
|
||||||
|
|||||||
+35
-18
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
The Initial Developer of the Original Code is
|
The Initial Developer of the Original Code is
|
||||||
Mark J Crane <markjcrane@fusionpbx.com>
|
Mark J Crane <markjcrane@fusionpbx.com>
|
||||||
Portions created by the Initial Developer are Copyright (C) 2008-2012
|
Portions created by the Initial Developer are Copyright (C) 2008-2014
|
||||||
the Initial Developer. All Rights Reserved.
|
the Initial Developer. All Rights Reserved.
|
||||||
|
|
||||||
Contributor(s):
|
Contributor(s):
|
||||||
@@ -43,11 +43,11 @@ else {
|
|||||||
require_once "resources/header.php";
|
require_once "resources/header.php";
|
||||||
require_once "resources/paging.php";
|
require_once "resources/paging.php";
|
||||||
|
|
||||||
$order_by = $_GET["order_by"];
|
$order_by = check_str($_GET["order_by"]);
|
||||||
$order = $_GET["order"];
|
$order = check_str($_GET["order"]);
|
||||||
|
|
||||||
if (strlen($_GET["a"]) > 0) {
|
if (strlen($_GET["a"]) > 0) {
|
||||||
$service_uuid = $_GET["id"];
|
$service_uuid = check_str($_GET["id"]);
|
||||||
$sql = "select * from v_services ";
|
$sql = "select * from v_services ";
|
||||||
$sql .= "where service_uuid = '$service_uuid' ";
|
$sql .= "where service_uuid = '$service_uuid' ";
|
||||||
$prep_statement = $db->prepare(check_sql($sql));
|
$prep_statement = $db->prepare(check_sql($sql));
|
||||||
@@ -61,7 +61,6 @@ if (strlen($_GET["a"]) > 0) {
|
|||||||
$service_cmd_start = $row["service_cmd_start"];
|
$service_cmd_start = $row["service_cmd_start"];
|
||||||
$service_cmd_stop = $row["service_cmd_stop"];
|
$service_cmd_stop = $row["service_cmd_stop"];
|
||||||
$service_description = $row["service_description"];
|
$service_description = $row["service_description"];
|
||||||
break; //limit to 1 row
|
|
||||||
}
|
}
|
||||||
unset ($prep_statement);
|
unset ($prep_statement);
|
||||||
|
|
||||||
@@ -148,10 +147,7 @@ if (strlen($_GET["a"]) > 0) {
|
|||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo "</tr>\n";
|
echo "</tr>\n";
|
||||||
|
|
||||||
if ($result_count == 0) {
|
if ($result_count > 0) {
|
||||||
//no results
|
|
||||||
}
|
|
||||||
else { //received results
|
|
||||||
foreach($result as $row) {
|
foreach($result as $row) {
|
||||||
$tr_link = (permission_exists('service_edit')) ? "href='service_edit.php?id=".$row[service_uuid]."'" : null;
|
$tr_link = (permission_exists('service_edit')) ? "href='service_edit.php?id=".$row[service_uuid]."'" : null;
|
||||||
echo "<tr ".$tr_link.">\n";
|
echo "<tr ".$tr_link.">\n";
|
||||||
@@ -164,20 +160,41 @@ if (strlen($_GET["a"]) > 0) {
|
|||||||
}
|
}
|
||||||
echo " </td>\n";
|
echo " </td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>\n";
|
||||||
$pid = file_get_contents($row[service_data]);
|
if ($row[service_type] == "pid" || $row[service_type] == "pid_file") {
|
||||||
if (is_process_running($pid)) {
|
$pid = file_get_contents($row[service_data]);
|
||||||
echo "<strong>Running</strong>";
|
if (is_process_running($pid)) {
|
||||||
|
echo "<strong>Running</strong>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<strong>Stopped</strong>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
if ($row[service_type] == "file") {
|
||||||
echo "<strong>Stopped</strong>";
|
$service_data = $row[service_data];
|
||||||
|
if (file_exists($service_data)) {
|
||||||
|
echo "<strong>Running</strong>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo "<strong>Stopped</strong>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo " <td valign='top' class='".$row_style[$c]."'>\n";
|
echo " <td valign='top' class='".$row_style[$c]."'>\n";
|
||||||
if (is_process_running($pid)) {
|
if ($row[service_type] == "pid" || $row[service_type] == "pid_file") {
|
||||||
echo " <a href='services.php?id=".$row[service_uuid]."&a=stop' alt='stop'>Stop</a>";
|
if (is_process_running($pid)) {
|
||||||
|
echo " <a href='services.php?id=".$row[service_uuid]."&a=stop' alt='stop'>Stop</a>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo " <a href='services.php?id=".$row[service_uuid]."&a=start' alt='start'>Start</a>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else {
|
if ($row[service_type] == "file") {
|
||||||
echo " <a href='services.php?id=".$row[service_uuid]."&a=start' alt='start'>Start</a>";
|
if (file_exists($service_data)) {
|
||||||
|
echo " <a href='services.php?id=".$row[service_uuid]."&a=stop' alt='stop'>Stop</a>";
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
echo " <a href='services.php?id=".$row[service_uuid]."&a=start' alt='start'>Start</a>";
|
||||||
|
}
|
||||||
}
|
}
|
||||||
echo "</td>\n";
|
echo "</td>\n";
|
||||||
echo " <td valign='top' class='row_stylebg'>".$row[service_description]." </td>\n";
|
echo " <td valign='top' class='row_stylebg'>".$row[service_description]." </td>\n";
|
||||||
|
|||||||
Reference in New Issue
Block a user