Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
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
9a946089
authored
Mar 26, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: renew vm without page reload
parent
be2bc593
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
one/static/script/cloud.js
+10
-4
No files found.
one/static/script/cloud.js
View file @
9a946089
...
...
@@ -134,7 +134,7 @@ $(function() {
e
.
stopPropagation
();
restart_vm
(
$
(
this
).
data
(
'id'
),
$
(
this
).
data
(
'name'
));
});
$
(
'.
renew-suspend-vm'
).
click
(
function
(
e
)
{
$
(
'.
entry'
).
on
(
'click'
,
'.renew-suspend-vm'
,
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
renew_suspend_vm
(
$
(
this
).
data
(
'id'
))
...
...
@@ -352,7 +352,11 @@ $(function() {
*/
function
renew_suspend_vm
(
id
)
{
manage_vm
(
id
,
"renew/suspend"
)
manage_vm
(
id
,
"renew/suspend"
,
function
(
data
)
{
//workaround for some strange jquery parse error :o
var
foo
=
$
(
'<div />'
).
append
(
data
);
$
(
'#vm-'
+
id
+
' .details-container'
).
replaceWith
(
foo
.
find
(
'.details-container'
));
});
}
/**
* Renew vm deletion time.
...
...
@@ -365,12 +369,14 @@ $(function() {
* Manage VM State generic
*/
function
manage_vm
(
id
,
state
)
{
function
manage_vm
(
id
,
state
,
f
)
{
$
.
ajax
({
type
:
'POST'
,
url
:
'/vm/'
+
state
+
'/'
+
id
+
'/'
,
success
:
function
(
data
,
b
,
c
)
{
if
(
state
==
"resume"
)
{
if
(
f
)
{
f
(
data
);
}
else
if
(
state
==
"resume"
)
{
window
.
location
.
href
=
'/vm/show/'
+
id
+
"/"
;
}
else
{
window
.
location
.
reload
();
...
...
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