Fixed: warning on docker container page when array is stopped

This commit is contained in:
bergware
2018-10-29 20:48:52 +01:00
parent 842cb9c259
commit 4b158a25a3
4 changed files with 13 additions and 20 deletions

View File

@@ -4,8 +4,8 @@ Code="f100"
Cond="exec(\"grep -o '^DOCKER_ENABLED=.yes' /boot/config/docker.cfg 2>/dev/null\")"
----
<?PHP
/* Copyright 2005-2017, Lime Technology
* Copyright 2014-2017, Guilherme Jardim, Eric Schultz, Jon Panozzo.
/* Copyright 2005-2018, Lime Technology
* Copyright 2014-2018, Guilherme Jardim, Eric Schultz, Jon Panozzo.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -16,12 +16,9 @@ Cond="exec(\"grep -o '^DOCKER_ENABLED=.yes' /boot/config/docker.cfg 2>/dev/null\
*/
?>
<?
if ($var['fsState'] != "Started") {
echo "<p class='notice shift'>Array must be <span class='strong big'>started</span> to view Docker containers.</p>";
return;
}
if ( !is_file('/var/run/dockerd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/dockerd.pid'))) ) {
echo "<p class='notice shift'>Docker Service failed to start.</p>";
return;
if ($var['fsState'] != 'Started') {
echo "<div class='notice shift'>Array must be <span class='strong big'>started</span> to view Docker containers.</div>";
} elseif (!is_file('/var/run/dockerd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/dockerd.pid')))) {
echo "<div class='notice shift'>Docker Service failed to start.</div>";
}
?>

View File

@@ -1,7 +1,7 @@
Menu="Docker:1"
Title="Docker Containers"
Tag="cubes"
Cond="(pgrep('dockerd')!==false)"
Cond="is_file('/var/run/dockerd.pid')"
Markdown="false"
---
<?PHP

View File

@@ -1,7 +1,7 @@
Menu="VMs:1"
Title="Virtual Machines"
Tag="columns"
Cond="(pgrep('libvirtd')!==false)"
Cond="is_file('/var/run/libvirt/libvirtd.pid')"
Markdown="false"
---
<?PHP

View File

@@ -4,8 +4,8 @@ Code="f108"
Cond="exec(\"grep -o '^SERVICE=.enable' /boot/config/domain.cfg 2>/dev/null\")"
---
<?PHP
/* Copyright 2005-2017, Lime Technology
* Copyright 2015-2017, Derek Macias, Eric Schultz, Jon Panozzo.
/* Copyright 2005-2018, Lime Technology
* Copyright 2015-2018, Derek Macias, Eric Schultz, Jon Panozzo.
*
* This program is free software; you can redistribute it and/or
* modify it under the terms of the GNU General Public License version 2,
@@ -17,13 +17,9 @@ Cond="exec(\"grep -o '^SERVICE=.enable' /boot/config/domain.cfg 2>/dev/null\")"
?>
<?
if ($var['fsState'] != "Started") {
echo "<p class='notice shift'>Array must be <span class='strong big'>started</span> to view Virtual Machines.</p>";
return;
echo "<div class='notice shift'>Array must be <span class='strong big'>started</span> to view Virtual Machines.</div>";
} elseif (!is_file('/var/run/libvirt/libvirtd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/libvirt/libvirtd.pid')))) {
echo "<div class='notice shift'>Libvirt Service failed to start.</div>";
}
if (!is_file('/var/run/libvirt/libvirtd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/libvirt/libvirtd.pid')))) {
echo "<p class='notice shift'>Libvirt Service failed to start.</p>";
return;
}
if (count($pages)==2) $tabbed = false;
?>