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
2e85542a
Commit
2e85542a
authored
Jul 10, 2015
by
Sascha Linke
Committed by
Franco Fichtner
Jul 15, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Created a small system log widget with changeable value for the log entries #211
parent
696d9caa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
56 additions
and
0 deletions
+56
-0
system_log.inc
src/www/widgets/include/system_log.inc
+4
-0
system_log.widget.php
src/www/widgets/widgets/system_log.widget.php
+52
-0
No files found.
src/www/widgets/include/system_log.inc
0 → 100644
View file @
2e85542a
<?php
//set variable for custom title
$system_log_title
=
"System Log"
;
$system_log_title_link
=
"diag_logs.php"
;
src/www/widgets/widgets/system_log.widget.php
0 → 100644
View file @
2e85542a
<?php
require_once
(
"functions.inc"
);
require_once
(
"guiconfig.inc"
);
require_once
(
'notices.inc'
);
include_once
(
"includes/functions.inc.php"
);
require_once
(
"script/load_phalcon.php"
);
$system_logfile
=
'/var/log/system.log'
;
if
(
!
$config
[
'widgets'
][
'systemlogfiltercount'
])
{
$syslogEntriesToFetch
=
$config
[
'syslog'
][
'nentries'
];
if
(
!
$syslogEntriesToFetch
)
{
$syslogEntriesToFetch
=
20
;
}
}
else
{
$syslogEntriesToFetch
=
$config
[
'widgets'
][
'systemlogfiltercount'
];
}
if
(
is_numeric
(
$_POST
[
'logfiltercount'
]))
{
$countReceived
=
$_POST
[
'logfiltercount'
];
$config
[
'widgets'
][
'systemlogfiltercount'
]
=
$countReceived
;
write_config
(
"Saved Widget System Log Filter Setting"
);
Header
(
"Location: /"
);
exit
(
0
);
}
?>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped table-sort"
cellspacing=
"0"
cellpadding=
"0"
>
<?
dump_clog
(
$system_logfile
,
$syslogEntriesToFetch
,
true
,
array
(),
array
(
"ppp"
));
?>
</table>
<table
class=
"table"
style=
"margin-bottom:0px;text-align:center;"
>
<tr
class=
"formselect"
>
<td>
Number of Log lines to display:
</td>
<td>
<form
action=
"/widgets/widgets/system_log.widget.php"
method=
"post"
name=
"iform"
>
<select
name=
"logfiltercount"
id=
"logfiltercount"
>
<?php
for
(
$i
=
1
;
$i
<=
50
;
$i
++
)
{
?>
<option
value=
"
<?php
echo
$i
;
?>
"
<?php
if
(
$syslogEntriesToFetch
==
$i
)
{
echo
"selected=
\"
selected
\"
"
;}
?>
>
<?php
echo
$i
;
?>
</option>
<?php
}
?>
</td>
<td>
<input
id=
"submit"
name=
"submit"
type=
"submit"
class=
"btn btn-primary formbtn"
value=
"Save"
autocomplete=
"off"
>
</form>
</td>
</tr>
</table>
</div>
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