mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-15 00:54:41 +00:00
firmware: sort upgrade packages, needs more work for other types
GUI sorting for now should be new, update, reinstall, remove. Later all those types ought to be merged into a single list with backwards- compatible behaviour. First of many neat firmware improvements on our way to 16.7. :)
This commit is contained in:
parent
93c20e1b69
commit
8770689a0c
@ -97,6 +97,18 @@ class FirmwareController extends ApiControllerBase
|
||||
$response = array('status' => 'unknown', 'status_msg' => gettext('Current status is unknown.'));
|
||||
}
|
||||
|
||||
/* XXX array isn't flat, need to refactor this */
|
||||
if (isset($response['upgrade_packages'])) {
|
||||
$sorted = array();
|
||||
foreach ($response['upgrade_packages'] as $key => $value) {
|
||||
$sorted[$value['name']] = $value;
|
||||
}
|
||||
uksort($sorted, function ($a, $b) {
|
||||
return strnatcmp($a, $b);
|
||||
});
|
||||
$response['upgrade_packages'] = $sorted;
|
||||
}
|
||||
|
||||
return $response;
|
||||
}
|
||||
|
||||
|
||||
@ -57,7 +57,7 @@ POSSIBILITY OF SUCH DAMAGE.
|
||||
// show upgrade list
|
||||
$("#updatelist").html("<tr><th>{{ lang._('Package Name') }}</th>" +
|
||||
"<th>{{ lang._('Current Version') }}</th><th>{{ lang._('New Version') }}</th></tr>");
|
||||
$.each(['upgrade_packages','new_packages','reinstall_packages'], function(type_idx,type_name){
|
||||
$.each(['new_packages', 'upgrade_packages', 'reinstall_packages'], function(type_idx,type_name){
|
||||
if ( data[type_name] != undefined ) {
|
||||
$.each(data[type_name],function(index,row){
|
||||
if (type_name == "new_packages") {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user