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
7f856315
authored
Apr 18, 2013
by
Bence Dányi
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: fix js format
parent
deba7118
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
17 deletions
+17
-17
one/static/script/cloud.js
+17
-17
No files found.
one/static/script/cloud.js
View file @
7f856315
...
...
@@ -17,9 +17,9 @@ $(function() {
$
(
'a[href=#]'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
});
$
(
'.host-toggle'
).
click
(
function
(
e
){
$
(
'.host-toggle'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
if
(
$
(
this
).
find
(
'.v4'
).
is
(
':hidden'
))
{
if
(
$
(
this
).
find
(
'.v4'
).
is
(
':hidden'
))
{
$
(
this
).
find
(
'.v4'
).
show
();
$
(
this
).
find
(
'.v6'
).
hide
();
$
(
this
).
parent
().
next
().
find
(
'.host'
).
show
();
...
...
@@ -84,20 +84,20 @@ $(function() {
var
handler
=
arguments
.
callee
;
var
oldName
=
$
(
this
).
data
(
'name'
);
var
content
=
$
(
'#vm-'
+
id
+
'-name'
).
html
();
var
self
=
this
;
var
self
=
this
;
var
url
=
$
(
this
).
data
(
'url'
);
$
(
'#vm-'
+
id
).
addClass
(
'editing'
);
$
(
this
).
unbind
(
'click'
).
click
(
function
(
e
){
$
(
'#vm-'
+
id
).
addClass
(
'editing'
);
$
(
this
).
unbind
(
'click'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
$
(
this
).
unbind
(
'click'
).
click
(
handler
);
$
(
'#vm-'
+
id
+
'-name-details'
).
show
();
$
(
'#vm-'
+
id
+
'-name'
).
html
(
content
);
$
(
'#vm-'
+
id
).
removeClass
(
'editing'
);
$
(
'#vm-'
+
id
).
removeClass
(
'editing'
);
})
$
(
'#vm-'
+
id
+
'-name-details'
).
hide
();
$
(
'#vm-'
+
id
+
'-name'
).
html
(
'<input type="text" value="'
+
oldName
+
'" />\
<input type="submit" value="'
+
gettext
(
'Rename'
)
+
'" data-url="'
+
url
+
'"/>'
);
<input type="submit" value="'
+
gettext
(
'Rename'
)
+
'" data-url="'
+
url
+
'"/>'
);
$
(
'#vm-'
+
id
+
'-name'
).
find
(
'input[type="text"]'
).
click
(
function
(
f
)
{
f
.
preventDefault
();
f
.
stopPropagation
();
...
...
@@ -116,7 +116,7 @@ $(function() {
$
(
'#vm-'
+
id
+
'-name'
).
text
(
data
.
name
);
$
(
self
).
click
(
handler
);
$
(
self
).
data
(
'name'
,
newName
);
$
(
'#vm-'
+
id
).
removeClass
(
'editing'
);
$
(
'#vm-'
+
id
).
removeClass
(
'editing'
);
}
});
})
...
...
@@ -167,14 +167,14 @@ $(function() {
})
$
(
'#modal'
).
show
();
});
$
(
'.edit-template'
).
click
(
function
(
e
){
$
(
'.edit-template'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
var
id
=
$
(
this
).
data
(
'id'
);
var
id
=
$
(
this
).
data
(
'id'
);
$
.
ajax
({
type
:
'GET'
,
url
:
$
(
this
).
data
(
'url'
),
success
:
function
(
data
){
success
:
function
(
data
)
{
$
(
'#modal'
).
show
();
$
(
'#modal-container'
).
html
(
data
);
}
...
...
@@ -281,9 +281,9 @@ $(function() {
function
get_vm_details
(
id
)
{
$
.
get
(
'/vm/credentials/'
+
id
,
function
(
data
)
{
$
(
'#modal-container'
).
html
(
data
);
$
(
'#modal-container .host-toggle'
).
click
(
function
(
e
){
$
(
'#modal-container .host-toggle'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
if
(
$
(
this
).
find
(
'.v4'
).
is
(
':hidden'
))
{
if
(
$
(
this
).
find
(
'.v4'
).
is
(
':hidden'
))
{
$
(
this
).
find
(
'.v4'
).
show
();
$
(
this
).
find
(
'.v6'
).
hide
();
$
(
this
).
parent
().
next
().
find
(
'.host'
).
show
();
...
...
@@ -323,7 +323,7 @@ $(function() {
});
}
cloud
.
confirm
=
vm_confirm_popup
;
cloud
.
confirm
=
vm_confirm_popup
;
/**
* Manage VM State (STOP)
*/
...
...
@@ -368,8 +368,8 @@ $(function() {
function
renew_suspend_vm
(
id
)
{
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'
));
var
foo
=
$
(
'<div />'
).
append
(
data
);
$
(
'#vm-'
+
id
+
' .details-container'
).
replaceWith
(
foo
.
find
(
'.details-container'
));
});
}
/**
...
...
@@ -388,7 +388,7 @@ $(function() {
type
:
'POST'
,
url
:
'/vm/'
+
state
+
'/'
+
id
+
'/'
,
success
:
function
(
data
,
b
,
c
)
{
if
(
f
)
{
if
(
f
)
{
f
(
data
);
}
else
if
(
state
==
"resume"
)
{
window
.
location
.
href
=
'/vm/show/'
+
id
+
"/"
;
...
...
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