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
d714d27c
Commit
d714d27c
authored
Feb 08, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) reimplement alias nesting. closes
https://github.com/opnsense/core/issues/372
parent
d0e3d2dd
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
36 additions
and
11 deletions
+36
-11
firewall_aliases_edit.php
src/www/firewall_aliases_edit.php
+36
-11
No files found.
src/www/firewall_aliases_edit.php
View file @
d714d27c
...
...
@@ -264,6 +264,8 @@ include("head.inc");
$
(
this
).
val
(
""
);
});
$
(
"
.act-removerow
"
).
click
(
removeRow
);
// link typeahead to new item
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()]
});
});
$
(
"
.act-removerow
"
).
click
(
removeRow
);
...
...
@@ -304,16 +306,39 @@ include("head.inc");
$
(
"
#detailsHeading1
"
).
html
(
"
<?=
gettext
(
"Port(s)"
);
?>
"
);
break
;
}
$
(
"
.fld_detail
"
).
typeahead
(
"
destroy
"
);
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()]
});
}
$
(
"
#typeSelect
"
).
change
(
function
(){
toggleType
();
});
// collect all known aliases per type
document
.
all_aliases
=
{};
$
(
"
#aliases > option
"
).
each
(
function
(){
if
(
document
.
all_aliases
[
$
(
this
).
data
(
'
type
'
)]
==
undefined
)
{
document
.
all_aliases
[
$
(
this
).
data
(
'
type
'
)]
=
[];
}
document
.
all_aliases
[
$
(
this
).
data
(
'
type
'
)].
push
(
$
(
this
).
val
())
});
toggleType
();
});
</script>
<!-- push all available (nestable) aliases in a hidden select box -->
<select
class=
"hidden"
id=
"aliases"
>
<?php
if
(
!
empty
(
$config
[
'aliases'
][
'alias'
]))
:
foreach
(
$config
[
'aliases'
][
'alias'
]
as
$alias
)
:
if
(
$alias
[
'type'
]
==
'network'
||
$alias
[
'type'
]
==
'host'
||
$alias
[
'type'
]
==
'port'
)
:?>
<
option
data
-
type
=
"<?=
$alias['type']
;?>"
value
=
"<?=
$alias['name']
;?>"
></
option
>
<?
php
endif
;
endforeach
;
endif
;
?>
</option>
<section
class=
"page-content-main"
>
<div
class=
"container-fluid"
>
...
...
@@ -325,9 +350,9 @@ include("head.inc");
<header
class=
"content-box-head container-fluid"
>
<h3>
<?=
gettext
(
"Alias Edit"
);
?>
</h3>
</header>
<div
class=
"content-box-main"
>
<div
class=
"content-box-main"
>
<form
action=
"firewall_aliases_edit.php"
method=
"post"
name=
"iform"
id=
"iform"
>
<div
class=
"table-responsive"
>
<div
class=
"table-responsive"
>
<table
class=
"table table-striped"
>
<tr>
<td
colspan=
"2"
align=
"right"
>
...
...
@@ -360,7 +385,7 @@ include("head.inc");
<tr>
<td><a
id=
"help_for_type"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Type"
);
?>
</td>
<td>
<select
name=
"type"
class=
"form-control"
id=
"typeSelect"
>
<select
name=
"type"
class=
"form-control"
id=
"typeSelect"
>
<option
value=
"host"
<?=
$pconfig
[
'type'
]
==
"host"
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Host(s)"
);
?>
</option>
<option
value=
"network"
<?=
$pconfig
[
'type'
]
==
"network"
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Network(s)"
);
?>
</option>
<option
value=
"port"
<?=
$pconfig
[
'type'
]
==
"port"
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Port(s)"
);
?>
</option>
...
...
@@ -421,15 +446,15 @@ include("head.inc");
<div
style=
"cursor:pointer;"
class=
"act-removerow btn btn-default btn-xs"
alt=
"remove"
><span
class=
"glyphicon glyphicon-minus"
></span></div>
</td>
<td>
<input
type=
"text"
class=
"f
orm-contro
l"
name=
"host_url[]"
value=
"
<?=
$address
;
?>
"
/>
<input
type=
"text"
class=
"f
ld_detai
l"
name=
"host_url[]"
value=
"
<?=
$address
;
?>
"
/>
</td>
<td>
<input
type=
"text"
class=
"form-control"
name=
"detail[]"
value=
"
<?=
isset
(
$detail_desc
[
$addressid
])
?
$detail_desc
[
$addressid
]
:
""
;
?>
"
?
>
<input
type=
"text"
name=
"detail[]"
value=
"
<?=
isset
(
$detail_desc
[
$addressid
])
?
$detail_desc
[
$addressid
]
:
""
;
?>
"
?
>
</td>
<td>
<?php
if
(
$addressid
==
0
)
:
?>
<input
type=
"text"
class=
"
form-control
input-sm"
id=
"updatefreq"
name=
"updatefreq"
value=
"
<?=
$pconfig
[
'updatefreq'
];
?>
"
>
<input
type=
"text"
class=
"input-sm"
id=
"updatefreq"
name=
"updatefreq"
value=
"
<?=
$pconfig
[
'updatefreq'
];
?>
"
>
<?php
endif
;
?>
</td>
...
...
@@ -485,11 +510,11 @@ include("head.inc");
</td>
</tr>
</table>
</div>
</form>
</div>
</form>
</div>
</div>
</section>
</div>
</section>
</div>
</div>
</section>
...
...
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