mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Feature #4352: Show ID of the new resource in clone actions
This commit is contained in:
parent
63d0c13059
commit
94d3203049
@ -108,9 +108,15 @@ module OpenNebulaJSON
|
||||
|
||||
def clone(params=Hash.new)
|
||||
if params['target_ds']
|
||||
super(params['name'], params['target_ds'].to_i)
|
||||
rc = super(params['name'], params['target_ds'].to_i)
|
||||
else
|
||||
super(params['name'])
|
||||
rc = super(params['name'])
|
||||
end
|
||||
|
||||
if OpenNebula.is_error?(rc)
|
||||
return rc
|
||||
else
|
||||
return ImageJSON.new_with_id(rc, @client)
|
||||
end
|
||||
end
|
||||
|
||||
|
@ -118,7 +118,13 @@ module OpenNebulaJSON
|
||||
end
|
||||
|
||||
def clone(params=Hash.new)
|
||||
super(params['name'])
|
||||
rc = super(params['name'])
|
||||
|
||||
if OpenNebula.is_error?(rc)
|
||||
return rc
|
||||
else
|
||||
return TemplateJSON.new_with_id(rc, @client)
|
||||
end
|
||||
end
|
||||
|
||||
def rename(params=Hash.new)
|
||||
|
@ -19,6 +19,7 @@ define(function(require) {
|
||||
var Notifier = require('utils/notifier');
|
||||
var Locale = require('utils/locale');
|
||||
var OpenNebulaResource = require('opennebula/image');
|
||||
var OpenNebulaAction = require('opennebula/action');
|
||||
var CommonActions = require('utils/common-actions');
|
||||
|
||||
var RESOURCE = "Image";
|
||||
@ -61,7 +62,7 @@ define(function(require) {
|
||||
function(formPanelInstance, context) {
|
||||
var selectedNodes = Sunstone.getDataTable(TAB_ID).elements();
|
||||
if (selectedNodes.length !== 1) {
|
||||
Notifier.notifyMessage('Please select one (and just one) Image to export.');
|
||||
Notifier.notifyMessage(Locale.tr("Please select one (and just one) Image to export."));
|
||||
return false;
|
||||
}
|
||||
|
||||
@ -80,6 +81,10 @@ define(function(require) {
|
||||
"Image.clone" : {
|
||||
type: "single",
|
||||
call: OpenNebulaResource.clone,
|
||||
callback: function(request, response) {
|
||||
OpenNebulaAction.clear_cache("IMAGE");
|
||||
Notifier.notifyCustom(Locale.tr("Image created"), " ID: " + response.IMAGE.ID, false);
|
||||
},
|
||||
error: Notifier.onError,
|
||||
notify: true
|
||||
}
|
||||
|
@ -106,6 +106,10 @@ define(function(require) {
|
||||
"Template.clone" : {
|
||||
type: "single",
|
||||
call: OpenNebulaResource.clone,
|
||||
callback: function(request, response) {
|
||||
OpenNebulaAction.clear_cache("VMTEMPLATE");
|
||||
Notifier.notifyCustom(Locale.tr("VM Template created"), " ID: " + response.VMTEMPLATE.ID, false);
|
||||
},
|
||||
error: Notifier.onError,
|
||||
notify: true
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user