1
0
mirror of https://github.com/OpenNebula/one.git synced 2025-03-22 18:50:08 +03:00

Feature #4212: Show VM ID after import action

This commit is contained in:
Daniel Molina 2016-02-22 12:43:39 +01:00
parent 2650e14dca
commit a4c3268410
5 changed files with 15 additions and 5 deletions

View File

@ -217,6 +217,7 @@ module OpenNebula
return rc if OpenNebula.is_error?(rc)
vm.deploy(id, false)
return vm.id
end
#######################################################################

View File

@ -73,7 +73,12 @@ module OpenNebulaJSON
end
def import_wild(params=Hash.new)
super(params['name'])
rc = super(params['name'])
if OpenNebula.is_error?(rc)
return rc
else
return VirtualMachineJSON.new_with_id(rc, @client)
end
end
end
end

View File

@ -206,7 +206,11 @@ class SunstoneServer < CloudServer
if OpenNebula.is_error?(rc)
return [500, rc.to_json]
else
return [204, resource.to_json]
if rc.nil?
return [204, resource.to_json]
else
return [201, rc.to_json]
end
end
end

View File

@ -53,10 +53,10 @@ define(function(require) {
type: "POST",
contentType: "application/json; charset=utf-8",
data: JSON.stringify(action),
success: function() {
success: function(response) {
_clearCache(cache_name);
return callback ? callback(request) : null;
return callback ? callback(request, response) : null;
},
error: function(response) {
return callbackError ?

View File

@ -151,7 +151,7 @@ define(function(require) {
data: dataJSON,
success: function(request, response) {
OpenNebulaAction.clear_cache("VM");
// TODO Notifier.notifyCustom(Locale.tr("VM imported"), " ID: " + response.VM.ID, false);
Notifier.notifyCustom(Locale.tr("VM imported"), " ID: " + response.VM.ID, false);
// Delete row (shouldn't be there in next monitorization)
that.dataTableWildHosts.fnDeleteRow(wild_row);