Commit 5daf7785 authored by Franco Fichtner's avatar Franco Fichtner

firmware: fetch changelogs in between, separate upgrade button

parent 5f5e438f
...@@ -478,27 +478,35 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -478,27 +478,35 @@ POSSIBILITY OF SUCH DAMAGE.
$('#upgrade').click(upgrade_ui); $('#upgrade').click(upgrade_ui);
$('#audit').click(audit); $('#audit').click(audit);
$('#upgrade_maj').click(function () { $('#upgrade_maj').click(function () {
BootstrapDialog.show({ $.upgrade_needs_reboot = 1;
type:BootstrapDialog.TYPE_WARNING, $.upgrade_action = 'maj';
title: "{{ lang._('Upgrade instructions') }}", upgrade_ui();
message: $('#message').html(), });
buttons: [{ $('#checkupdate_maj').click(function () {
$("#checkupdate_progress").addClass("fa fa-spinner fa-pulse");
// empty call refreshes changelogs in the background
ajaxCall('/api/core/firmware/changelog/', {}, function () {
$("#checkupdate_progress").removeClass("fa fa-spinner fa-pulse");
BootstrapDialog.show({
type:BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('Upgrade instructions') }}",
message: $('#message').html(),
buttons: [{
<?php if (file_exists('/usr/local/opnsense/firmware-upgrade')): ?> <?php if (file_exists('/usr/local/opnsense/firmware-upgrade')): ?>
label: "{{ lang._('Upgrade') }}", label: "{{ lang._('Upgrade') }}",
cssClass: 'btn-warning', cssClass: 'btn-warning',
action: function(dialogRef){ action: function (dialogRef) {
dialogRef.close(); dialogRef.close();
$.upgrade_needs_reboot = 1; $("#upgrade").attr("style","");
$.upgrade_action = 'maj'; }
upgrade_ui(); },{
}
},{
<?php endif ?> <?php endif ?>
label: "{{ lang._('Close') }}", label: "{{ lang._('Close') }}",
action: function(dialogRef){ action: function (dialogRef) {
dialogRef.close(); dialogRef.close();
} }
}] }]
});
}); });
}); });
...@@ -629,7 +637,8 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -629,7 +637,8 @@ POSSIBILITY OF SUCH DAMAGE.
<?php if (file_exists('/usr/local/opnsense/firmware-message')): ?> <?php if (file_exists('/usr/local/opnsense/firmware-message')): ?>
<div id="message" style="display:none;"><?= @file_get_contents('/usr/local/opnsense/firmware-message') ?></div> <div id="message" style="display:none;"><?= @file_get_contents('/usr/local/opnsense/firmware-message') ?></div>
<div class="alert alert-warning" role="alert" style="min-height: 65px;"> <div class="alert alert-warning" role="alert" style="min-height: 65px;">
<button class='btn pull-right' id="upgrade_maj">{{ lang._('Upgrade instructions') }}</button> <button class='btn btn-primary pull-right' id="upgrade_maj" style="display:none;"><i id="upgrade_progress_maj" class=""></i> {{ lang._('Upgrade now') }}</button>
<button class='btn pull-right' id="checkupdate_maj">{{ lang._('Check for upgrade') }}</button>
<div style="margin-top: 8px;">{{ lang._('This software release has reached its designated end of life.') }}</div> <div style="margin-top: 8px;">{{ lang._('This software release has reached its designated end of life.') }}</div>
</div> </div>
<?php endif ?> <?php endif ?>
......
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