mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 00:24:40 +00:00
firmware: show support tiers in plugin list; closes #6374
This commit is contained in:
parent
80af1c5ae9
commit
8db8ceb4b9
@ -857,8 +857,19 @@ class FirmwareController extends ApiMutableModelControllerBase
|
||||
$devel = count($devel) == 2 ? $devel[1] == 'devel' : false;
|
||||
|
||||
/* need both remote and local, create array earlier */
|
||||
$packages = array();
|
||||
$plugins = array();
|
||||
$packages = [];
|
||||
$plugins = [];
|
||||
$tiers = [];
|
||||
|
||||
$current = $backend->configdRun('firmware tiers');
|
||||
$current = explode("\n", trim($current ?? ''));
|
||||
|
||||
foreach ($current as $line) {
|
||||
$expanded = explode('|||', $line);
|
||||
if (count($expanded) == 3) {
|
||||
$tiers[$expanded[0]] = $expanded[2];
|
||||
}
|
||||
}
|
||||
|
||||
/* package infos are flat lists with 3 pipes as delimiter */
|
||||
foreach (array('remote', 'local') as $type) {
|
||||
@ -939,6 +950,7 @@ class FirmwareController extends ApiMutableModelControllerBase
|
||||
|
||||
$response['plugin'] = array();
|
||||
foreach ($plugins as $plugin) {
|
||||
$plugin['tier'] = isset($tiers[$plugin['name']]) ? $tiers[$plugin['name']] : gettext('N/A');
|
||||
$response['plugin'][] = $plugin;
|
||||
}
|
||||
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{#
|
||||
# Copyright (c) 2015-2022 Franco Fichtner <franco@opnsense.org>
|
||||
# Copyright (c) 2015-2023 Franco Fichtner <franco@opnsense.org>
|
||||
# Copyright (c) 2015-2018 Deciso B.V.
|
||||
# All rights reserved.
|
||||
#
|
||||
@ -443,6 +443,7 @@
|
||||
'<tr class="plugin_entry">' + '<td>' + bold_on + row['name'] + status_text + bold_off + '</td>' +
|
||||
'<td>' + bold_on + row['version'] + bold_off + '</td>' +
|
||||
'<td>' + bold_on + row['flatsize'] + bold_off + '</td>' +
|
||||
'<td>' + bold_on + row['tier'] + bold_off + '</td>' +
|
||||
'<td>' + bold_on + row['repository'] + bold_off + '</td>' +
|
||||
'<td>' + bold_on + row['comment'] + bold_off + '</td>' +
|
||||
'<td style="white-space:nowrap;vertical-align:middle;"><div class="input-group">' +
|
||||
@ -931,6 +932,7 @@
|
||||
<th style="vertical-align:middle"><input type="text" class="input-sm" autocomplete="off" id="plugin_search" placeholder="{{ lang._('Name') }}"></th>
|
||||
<th style="vertical-align:middle">{{ lang._('Version') }}</th>
|
||||
<th style="vertical-align:middle">{{ lang._('Size') }}</th>
|
||||
<th style="vertical-align:middle">{{ lang._('Tier') }}</th>
|
||||
<th style="vertical-align:middle">{{ lang._('Repository') }}</th>
|
||||
<th style="vertical-align:middle">{{ lang._('Comment') }}</th>
|
||||
<th style="vertical-align:middle"></th>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user