Commit 534e2526 authored by Franco Fichtner's avatar Franco Fichtner

firmware: improve GUI responses; closes #1009

(cherry picked from commit a89858db)
parent 2637370a
...@@ -55,10 +55,10 @@ class FirmwareController extends ApiControllerBase ...@@ -55,10 +55,10 @@ class FirmwareController extends ApiControllerBase
$response['status_msg'] = gettext('Connection error.'); $response['status_msg'] = gettext('Connection error.');
$response['status'] = 'error'; $response['status'] = 'error';
} elseif (array_key_exists('repository', $response) && $response['repository'] == 'error') { } elseif (array_key_exists('repository', $response) && $response['repository'] == 'error') {
$response['status_msg'] = gettext('Repository problem.'); $response['status_msg'] = gettext('Could not find the repository on the selected mirror.');
$response['status'] = 'error'; $response['status'] = 'error';
} elseif (array_key_exists('updates', $response) && $response['updates'] == 0) { } elseif (array_key_exists('updates', $response) && $response['updates'] == 0) {
$response['status_msg'] = gettext('There are no updates available.'); $response['status_msg'] = gettext('There are no updates available on the selected mirror.');
$response['status'] = 'none'; $response['status'] = 'none';
} elseif ((array_key_exists(0, $response['upgrade_packages']) && } elseif ((array_key_exists(0, $response['upgrade_packages']) &&
$response['upgrade_packages'][0]['name'] == 'pkg') || $response['upgrade_packages'][0]['name'] == 'pkg') ||
...@@ -66,11 +66,7 @@ class FirmwareController extends ApiControllerBase ...@@ -66,11 +66,7 @@ class FirmwareController extends ApiControllerBase
$response['reinstall_packages'][0]['name'] == 'pkg')) { $response['reinstall_packages'][0]['name'] == 'pkg')) {
$response['status_upgrade_action'] = 'pkg'; $response['status_upgrade_action'] = 'pkg';
$response['status'] = 'ok'; $response['status'] = 'ok';
$response['status_msg'] = $response['status_msg'] = gettext('There is a mandatory update for the package manager available.');
gettext(
'There is a mandatory update for the package manager available. ' .
'Please install and fetch updates again.'
);
} elseif (array_key_exists('updates', $response)) { } elseif (array_key_exists('updates', $response)) {
$response['status_upgrade_action'] = 'all'; $response['status_upgrade_action'] = 'all';
$response['status'] = 'ok'; $response['status'] = 'ok';
......
...@@ -160,7 +160,11 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -160,7 +160,11 @@ POSSIBILITY OF SUCH DAMAGE.
} }
if (data['status'] == 'done') { if (data['status'] == 'done') {
$("#upgrade_progress").removeClass("fa fa-spinner fa-pulse"); $("#upgrade_progress").removeClass("fa fa-spinner fa-pulse");
if ($.upgrade_action != 'pkg') {
$('#updatestatus').html("{{ lang._('Upgrade done!') }}"); $('#updatestatus').html("{{ lang._('Upgrade done!') }}");
} else {
$('#updatestatus').html("{{ lang._('Package manager update done. Please check for more updates.') }}");
}
$("#upgrade").attr("style","display:none"); $("#upgrade").attr("style","display:none");
packagesInfo(); packagesInfo();
} else if (data['status'] == 'reboot') { } else if (data['status'] == 'reboot') {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment