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
4e6d9e24
Commit
4e6d9e24
authored
May 02, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(dashboard) cleanup dyn_dns_status.widget.php
parent
6228e77d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
57 additions
and
63 deletions
+57
-63
dyn_dns_status.widget.php
src/www/widgets/widgets/dyn_dns_status.widget.php
+57
-63
No files found.
src/www/widgets/widgets/dyn_dns_status.widget.php
View file @
4e6d9e24
<?php
/*
Copyright (C) 2014 Deciso B.V.
Copyright (C) 2014
-2016
Deciso B.V.
Copyright (C) 2008 Ermal Luci
Copyright (C) 2013 Stanley P. Miller \ stan-qaz
All rights reserved.
...
...
@@ -28,8 +28,6 @@
POSSIBILITY OF SUCH DAMAGE.
*/
$nocsrf
=
true
;
require_once
(
"guiconfig.inc"
);
require_once
(
"pfsense-utils.inc"
);
require_once
(
"widgets/include/dyn_dns_status.inc"
);
...
...
@@ -42,7 +40,7 @@ if (!isset($config['dyndnses']['dyndns'])) {
$a_dyndns
=
&
$config
[
'dyndnses'
][
'dyndns'
];
if
(
$_REQUEST
[
'getdyndnsstatus'
]
)
{
if
(
!
empty
(
$_REQUEST
[
'getdyndnsstatus'
])
)
{
$first_entry
=
true
;
foreach
(
$a_dyndns
as
$dyndns
)
{
if
(
$first_entry
)
{
...
...
@@ -85,18 +83,22 @@ if ($_REQUEST['getdyndnsstatus']) {
?>
<table
class=
"table table-triped"
width=
"100%"
border=
"0"
cellpadding=
"0"
cellspacing=
"0"
>
<tr>
<td
width=
"5%"
class=
"listhdrr"
><b>
<?=
gettext
(
"Int."
);
?>
</b></td>
<td
width=
"15%"
class=
"listhdrr"
><b>
<?=
gettext
(
"Service"
);
?>
</b></td>
<td
width=
"20%"
class=
"listhdrr"
><b>
<?=
gettext
(
"Hostname"
);
?>
</b></td>
<td
width=
"20%"
class=
"listhdrr"
><b>
<?=
gettext
(
"Cached IP"
);
?>
</b></td>
</tr>
<?php
$i
=
0
;
foreach
(
$a_dyndns
as
$dyndns
)
:
?>
<table
class=
"table table-striped table-condensed"
>
<thead>
<th>
<?=
gettext
(
"Int."
);
?>
</th>
<th>
<?=
gettext
(
"Service"
);
?>
</th>
<th>
<?=
gettext
(
"Hostname"
);
?>
</th>
<th>
<?=
gettext
(
"Cached IP"
);
?>
</th>
</thead>
<tbody>
<?php
$iflist
=
get_configured_interface_with_descr
();
$types
=
services_dyndns_list
();
$groupslist
=
return_gateway_groups_array
();
foreach
(
$a_dyndns
as
$i
=>
$dyndns
)
:?>
<
tr
ondblclick
=
"document.location='services_dyndns_edit.php?id=<?=
$i
;?>'"
>
<td
class=
"listlr"
>
<?php
$iflist
=
get_configured_interface_with_descr
();
<
td
>
<?
php
foreach
(
$iflist
as
$if
=>
$ifdesc
)
{
if
(
$dyndns
[
'interface'
]
==
$if
)
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
{
...
...
@@ -107,7 +109,6 @@ if ($_REQUEST['getdyndnsstatus']) {
break
;
}
}
$groupslist
=
return_gateway_groups_array
();
foreach
(
$groupslist
as
$if
=>
$group
)
{
if
(
$dyndns
[
'interface'
]
==
$if
)
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
{
...
...
@@ -117,12 +118,10 @@ if ($_REQUEST['getdyndnsstatus']) {
}
break
;
}
}
?>
}
?>
</td>
<td
class=
"listr"
>
<?php
$types
=
services_dyndns_list
();
<td>
<?php
if
(
isset
(
$types
[
$dyndns
[
'type'
]]))
{
if
(
!
isset
(
$dyndns
[
'enable'
]))
{
echo
'<span class="text-muted">'
.
htmlspecialchars
(
$types
[
$dyndns
[
'type'
]])
.
'</span>'
;
...
...
@@ -130,51 +129,46 @@ if ($_REQUEST['getdyndnsstatus']) {
echo
htmlspecialchars
(
$types
[
$dyndns
[
'type'
]]);
}
}
?>
?>
</td>
<td
class=
"listr"
>
<?php
<td
>
<?php
if
(
!
isset
(
$dyndns
[
'enable'
]))
{
echo
"<span class=
\"
text-muted
\"
>"
.
htmlspecialchars
(
$dyndns
[
'host'
])
.
"</span>"
;
}
else
{
echo
htmlspecialchars
(
$dyndns
[
'host'
]);
}
?>
?>
</td>
<td
class=
"listr"
>
<td
>
<div
id=
'dyndnsstatus
<?php
echo
$i
;
?>
'
>
<?php
echo
gettext
(
"Checking ..."
);
?>
</div>
</td>
</tr>
<?php
$i
++
;
endforeach
;
?
>
<?php
endforeach
;
?>
</tbody
>
</table>
<script
type=
"text/javascript"
>
//
<!
[
CDATA
[
function
dyndns_getstatus
()
{
function
dyndns_getstatus
()
{
scroll
(
0
,
0
);
var
url
=
"
/widgets/widgets/dyn_dns_status.widget.php
"
;
var
pars
=
'
getdyndnsstatus=yes
'
;
jQuery
.
ajax
(
url
,
{
type
:
'
get
'
,
data
:
pars
,
complete
:
dyndnscallback
});
jQuery
.
ajax
(
url
,
{
type
:
'
get
'
,
data
:
pars
,
complete
:
dyndnscallback
});
// Refresh the status every 5 minutes
setTimeout
(
'
dyndns_getstatus()
'
,
5
*
60
*
1000
);
}
function
dyndnscallback
(
transport
)
{
function
dyndnscallback
(
transport
)
{
// The server returns a string of statuses separated by vertical bars
var
responseStrings
=
transport
.
responseText
.
split
(
"
|
"
);
for
(
var
count
=
0
;
count
<
responseStrings
.
length
;
count
++
)
{
for
(
var
count
=
0
;
count
<
responseStrings
.
length
;
count
++
)
{
var
divlabel
=
'
#dyndnsstatus
'
+
count
;
jQuery
(
divlabel
).
prop
(
'
innerHTML
'
,
responseStrings
[
count
]);
}
}
$
(
document
).
ready
(
function
()
{
// Do the first status check 2 seconds after the dashboard opens
setTimeout
(
'
dyndns_getstatus()
'
,
2000
);
//]]>
});
</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