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
a8f5cf50
Commit
a8f5cf50
authored
May 09, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(dashboard) remove some legacy files
parent
de1d8a14
Changes
6
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
3 additions
and
606 deletions
+3
-606
stats.inc
src/etc/inc/stats.inc
+0
-357
ACL_Legacy_Page_Map.json
...nse/mvc/app/models/OPNsense/Core/ACL_Legacy_Page_Map.json
+2
-2
getstats.php
src/www/getstats.php
+0
-40
index.php
src/www/index.php
+1
-2
ajax.js
src/www/javascript/index/ajax.js
+0
-202
system_information.widget.php
src/www/widgets/widgets/system_information.widget.php
+0
-3
No files found.
src/etc/inc/stats.inc
deleted
100644 → 0
View file @
de1d8a14
This diff is collapsed.
Click to expand it.
src/opnsense/mvc/app/models/OPNsense/Core/ACL_Legacy_Page_Map.json
View file @
a8f5cf50
...
...
@@ -28,7 +28,7 @@
"descr"
:
"Allow access to the 'AJAX: Get Stats' page."
,
"match"
:
[
"license.php"
,
"
getstats
.php*"
"
widgets/api/get
.php*"
]
},
"page-all"
:
{
...
...
@@ -52,7 +52,7 @@
"index.php*"
,
"*.widget.php*"
,
"graph.php*"
,
"
getstats
.php*"
,
"
widgets/api/get
.php*"
,
"legacy_traffic_stats.php*"
,
"diag_logs_filter_dynamic.php*"
]
...
...
src/www/getstats.php
deleted
100644 → 0
View file @
de1d8a14
<?php
/*
Copyright (C) 2014-2015 Deciso B.V.
Copyright (C) 2009 Bill Marquette
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.
THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES,
INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
*/
header
(
"Last-Modified: "
.
gmdate
(
"D, j M Y H:i:s"
)
.
" GMT"
);
header
(
"Expires: "
.
gmdate
(
"D, j M Y H:i:s"
,
time
()
)
.
" GMT"
);
header
(
"Cache-Control: no-store, no-cache, must-revalidate"
);
// HTTP/1.1
header
(
"Cache-Control: post-check=0, pre-check=0"
,
FALSE
);
header
(
"Pragma: no-cache"
);
// HTTP/1.0
require_once
(
"guiconfig.inc"
);
require_once
(
"system.inc"
);
require_once
(
"stats.inc"
);
echo
get_stats
();
src/www/index.php
View file @
a8f5cf50
...
...
@@ -147,7 +147,6 @@ include("fbegin.inc");?>
// normal dashboard
else
:?>
<
script
src
=
'/javascript/index/ajax.js'
></
script
>
<
script
src
=
'/ui/js/jquery-sortable.js'
></
script
>
<
script
type
=
"text/javascript"
>
function
addWidget
(
selectedDiv
)
{
...
...
@@ -237,7 +236,7 @@ include("fbegin.inc");?>
}
});
// schedule next update
setTimeout
(
'process_widget_data()'
,
3
0000
);
setTimeout
(
'process_widget_data()'
,
1
0000
);
});
}
</
script
>
...
...
src/www/javascript/index/ajax.js
deleted
100644 → 0
View file @
de1d8a14
/* Most widgets update their backend data every 10 seconds. 11 seconds
* will ensure that we update the GUI right after the stats are updated.
* Seconds * 1000 = value
*/
var
Seconds
=
11
;
var
update_interval
=
(
Math
.
abs
(
Math
.
ceil
(
Seconds
))
-
1
)
*
1000
+
990
;
function
updateMeters
()
{
url
=
'
/getstats.php
'
;
jQuery
.
ajax
(
url
,
{
type
:
'
get
'
,
success
:
function
(
data
)
{
response
=
data
||
""
;
if
(
response
!=
""
)
stats
(
data
);
}
});
setTimer
();
}
function
setTimer
()
{
timeout
=
window
.
setTimeout
(
'
updateMeters()
'
,
update_interval
);
}
function
stats
(
x
)
{
var
values
=
x
.
split
(
"
|
"
);
if
(
jQuery
.
each
(
values
,
function
(
key
,
value
){
if
(
value
==
'
undefined
'
||
value
==
null
)
return
true
;
else
return
false
;
}))
updateUptime
(
values
[
2
]);
updateDateTime
(
values
[
5
]);
updateCPU
(
values
[
0
]);
updateMemory
(
values
[
1
]);
updateState
(
values
[
3
]);
updateTemp
(
values
[
4
]);
updateInterfaceStats
(
values
[
6
]);
updateInterfaces
(
values
[
7
]);
updateGatewayStats
(
values
[
8
]);
updateCpuFreq
(
values
[
9
]);
updateLoadAverage
(
values
[
10
]);
updateMbuf
(
values
[
11
]);
updateMbufMeter
(
values
[
12
]);
updateStateMeter
(
values
[
13
]);
}
function
updateMemory
(
x
)
{
if
(
jQuery
(
'
#memusagemeter
'
))
jQuery
(
"
#memusagemeter
"
).
html
(
x
+
'
%
'
);
if
(
jQuery
(
'
#memUsagePB
'
))
jQuery
(
'
#memUsagePB
'
).
css
(
{
width
:
parseInt
(
x
)
+
'
%
'
}
);
}
function
updateMbuf
(
x
)
{
if
(
jQuery
(
'
#mbuf
'
))
jQuery
(
"
#mbuf
"
).
html
(
x
);
}
function
updateMbufMeter
(
x
)
{
if
(
jQuery
(
'
#mbufusagemeter
'
))
jQuery
(
"
#mbufusagemeter
"
).
html
(
x
+
'
%
'
);
if
(
jQuery
(
'
#mbufPB
'
))
jQuery
(
'
#mbufPB
'
).
css
(
{
width
:
parseInt
(
x
)
+
'
%
'
}
);
}
function
updateCPU
(
x
)
{
if
(
jQuery
(
'
#cpumeter
'
))
jQuery
(
"
#cpumeter
"
).
html
(
x
+
'
%
'
);
if
(
jQuery
(
'
#cpuPB
'
))
jQuery
(
'
#cpuPB
'
).
css
(
{
width
:
parseInt
(
x
)
+
'
%
'
}
);
}
function
updateTemp
(
x
)
{
if
(
jQuery
(
"
#tempmeter
"
))
jQuery
(
"
#tempmeter
"
).
html
(
x
+
'
\
u00B0
'
+
'
C
'
);
if
(
jQuery
(
'
#tempPB
'
))
jQuery
(
"
#tempPB
"
).
css
(
{
width
:
parseInt
(
x
)
+
'
%
'
}
);
}
function
updateDateTime
(
x
)
{
if
(
jQuery
(
'
#datetime
'
))
jQuery
(
"
#datetime
"
).
html
(
x
);
}
function
updateUptime
(
x
)
{
if
(
jQuery
(
'
#uptime
'
))
jQuery
(
"
#uptime
"
).
html
(
x
);
}
function
updateState
(
x
)
{
if
(
jQuery
(
'
#pfstate
'
))
jQuery
(
"
#pfstate
"
).
html
(
x
);
}
function
updateStateMeter
(
x
)
{
if
(
jQuery
(
'
#pfstateusagemeter
'
))
jQuery
(
"
#pfstateusagemeter
"
).
html
(
x
+
'
%
'
);
if
(
jQuery
(
'
#statePB
'
))
jQuery
(
'
#statePB
'
).
css
(
{
width
:
parseInt
(
x
)
+
'
%
'
}
);
}
function
updateGatewayStats
(
x
){
if
(
widgetActive
(
"
gateways
"
)){
gateways_split
=
x
.
split
(
"
,
"
);
for
(
var
y
=
0
;
y
<
gateways_split
.
length
;
y
++
){
if
(
jQuery
(
'
#gateway
'
+
(
y
+
1
)))
{
jQuery
(
'
#gateway
'
+
(
y
+
1
)).
html
(
gateways_split
[
y
]);
}
}
}
}
function
updateCpuFreq
(
x
)
{
if
(
jQuery
(
'
#cpufreq
'
))
jQuery
(
"
#cpufreq
"
).
html
(
x
);
}
function
updateLoadAverage
(
x
)
{
if
(
jQuery
(
'
#load_average
'
))
jQuery
(
"
#load_average
"
).
html
(
x
);
}
function
updateInterfaceStats
(
x
){
if
(
widgetActive
(
"
interface_statistics
"
)){
statistics_split
=
x
.
split
(
"
,
"
);
var
counter
=
1
;
for
(
var
y
=
0
;
y
<
statistics_split
.
length
-
1
;
y
++
){
if
(
jQuery
(
'
#stat
'
+
counter
))
{
jQuery
(
'
#stat
'
+
counter
).
html
(
statistics_split
[
y
]);
counter
++
;
}
}
}
}
function
updateInterfaces
(
x
){
if
(
widgetActive
(
"
interfaces
"
)){
interfaces_split
=
x
.
split
(
"
~
"
);
//interfaces_split.each(function(iface){
jQuery
.
each
(
interfaces_split
,
function
(
id
,
iface
){
details
=
iface
.
split
(
"
,
"
);
switch
(
details
[
1
])
{
case
"
up
"
:
// Interface Arrow color
jQuery
(
'
#
'
+
details
[
0
]
).
addClass
(
"
text-success
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
text-danger
"
)
// Interface Icon color
jQuery
(
'
#
'
+
details
[
0
]
+
'
icon
'
).
addClass
(
"
text-success
"
)
jQuery
(
'
#
'
+
details
[
0
]
+
'
icon
'
).
removeClass
(
"
text-danger
"
)
// Interface Arrow type
jQuery
(
'
#
'
+
details
[
0
]
).
addClass
(
"
glyphicon-arrow-up
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
glyphicon-arrow-down
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
glyphicon-arrow-remove
"
)
break
;
case
"
down
"
:
jQuery
(
'
#
'
+
details
[
0
]
).
addClass
(
"
text-danger
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
text-success
"
)
// Interface Icon color
jQuery
(
'
#
'
+
details
[
0
]
+
'
icon
'
).
addClass
(
"
text-danger
"
)
jQuery
(
'
#
'
+
details
[
0
]
+
'
icon
'
).
removeClass
(
"
text-success
"
)
// Interface Arrow type
jQuery
(
'
#
'
+
details
[
0
]
).
addClass
(
"
glyphicon-arrow-down
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
glyphicon-arrow-up
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
glyphicon-arrow-remove
"
)
break
;
case
"
block
"
:
// Interface Icon color
jQuery
(
'
#
'
+
details
[
0
]
).
addClass
(
"
text-danger
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
text-success
"
)
// Interface Arrow type
jQuery
(
'
#
'
+
details
[
0
]
).
addClass
(
"
glyphicon-arrow-remove
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
glyphicon-arrow-up
"
)
jQuery
(
'
#
'
+
details
[
0
]
).
removeClass
(
"
glyphicon-arrow-down
"
)
break
;
}
});
}
}
function
widgetActive
(
x
)
{
var
widget
=
jQuery
(
'
#
'
+
x
+
'
-container
'
);
if
((
widget
!=
null
)
&&
(
widget
.
css
(
'
display
'
)
!=
null
)
&&
(
widget
.
css
(
'
display
'
)
!=
"
none
"
))
return
true
;
else
return
false
;
}
/* start updater */
jQuery
(
document
).
ready
(
function
(){
setTimer
();
});
src/www/widgets/widgets/system_information.widget.php
View file @
a8f5cf50
...
...
@@ -32,7 +32,6 @@
require_once
(
"guiconfig.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"system.inc"
);
require_once
(
"stats.inc"
);
if
(
isset
(
$_POST
[
'getupdatestatus'
]))
{
...
...
@@ -53,8 +52,6 @@ if (isset($_POST['getupdatestatus'])) {
exit
;
}
$filesystems
=
get_mounted_filesystems
();
?>
<script
src=
"/ui/js/moment-with-locales.min.js"
type=
"text/javascript"
></script>
...
...
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