Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
Gelencsér Szabolcs
/
circlestack
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
ed395c7a
authored
Sep 18, 2013
by
Bach Dániel
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
vm: vnc support for VmDetailView
parent
5b27960e
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
25 additions
and
10 deletions
+25
-10
circle/dashboard/templates/dashboard/vm-detail-console.html
+5
-5
circle/dashboard/templates/dashboard/vm-detail.html
+1
-1
circle/dashboard/urls.py
+1
-1
circle/dashboard/views.py
+17
-2
circle/vm/models.py
+1
-1
No files found.
circle/dashboard/templates/dashboard/vm-detail-console.html
View file @
ed395c7a
...
...
@@ -61,13 +61,13 @@
$
(
"#vm-detail-pane"
).
addClass
(
"col-md-12"
);
WebUtil
.
init_logging
(
'warn'
);
host
=
'10.9.2.232'
;
port
=
'443'
;
password
=
'
tbdgpzhtow
'
;
path
=
'vnc/'
;
host
=
window
.
location
.
hostname
;
port
=
window
.
location
.
port
==
""
?
"443"
:
window
.
location
.
port
;
password
=
'
autogiro
'
;
path
=
'vnc/
?d={{ vnc_url }}
'
;
rfb
=
new
RFB
({
'target'
:
$D
(
'noVNC_canvas'
),
'encrypt'
:
true
,
//
(window.location.protocol === "https:"),
'encrypt'
:
(
window
.
location
.
protocol
===
"https:"
),
'true_color'
:
true
,
'local_cursor'
:
true
,
'shared'
:
true
,
...
...
circle/dashboard/templates/dashboard/vm-detail.html
View file @
ed395c7a
...
...
@@ -4,7 +4,7 @@
{% block content %}
<div
class=
"body-content"
>
<div
class=
"page-header"
>
<h1>
devenv
<small>
550.vm.ik.bme.hu
</small></h1>
<h1>
{{ instance.name }}
<small>
550.vm.ik.bme.hu
</small></h1>
</div>
<div
class=
"row"
>
<div
class=
"col-md-4"
id=
"vm-info-pane"
>
...
...
circle/dashboard/urls.py
View file @
ed395c7a
...
...
@@ -4,5 +4,5 @@ from .views import IndexView, VmDetailView
urlpatterns
=
patterns
(
''
,
url
(
r'^$'
,
IndexView
.
as_view
()),
url
(
r'^vm/(?P<
id
>\d+)/$'
,
VmDetailView
.
as_view
(),
url
(
r'^vm/(?P<
pk
>\d+)/$'
,
VmDetailView
.
as_view
(),
name
=
'dashboard.views.detail'
),)
circle/dashboard/views.py
View file @
ed395c7a
from
django.views.generic
import
TemplateView
from
django.views.generic
import
TemplateView
,
DetailView
from
vm.models
import
Instance
from
django.core
import
signing
class
IndexView
(
TemplateView
):
...
...
@@ -18,5 +19,19 @@ class IndexView(TemplateView):
return
context
class
VmDetailView
(
Template
View
):
class
VmDetailView
(
Detail
View
):
template_name
=
"dashboard/vm-detail.html"
queryset
=
Instance
.
objects
.
all
()
def
get_context_data
(
self
,
**
kwargs
):
context
=
super
(
DetailView
,
self
)
.
get_context_data
(
**
kwargs
)
instance
=
context
[
'instance'
]
if
instance
.
node
:
port
=
instance
.
vnc_port
host
=
instance
.
node
.
host
.
ipv4
value
=
signing
.
dumps
({
'host'
:
host
,
'port'
:
port
},
key
=
'asdasd'
)
context
.
update
({
'vnc_url'
:
'
%
s'
%
value
})
return
context
circle/vm/models.py
View file @
ed395c7a
...
...
@@ -359,7 +359,7 @@ class Instance(BaseResourceConfigModel, TimeStampedModel):
@permalink
def
get_absolute_url
(
self
):
return
(
'dashboard.views.detail'
,
None
,
{
'
id
'
:
self
.
id
})
return
(
'dashboard.views.detail'
,
None
,
{
'
pk
'
:
self
.
id
})
@property
def
vm_name
(
self
):
...
...
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