summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSimon Rettberg2019-03-19 16:45:01 +0100
committerSimon Rettberg2019-03-19 16:45:01 +0100
commit847c6ef5d74992f0a453a12ea65924a5e4b68964 (patch)
treedae79c08942c4d5daf6fc2195c5be63b19412674
parent[serversetup-bwlp-ipxe] Fix localboot detection for PXELinux import (diff)
downloadslx-admin-847c6ef5d74992f0a453a12ea65924a5e4b68964.tar.gz
slx-admin-847c6ef5d74992f0a453a12ea65924a5e4b68964.tar.xz
slx-admin-847c6ef5d74992f0a453a12ea65924a5e4b68964.zip
[serversetup-bwlp-ipxe] Fix incomplete bootentries, hide arch select
For type "script", the architecture options do nothing. Hide.
-rw-r--r--modules-available/serversetup-bwlp-ipxe/page.inc.php9
-rw-r--r--modules-available/serversetup-bwlp-ipxe/templates/ipxe-new-boot-entry.html22
2 files changed, 20 insertions, 11 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php
index 4941a44b..de802da8 100644
--- a/modules-available/serversetup-bwlp-ipxe/page.inc.php
+++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php
@@ -475,6 +475,15 @@ class Page_ServerSetup extends Page
$params['title'] = $row['title'];
$params['oldentryid'] = $params['entryid'] = $row['entryid'];
$params['builtin'] = $row['builtin'];
+ if (!is_array($params['entries'])) {
+ $params['entries'] = [];
+ }
+ if (!in_array(['mode' => 'PCBIOS'], $params['entries'])) {
+ $params['entries'][] = ['mode' => 'PCBIOS'];
+ }
+ if (!in_array(['mode' => 'EFI'], $params['entries'])) {
+ $params['entries'][] = ['mode' => 'EFI'];
+ }
$params['menus'] = Database::queryAll('SELECT m.menuid, m.title FROM serversetup_menu m
INNER JOIN serversetup_menuentry me ON (me.menuid = m.menuid)
WHERE me.entryid = :entryid', ['entryid' => $row['entryid']]);
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 687c312b..a6955642 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
@@ -39,19 +39,19 @@
</label>
<input id="input-title" class="form-control" name="title" value="{{title}}" maxlength="100">
</div>
- <div class="form-group">
- <label for="arch-selector">
- {{lang_archSelector}}
- </label>
- <select id="arch-selector" class="form-control" name="entry[arch]">
- <option value="agnostic" {{agnostic_selected}}>{{lang_archAgnostic}}</option>
- <option value="PCBIOS" {{PCBIOS_selected}}>{{lang_biosOnly}}</option>
- <option value="EFI" {{EFI_selected}}>{{lang_efiOnly}}</option>
- <option value="PCBIOS-EFI" {{PCBIOS-EFI_selected}}>{{lang_archBoth}}</option>
- </select>
- </div>
<div class="type-form" id="form-exec">
+ <div class="form-group">
+ <label for="arch-selector">
+ {{lang_archSelector}}
+ </label>
+ <select id="arch-selector" class="form-control" name="entry[arch]">
+ <option value="agnostic" {{agnostic_selected}}>{{lang_archAgnostic}}</option>
+ <option value="PCBIOS" {{PCBIOS_selected}}>{{lang_biosOnly}}</option>
+ <option value="EFI" {{EFI_selected}}>{{lang_efiOnly}}</option>
+ <option value="PCBIOS-EFI" {{PCBIOS-EFI_selected}}>{{lang_archBoth}}</option>
+ </select>
+ </div>
<div class="row">
{{#entries}}
<div class="mode-class col-md-6" id="col-{{mode}}">