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
Show 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");
$
(
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"
>
...
...
@@ -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>
...
...
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