summaryrefslogtreecommitdiffstats
path: root/modules-available/dnbd3
diff options
context:
space:
mode:
authorSimon Rettberg2024-01-18 15:29:48 +0100
committerSimon Rettberg2024-01-18 15:29:48 +0100
commitfd386a84a1a4c6dfbd0316711ff22aa99b8b8a09 (patch)
tree5c11c8c7fe5e637e6182ebccbec52a544c09ccaa /modules-available/dnbd3
parent[locations/statistics] More type safety, array key checks (diff)
downloadslx-admin-fd386a84a1a4c6dfbd0316711ff22aa99b8b8a09.tar.gz
slx-admin-fd386a84a1a4c6dfbd0316711ff22aa99b8b8a09.tar.xz
slx-admin-fd386a84a1a4c6dfbd0316711ff22aa99b8b8a09.zip
[dnbd3] Add warning if proxy servers exist but DNBD3 is disabled for VMs
Diffstat (limited to 'modules-available/dnbd3')
-rw-r--r--modules-available/dnbd3/lang/de/template-tags.json1
-rw-r--r--modules-available/dnbd3/lang/en/template-tags.json1
-rw-r--r--modules-available/dnbd3/page.inc.php3
-rw-r--r--modules-available/dnbd3/templates/page-serverlist.html7
4 files changed, 10 insertions, 2 deletions
diff --git a/modules-available/dnbd3/lang/de/template-tags.json b/modules-available/dnbd3/lang/de/template-tags.json
index 1730fe50..d58c033f 100644
--- a/modules-available/dnbd3/lang/de/template-tags.json
+++ b/modules-available/dnbd3/lang/de/template-tags.json
@@ -24,6 +24,7 @@
"lang_dnbd3Status": "DNBD3 Status",
"lang_editProxyHeading": "Proxy-Einstellungen bearbeiten",
"lang_enableDnbd3": "DNBD3 f\u00fcr VMs aktivieren",
+ "lang_enableDnbd3Hint": "Sie haben Proxy-Server angelegt, aber DNBD3 nicht f\u00fcr VMs aktiviert. Aktuell wird nur der Bootvorgang des Grundsystems \u00fcber DNBD3 durchgef\u00fchrt, die VM-Images werden weiterhin direkt vom NFS\/CIFS-Server geladen, und profitieren nicht von Lastverteilung und Failover.",
"lang_enabled": "Aktiviert",
"lang_enterIpOfServer": "Bitte geben Sie die IP-Adresse des hinzuzuf\u00fcgenden Servers ein",
"lang_externalServer": "Externer DNBD3-Server",
diff --git a/modules-available/dnbd3/lang/en/template-tags.json b/modules-available/dnbd3/lang/en/template-tags.json
index 27ba9598..890aa0c2 100644
--- a/modules-available/dnbd3/lang/en/template-tags.json
+++ b/modules-available/dnbd3/lang/en/template-tags.json
@@ -24,6 +24,7 @@
"lang_dnbd3Status": "DNBD3 status",
"lang_editProxyHeading": "Edit proxy settings",
"lang_enableDnbd3": "Enable DNBD3 for VMs",
+ "lang_enableDnbd3Hint": "You have created proxy servers, but did not enable DNBD3 for VMs. Currently, only the boot process of the client is done via DNBD3, the VM images are still loaded directly from the NFS\/CIFS server and do not benefit from load balancing and failover.",
"lang_enabled": "Enabled",
"lang_enterIpOfServer": "Please enter the ip address ot the server",
"lang_externalServer": "External DNBD3-Server",
diff --git a/modules-available/dnbd3/page.inc.php b/modules-available/dnbd3/page.inc.php
index ffaa995e..6b0df8e4 100644
--- a/modules-available/dnbd3/page.inc.php
+++ b/modules-available/dnbd3/page.inc.php
@@ -257,7 +257,8 @@ class Page_Dnbd3 extends Page
'enabled_checked_s' => Dnbd3::isEnabled() ? 'checked' : '',
'nfs_checked_s' => Dnbd3::hasNfsFallback() ? 'checked' : '',
'local_checked_s' => Dnbd3::preferLocal() ? 'checked' : '',
- 'rebootcontrol' => Module::isAvailable('rebootcontrol', false)
+ 'rebootcontrol' => Module::isAvailable('rebootcontrol', false),
+ 'show_enable_warning' => count($servers) > 1 && !Dnbd3::isEnabled(),
);
Permission::addGlobalTags($data['perms'], null, ['view.details', 'refresh', 'toggle-usage', 'configure.proxy', 'configure.external']);
Render::addTemplate('page-serverlist', $data);
diff --git a/modules-available/dnbd3/templates/page-serverlist.html b/modules-available/dnbd3/templates/page-serverlist.html
index efec21e1..bcb0d766 100644
--- a/modules-available/dnbd3/templates/page-serverlist.html
+++ b/modules-available/dnbd3/templates/page-serverlist.html
@@ -16,7 +16,7 @@
</b>
– <a href="#" data-toggle="collapse" data-target="#toggle-div">{{lang_changeDnbd3Status}}</a>
</div>
- <div class="panel-collapse collapse" id="toggle-div">
+ <div class="panel-collapse {{^show_enable_warning}}collapse{{/show_enable_warning}}" id="toggle-div">
<div class="panel-body">
<form method="post" action="?do=dnbd3">
<input type="hidden" name="token" value="{{token}}">
@@ -24,6 +24,11 @@
<input id="enable-dnbd3" type="checkbox" name="enabled" {{enabled_checked_s}} {{perms.toggle-usage.disabled}}>
<label for="enable-dnbd3">{{lang_enableDnbd3}}</label>
</div>
+ {{#show_enable_warning}}
+ <div class="text-warning">
+ {{lang_enableDnbd3Hint}}
+ </div>
+ {{/show_enable_warning}}
<div class="checkbox">
<input id="allow-nfs" type="checkbox" name="with-nfs" {{nfs_checked_s}} {{perms.toggle-usage.disabled}}>
<label for="allow-nfs">{{lang_allowNfsFallback}}</label>