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
c23950b0
Commit
c23950b0
authored
Dec 10, 2014
by
Jos Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fix traffic graph widget
parent
727453c0
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
15 additions
and
6 deletions
+15
-6
index.php
src/www/index.php
+1
-1
traffic_graph-min.js
src/www/widgets/javascript/min/traffic_graph-min.js
+0
-1
traffic_graph.js
src/www/widgets/javascript/traffic_graph.js
+3
-1
traffic_graphs.widget.php
src/www/widgets/widgets/traffic_graphs.widget.php
+11
-3
No files found.
src/www/index.php
View file @
c23950b0
...
...
@@ -530,7 +530,7 @@ echo $jscriptstr;
?>
<section
class=
"col-xs-12 col-md-6 widgetdiv"
id=
"
<?php
echo
$widgetname
;
?>
"
style=
"display:
<?php
echo
$divdisplay
;
?>
;"
>
<div
class=
"content-box"
>
<form
action=
"
<?=
$_SERVER
[
'REQUEST_URI'
];
?>
"
method=
"post"
id=
"iform"
>
<form
action=
"
<?=
$_SERVER
[
'REQUEST_URI'
];
?>
"
method=
"post"
id=
"iform"
>
<input
type=
"hidden"
value=
""
name=
"sequence"
id=
"sequence"
/>
<header
class=
"content-box-head container-fluid"
>
...
...
src/www/widgets/javascript/min/traffic_graph-min.js
deleted
100644 → 0
View file @
727453c0
function
trafficshowDiv
(
e
,
t
){
selectedDiv
=
e
+
"
graphdiv
"
,
jQuery
(
"
#
"
+
selectedDiv
).
show
(),
d
=
document
,
t
&&
(
selectIntLink
=
selectedDiv
+
"
-min
"
,
textlink
=
d
.
getElementById
(
selectIntLink
),
textlink
.
style
.
display
=
"
inline
"
,
selectIntLink
=
selectedDiv
+
"
-open
"
,
textlink
=
d
.
getElementById
(
selectIntLink
),
textlink
.
style
.
display
=
"
none
"
)}
function
trafficminimizeDiv
(
e
,
t
){
selectedDiv
=
e
+
"
graphdiv
"
,
jQuery
(
"
#
"
+
selectedDiv
).
hide
(),
d
=
document
,
t
&&
(
selectIntLink
=
selectedDiv
+
"
-open
"
,
textlink
=
d
.
getElementById
(
selectIntLink
),
textlink
.
style
.
display
=
"
inline
"
,
selectIntLink
=
selectedDiv
+
"
-min
"
,
textlink
=
d
.
getElementById
(
selectIntLink
),
textlink
.
style
.
display
=
"
none
"
)}
\ No newline at end of file
src/www/widgets/javascript/traffic_graph.js
View file @
c23950b0
function
trafficshowDiv
(
incDiv
,
swapButtons
){
//appear element
selectedDiv
=
incDiv
+
"
graphdiv
"
;
jQuery
(
'
#
'
+
selectedDiv
).
show
();
jQuery
(
'
#
'
+
selectedDiv
).
show
();
d
=
document
;
if
(
swapButtons
){
selectIntLink
=
selectedDiv
+
"
-min
"
;
...
...
@@ -12,6 +12,7 @@ function trafficshowDiv(incDiv,swapButtons){
textlink
=
d
.
getElementById
(
selectIntLink
);
textlink
.
style
.
display
=
"
none
"
;
}
document
.
iform
[
"
shown[
"
+
incDiv
+
"
]
"
].
value
=
"
show
"
;
}
function
trafficminimizeDiv
(
incDiv
,
swapButtons
){
...
...
@@ -28,5 +29,6 @@ function trafficminimizeDiv(incDiv,swapButtons){
textlink
=
d
.
getElementById
(
selectIntLink
);
textlink
.
style
.
display
=
"
none
"
;
}
document
.
iform
[
"
shown[
"
+
incDiv
+
"
]
"
].
value
=
"
hide
"
;
}
src/www/widgets/widgets/traffic_graphs.widget.php
View file @
c23950b0
...
...
@@ -38,6 +38,12 @@ require_once("pfsense-utils.inc");
require_once
(
"functions.inc"
);
$first_time
=
false
;
//var_dump($config["widgets"]["trafficgraphs"]);
//$config["widgets"]["trafficgraphs"]["shown"]["item"][1]="lan";
//write_config(gettext("Widget configuration has been changed."));
if
(
!
is_array
(
$config
[
"widgets"
][
"trafficgraphs"
]))
{
$first_time
=
true
;
$config
[
"widgets"
][
"trafficgraphs"
]
=
array
();
...
...
@@ -56,6 +62,7 @@ if (isset($config['ipsec']['enable']))
$ifdescrs
[
'enc0'
]
=
"IPsec"
;
if
(
$_POST
)
{
if
(
isset
(
$_POST
[
"refreshinterval"
]))
{
$a_config
[
"refreshinterval"
]
=
$_POST
[
"refreshinterval"
];
}
...
...
@@ -100,12 +107,13 @@ if (isset($a_config["scale_type"])) {
<div
id=
"traffic_graphs-settings"
class=
"widgetconfigdiv"
style=
"display:none;"
>
<form
action=
"/widgets/widgets/traffic_graphs.widget.php"
method=
"post"
name=
"iform"
id=
"iform"
>
<?php
foreach
(
$ifdescrs
as
$ifname
=>
$ifdescr
)
{
?>
<input
type=
"hidden"
name=
"shown[
<?=
$ifname
?>
]"
value=
"
<?=
$shown
[
$ifname
]
?
"show"
:
"hide"
?>
"
/>
<?php
}
?>
<table
class=
"table table-striped"
>
<tbody>
<?php
foreach
(
$ifdescrs
as
$ifname
=>
$ifdescr
)
{
?>
<input
type=
"hidden"
name=
"shown[
<?=
$ifname
?>
]"
value=
"
<?=
$shown
[
$ifname
]
?
"show"
:
"hide"
?>
"
/>
<?php
}
?>
<tr>
<td>
Default AutoScale:
...
...
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