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
c1d5211f
authored
Feb 20, 2013
by
Dányi Bence
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
webui: vm-rename interface
parent
f6884f42
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
22 additions
and
1 deletions
+22
-1
one/static/script/cloud.js
+18
-0
one/templates/box/vm/summary.html
+4
-1
No files found.
one/static/script/cloud.js
View file @
c1d5211f
...
...
@@ -41,6 +41,24 @@ $(function() {
e
.
stopPropagation
();
});
}
$
(
'.rename-vm'
).
click
(
function
(
e
){
e
.
preventDefault
();
e
.
stopPropagation
();
var
id
=
$
(
this
).
data
(
'id'
);
var
oldName
=
$
(
this
).
data
(
'name'
);
$
(
'#vm-'
+
id
+
'-name-details'
).
hide
();
$
(
'#vm-'
+
id
+
'-name'
).
html
(
'<input type="text" value="'
+
name
+
'" />\
<input type="submit" value="'
+
gettext
(
'Rename'
)
+
'" />'
);
$
(
'#vm-'
+
id
+
'-name'
).
find
(
'input[type="text"]'
).
click
(
function
(
f
){
f
.
preventDefault
();
f
.
stopPropagation
();
}).
focus
();
$
(
'#vm-'
+
id
+
'-name'
).
find
(
'input[type=submit]'
).
click
(
function
(
f
){
f
.
preventDefault
();
f
.
stopPropagation
();
alert
(
$
(
this
).
prev
().
val
());
})
});
$
(
'.try-template-button'
).
click
(
function
(
e
)
{
e
.
preventDefault
();
e
.
stopPropagation
();
...
...
one/templates/box/vm/summary.html
View file @
c1d5211f
...
...
@@ -10,7 +10,10 @@
{% block name %}
<div
class=
"name {% if i.state == 'ACTIVE' %}vm-on{% else %}vm-off{% endif %}"
>
{{vm.name|truncatechars:20}}
<small
class=
"details"
>
(
<a
href=
"/vm/show/{{vm.id}}/"
title=
"{{vm.name}}"
>
{% trans "More details" %}
</a>
)
</small>
<span
id=
"vm-{{vm.id}}-name"
>
{{vm.name|truncatechars:20}}
</span>
<small
id=
"vm-{{vm.id}}-name-details"
class=
"details"
>
(
<a
href=
"/vm/show/{{vm.id}}/"
title=
"{{vm.name}}"
>
{% trans "More details" %}
</a>
)
</small>
</div>
{% endblock %}
...
...
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