Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gyuricska Milán
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
55cd39eb
authored
Apr 30, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: show rule details RESTful url endpoint added
parent
40c3dccf
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
44 additions
and
1 deletions
+44
-1
cloud/urls.py
+2
-0
firewall_gui/static/js/project.js
+20
-1
firewall_gui/static/partials/rule-edit.html
+22
-0
firewall_gui/views.py
+0
-0
No files found.
cloud/urls.py
View file @
55cd39eb
...
...
@@ -103,4 +103,6 @@ urlpatterns = patterns('',
url
(
r'^firewall/domains/$'
,
'firewall_gui.views.list_domains'
),
url
(
r'^firewall/records/$'
,
'firewall_gui.views.list_records'
),
url
(
r'^firewall/blacklists/$'
,
'firewall_gui.views.list_blacklists'
),
url
(
r'^firewall/rules/(?P<id>\d+)/$'
,
'firewall_gui.views.show_rule'
),
)
firewall_gui/static/js/project.js
View file @
55cd39eb
...
...
@@ -6,7 +6,7 @@
* @type {Array}
*/
var
listControllers
=
[
'rule'
,
'host'
,
'vlan'
,
'vlangroup'
,
'hostgroup'
,
'firewall'
,
'domain'
,
'record'
,
'blacklist'
];
var
entityControllers
=
[
'rule'
];
var
module
=
angular
.
module
(
'firewall'
,
[]).
config
(
[
'$routeProvider'
,
function
(
$routeProvider
)
{
for
(
var
i
in
listControllers
)
{
...
...
@@ -16,6 +16,13 @@ var module = angular.module('firewall', []).config(
controller
:
ListController
(
'/firewall/'
+
c
+
's/'
)
});
}
for
(
var
i
in
entityControllers
)
{
var
c
=
entityControllers
[
i
];
$routeProvider
.
when
(
'/'
+
c
+
's/:id/'
,
{
templateUrl
:
'/static/partials/'
+
c
+
'-edit.html'
,
controller
:
EntityController
(
'/firewall/'
+
c
+
's/'
)
});
}
$routeProvider
.
otherwise
({
redirectTo
:
'/rules/'
});
...
...
@@ -77,3 +84,15 @@ function ListController(url) {
});
}
}
function
EntityController
(
url
)
{
console
.
log
(
'creatin...'
,
url
);
return
function
(
$scope
,
$http
,
$routeParams
)
{
var
id
=
$routeParams
.
id
;
console
.
log
(
'foooooo'
);
$http
.
get
(
url
+
id
+
'/'
).
success
(
function
success
(
data
)
{
console
.
log
(
data
);
$scope
.
rule
=
data
;
});
}
}
firewall_gui/static/partials/rule-edit.html
0 → 100644
View file @
55cd39eb
<form
class=
"form-horizontal"
>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"ID"
>
ID
</label>
<div
class=
"controls"
>
<input
class=
"input-mini"
type=
"text"
id=
"ID"
placeholder=
"ID"
value=
"{{rule.id}}"
disabled=
"disabled"
>
</div>
</div>
<div
class=
"control-group"
>
<label
class=
"control-label"
for=
"inputPassword"
>
Password
</label>
<div
class=
"controls"
>
<input
type=
"password"
id=
"inputPassword"
placeholder=
"Password"
>
</div>
</div>
<div
class=
"control-group"
>
<div
class=
"controls"
>
<label
class=
"checkbox"
>
<input
type=
"checkbox"
>
Remember me
</label>
<button
type=
"submit"
class=
"btn"
>
Sign in
</button>
</div>
</div>
</form>
firewall_gui/views.py
View file @
55cd39eb
This diff is collapsed.
Click to expand it.
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