Skip to content
Toggle navigation
P
Projects
G
Groups
S
Snippets
Help
CIRCLE
/
cloud
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
94
Merge Requests
10
Pipelines
Wiki
Snippets
Members
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit
b5fead6f
authored
12 years ago
by
tarokkk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: VM connect button popup on not cloudgui clients
parent
53edd6ca
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
31 additions
and
6 deletions
+31
-6
cloud/urls.py
+1
-0
one/static/cloud.js
+19
-4
one/templates/box-vmlist.html
+1
-1
one/views.py
+10
-1
No files found.
cloud/urls.py
View file @
b5fead6f
...
...
@@ -27,6 +27,7 @@ urlpatterns = patterns('',
url
(
r'^vm/port_add/(?P<iid>\d+)/$'
,
'one.views.vm_port_add'
,
name
=
'vm_port_add'
),
url
(
r'^vm/port_del/(?P<iid>\d+)/(?P<proto>tcp|udp)/(?P<public>\d+)/$'
,
'one.views.vm_port_del'
,
name
=
'vm_port_del'
),
url
(
r'^vm/saveas/(?P<vmid>\d+)$'
,
'one.views.vm_saveas'
,
name
=
'vm_saveas'
),
url
(
r'^vm/credentials/(?P<iid>\d+)$'
,
'one.views.vm_credentials'
,
name
=
'vm_credentials'
),
url
(
r'^reload/$'
,
'firewall.views.reload_firewall'
,
name
=
'reload_firewall'
),
url
(
r'^fwapi/$'
,
'firewall.views.firewall_api'
,
name
=
'firewall_api'
),
url
(
r'^store/$'
,
'store.views.index'
,
name
=
'store_index'
),
...
...
This diff is collapsed.
Click to expand it.
one/static/cloud.js
View file @
b5fead6f
...
...
@@ -41,9 +41,12 @@ $(function() {
delete_template_confirm
(
$
(
this
).
data
(
'id'
),
$
(
this
).
data
(
'name'
));
});
$
(
'.wm .summary'
).
unbind
(
'click'
).
click
(
toggleDetails
);
if
(
window
.
navigator
.
userAgent
.
indexOf
(
'cloud-gui'
)
!=
0
)
{
$
(
'.connect-vm-button'
).
click
(
function
(
e
)
{
e
.
stopPropagation
();
e
.
preventDefault
();
e
.
stopPropagation
();
get_vm_details
(
$
(
this
).
data
(
'id'
));
});
}
$
(
'.stop-vm-button'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
stop_vm
(
$
(
this
).
data
(
'id'
),
$
(
this
).
data
(
'name'
));
...
...
@@ -65,19 +68,22 @@ $(function() {
$
(
'#modal-container'
).
html
(
$
(
'#new-wm'
).
html
());
$
(
'#modal-container .wm .summary'
).
click
(
toggleDetails
);
});
/*
*FIXME Most ez itt miért van 2x??????
*/
$
(
'#new-template-button'
).
click
(
function
()
{
$
(
'#modal'
).
show
();
$
(
'#modal-container'
).
html
(
$
(
'#new-template'
).
html
());
});
$
(
'#shadow'
).
click
(
function
()
{
$
(
'#modal'
).
hide
();
})
$
(
'#new-template-button'
).
click
(
function
()
{
$
.
get
(
'/ajax/templateWizard'
,
function
(
data
)
{
$
(
'#modal-container'
).
html
(
data
);
})
$
(
'#modal'
).
show
();
});
$
(
'#shadow'
).
click
(
function
()
{
$
(
'#modal'
).
hide
();
})
$
(
'#old-upload'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
$
(
this
).
parent
().
parent
().
hide
().
parent
().
find
(
'#old-upload-form'
).
show
();
...
...
@@ -116,6 +122,15 @@ $(function() {
toggleDetails
.
apply
(
$
(
'.selected-summary'
));
toggleDetails
.
apply
(
$
(
'.selected-summary'
));
/**
* Connect button new window
*/
function
get_vm_details
(
id
)
{
$
.
get
(
'/vm/credentials/'
+
id
,
function
(
data
)
{
$
(
'#modal-container'
).
html
(
data
);
})
$
(
'#modal'
).
show
();
};
/**
* Confirm pop-up window
*/
...
...
This diff is collapsed.
Click to expand it.
one/templates/box-vmlist.html
View file @
b5fead6f
...
...
@@ -13,7 +13,7 @@
</div>
<div
class=
"actions"
>
{% if i.state == 'ACTIVE' %}
<a
href=
"{{i.get_connect_uri}}"
class=
"connect-vm-button"
title=
"{% trans "
Connect
"
%}"
>
<a
href=
"{{i.get_connect_uri}}"
data-id=
"{{ i.id }}"
class=
"connect-vm-button"
title=
"{% trans "
Connect
"
%}"
>
<img
src=
"/static/icons/plug.png"
alt=
"{% trans "
Connect
"
%}"
/>
</a>
<a
href=
"#"
class=
"stop-vm-button"
data-name=
"{{ i.name}}"
data-id=
"{{ i.id }}"
title=
"{% trans "
Pause
"
%}"
>
...
...
This diff is collapsed.
Click to expand it.
one/views.py
View file @
b5fead6f
...
...
@@ -75,7 +75,7 @@ def home(request):
return
render_to_response
(
"home.html"
,
RequestContext
(
request
,
{
'templates'
:
Template
.
objects
.
filter
(
state
=
'READY'
),
'mytemplates'
:
Template
.
objects
.
filter
(
owner
=
request
.
user
),
'publictemplates'
:
Template
.
objects
.
filter
(
public
=
True
),
'publictemplates'
:
Template
.
objects
.
filter
(
public
=
True
,
state
=
'READY'
),
'instances'
:
_list_instances
(
request
),
'groups'
:
request
.
user
.
person_set
.
all
()[
0
]
.
owned_groups
.
all
(),
'semesters'
:
Semester
.
objects
.
all
(),
...
...
@@ -105,6 +105,15 @@ def ajax_template_name_unique(request, name):
s
=
"False"
return
HttpResponse
(
s
)
@login_required
def
vm_credentials
(
request
,
iid
):
vm
=
get_object_or_404
(
Instance
,
pk
=
iid
)
if
vm
.
owner
==
request
.
user
:
return
render_to_response
(
'vm-credentials.html'
,
RequestContext
(
request
,
{
'i'
:
vm
}))
else
:
return
HttpResponse
(
"Stale id."
)
class
AjaxTemplateWizard
(
View
):
def
get
(
self
,
request
,
*
args
,
**
kwargs
):
return
render_to_response
(
'new-template-flow-1.html'
,
RequestContext
(
request
,{
...
...
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