Commit 4f88f025 authored by Franco Fichtner's avatar Franco Fichtner

firmware: dialog primary buttons and less trigger-happy process #1707

parent b73c0e7d
...@@ -216,6 +216,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -216,6 +216,7 @@ POSSIBILITY OF SUCH DAMAGE.
message: "{{ lang._('The firewall will be rebooted directly after this firmware update.') }}", message: "{{ lang._('The firewall will be rebooted directly after this firmware update.') }}",
buttons: [{ buttons: [{
label: "{{ lang._('OK') }}", label: "{{ lang._('OK') }}",
cssClass: 'btn-primary',
action: function(dialogRef){ action: function(dialogRef){
dialogRef.close(); dialogRef.close();
upgrade(); upgrade();
...@@ -471,15 +472,15 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -471,15 +472,15 @@ POSSIBILITY OF SUCH DAMAGE.
$('#checkupdate').click(updateStatus); $('#checkupdate').click(updateStatus);
$('#upgrade').click(upgrade_ui); $('#upgrade').click(upgrade_ui);
$('#audit').click(audit); $('#audit').click(audit);
// show upgrade message if there $('#upgrade_maj').click(function () {
if ($('#message').html() != '') {
BootstrapDialog.show({ BootstrapDialog.show({
type:BootstrapDialog.TYPE_WARNING, type:BootstrapDialog.TYPE_WARNING,
title: "{{ lang._('End-of-Life Notice') }}", title: "{{ lang._('Upgrade instructions') }}",
message: $('#message').html(), message: $('#message').html(),
buttons: [{ 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-primary',
action: function(dialogRef){ action: function(dialogRef){
dialogRef.close(); dialogRef.close();
$.upgrade_needs_reboot = 1; $.upgrade_needs_reboot = 1;
...@@ -494,7 +495,7 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -494,7 +495,7 @@ POSSIBILITY OF SUCH DAMAGE.
} }
}] }]
}); });
} });
// populate package information // populate package information
packagesInfo(true); packagesInfo(true);
...@@ -620,7 +621,13 @@ POSSIBILITY OF SUCH DAMAGE. ...@@ -620,7 +621,13 @@ POSSIBILITY OF SUCH DAMAGE.
<div class="container-fluid"> <div class="container-fluid">
<div class="row"> <div class="row">
<?php if (file_exists('/usr/local/opnsense/firmware-message')): ?>
<div id="message" style="display:none" class="alert alert-warning" role="alert"><?= @file_get_contents('/usr/local/opnsense/firmware-message') ?></div> <div id="message" style="display:none" class="alert alert-warning" role="alert"><?= @file_get_contents('/usr/local/opnsense/firmware-message') ?></div>
<div class="alert alert-warning" role="alert" style="min-height: 65px;">
<button class='btn btn-primary pull-right' id="upgrade_maj">{{ lang._('Upgrade instructions') }}</button>
<div style="margin-top: 8px;">{{ lang._('This software release has reached its designated end of life.') }}</div>
</div>
<?php endif ?>
<div class="alert alert-info" role="alert" style="min-height: 65px;"> <div class="alert alert-info" role="alert" style="min-height: 65px;">
<button class='btn btn-primary pull-right' id="upgrade" style="display:none"><i id="upgrade_progress" class=""></i> {{ lang._('Upgrade now') }}</button> <button class='btn btn-primary pull-right' id="upgrade" style="display:none"><i id="upgrade_progress" class=""></i> {{ lang._('Upgrade now') }}</button>
<button class='btn btn-primary pull-right' id="audit"><i id="audit_progress" class=""></i> {{ lang._('Audit now') }}</button> <button class='btn btn-primary pull-right' id="audit"><i id="audit_progress" class=""></i> {{ lang._('Audit now') }}</button>
......
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