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
253904a6
Commit
253904a6
authored
Mar 14, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Mar 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) refactor status_filter_reload.php
(cherry picked from commit
f79e2018
)
parent
72767f60
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
130 deletions
+79
-130
status_filter_reload.php
src/www/status_filter_reload.php
+79
-130
No files found.
src/www/status_filter_reload.php
View file @
253904a6
...
@@ -37,7 +37,7 @@ if($_GET['getstatus']) {
...
@@ -37,7 +37,7 @@ if($_GET['getstatus']) {
exit
;
exit
;
}
}
if
(
$_POST
[
'reloadfilter'
])
{
if
(
$_POST
[
'reloadfilter'
])
{
configd_run
(
"filter reload"
);
configd_run
(
"filter reload"
);
if
(
isset
(
$config
[
'hasync'
][
'synchronizetoip'
])
&&
trim
(
$config
[
'hasync'
][
'synchronizetoip'
])
!=
""
)
{
if
(
isset
(
$config
[
'hasync'
][
'synchronizetoip'
])
&&
trim
(
$config
[
'hasync'
][
'synchronizetoip'
])
!=
""
)
{
// only try to sync when hasync is configured
// only try to sync when hasync is configured
...
@@ -46,7 +46,7 @@ if($_POST['reloadfilter']) {
...
@@ -46,7 +46,7 @@ if($_POST['reloadfilter']) {
header
(
"Location: status_filter_reload.php"
);
header
(
"Location: status_filter_reload.php"
);
exit
;
exit
;
}
}
if
(
$_POST
[
'syncfilter'
])
{
if
(
$_POST
[
'syncfilter'
])
{
configd_run
(
"filter sync"
);
configd_run
(
"filter sync"
);
header
(
"Location: status_filter_reload.php"
);
header
(
"Location: status_filter_reload.php"
);
exit
;
exit
;
...
@@ -56,17 +56,30 @@ include("head.inc");
...
@@ -56,17 +56,30 @@ include("head.inc");
?>
?>
<body>
<body>
<script
type=
"text/javascript"
>
$
(
document
).
ready
(
function
()
{
function
refresh_data
()
{
$
.
ajax
(
"
status_filter_reload.php?getstatus=true
"
,
{
type
:
'
get
'
,
cache
:
false
,
dataType
:
"
html
"
,
data
:
{},
success
:
function
(
data
)
{
$
(
'
#status
'
).
html
(
data
);
setTimeout
(
refresh_data
,
200
);
}
});
}
refresh_data
();
});
</script>
<?php
include
(
"fbegin.inc"
);
?>
<?php
include
(
"fbegin.inc"
);
?>
<section
class=
"page-content-main"
>
<section
class=
"page-content-main"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
<div
class=
"row"
>
<div
class=
"row"
>
<?php
print_service_banner
(
'firewall'
);
?>
<?php
print_service_banner
(
'firewall'
);
?>
<?php
if
(
isset
(
$input_errors
)
&&
count
(
$input_errors
)
>
0
)
print_input_errors
(
$input_errors
);
?>
<?php
if
(
isset
(
$input_errors
)
&&
count
(
$input_errors
)
>
0
)
print_input_errors
(
$input_errors
);
?>
<section
class=
"col-xs-12"
>
<section
class=
"col-xs-12"
>
<div
class=
"content-box "
>
<div
class=
"content-box "
>
<div
class=
"col-xs-12"
>
<div
class=
"col-xs-12"
>
<p><form
action=
"status_filter_reload.php"
method=
"post"
name=
"filter"
>
<p><form
action=
"status_filter_reload.php"
method=
"post"
name=
"filter"
>
...
@@ -83,68 +96,4 @@ include("head.inc");
...
@@ -83,68 +96,4 @@ include("head.inc");
</div>
</div>
</section>
</section>
<script
type=
"text/javascript"
>
//
<!
[
CDATA
[
/* init update "thread */
function
update_status_thread
()
{
getURL
(
'
status_filter_reload.php?getstatus=true
'
,
update_data
);
}
function
update_data
(
obj
)
{
var
result_text
=
obj
.
content
;
jQuery
(
'
#status
'
).
html
(
result_text
);
window
.
setTimeout
(
'
update_status_thread()
'
,
200
);
}
//]]>
</script>
<script
type=
"text/javascript"
>
//
<!
[
CDATA
[
/*
* getURL is a proprietary Adobe function, but it's simplicity has made it very
* popular. If getURL is undefined we spin our own by wrapping XMLHttpRequest.
*/
if
(
typeof
getURL
==
'
undefined
'
)
{
getURL
=
function
(
url
,
callback
)
{
if
(
!
url
)
throw
'
No URL for getURL
'
;
try
{
if
(
typeof
callback
.
operationComplete
==
'
function
'
)
callback
=
callback
.
operationComplete
;
}
catch
(
e
)
{}
if
(
typeof
callback
!=
'
function
'
)
throw
'
No callback function for getURL
'
;
var
http_request
=
null
;
if
(
typeof
XMLHttpRequest
!=
'
undefined
'
)
{
http_request
=
new
XMLHttpRequest
();
}
else
if
(
typeof
ActiveXObject
!=
'
undefined
'
)
{
try
{
http_request
=
new
ActiveXObject
(
'
Msxml2.XMLHTTP
'
);
}
catch
(
e
)
{
try
{
http_request
=
new
ActiveXObject
(
'
Microsoft.XMLHTTP
'
);
}
catch
(
e
)
{}
}
}
if
(
!
http_request
)
throw
'
Both getURL and XMLHttpRequest are undefined
'
;
http_request
.
onreadystatechange
=
function
()
{
if
(
http_request
.
readyState
==
4
)
{
callback
(
{
success
:
true
,
content
:
http_request
.
responseText
,
contentType
:
http_request
.
getResponseHeader
(
"
Content-Type
"
)
}
);
}
}
http_request
.
open
(
'
GET
'
,
url
,
true
);
http_request
.
send
(
null
);
}
}
update_status_thread
();
//]]>
</script>
<?php
include
(
"foot.inc"
);
?>
<?php
include
(
"foot.inc"
);
?>
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