Commit b73c0e7d authored by Franco Fichtner's avatar Franco Fichtner

firmware: major upgrade button for #1707

parent 5198b7d4
......@@ -313,6 +313,7 @@
/usr/local/opnsense/contrib/simplepie/library/SimplePie/gzdecode.php
/usr/local/opnsense/contrib/simplepie/phpunit.xml.dist
/usr/local/opnsense/contrib/tzdata/iso3166.tab
/usr/local/opnsense/firmware-message
/usr/local/opnsense/firmware-product
/usr/local/opnsense/firmware-upgrade
/usr/local/opnsense/mvc/app/cache/README
......
A placeholder for the 17.7 upgrade message.
......@@ -266,12 +266,14 @@ class FirmwareController extends ApiControllerBase
{
$backend = new Backend();
$response = array();
if ($this->request->hasPost("upgrade")) {
if ($this->request->hasPost('upgrade')) {
$response['status'] = 'ok';
if ($this->request->getPost("upgrade") == "pkg") {
$action = "firmware upgrade pkg";
if ($this->request->getPost('upgrade') == 'pkg') {
$action = 'firmware upgrade pkg';
} elseif ($this->request->getPost('upgrade') == 'maj') {
$action = 'firmware upgrade maj';
} else {
$action = "firmware upgrade all";
$action = 'firmware upgrade all';
}
$response['msg_uuid'] = trim($backend->configdRun($action, true));
} else {
......
......@@ -478,6 +478,16 @@ POSSIBILITY OF SUCH DAMAGE.
title: "{{ lang._('End-of-Life Notice') }}",
message: $('#message').html(),
buttons: [{
<?php if (file_exists('/usr/local/opnsense/firmware-upgrade')): ?>
label: "{{ lang._('Upgrade') }}",
action: function(dialogRef){
dialogRef.close();
$.upgrade_needs_reboot = 1;
$.upgrade_action = 'maj';
upgrade_ui();
}
},{
<?php endif ?>
label: "{{ lang._('Close') }}",
action: function(dialogRef){
dialogRef.close();
......
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