summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-21 11:24:26 +0100
committerSimon Rettberg2019-03-21 11:24:26 +0100
commit57a3b41b40890a5aee5cb3b5103014d6e144ca67 (patch)
tree4e8f0e3ee84b07eee43b0e291ad1d7087aaf2c8b
parent[serversetup-bwlp-ipxe] Much better dup detection on import (diff)
downloadslx-admin-57a3b41b40890a5aee5cb3b5103014d6e144ca67.tar.gz
slx-admin-57a3b41b40890a5aee5cb3b5103014d6e144ca67.tar.xz
slx-admin-57a3b41b40890a5aee5cb3b5103014d6e144ca67.zip
[serversetup-bwlp-ipxe] Fix stdbootentry edit; fix duplicate id in html
-rw-r--r--modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php4
-rw-r--r--modules-available/serversetup-bwlp-ipxe/page.inc.php10
-rw-r--r--modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html12
3 files changed, 17 insertions, 9 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
index 2353c0e9..130bb52b 100644
--- a/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/inc/bootentry.inc.php
@@ -62,8 +62,10 @@ abstract class BootEntry
$list[] = StandardBootEntry::EFI;
}
foreach ($list as $mode) {
- if (empty($ret->toArray()['executable'][$mode]))
+ if (empty($ret->toArray()['executable'][$mode])) {
+ error_log('Incomplete stdbot: ' . print_r($initData, true));
return null;
+ }
}
return $ret;
}
diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php
index 8942f8fb..5ca11c86 100644
--- a/modules-available/serversetup-bwlp-ipxe/page.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php
@@ -489,10 +489,16 @@ class Page_ServerSetup extends Page
if (!is_array($params['entries'])) {
$params['entries'] = [];
}
- if (!in_array(['mode' => 'PCBIOS'], $params['entries'])) {
+ $f = [];
+ foreach ($params['entries'] as $e) {
+ if (isset($e['mode'])) {
+ $f[] = $e['mode'];
+ }
+ }
+ if (!in_array('PCBIOS', $f)) {
$params['entries'][] = ['mode' => 'PCBIOS'];
}
- if (!in_array(['mode' => 'EFI'], $params['entries'])) {
+ if (!in_array('EFI', $f)) {
$params['entries'][] = ['mode' => 'EFI'];
}
$params['menus'] = Database::queryAll('SELECT m.menuid, m.title FROM serversetup_menu m
diff --git a/modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html b/modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html
index c04661f2..b195394d 100644
--- a/modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html
+++ b/modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html
@@ -65,22 +65,22 @@
<div class="panel-body">
<h4 class="arch-heading">{{mode}}</h4>
<div class="form-group">
- <label for="input-ex">
+ <label for="input-ex-{{mode}}">
{{lang_imageToLoad}}
</label>
- <input id="input-ex" class="form-control" name="entry[executable][{{mode}}]" value="{{executable}}" {{disabled}}>
+ <input id="input-ex-{{mode}}" class="form-control" name="entry[executable][{{mode}}]" value="{{executable}}" {{disabled}}>
</div>
<div class="form-group">
- <label for="input-rd">
+ <label for="input-rd-{{mode}}">
{{lang_initRd}}
</label>
- <input id="input-rd" class="form-control" name="entry[initRd][{{mode}}]" value="{{initRd}}" {{disabled}}>
+ <input id="input-rd-{{mode}}" class="form-control" name="entry[initRd][{{mode}}]" value="{{initRd}}" {{disabled}}>
</div>
<div class="form-group">
- <label for="input-cmd">
+ <label for="input-cmd-{{mode}}">
{{lang_commandLine}}
</label>
- <input id="input-cmd" class="form-control" name="entry[commandLine][{{mode}}]"
+ <input id="input-cmd-{{mode}}" class="form-control" name="entry[commandLine][{{mode}}]"
value="{{commandLine}}" {{disabled}}>
</div>
<div class="form-group">