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
c52dbf2c
Commit
c52dbf2c
authored
Jul 15, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(firewall, alias) hide already used aliases. closes
https://github.com/opnsense/core/issues/1042
parent
f6a6a082
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
2 deletions
+25
-2
firewall_aliases_edit.php
src/www/firewall_aliases_edit.php
+25
-2
No files found.
src/www/firewall_aliases_edit.php
View file @
c52dbf2c
...
...
@@ -291,6 +291,29 @@ include("head.inc");
$
(
this
).
parent
().
parent
().
remove
();
}
}
/**
* link alias typeahead to input, only return items not already on this form.
*/
function
addFieldTypeAhead
()
{
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()],
matcher
:
function
(
item
){
var
used
=
false
;
$
(
"
.fld_detail
"
).
each
(
function
(){
if
(
item
==
$
(
this
).
val
())
{
used
=
true
;
}
});
if
(
used
)
{
return
false
;
}
else
{
return
~
item
.
toLowerCase
().
indexOf
(
this
.
query
)
}
}
});
}
// add new detail record
$
(
"
#addNew
"
).
click
(
function
(){
// copy last row and reset values
...
...
@@ -300,7 +323,7 @@ include("head.inc");
});
$
(
"
.act-removerow
"
).
click
(
removeRow
);
// link typeahead to new item
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()]
}
);
addFieldTypeAhead
(
);
// link geoip list to new item
$
(
"
.geoip_list
"
).
change
(
function
(){
$
(
this
).
parent
().
find
(
'
input
'
).
val
(
$
(
this
).
val
());
...
...
@@ -364,7 +387,7 @@ include("head.inc");
break
;
}
$
(
"
.fld_detail
"
).
typeahead
(
"
destroy
"
);
$
(
"
.fld_detail
"
).
typeahead
({
source
:
document
.
all_aliases
[
$
(
"
#typeSelect
"
).
val
()]
}
);
addFieldTypeAhead
(
);
}
$
(
"
#typeSelect
"
).
change
(
function
(){
...
...
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