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
b9067fe7
Commit
b9067fe7
authored
Feb 08, 2016
by
Ad Schellevis
Committed by
Franco Fichtner
Feb 14, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(legacy) reimplement alias nesting. closes
https://github.com/opnsense/core/issues/372
(cherry picked from commit
d714d27c
)
parent
9fdfae84
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 @
b9067fe7
...
@@ -264,6 +264,8 @@ include("head.inc");
...
@@ -264,6 +264,8 @@ include("head.inc");
$
(
this
).
val
(
""
);
$
(
this
).
val
(
""
);
});
});
$
(
"
.act-removerow
"
).
click
(
removeRow
);
$
(
"
.act-removerow
"
).
click
(
removeRow
);
// link typeahead to new item
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()]
});
});
});
$
(
"
.act-removerow
"
).
click
(
removeRow
);
$
(
"
.act-removerow
"
).
click
(
removeRow
);
...
@@ -304,16 +306,39 @@ include("head.inc");
...
@@ -304,16 +306,39 @@ include("head.inc");
$
(
"
#detailsHeading1
"
).
html
(
"
<?=
gettext
(
"Port(s)"
);
?>
"
);
$
(
"
#detailsHeading1
"
).
html
(
"
<?=
gettext
(
"Port(s)"
);
?>
"
);
break
;
break
;
}
}
$
(
"
.fld_detail
"
).
typeahead
(
"
destroy
"
);
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()]
});
}
}
$
(
"
#typeSelect
"
).
change
(
function
(){
$
(
"
#typeSelect
"
).
change
(
function
(){
toggleType
();
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
();
toggleType
();
});
});
</script>
</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"
>
<section
class=
"page-content-main"
>
<div
class=
"container-fluid"
>
<div
class=
"container-fluid"
>
...
@@ -325,9 +350,9 @@ include("head.inc");
...
@@ -325,9 +350,9 @@ include("head.inc");
<header
class=
"content-box-head container-fluid"
>
<header
class=
"content-box-head container-fluid"
>
<h3>
<?=
gettext
(
"Alias Edit"
);
?>
</h3>
<h3>
<?=
gettext
(
"Alias Edit"
);
?>
</h3>
</header>
</header>
<div
class=
"content-box-main"
>
<div
class=
"content-box-main"
>
<form
action=
"firewall_aliases_edit.php"
method=
"post"
name=
"iform"
id=
"iform"
>
<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"
>
<table
class=
"table table-striped"
>
<tr>
<tr>
<td
colspan=
"2"
align=
"right"
>
<td
colspan=
"2"
align=
"right"
>
...
@@ -360,7 +385,7 @@ include("head.inc");
...
@@ -360,7 +385,7 @@ include("head.inc");
<tr>
<tr>
<td><a
id=
"help_for_type"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Type"
);
?>
</td>
<td><a
id=
"help_for_type"
href=
"#"
class=
"showhelp"
><i
class=
"fa fa-info-circle"
></i></a>
<?=
gettext
(
"Type"
);
?>
</td>
<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=
"host"
<?=
$pconfig
[
'type'
]
==
"host"
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Host(s)"
);
?>
</option>
<option
value=
"network"
<?=
$pconfig
[
'type'
]
==
"network"
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Network(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>
<option
value=
"port"
<?=
$pconfig
[
'type'
]
==
"port"
?
"selected=
\"
selected
\"
"
:
""
;
?>
>
<?=
gettext
(
"Port(s)"
);
?>
</option>
...
@@ -421,15 +446,15 @@ include("head.inc");
...
@@ -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>
<div
style=
"cursor:pointer;"
class=
"act-removerow btn btn-default btn-xs"
alt=
"remove"
><span
class=
"glyphicon glyphicon-minus"
></span></div>
</td>
</td>
<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>
<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>
<td>
<td>
<?php
if
(
$addressid
==
0
)
:
<?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
;
<?php
endif
;
?>
?>
</td>
</td>
...
@@ -485,11 +510,11 @@ include("head.inc");
...
@@ -485,11 +510,11 @@ include("head.inc");
</td>
</td>
</tr>
</tr>
</table>
</table>
</div>
</div>
</form>
</form>
</div>
</div>
</div>
</div>
</section>
</section>
</div>
</div>
</div>
</div>
</section>
</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