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
9c51c500
Commit
9c51c500
authored
Jan 09, 2015
by
Jos Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Cleanup and fix system routes / system routes edit, fixes #22
parent
89b3dcc1
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
27 additions
and
35 deletions
+27
-35
system_routes.php
src/www/system_routes.php
+1
-1
system_routes_edit.php
src/www/system_routes_edit.php
+26
-34
No files found.
src/www/system_routes.php
View file @
9c51c500
...
...
@@ -345,7 +345,7 @@ $main_buttons = array(
<?php
else
:
?>
<button
name=
"del
"
type=
"submit"
title=
"
<?=
gettext
(
"delete selected routes"
);
?>
"
<button
name=
"del
_x"
type=
"submit"
title=
"
<?=
gettext
(
"delete selected routes"
);
?>
"
onclick=
"return confirm('
<?=
gettext
(
"Do you really want to delete the selected routes?"
);
?>
')"
class=
"btn btn-default btn-xs"
><span
class=
"glyphicon glyphicon-remove"
></span></button>
<?php
endif
;
...
...
src/www/system_routes_edit.php
View file @
9c51c500
...
...
@@ -244,13 +244,14 @@ include("head.inc");
<tr>
<td
width=
"22%"
valign=
"top"
class=
"vncellreq"
>
<?=
gettext
(
"Gateway"
);
?>
</td>
<td
width=
"78%"
class=
"vtable"
>
<select
name=
"gateway"
id=
"gateway"
class=
"form
select
"
>
<select
name=
"gateway"
id=
"gateway"
class=
"form
-control
"
>
<?php
foreach
(
$a_gateways
as
$gateway
)
{
echo
"<option value='
{
$gateway
[
'name'
]
}
' "
;
if
(
$gateway
[
'name'
]
==
$pconfig
[
'gateway'
])
echo
"selected=
\"
selected
\"
"
;
echo
">"
.
htmlspecialchars
(
$gateway
[
'name'
])
.
" - "
.
htmlspecialchars
(
$gateway
[
'gateway'
])
.
"</option>
\n
"
;
?>
<option
value=
"
<?=
$gateway
[
'name'
];
?>
"
<?php
if
(
$gateway
[
'name'
]
==
$pconfig
[
'gateway'
])
echo
"selected=
\"
selected
\"
"
;
?>
>
<?=
htmlspecialchars
(
$gateway
[
'name'
])
.
" - "
.
htmlspecialchars
(
$gateway
[
'gateway'
]);
?>
</option>
<?php
}
?>
</select>
<br
/>
...
...
@@ -262,21 +263,17 @@ include("head.inc");
<div
style=
"display:none"
id=
"status"
>
</div>
<div
style=
"display:none"
id=
"addgateway"
>
<table
border=
"1"
style=
"background:#990000; border-style: none none none none; width:225px;"
summary=
"add gateway"
>
<tr>
<td>
<table
bgcolor=
"#990000"
cellpadding=
"1"
cellspacing=
"1"
summary=
"add"
>
<tr><td>
</td></tr>
<table
class=
"table table-striped"
summary=
"addgateway"
>
<tbody>
<tr>
<td
colspan=
"2"
align=
"center"
><b><font
color=
"white"
>
<?=
gettext
(
"Add new gateway:"
);
?>
</font
></b></td>
<td
colspan=
"2"
valign=
"top"
class=
"listtopic"
><b>
<?=
gettext
(
"Add new gateway:"
);
?
>
</b></td>
</tr>
<tr><td>
</td></tr>
<tr>
<td
width=
"
45%"
align=
"right"
><font
color=
"white"
>
<?=
gettext
(
"Default gateway:"
);
?>
</font></td><td><input
type=
"checkbox"
id=
"defaultgw"
name=
"defaultgw"
/></td>
<td
width=
"
22%"
>
<?=
gettext
(
"Default gateway:"
);
?>
</td><td
with=
"78%"
><input
class=
"form-control"
type=
"checkbox"
id=
"defaultgw"
name=
"defaultgw"
/></td>
</tr>
<tr>
<td
width=
"
45%"
align=
"right"
><font
color=
"white"
>
<?=
gettext
(
"Interface:"
);
?>
</font
></td>
<td>
<td
width=
"
22%"
>
<?=
gettext
(
"Interface:"
);
?
>
</td>
<td
with=
"78%"
>
<select
name=
"addinterfacegw"
id=
"addinterfacegw"
>
<?php
$gwifs
=
get_configured_interface_with_descr
();
foreach
(
$gwifs
as
$fif
=>
$dif
)
...
...
@@ -286,29 +283,26 @@ include("head.inc");
</td>
</tr>
<tr>
<td
align=
"right"
><font
color=
"white"
>
<?=
gettext
(
"Gateway Name:"
);
?>
</font></td><td><input
id=
"name"
name=
"name"
value=
"GW"
/></td>
<td
with=
"22%"
>
<?=
gettext
(
"Gateway Name:"
);
?>
</td><td
with=
"78%"
><input
class=
"form-control"
id=
"name"
name=
"name"
value=
"GW"
/></td>
</tr>
<tr>
<td
align=
"right"
><font
color=
"white"
>
<?=
gettext
(
"Gateway IP:"
);
?>
</font></td><td><input
id=
"gatewayip"
name=
"gatewayip"
/></td>
<td
with=
"22%"
>
<?=
gettext
(
"Gateway IP:"
);
?>
</td><td
with=
"78%"
><input
class=
"form-control"
id=
"gatewayip"
name=
"gatewayip"
/></td>
</tr>
<tr>
<td
align=
"right"
><font
color=
"white"
>
<?=
gettext
(
"Description:"
);
?>
</font></td><td><input
id=
"gatewaydescr"
name=
"gatewaydescr"
/></td>
<td
with=
"22%"
>
<?=
gettext
(
"Description:"
);
?>
</td><td
with=
"78%"
><input
class=
"form-control"
id=
"gatewaydescr"
name=
"gatewaydescr"
/></td>
</tr>
<tr><td>
</td></tr>
<tr>
<td
colspan=
"2"
align=
"center"
>
<td
with=
"22%"
></td>
<td
with=
"78%"
>
<div
id=
'savebuttondiv'
>
<input
type=
"hidden"
name=
"addrtype"
id=
"addrtype"
value=
"IPv4"
/>
<input
id=
"gwsave"
type=
"button"
value=
"
<?=
gettext
(
"Save Gateway"
);
?>
"
onclick=
'hide_add_gatewaysave();'
/>
<input
id=
"gwcancel"
type=
"button"
value=
"
<?=
gettext
(
"Cancel"
);
?>
"
onclick=
'hide_add_gateway();'
/>
<input
class=
"btn btn-primary"
id=
"gwsave"
type=
"button"
value=
"
<?=
gettext
(
"Save Gateway"
);
?>
"
onclick=
'hide_add_gatewaysave();'
/>
<input
class=
"btn btn-default"
id=
"gwcancel"
type=
"button"
value=
"
<?=
gettext
(
"Cancel"
);
?>
"
onclick=
'hide_add_gateway();'
/>
</div>
</td>
</tr>
<
tr><td>
</td></tr
>
<
/tbody
>
</table>
</td>
</tr>
</table>
</div>
</td>
</tr>
...
...
@@ -331,7 +325,7 @@ include("head.inc");
<td
width=
"22%"
valign=
"top"
>
</td>
<td
width=
"78%"
>
<input
id=
"save"
name=
"Submit"
type=
"submit"
class=
"btn btn-primary"
value=
"
<?=
gettext
(
"Save"
);
?>
"
/>
<input
type=
"button"
class=
"btn btn-default"
value=
"
<?=
gettext
(
"Cancel"
);
?>
"
onclick=
"window.location.href='
<?=
$referer
;
?>
'"
/>
<input
id=
"cancel"
type=
"button"
class=
"btn btn-default"
value=
"
<?=
gettext
(
"Cancel"
);
?>
"
onclick=
"window.location.href='
<?=
$referer
;
?>
'"
/>
<?php
if
(
isset
(
$id
)
&&
$a_routes
[
$id
])
:
?>
<input
name=
"id"
type=
"hidden"
value=
"
<?=
htmlspecialchars
(
$id
);
?>
"
/>
<?php
endif
;
?>
...
...
@@ -371,7 +365,6 @@ include("head.inc");
}
function
hide_add_gatewaysave
()
{
document
.
getElementById
(
"
addgateway
"
).
style
.
display
=
'
none
'
;
jQuery
(
'
#status
'
).
html
(
'
<img src="/themes/
<?=
$g
[
'theme'
];
?>
/images/misc/loader.gif"> One moment please...
'
);
var
iface
=
jQuery
(
'
#addinterfacegw
'
).
val
();
name
=
jQuery
(
'
#name
'
).
val
();
var
descr
=
jQuery
(
'
#gatewaydescr
'
).
val
();
...
...
@@ -385,10 +378,10 @@ include("head.inc");
jQuery
.
ajax
(
url
,
{
type
:
'
post
'
,
type
:
'
post
'
,
data
:
pars
,
error
:
report_failure
,
complete
:
save_callback
success
:
save_callback
});
}
function
addOption
(
selectbox
,
text
,
value
)
...
...
@@ -404,13 +397,12 @@ include("head.inc");
alert
(
"
<?=
gettext
(
"Sorry, we could not create your gateway at this time."
);
?>
"
);
hide_add_gateway
();
}
function
save_callback
(
transport
)
{
var
response
=
transport
.
responseText
;
function
save_callback
(
response
)
{
if
(
response
)
{
document
.
getElementById
(
"
addgateway
"
).
style
.
display
=
'
none
'
;
hide_add_gateway
();
jQuery
(
'
#status
'
).
html
(
''
)
;
addOption
(
jQuery
(
'
#gateway
'
),
name
,
name
);
var
gwtext
=
escape
(
name
)
+
"
-
"
+
gatewayip
;
addOption
(
jQuery
(
'
#gateway
'
),
gwtext
,
name
);
}
else
{
report_failure
();
}
...
...
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