services instead of running services
Some checks failed
continuous-integration/drone/push Build is failing

This commit is contained in:
2024-09-12 06:25:17 +00:00
parent 20e44a0f1f
commit 536bc979cc
2 changed files with 50 additions and 4 deletions

View File

@@ -56,8 +56,8 @@
</fieldset>
<fieldset>
<legend>Running services</legend>
<pre><div id="running" style="text-align:left">Loading...</div></pre>
<legend>Services</legend>
<pre><div id="services" style="text-align:left">Loading...</div></pre>
</fieldset>
<fieldset>
@@ -180,11 +180,30 @@ function check_deployment(additional) {
});
}
function check_services() {
var url = 'scan.php?op=check_services';
jQuery.get(url, function(data) {
if (data!="") {
jQuery("#services").html(data);
}
else setTimeout(check_services, 1000);
});
}
function get_services() {
var url = 'scan.php?op=services';
jQuery.get(url, function(data) {
if (data=="OK") {
setTimeout(check_services, 1000);
}
});
}
function check_containers() {
var url = 'scan.php?op=check_containers';
jQuery.get(url, function(data) {
if (data!="") {
jQuery("#running").html(data);
jQuery("#containers").html(data);
}
else setTimeout(check_containers, 1000);
});
@@ -204,7 +223,7 @@ jQuery(document).ready(function(){
get_system();
get_repositories();
get_deployments();
get_containers();
get_services();
jQuery('#settings_btn').click(function() {
jQuery('#settings').toggle();

View File

@@ -58,6 +58,33 @@ switch ($_GET["op"]) {
}
else echo "WAIT";
break;
case "services":
$arr = array("STATUS" => 0);
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);
$op = "services"; //"init:".date("YmdHis");
redis_set($op,$json);
echo "OK"; // TODO?
break;
case "check_services":
$arr = check_redis("web_out","services");
if (!empty($arr)) {
foreach ($arr as $key=>$data) {
if ($key=="services") {
if ($data["INSTALL_STATUS"]==2) echo "NEW";
elseif ($data["INSTALL_STATUS"]==1) {
foreach ($data["INSTALLED_SERVICES"] as $service_name => $content) {
//echo base64_decode($content);
echo $service_name."<br>";
}
echo "<br>";
}
redis_remove("$key");
}
}
}
else echo "WAIT";
break;
case "deployments":
$arr = array("STATUS" => 0);
$json = json_encode($arr, JSON_UNESCAPED_SLASHES|JSON_PRETTY_PRINT);