diff options
author | Simon Rettberg | 2019-10-17 15:55:05 +0200 |
---|---|---|
committer | Simon Rettberg | 2019-10-17 15:55:05 +0200 |
commit | 0064f98651c627387115e84e7632f9eceff5d4c3 (patch) | |
tree | bf06e04bc6bde06f322631945be7b7d5ec5108db /modules-available/serversetup-bwlp-ipxe/page.inc.php | |
parent | [serversetup-bwlp-ipxe/minilinux] Further improvements (diff) | |
download | slx-admin-0064f98651c627387115e84e7632f9eceff5d4c3.tar.gz slx-admin-0064f98651c627387115e84e7632f9eceff5d4c3.tar.xz slx-admin-0064f98651c627387115e84e7632f9eceff5d4c3.zip |
[serversetup-bwlp-ipxe] UI/UX tweaks
* Decluttered bootentry View in menu editor
* Show details for hook bootentry in menu editor
* Buttons for "save and reload" in menu/bootentry editor
Diffstat (limited to 'modules-available/serversetup-bwlp-ipxe/page.inc.php')
-rw-r--r-- | modules-available/serversetup-bwlp-ipxe/page.inc.php | 29 |
1 files changed, 28 insertions, 1 deletions
diff --git a/modules-available/serversetup-bwlp-ipxe/page.inc.php b/modules-available/serversetup-bwlp-ipxe/page.inc.php index 81f15922..cc5fdbe5 100644 --- a/modules-available/serversetup-bwlp-ipxe/page.inc.php +++ b/modules-available/serversetup-bwlp-ipxe/page.inc.php @@ -422,8 +422,29 @@ class Page_ServerSetup extends Page Database::queryAll("SELECT Concat('menu:', menuid) AS entryid, title FROM serversetup_menu ORDER BY title ASC") ); foreach ($menu['entrylist'] as &$bootentry) { - if (!isset($bootentry['data']) || !isset($bootentry['module']) || $bootentry['module']{0} !== '.') + if (!isset($bootentry['data']) || !isset($bootentry['module'])) continue; + if ($bootentry['module']{0} !== '.') { + // Hook from other module + $bootentry['moduleName'] = Dictionary::translateFileModule($bootentry['module'], 'module', 'module_name'); + if (!$bootentry['moduleName']) { + $bootentry['moduleName'] = $bootentry['module']; + } + $bootentry['ishook'] = true; + $data = json_decode($bootentry['data'], true); + unset($bootentry['data']); + $bootentry['id'] = $data['id']; + $bootentry['otherFields'] = []; + foreach ($data as $k => $v) { + if ($k === 'id') + continue; + $bootentry['otherFields'][] = [ + 'key' => Dictionary::translateFileModule($bootentry['module'], 'module', 'ipxe-' . $k, true), + 'value' => is_bool($v) ? Util::boolToString($v) : $v, + ]; + } + continue; + } $entry = BootEntry::fromJson($bootentry['module'], $bootentry['data']); if ($entry === null) { error_log('WARNING: Ignoring NULL menu entry: ' . $bootentry['data']); @@ -753,6 +774,9 @@ class Page_ServerSetup extends Page } Message::addSuccess('menu-saved'); + if (Request::post('next') === 'reload') { + Util::redirect('?do=serversetup&show=editmenu&id=' . $menu['menuid']); + } } private function updateLocalAddress() @@ -857,6 +881,9 @@ class Page_ServerSetup extends Page WHERE entryid = :oldid', $params); Message::addSuccess('boot-entry-updated', $newId); } + if (Request::post('next') === 'reload') { + Util::redirect('?do=serversetup&show=editbootentry&id=' . $newId); + } Util::redirect('?do=serversetup&show=bootentry'); } |