Commit a89858db authored by Franco Fichtner's avatar Franco Fichtner

firmware: improve GUI responses; closes #1009

parent 569bc3fd
......@@ -55,10 +55,10 @@ class FirmwareController extends ApiControllerBase
$response['status_msg'] = gettext('Connection error.');
$response['status'] = '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';
} 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';
} elseif ((array_key_exists(0, $response['upgrade_packages']) &&
$response['upgrade_packages'][0]['name'] == 'pkg') ||
......@@ -66,11 +66,7 @@ class FirmwareController extends ApiControllerBase
$response['reinstall_packages'][0]['name'] == 'pkg')) {
$response['status_upgrade_action'] = 'pkg';
$response['status'] = 'ok';
$response['status_msg'] =
gettext(
'There is a mandatory update for the package manager available. ' .
'Please install and fetch updates again.'
);
$response['status_msg'] = gettext('There is a mandatory update for the package manager available.');
} elseif (array_key_exists('updates', $response)) {
$response['status_upgrade_action'] = 'all';
$response['status'] = 'ok';
......
......@@ -160,7 +160,11 @@ POSSIBILITY OF SUCH DAMAGE.
}
if (data['status'] == 'done') {
$("#upgrade_progress").removeClass("fa fa-spinner fa-pulse");
if ($.upgrade_action != 'pkg') {
$('#updatestatus').html("{{ lang._('Upgrade done!') }}");
} else {
$('#updatestatus').html("{{ lang._('Package manager update done. Please check for more updates.') }}");
}
$("#upgrade").attr("style","display:none");
packagesInfo();
} 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