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
Commit
a04acaea
authored
Mar 21, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: vm-credentials popup
parent
f2934fb6
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
23 additions
and
10 deletions
+23
-10
one/static/script/cloud.js
+15
-1
one/static/style/box.less
+1
-1
one/views.py
+7
-8
No files found.
one/static/script/cloud.js
View file @
a04acaea
...
...
@@ -25,7 +25,7 @@ $(function() {
$
(
this
).
parent
().
next
().
find
(
'.host'
).
hide
();
$
(
this
).
parent
().
next
().
find
(
'.ipv4host'
).
show
();
}
})
})
;
$
(
'.delete-template'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
@@ -269,6 +269,20 @@ $(function() {
function
get_vm_details
(
id
)
{
$
.
get
(
'/vm/credentials/'
+
id
,
function
(
data
)
{
$
(
'#modal-container'
).
html
(
data
);
$
(
'#modal-container .host-toggle'
).
click
(
function
(
e
){
e
.
preventDefault
();
if
(
$
(
this
).
find
(
'.v4'
).
is
(
':hidden'
)){
$
(
this
).
find
(
'.v4'
).
show
();
$
(
this
).
find
(
'.v6'
).
hide
();
$
(
this
).
parent
().
next
().
find
(
'.host'
).
show
();
$
(
this
).
parent
().
next
().
find
(
'.ipv4host'
).
hide
();
}
else
{
$
(
this
).
find
(
'.v6'
).
show
();
$
(
this
).
find
(
'.v4'
).
hide
();
$
(
this
).
parent
().
next
().
find
(
'.host'
).
hide
();
$
(
this
).
parent
().
next
().
find
(
'.ipv4host'
).
show
();
}
});
$
(
'#modal-container .hidden-password'
).
click
(
function
()
{
if
(
$
(
this
).
attr
(
'type'
)
==
'password'
)
{
$
(
this
).
attr
(
'type'
,
'text'
);
...
...
one/static/style/box.less
View file @
a04acaea
...
...
@@ -321,7 +321,7 @@
font-size: .8em;
text-align: right;
}
span {
.entry
span {
background-position: left center;
background-repeat: no-repeat;
padding-left: 18px;
...
...
one/views.py
View file @
a04acaea
...
...
@@ -358,11 +358,6 @@ vm_list = login_required(VmListView.as_view())
@login_required
def
vm_show
(
request
,
iid
):
inst
=
get_object_or_404
(
Instance
,
id
=
iid
,
owner
=
request
.
user
)
is_ipv6
=
True
#len(request.META["REMOTE_ADDR"].split('.')) == 1
inst
.
is_ipv6
=
is_ipv6
inst
.
hostname_v4
=
inst
.
get_connect_host
(
use_ipv6
=
False
)
inst
.
nat
=
inst
.
template
.
network
.
nat
inst
.
port
=
inst
.
get_port
(
use_ipv6
=
is_ipv6
)
try
:
ports
=
inst
.
firewall_host
.
list_ports
()
except
:
...
...
@@ -372,9 +367,13 @@ def vm_show(request, iid):
except
UserCloudDetails
.
DoesNotExist
:
details
=
UserCloudDetails
(
user
=
request
.
user
)
details
.
save
()
proto
=
len
(
request
.
META
[
"REMOTE_ADDR"
]
.
split
(
'.'
))
==
1
inst
.
hostname
=
inst
.
get_connect_host
(
use_ipv6
=
proto
)
inst
.
port
=
inst
.
get_port
(
use_ipv6
=
proto
)
is_ipv6
=
len
(
request
.
META
[
"REMOTE_ADDR"
]
.
split
(
'.'
))
==
1
inst
.
is_ipv6
=
is_ipv6
inst
.
hostname_v4
=
inst
.
get_connect_host
(
use_ipv6
=
False
)
inst
.
nat
=
inst
.
template
.
network
.
nat
inst
.
port
=
inst
.
get_port
(
use_ipv6
=
is_ipv6
)
inst
.
hostname
=
inst
.
get_connect_host
(
use_ipv6
=
is_ipv6
)
inst
.
port
=
inst
.
get_port
(
use_ipv6
=
is_ipv6
)
return
render_to_response
(
"show.html"
,
RequestContext
(
request
,{
'uri'
:
inst
.
get_connect_uri
(),
'state'
:
inst
.
state
,
...
...
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