Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Fukász Rómeó Ervin
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
A prog2-höz tartozó friss repo anyagok itt elérhetőek:
https://git.iit.bme.hu/
Commit
0393bf07
authored
May 22, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
firewall_gui: reload entity list after delete
parent
10ad5fcd
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
3 deletions
+22
-3
firewall_gui/static/js/project.js
+22
-3
No files found.
firewall_gui/static/js/project.js
View file @
0393bf07
...
@@ -225,11 +225,24 @@ function ListController(url) {
...
@@ -225,11 +225,24 @@ function ListController(url) {
$scope
.
prevPage
=
function
()
{
$scope
.
prevPage
=
function
()
{
$scope
.
page
=
Math
.
max
(
$scope
.
page
-
1
,
1
);
$scope
.
page
=
Math
.
max
(
$scope
.
page
-
1
,
1
);
};
};
$scope
.
deleteEntity
=
function
(
id
)
{
$
.
ajax
({
url
:
url
.
split
(
'/'
)[
2
]
+
'/'
+
id
+
'/delete/'
,
type
:
'post'
,
success
:
reloadList
});
};
function
reloadList
()
{
$http
.
get
(
url
).
success
(
function
success
(
data
)
{
$http
.
get
(
url
).
success
(
function
success
(
data
)
{
rules
=
data
;
rules
=
data
;
$scope
.
pages
=
range
(
1
,
Math
.
ceil
(
data
.
length
/
pageSize
));
$scope
.
pages
=
range
(
1
,
Math
.
ceil
(
data
.
length
/
pageSize
));
});
});
}
}
reloadList
();
}
}
}
/**
/**
...
@@ -275,7 +288,8 @@ function EntityController(url, init) {
...
@@ -275,7 +288,8 @@ function EntityController(url, init) {
console
.
log
(
data
);
console
.
log
(
data
);
$scope
.
$apply
(
function
()
{
$scope
.
$apply
(
function
()
{
$scope
.
errors
=
{};
$scope
.
errors
=
{};
})
});
window
.
location
.
hash
=
'/'
+
url
.
split
(
'/'
)[
2
]
+
'/'
+
data
+
'/'
;
}
}
}).
error
(
function
(
data
)
{
}).
error
(
function
(
data
)
{
try
{
try
{
...
@@ -293,9 +307,12 @@ function EntityController(url, init) {
...
@@ -293,9 +307,12 @@ function EntityController(url, init) {
}
}
})
})
}
}
function
reloadEntity
()
{
$http
.
get
(
url
+
id
+
'/'
).
success
(
function
success
(
data
)
{
$http
.
get
(
url
+
id
+
'/'
).
success
(
function
success
(
data
)
{
$scope
.
entity
=
data
;
$scope
.
entity
=
data
;
$
(
'input[type=text], input[type=number], select, textarea, .has-tooltip'
).
tooltip
({
placement
:
'right'
});
$
(
'input[type=text], input[type=number], select, textarea, .has-tooltip'
).
tooltip
({
placement
:
'right'
});
[
'vlan'
,
'vlangroup'
,
'host'
,
'hostgroup'
,
'firewall'
,
'owner'
,
'domain'
,
'record'
].
forEach
(
function
(
t
)
{
[
'vlan'
,
'vlangroup'
,
'host'
,
'hostgroup'
,
'firewall'
,
'owner'
,
'domain'
,
'record'
].
forEach
(
function
(
t
)
{
$
(
'.'
+
t
).
typeahead
({
$
(
'.'
+
t
).
typeahead
({
/**
/**
...
@@ -339,7 +356,7 @@ function EntityController(url, init) {
...
@@ -339,7 +356,7 @@ function EntityController(url, init) {
}
catch
(
ex
)
{
}
catch
(
ex
)
{
try
{
try
{
$scope
[
self
.
$element
[
0
].
getAttribute
(
'ng-model'
)]
=
item
;
$scope
[
self
.
$element
[
0
].
getAttribute
(
'ng-model'
)]
=
item
;
}
catch
(
ex
)
{
}
catch
(
ex
)
{
}
}
}
}
...
@@ -350,4 +367,6 @@ function EntityController(url, init) {
...
@@ -350,4 +367,6 @@ function EntityController(url, init) {
})
})
});
});
}
}
reloadEntity
();
}
}
}
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