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
76986c0a
Commit
76986c0a
authored
Nov 18, 2016
by
Franco Fichtner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firmware: display latest changelog if found
parent
ecd05eaf
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
21 additions
and
3 deletions
+21
-3
FirmwareController.php
.../app/controllers/OPNsense/Core/Api/FirmwareController.php
+8
-2
firmware.volt
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
+11
-0
check.sh
src/opnsense/scripts/firmware/check.sh
+2
-1
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Core/Api/FirmwareController.php
View file @
76986c0a
...
...
@@ -180,8 +180,14 @@ class FirmwareController extends ApiControllerBase
return
preg_replace
(
'/[^0-9a-zA-Z\.]/'
,
''
,
$value
);
});
$version
=
$filter
->
sanitize
(
$version
,
'version'
);
$response
[
'text'
]
=
trim
(
$backend
->
configdRun
(
sprintf
(
'firmware changelog text %s'
,
$version
)));
$response
[
'html'
]
=
trim
(
$backend
->
configdRun
(
sprintf
(
'firmware changelog html %s'
,
$version
)));
$text
=
trim
(
$backend
->
configdRun
(
sprintf
(
'firmware changelog text %s'
,
$version
)));
$html
=
trim
(
$backend
->
configdRun
(
sprintf
(
'firmware changelog html %s'
,
$version
)));
if
(
!
empty
(
$text
))
{
$response
[
'text'
]
=
$text
;
}
if
(
!
empty
(
$html
))
{
$response
[
'html'
]
=
$html
;
}
}
return
$response
;
...
...
src/opnsense/mvc/app/views/OPNsense/Core/firmware.volt
View file @
76986c0a
...
...
@@ -58,6 +58,8 @@ POSSIBILITY OF SUCH DAMAGE.
$.upgrade_needs_reboot = 0 ;
}
$.upgrade_show_log = '';
// unhide upgrade button
$("#upgrade").attr("style","");
...
...
@@ -73,8 +75,17 @@ POSSIBILITY OF SUCH DAMAGE.
$('#updatelist').append('<tr><td>'+row['name']+'</td>' +
'<td>'+row['old']+'</td><td>'+row['new']+'</td><td>' +
row['reason'] + '</td></tr>');
if (row['name'] == data['product_name']) {
$.upgrade_show_log = data['product_version'].replace(/[_-].*/, '');
}
});
// display the current changelog if one was found
if ($.upgrade_show_log != '') {
changelog($.upgrade_show_log);
}
// update list so plugins sync as well (no logs)
packagesInfo(false);
} else {
...
...
src/opnsense/scripts/firmware/check.sh
View file @
76986c0a
...
...
@@ -226,9 +226,10 @@ if [ "$pkg_running" == "" ]; then
fi
product_version
=
$(
cat
/usr/local/opnsense/version/opnsense
)
product_name
=
$(
cat
/usr/local/opnsense/version/opnsense.name
)
os_version
=
$(
uname
-sr
)
last_check
=
$(
date
)
# Write our json structure to disk
echo
"{
\"
connection
\"
:
\"
$connection
\"
,
\"
repository
\"
:
\"
$repository
\"
,
\"
product_version
\"
:
\"
$product_version
\"
,
\"
os_version
\"
:
\"
$os_version
\"
,
\"
last_check
\"
:
\"
$last_check
\"
,
\"
updates
\"
:
\"
$updates
\"
,
\"
download_size
\"
:
\"
$download_size
\"
,
\"
extra_space_required
\"
:
\"
$required_space
\"
,
\"
new_packages
\"
:[
$packages_new
],
\"
reinstall_packages
\"
:[
$packages_reinstall
],
\"
upgrade_packages
\"
:[
$packages_upgraded
],
\"
upgrade_needs_reboot
\"
:
\"
$upgrade_needs_reboot
\"
}"
echo
"{
\"
connection
\"
:
\"
$connection
\"
,
\"
repository
\"
:
\"
$repository
\"
,
\"
product_version
\"
:
\"
$product_version
\"
,
\"
product_name
\"
:
\"
$product_name
\"
,
\"
os_version
\"
:
\"
$os_version
\"
,
\"
last_check
\"
:
\"
$last_check
\"
,
\"
updates
\"
:
\"
$updates
\"
,
\"
download_size
\"
:
\"
$download_size
\"
,
\"
extra_space_required
\"
:
\"
$required_space
\"
,
\"
new_packages
\"
:[
$packages_new
],
\"
reinstall_packages
\"
:[
$packages_reinstall
],
\"
upgrade_packages
\"
:[
$packages_upgraded
],
\"
upgrade_needs_reboot
\"
:
\"
$upgrade_needs_reboot
\"
}"
fi
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