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
Commit
cbdf34c6
authored
Feb 06, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
cloud: vm status view added (ajax)
parent
8d8d3048
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
0 deletions
+8
-0
one/views.py
+8
-0
No files found.
one/views.py
View file @
cbdf34c6
...
@@ -22,6 +22,7 @@ from django.views.generic import *
...
@@ -22,6 +22,7 @@ from django.views.generic import *
from
one.models
import
*
from
one.models
import
*
import
django.contrib.auth
as
auth
import
django.contrib.auth
as
auth
from
firewall.tasks
import
*
from
firewall.tasks
import
*
import
json
class
LoginView
(
View
):
class
LoginView
(
View
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
...
@@ -119,6 +120,13 @@ def vm_show(request, iid):
...
@@ -119,6 +120,13 @@ def vm_show(request, iid):
'ports'
:
inst
.
firewall_host
.
list_ports
()
'ports'
:
inst
.
firewall_host
.
list_ports
()
}))
}))
@require_safe
@login_required
def
vm_ajax_instance_status
(
request
,
iid
):
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
inst
.
update_state
()
return
HttpResponse
(
json
.
dumps
({
'booting'
:
not
inst
.
active_since
,
'state'
:
inst
.
state
}))
class
VmPortAddView
(
View
):
class
VmPortAddView
(
View
):
def
post
(
self
,
request
,
iid
,
*
args
,
**
kwargs
):
def
post
(
self
,
request
,
iid
,
*
args
,
**
kwargs
):
try
:
try
:
...
...
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