Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
e4682fff
Commit
e4682fff
authored
Jul 13, 2015
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: poll for GUI to come back up; fixes #250
parent
ac790ce8
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
21 additions
and
18 deletions
+21
-18
firmware.volt
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
+18
-15
pkg_upgrade.sh
src/opnsense/scripts/pkg_upgrade.sh
+3
-3
No files found.
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
View file @
e4682fff
...
@@ -97,7 +97,7 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -97,7 +97,7 @@ POSSIBILITY OF SUCH DAMAGE.
ajaxCall('/api/core/firmware/upgrade',{upgrade:$.upgrade_action},function() {
ajaxCall('/api/core/firmware/upgrade',{upgrade:$.upgrade_action},function() {
$("#upgrade_progress").removeClass("fa fa-spinner fa-pulse");
$("#upgrade_progress").removeClass("fa fa-spinner fa-pulse");
$('#updatelist').empty();
$('#updatelist').empty();
setTimeout(trackStatus,
1000)
;
setTimeout(trackStatus,
500)
;
});
});
}
}
...
@@ -131,6 +131,17 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -131,6 +131,17 @@ POSSIBILITY OF SUCH DAMAGE.
}
}
}
}
function rebootWait() {
$.ajax({
url: document.url,
timeout: 2500
}).fail(function () {
setTimeout(rebootWait, 2500);
}).done(function () {
$(location).attr('href',"/");
});
}
/**
/**
* handle update status
* handle update status
*/
*/
...
@@ -147,25 +158,17 @@ POSSIBILITY OF SUCH DAMAGE.
...
@@ -147,25 +158,17 @@ POSSIBILITY OF SUCH DAMAGE.
// reboot required, tell the user to wait until this is finished and redirect after 5 minutes
// reboot required, tell the user to wait until this is finished and redirect after 5 minutes
BootstrapDialog.show({
BootstrapDialog.show({
type:BootstrapDialog.TYPE_INFO,
type:BootstrapDialog.TYPE_INFO,
title: "{{ lang._('
Upgrade
') }}",
title: "{{ lang._('
Your device is rebooting
') }}",
message: "{{ lang._('The upgrade is finished and your device is being rebooted at the moment, please wait.') }}",
message: "{{ lang._('The upgrade is finished and your device is being rebooted at the moment, please wait.') }}",
closable: false,
closable: false,
onshow:function(dialogRef){
onshow:function(dialogRef){
dialogRef.setClosable(false);
dialogRef.setClosable(false);
dialogRef.getModalBody().html(
"{{ lang._('You will be redirected to the login page in 5 minutes.') }}");
dialogRef.getModalBody().html(
setTimeout(function(){
"{{ lang._('The upgrade is finished and your device is being rebooted at the moment, please wait...') }}" +
dialogRef.close();
' <i class="fa fa-cog fa-spin"></i>'
$(location).attr('href',"/"
);
);
}, 60000 * 5
);
setTimeout(rebootWait, 30000
);
},
},
buttons: [{
label: "{{ lang._('Close') }}",
cssClass: 'btn-success',
autospin: true,
action: function(dialogRef){
dialogRef.enableButtons(false);
}
}]
});
});
} else {
} else {
// schedule next poll
// schedule next poll
...
...
src/opnsense/scripts/pkg_upgrade.sh
View file @
e4682fff
...
@@ -62,8 +62,8 @@ fi
...
@@ -62,8 +62,8 @@ fi
if
[
-n
"
${
REBOOT
}
"
]
;
then
if
[
-n
"
${
REBOOT
}
"
]
;
then
echo
'***REBOOT***'
>>
${
PKG_PROGRESS_FILE
}
echo
'***REBOOT***'
>>
${
PKG_PROGRESS_FILE
}
# give the frontend some time to figure out that a reboot is coming
# give the frontend some time to figure out that a reboot is coming
sleep
10
sleep
5
/usr/local/etc/rc.reboot
/usr/local/etc/rc.reboot
else
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
fi
fi
echo
'***DONE***'
>>
${
PKG_PROGRESS_FILE
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment