mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-20 10:50:08 +03:00
Feature #4126: Rename VM in cloud view
(cherry picked from commit 9a3ab43b22e91d4db3084c6f9e544ace5992f898)
This commit is contained in:
parent
1b41ef223a
commit
41add4229e
@ -25,6 +25,10 @@
|
||||
{{!opts.title}}
|
||||
</span>
|
||||
<span class="provision_info_vm_name only-not-active"></span>
|
||||
 
|
||||
<span class="provision_info_vm_rename only-not-active">
|
||||
<a href="#"> <i class="fa fa-pencil"/></a>
|
||||
</span>
|
||||
<span href"#" class="right only-active button small radius secondary provision_vms_list_refresh_button"
|
||||
{{#unless opts.refresh}}style="display:none"{{/unless}} title=" {{tr "Refresh"}}">
|
||||
<i class="fa fa-fw fa-lg fa-refresh"/></span>
|
||||
|
@ -341,6 +341,33 @@ define(function(require) {
|
||||
|
||||
$(".provision_info_vm_name", context).text(data.NAME);
|
||||
|
||||
context.off("click", ".provision_info_vm_rename a");
|
||||
context.on("click", ".provision_info_vm_rename a", function() {
|
||||
var valueStr = $(".provision_info_vm_name", context).text();
|
||||
$(".provision_info_vm_name", context).html('<input class="input_edit_value_rename" type="text" value="' + valueStr + '"/>');
|
||||
});
|
||||
|
||||
context.off("change", ".input_edit_value_rename");
|
||||
context.on("change", ".input_edit_value_rename", function() {
|
||||
var valueStr = $(".input_edit_value_rename", context).val();
|
||||
if (valueStr != "") {
|
||||
OpenNebula.VM.rename({
|
||||
data : {
|
||||
id: vm_id,
|
||||
extra_param: {
|
||||
"name" : valueStr
|
||||
}
|
||||
},
|
||||
success: function(request, response){
|
||||
update_provision_vm_info(vm_id, context);
|
||||
},
|
||||
error: function(request, response){
|
||||
Notifier.onError(request, response);
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
$(".provision-pricing-table_vm_info", context).html(
|
||||
'<li class="text-left provision-bullet-item">'+
|
||||
'<span class="'+ state.color +'-color">'+
|
||||
|
Loading…
x
Reference in New Issue
Block a user