mirror of
https://github.com/unraid/webgui.git
synced 2026-01-05 00:59:48 -06:00
refactor: shares, docker, and vm pages - move away from echoing full HTML
This commit is contained in:
@@ -18,9 +18,14 @@ Cond="exec(\"grep -o '^DOCKER_ENABLED=.yes' /boot/config/docker.cfg 2>/dev/null\
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
if ($var['fsState'] != 'Started') {
|
||||
echo "<div class='notice shift'>_(Array must be **Started** 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>";
|
||||
}
|
||||
$noticeMessage = null;
|
||||
if ($var['fsState'] != 'Started') {
|
||||
$noticeMessage = _('Array must be **Started** to view Docker containers');
|
||||
} elseif (!is_file('/var/run/dockerd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/dockerd.pid')))) {
|
||||
$noticeMessage = _('Docker Service failed to start');
|
||||
}
|
||||
?>
|
||||
|
||||
<? if ($noticeMessage): ?>
|
||||
<p class="notice"><?= $noticeMessage ?></p>
|
||||
<? endif; ?>
|
||||
|
||||
@@ -18,10 +18,19 @@ Cond="exec(\"grep -o '^SERVICE=.enable' /boot/config/domain.cfg 2>/dev/null\")"
|
||||
*/
|
||||
?>
|
||||
<?
|
||||
if ($var['fsState'] != "Started") {
|
||||
echo "<div class='notice shift'>"._('Array must be **started** 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>";
|
||||
$noticeMessage = null;
|
||||
if ($var['fsState'] != "Started") {
|
||||
$noticeMessage = _('Array must be **started** to view Virtual Machines');
|
||||
} elseif (!is_file('/var/run/libvirt/libvirtd.pid') || (!is_dir('/proc/'.@file_get_contents('/var/run/libvirt/libvirtd.pid')))) {
|
||||
$noticeMessage = _('Libvirt Service failed to start');
|
||||
}
|
||||
?>
|
||||
<? if ($noticeMessage): ?>
|
||||
<p class="notice"><?= $noticeMessage ?></p>
|
||||
<? endif; ?>
|
||||
|
||||
<?
|
||||
if (count($pages) == 2) {
|
||||
$tabbed = false;
|
||||
}
|
||||
if (count($pages)==2) $tabbed = false;
|
||||
?>
|
||||
@@ -2,10 +2,20 @@ Menu="Tasks:2"
|
||||
Type="xmenu"
|
||||
Code="e92a"
|
||||
---
|
||||
<?PHP
|
||||
if ($var['fsState']=="Stopped") {
|
||||
echo "<p class='notice shift'>"._('Array must be **Started** to view Shares').".</p>";
|
||||
return;
|
||||
}
|
||||
if (count($pages)==2) $tabbed = false;
|
||||
<?
|
||||
$noticeMessage = null;
|
||||
if ($var['fsState'] == "Stopped") {
|
||||
$noticeMessage = _('Array must be **Started** to view Shares');
|
||||
}
|
||||
?>
|
||||
|
||||
<? if ($noticeMessage): ?>
|
||||
<p class="notice"><?= $noticeMessage ?></p>
|
||||
<? return; ?>
|
||||
<? endif; ?>
|
||||
|
||||
<?
|
||||
if (count($pages) == 2) {
|
||||
$tabbed = false;
|
||||
}
|
||||
?>
|
||||
|
||||
Reference in New Issue
Block a user