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

Feature #3932, #3801: Rename VM shutdown & delete in sunstone

This commit is contained in:
Carlos Martín 2016-05-05 17:43:49 +02:00
parent f362b7ca85
commit 2fcc4f7244
20 changed files with 491 additions and 460 deletions

View File

@ -256,10 +256,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: true
VM.undeploy_hard: true
VM.shutdown: true
VM.shutdown_hard: true
VM.delete: true
VM.delete_recreate: true
VM.terminate: true
VM.terminate_hard: true
VM.resize: true
VM.attachdisk: true
VM.detachdisk: true
@ -274,7 +272,7 @@ tabs:
VM.disk_snapshot_delete: true
VM.resched: true
VM.unresched: true
VM.saveas_template: true
VM.save_as_template: true
VM.updateconf: true
oneflow-services-tab:
panel_tabs:

View File

@ -256,10 +256,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: true
VM.undeploy_hard: true
VM.shutdown: true
VM.shutdown_hard: true
VM.delete: true
VM.delete_recreate: true
VM.terminate: true
VM.terminate_hard: true
VM.resize: true
VM.attachdisk: true
VM.detachdisk: true
@ -274,7 +272,7 @@ tabs:
VM.disk_snapshot_delete: false
VM.resched: true
VM.unresched: true
VM.saveas_template: false
VM.save_as_template: false
VM.updateconf: true
oneflow-services-tab:
panel_tabs:

View File

@ -40,8 +40,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: false
VM.undeploy_hard: false
VM.shutdown_hard: true
VM.delete: true
VM.terminate: true
VM.terminate_hard: true
VM.resize: false
VM.attachdisk: false
VM.detachdisk: false
@ -54,6 +54,7 @@ tabs:
VM.disk_snapshot_create: false
VM.disk_snapshot_revert: false
VM.disk_snapshot_delete: false
VM.save_as_template: true
dashboard:
quotas: true
vms: true

View File

@ -40,8 +40,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: false
VM.undeploy_hard: false
VM.shutdown_hard: true
VM.delete: true
VM.terminate: true
VM.terminate_hard: true
VM.resize: false
VM.attachdisk: false
VM.detachdisk: false
@ -54,6 +54,7 @@ tabs:
VM.disk_snapshot_create: false
VM.disk_snapshot_revert: false
VM.disk_snapshot_delete: false
VM.save_as_template: true
dashboard:
quotas: true
vms: true

View File

@ -255,10 +255,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: true
VM.undeploy_hard: true
VM.shutdown: true
VM.shutdown_hard: true
VM.delete: true
VM.delete_recreate: false
VM.terminate: true
VM.terminate_hard: true
VM.resize: false
VM.attachdisk: false
VM.detachdisk: false
@ -273,7 +271,7 @@ tabs:
VM.disk_snapshot_delete: false
VM.resched: false
VM.unresched: false
VM.saveas_template: true
VM.save_as_template: true
VM.updateconf: false
oneflow-services-tab:
panel_tabs:

View File

@ -257,10 +257,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: true
VM.undeploy_hard: true
VM.shutdown: true
VM.shutdown_hard: true
VM.delete: true
VM.delete_recreate: false
VM.terminate: true
VM.terminate_hard: true
VM.resize: false
VM.attachdisk: false
VM.detachdisk: false
@ -275,7 +273,7 @@ tabs:
VM.disk_snapshot_delete: false
VM.resched: false
VM.unresched: false
VM.saveas_template: false
VM.save_as_template: false
VM.updateconf: false
oneflow-services-tab:
panel_tabs:

View File

@ -259,10 +259,8 @@ tabs:
VM.poweroff_hard: true
VM.undeploy: true
VM.undeploy_hard: true
VM.shutdown: true
VM.shutdown_hard: true
VM.delete: true
VM.delete_recreate: true
VM.terminate: true
VM.terminate_hard: true
VM.resize: true
VM.attachdisk: true
VM.detachdisk: true
@ -277,7 +275,7 @@ tabs:
VM.disk_snapshot_delete: true
VM.resched: false
VM.unresched: false
VM.saveas_template: true
VM.save_as_template: true
VM.updateconf: true
oneflow-services-tab:
panel_tabs:

View File

@ -44,7 +44,6 @@ module OpenNebulaJSON
rc = case action_hash['perform']
when "deploy" then self.deploy(action_hash['params'])
when "finalize" then self.finalize
when "hold" then self.hold
when "livemigrate" then self.migrate(action_hash['params'], true)
when "migrate" then self.migrate(action_hash['params'], false)
@ -52,7 +51,6 @@ module OpenNebulaJSON
when "release" then self.release
when "stop" then self.stop
when "suspend" then self.suspend
when "reset" then self.reset
when "disk_saveas" then self.disk_saveas(action_hash['params'])
when "snapshot_create" then self.snapshot_create(action_hash['params'])
when "snapshot_revert" then self.snapshot_revert(action_hash['params'])
@ -60,10 +58,9 @@ module OpenNebulaJSON
when "disk_snapshot_create" then self.disk_snapshot_create(action_hash['params'])
when "disk_snapshot_revert" then self.disk_snapshot_revert(action_hash['params'])
when "disk_snapshot_delete" then self.disk_snapshot_delete(action_hash['params'])
when "shutdown" then self.shutdown(action_hash['params'])
when "reboot" then self.reboot
when "terminate" then self.terminate(action_hash['params'])
when "reboot" then self.reboot(action_hash['params'])
when "poweroff" then self.poweroff(action_hash['params'])
when "resubmit" then self.resubmit
when "chown" then self.chown(action_hash['params'])
when "chmod" then self.chmod_octet(action_hash['params'])
when "resize" then self.resize(action_hash['params'])
@ -86,10 +83,6 @@ module OpenNebulaJSON
end
end
def delete
super()
end
def deploy(params=Hash.new)
super(params['host_id'], params['enforce'], params['ds_id'])
end
@ -98,7 +91,11 @@ module OpenNebulaJSON
super(params['hard'])
end
def shutdown(params=Hash.new)
def terminate(params=Hash.new)
super(params['hard'])
end
def reboot(params=Hash.new)
super(params['hard'])
end

View File

@ -298,33 +298,35 @@ define(function(require) {
];
var MIGRATE_ACTION_STR = [
"none",
"migrate",
"live-migrate",
"shutdown",
"shutdown-hard",
"undeploy",
"undeploy-hard",
"hold",
"release",
"stop",
"suspend",
"resume",
"boot",
"delete",
"delete-recreate",
"reboot",
"reboot-hard",
"resched",
"unresched",
"poweroff",
"poweroff-hard",
"disk-attach",
"disk-detach",
"nic-attach",
"nic-detach",
"snap-create",
"snap-delete"
"none", // NONE_ACTION = 0
"migrate", // MIGRATE_ACTION = 1
"live-migrate", // LIVE_MIGRATE_ACTION = 2
"shutdown", // //SHUTDOWN_ACTION = 3
"shutdown-hard", // //SHUTDOWN_HARD_ACTION = 4
"undeploy", // UNDEPLOY_ACTION = 5
"undeploy-hard", // UNDEPLOY_HARD_ACTION = 6
"hold", // HOLD_ACTION = 7
"release", // RELEASE_ACTION = 8
"stop", // STOP_ACTION = 9
"suspend", // SUSPEND_ACTION = 10
"resume", // RESUME_ACTION = 11
"boot", // //BOOT_ACTION = 12
"delete", // DELETE_ACTION = 13
"delete-recreate", // DELETE_RECREATE_ACTION = 14
"reboot", // REBOOT_ACTION = 15
"reboot-hard", // REBOOT_HARD_ACTION = 16
"resched", // RESCHED_ACTION = 17
"unresched", // UNRESCHED_ACTION = 18
"poweroff", // POWEROFF_ACTION = 19
"poweroff-hard", // POWEROFF_HARD_ACTION = 20
"disk-attach", // DISK_ATTACH_ACTION = 21
"disk-detach", // DISK_DETACH_ACTION = 22
"nic-attach", // NIC_ATTACH_ACTION = 23
"nic-detach", // NIC_DETACH_ACTION = 24
"snap-create", // DISK_SNAPSHOT_CREATE_ACTION = 25
"snap-delete", // DISK_SNAPSHOT_DELETE_ACTION = 26
"terminate", // TERMINATE_ACTION = 27
"terminate-hard" // TERMINATE_HARD_ACTION = 28
];
var VM = {
@ -332,9 +334,6 @@ define(function(require) {
"create": function(params) {
OpenNebulaAction.create(params, RESOURCE);
},
"del": function(params) {
OpenNebulaAction.del(params, RESOURCE);
},
"list": function(params) {
OpenNebulaAction.list(params, RESOURCE);
},
@ -351,13 +350,13 @@ define(function(require) {
var action_obj = params.data.extra_param;
OpenNebulaAction.simple_action(params, RESOURCE, "chmod", action_obj);
},
"shutdown": function(params) {
"terminate": function(params) {
var action_obj = {"hard": false};
OpenNebulaAction.simple_action(params, RESOURCE, "shutdown", action_obj);
OpenNebulaAction.simple_action(params, RESOURCE, "terminate", action_obj);
},
"shutdown_hard" : function(params) {
"terminate_hard" : function(params) {
var action_obj = {"hard": true};
OpenNebulaAction.simple_action(params, RESOURCE, "shutdown", action_obj);
OpenNebulaAction.simple_action(params, RESOURCE, "terminate", action_obj);
},
"hold": function(params) {
OpenNebulaAction.simple_action(params, RESOURCE, "hold");
@ -377,9 +376,6 @@ define(function(require) {
"resume": function(params) {
OpenNebulaAction.simple_action(params, RESOURCE, "resume");
},
"resubmit": function(params) {
OpenNebulaAction.simple_action(params, RESOURCE, "resubmit");
},
"poweroff" : function(params) {
var action_obj = {"hard": false};
OpenNebulaAction.simple_action(params, RESOURCE, "poweroff", action_obj);
@ -396,11 +392,13 @@ define(function(require) {
var action_obj = {"hard": true};
OpenNebulaAction.simple_action(params, RESOURCE, "undeploy", action_obj);
},
"reboot" : function(params) {
OpenNebulaAction.simple_action(params, RESOURCE, "reboot");
"reboot": function(params) {
var action_obj = {"hard": false};
OpenNebulaAction.simple_action(params, RESOURCE, "reboot", action_obj);
},
"reset" : function(params) {
OpenNebulaAction.simple_action(params, RESOURCE, "reset");
"reboot_hard" : function(params) {
var action_obj = {"hard": true};
OpenNebulaAction.simple_action(params, RESOURCE, "reboot", action_obj);
},
"log": function(params) {

View File

@ -0,0 +1,47 @@
<div data-closable class="callout large secondary">
<div class="row">
<div class="large-11 columns">
<span>
{{tr "This action will power off this Virtual Machine. The Virtual Machine will remain in the poweroff state, and can be powered on later"}}
{{#if opts.both}}
<br/>
<br/>
{{tr "You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't affect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer)."}}
{{/if}}
</span>
</div>
</div>
<br/>
<div class="row">
<div class="large-12 columns">
<button href"#" class="provision_poweroff_button button right">
{{tr "Power off"}}
</button>
{{#if opts.both}}
<ul class="menu simple">
<li>
<label class="left">
<input type="radio" name="provision_poweroff_radio" value="poweroff_hard">
<i class="fa fa-fw fa-bolt"/> {{tr "Power off the machine"}}
</label>
</li>
<li>
<label class="left">
<input type="radio" name="provision_poweroff_radio" value="poweroff" checked>
<i class="fa fa-fw fa-power-off"/> {{tr "Send the power off signal"}}
</label>
</li>
</ul>
{{else}}
{{#if opts.hard}}
<input checked hidden type="radio" name="provision_poweroff_radio" value="poweroff_hard">
{{else}}
<input checked hidden type="radio" name="provision_poweroff_radio" value="poweroff">
{{/if}}
{{/if}}
</div>
</div>
<button class="close-button" aria-label="Close" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
</div>

View File

@ -0,0 +1,47 @@
<div data-closable class="callout large secondary">
<div class="row">
<div class="large-11 columns">
<span>
{{tr "This action will reboot this Virtual Machine."}}
{{#if opts.both}}
<br/>
<br/>
{{tr "You can send the reboot signal to the Virtual Machine (this is equivalent to execute the reboot command form the console). If that doesn't affect your Virtual Machine, try to Reboot the machine (this is equivalent to pressing the reset button a physical computer)."}}
{{/if}}
</span>
</div>
</div>
<br/>
<div class="row">
<div class="large-12 columns">
<button href"#" class="provision_reboot_button button right">
{{tr "Reboot"}}
</button>
{{#if opts.both}}
<ul class="menu simple">
<li>
<label class="left">
<input type="radio" name="provision_reboot_radio" value="reboot_hard">
<i class="fa fa-fw fa-bolt"/> {{tr "Reboot the machine"}}
</label>
</li>
<li>
<label class="left">
<input type="radio" name="provision_reboot_radio" value="reboot" checked>
<i class="fa fa-fw fa-power-off"/> {{tr "Send the reboot signal"}}
</label>
</li>
</ul>
{{else}}
{{#if opts.hard}}
<input checked hidden type="radio" name="provision_reboot_radio" value="reboot_hard">
{{else}}
<input checked hidden type="radio" name="provision_reboot_radio" value="reboot">
{{/if}}
{{/if}}
</div>
</div>
<button class="close-button" aria-label="Close" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
</div>

View File

@ -0,0 +1,55 @@
<div data-closable class="callout large secondary">
<div class="row">
<div class="large-12 columns">
<span>
{{tr "This Virtual Machine will be saved in a new Template."}}
<br>
{{tr "You can then create a new Virtual Machine using this Template."}}
</span>
</div>
</div>
<br>
<div class="row">
<div class="large-11 large-centered columns">
<input type="text" class="provision_snapshot_name" placeholder="{{tr "Template Name"}}"/>
</div>
</div>
<br>
<div class="row">
<div class="large-12 columns">
<span>
{{tr "The new Virtual Machine's disks can be made persistent. In a persistent Virtual Machine the changes made survive after it is destroyed. On the other hand, you cannot create more than one simultaneous Virtual Machine from a Template with persistent disks."}}
</span>
</div>
</div>
<br>
<div class="row">
<div class="large-12 columns">
<ul class="menu simple">
<li>
<label class="left">
<input type="radio" name="provision_snapshot_radio" value="persistent">
<i class="fa fa-fw fa-save"/> {{tr "Persistent"}}
</label>
</li>
<li>
<label class="left">
<input type="radio" name="provision_snapshot_radio" value="nonpersistent" checked>
<i class="fa fa-fw fa-trash-o"/> {{tr "Non-persistent"}}
</label>
</li>
</ul>
</div>
</div>
<br>
<div class="row">
<div class="large-11 large-centered columns">
<button href"#" class="provision_save_as_template_button success button right">
{{tr "Save Virtual Machine to Template"}}
</button>
</div>
</div>
<button class="close-button" aria-label="Close" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
</div>

View File

@ -0,0 +1,47 @@
<div data-closable class="callout large secondary">
<div class="row">
<div class="large-11 columns">
<span>
{{tr "Be careful, this action will shutdown and destroy your Virtual Machine"}}
{{#if opts.both}}
<br/>
<br/>
{{tr "You can send the shutdown signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't affect your Virtual Machine, try to terminate the machine (this is equivalent to pressing the power off button in a physical computer)."}}
{{/if}}
</span>
</div>
</div>
<br/>
<div class="row">
<div class="large-12 columns">
<button href"#" class="provision_terminate_button alert button right">
{{tr "Terminate"}}
</button>
{{#if opts.both}}
<ul class="menu simple">
<li>
<label class="left">
<input type="radio" name="provision_terminate_radio" value="terminate_hard">
<i class="fa fa-fw fa-bolt"/> {{tr "Terminate the machine"}}
</label>
</li>
<li>
<label class="left">
<input type="radio" name="provision_terminate_radio" value="terminate" checked>
<i class="fa fa-fw fa-power-off"/> {{tr "Send the shutdown signal and terminate"}}
</label>
</li>
</ul>
{{else}}
{{#if opts.hard}}
<input checked hidden type="radio" name="provision_terminate_radio" value="terminate_hard">
{{else}}
<input checked hidden type="radio" name="provision_terminate_radio" value="terminate">
{{/if}}
{{/if}}
</div>
</div>
<button class="close-button" aria-label="Close" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
</div>

View File

@ -0,0 +1,47 @@
<div data-closable class="callout large secondary">
<div class="row">
<div class="large-11 columns">
<span>
{{tr "This action will power off this Virtual Machine and will be undeployed from the physical machine"}}
{{#if opts.both}}
<br/>
<br/>
{{tr "You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't affect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer)."}}
{{/if}}
</span>
</div>
</div>
<br/>
<div class="row">
<div class="large-12 columns">
<button href"#" class="provision_undeploy_button button right">
{{tr "Power off and undeploy"}}
</button>
{{#if opts.both}}
<ul class="menu simple">
<li>
<label class="left">
<input type="radio" name="provision_undeploy_radio" value="undeploy_hard">
<i class="fa fa-fw fa-bolt"/> {{tr "Power off and undeploy the VM"}}
</label>
</li>
<li>
<label class="left">
<input type="radio" name="provision_undeploy_radio" value="undeploy" checked>
<i class="fa fa-fw fa-power-off"/> {{tr "Send the power off signal and undeploy the VM"}}
</label>
</li>
</ul>
{{else}}
{{#if opts.hard}}
<input checked hidden type="radio" name="provision_undeploy_radio" value="undeploy_hard">
{{else}}
<input checked hidden type="radio" name="provision_undeploy_radio" value="undeploy">
{{/if}}
{{/if}}
</div>
</div>
<button class="close-button" aria-label="Close" type="button" data-close>
<span aria-hidden="true">&times;</span>
</button>
</div>

View File

@ -43,61 +43,46 @@
<button title="{{tr "You have to boot the Virtual Machine first"}}" class="button radius white provision_vnc_button_disabled disabled tip-top" disabled>
<i class="fa fa-fw fa-lg fa-desktop"/></button>
</li>
{{#isProvisionTabEnabled "provision-tab" "templates"}}
{{#isTabActionEnabled "provision-tab" "VM.save_as_template"}}
<li>
<button href"#" title="{{tr "The main disk of the Virtual Machine will be saved in a new Image"}}" class="button radius success provision_snapshot_button tip-top">
<button href"#" title="{{tr "The disks of the Virtual Machine will be saved in a new Image"}}" class="button radius success provision_save_as_template_confirm_button tip-top">
<i class="fa fa-fw fa-lg fa-save"/>
</button>
</li>
<li>
<button title="{{tr "You have to power-off the virtual machine first"}}" class="button radius white provision_snapshot_button_disabled disabled tip-top" disabled>
<button title="{{tr "You have to power-off the virtual machine first"}}" class="button radius white provision_save_as_template_confirm_button_disabled disabled tip-top" disabled>
<i class="fa fa-fw fa-lg fa-save"/>
</button>
</li>
{{/isProvisionTabEnabled}}
{{/isTabActionEnabled}}
<li>
{{#isTabActionEnabled "provision-tab" "VM.delete"}}
<li>
<button href"#" title="{{tr "Delete"}}" class="button radius alert provision_delete_confirm_button tip-top">
<button href"#" title="{{tr "Terminate"}}" class="button radius alert provision_terminate_confirm_button tip-top">
<i class="fa fa-fw fa-lg fa-trash-o"/>
</button>
</li>
{{/isTabActionEnabled}}
{{#isTabActionEnabled "provision-tab" "VM.shutdown_hard"}}
<li>
<button href"#" title="{{tr "Delete"}}" class="button radius alert provision_shutdownhard_confirm_button tip-top">
<i class="fa fa-fw fa-lg fa-trash-o"/>
</button>
</li>
{{/isTabActionEnabled}}
{{#isTabActionEnabled "provision-tab" "VM.poweroff"}}
<li>
<button href"#" title="{{tr "Power off"}}" class="button radius secondary provision_poweroff_confirm_button tip-top">
<i class="fa fa-fw fa-lg fa-power-off"/>
</button>
</li>
{{/isTabActionEnabled}}
{{#isTabActionEnabled "provision-tab" "VM.undeploy"}}
<li>
<button href"#" title="{{tr "Power off"}}" class="button radius secondary provision_undeploy_confirm_button tip-top">
<i class="fa fa-fw fa-lg fa-power-off"/>
</button>
</li>
{{/isTabActionEnabled}}
{{#isTabActionEnabled "provision-tab" "VM.resume"}}
{{#isTabActionEnabled "provision-tab" "VM.resume"}}
<li>
<button href"#" title="{{tr "Power on"}}" class="button radius secondary provision_poweron_button tip-top">
<button href"#" title="{{tr "Power on"}}" class="button radius secondary provision_resume_button tip-top">
<i class="fa fa-fw fa-lg fa-play"/>
</button>
</li>
{{/isTabActionEnabled}}
{{#isTabActionEnabled "provision-tab" "VM.reboot"}}
{{/isTabActionEnabled}}
<li>
<button href"#" title="{{tr "Reboot"}}" class="button radius secondary provision_reboot_confirm_button tip-top">
<i class="fa fa-fw fa-lg fa-repeat"/>
</button>
</li>
{{/isTabActionEnabled}}
</ul>
</li>
</ul>

View File

@ -26,8 +26,14 @@ define(function(require) {
var ResourceSelect = require('utils/resource-select');
var Graphs = require('utils/graphs');
var TemplateUtils = require('utils/template-utils');
var StateActions = require('tabs/vms-tab/utils/state-actions');
var TemplateVmsList = require('hbs!./list');
var TemplateConfirmSaveAsTemplate = require('hbs!./confirm_save_as_template');
var TemplateConfirmTerminate = require('hbs!./confirm_terminate');
var TemplateConfirmPoweroff = require('hbs!./confirm_poweroff');
var TemplateConfirmUndeploy = require('hbs!./confirm_undeploy');
var TemplateConfirmReboot = require('hbs!./confirm_reboot');
var TAB_ID = require('../tabId');
var _accordionId = 0;
@ -255,86 +261,63 @@ define(function(require) {
var data = response.VM
var state = get_provision_vm_state(data);
switch (state.color) {
case "deploying":
$(".provision_reboot_confirm_button", context).hide();
$(".provision_poweroff_confirm_button", context).hide();
$(".provision_undeploy_confirm_button", context).hide();
$(".provision_poweron_button", context).hide();
$(".provision_delete_confirm_button", context).show();
$(".provision_shutdownhard_confirm_button", context).hide();
$(".provision_snapshot_button", context).hide();
$(".provision_vnc_button", context).hide();
$(".provision_snapshot_button_disabled", context).hide();
$(".provision_vnc_button_disabled", context).hide();
break;
case "running":
$(".provision_reboot_confirm_button", context).show();
$(".provision_poweroff_confirm_button", context).show();
$(".provision_undeploy_confirm_button", context).show();
$(".provision_poweron_button", context).hide();
$(".provision_delete_confirm_button", context).hide();
$(".provision_shutdownhard_confirm_button", context).show();
$(".provision_snapshot_button", context).hide();
$(".provision_vnc_button", context).show();
$(".provision_snapshot_button_disabled", context).show();
$(".provision_vnc_button_disabled", context).hide();
break;
case "off":
$(".provision_reboot_confirm_button", context).hide();
$(".provision_poweroff_confirm_button", context).hide();
$(".provision_undeploy_confirm_button", context).hide();
$(".provision_poweron_button", context).show();
$(".provision_delete_confirm_button", context).hide();
$(".provision_shutdownhard_confirm_button", context).show();
$(".provision_snapshot_button", context).show();
$(".provision_vnc_button", context).hide();
$(".provision_snapshot_button_disabled", context).hide();
$(".provision_vnc_button_disabled", context).show();
break;
case "undeployed":
$(".provision_reboot_confirm_button", context).hide();
$(".provision_poweroff_confirm_button", context).hide();
$(".provision_undeploy_confirm_button", context).hide();
$(".provision_poweron_button", context).show();
$(".provision_delete_confirm_button", context).hide();
$(".provision_shutdownhard_confirm_button", context).show();
$(".provision_snapshot_button", context).hide();
$(".provision_vnc_button", context).hide();
$(".provision_snapshot_button_disabled", context).hide();
$(".provision_vnc_button_disabled", context).show();
break;
case "powering_off":
case "error":
$(".provision_reboot_confirm_button", context).hide();
$(".provision_poweroff_confirm_button", context).hide();
$(".provision_undeploy_confirm_button", context).hide();
$(".provision_poweron_button", context).hide();
$(".provision_delete_confirm_button", context).show();
$(".provision_shutdownhard_confirm_button", context).hide();
$(".provision_snapshot_button", context).hide();
$(".provision_vnc_button", context).hide();
$(".provision_snapshot_button_disabled", context).hide();
$(".provision_vnc_button_disabled", context).hide();
break;
default:
color = 'secondary';
$(".provision_reboot_confirm_button", context).hide();
$(".provision_poweroff_confirm_button", context).hide();
$(".provision_undeploy_confirm_button", context).hide();
$(".provision_poweron_button", context).hide();
$(".provision_delete_confirm_button", context).show();
$(".provision_shutdownhard_confirm_button", context).hide();
$(".provision_snapshot_button", context).hide();
$(".provision_vnc_button", context).hide();
$(".provision_snapshot_button_disabled", context).hide();
$(".provision_vnc_button_disabled", context).hide();
break;
// helper, cleaner code
function enabled(action){
return Config.isTabActionEnabled("provision-tab", action) &&
StateActions.enabledStateAction(action, data.STATE, data.LCM_STATE);
}
if (!OpenNebula.VM.isVNCSupported(data) && !OpenNebula.VM.isSPICESupported(data)) {
$(".provision_vnc_button", context).hide();
$(".provision_vnc_button_disabled", context).hide();
if (enabled("VM.reboot") || enabled("VM.reboot_hard")){
$(".provision_reboot_confirm_button", context).show();
} else {
$(".provision_reboot_confirm_button", context).hide();
}
if (enabled("VM.poweroff") || enabled("VM.poweroff_hard")){
$(".provision_poweroff_confirm_button", context).show();
} else {
$(".provision_poweroff_confirm_button", context).hide();
}
if (enabled("VM.undeploy") || enabled("VM.undeploy_hard")){
$(".provision_undeploy_confirm_button", context).show();
} else {
$(".provision_undeploy_confirm_button", context).hide();
}
if (enabled("VM.resume")){
$(".provision_resume_button", context).show();
} else {
$(".provision_resume_button", context).hide();
}
if (enabled("VM.terminate") || enabled("VM.terminate_hard")){
$(".provision_terminate_confirm_button", context).show();
} else {
$(".provision_terminate_confirm_button", context).hide();
}
if(Config.isTabActionEnabled("provision-tab", "VM.save_as_template")){
if (enabled("VM.save_as_template")){
$(".provision_save_as_template_confirm_button", context).show();
$(".provision_save_as_template_confirm_button_disabled", context).hide();
} else {
$(".provision_save_as_template_confirm_button", context).hide();
$(".provision_save_as_template_confirm_button_disabled", context).show();
}
}else{
$(".provision_save_as_template_confirm_button", context).hide();
$(".provision_save_as_template_confirm_button_disabled", context).hide();
}
if (OpenNebula.VM.isVNCSupported(data) ||
OpenNebula.VM.isSPICESupported(data)) {
$(".provision_vnc_button", context).show();
$(".provision_vnc_button_disabled", context).hide();
}else{
$(".provision_vnc_button", context).hide();
$(".provision_vnc_button_disabled", context).show();
}
$(".provision_info_vm", context).attr("vm_id", data.ID);
@ -487,65 +470,13 @@ define(function(require) {
})
}
if (Config.isProvisionTabEnabled("provision-tab", "templates")) {
context.on("click", ".provision_snapshot_button", function(){
if (Config.isTabActionEnabled("provision-tab", "VM.save_as_template")) {
context.on("click", ".provision_save_as_template_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
'<div data-closable class="callout large secondary">'+
'<div class="row">'+
'<div class="large-12 columns">'+
'<span>'+
Locale.tr("This Virtual Machine will be saved in a new Template.")+
'<br>'+
Locale.tr("You can then create a new Virtual Machine using this Template.")+
'</span>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-11 large-centered columns">'+
'<input type="text" class="provision_snapshot_name" placeholder="'+Locale.tr("Template Name")+'"/>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-12 columns">'+
'<span>'+
Locale.tr("The new Virtual Machine's disks can be made persistent. In a persistent Virtual Machine the changes made survive after it is destroyed. On the other hand, you cannot create more than one simultaneous Virtual Machine from a Template with persistent disks.")+
'</span>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-12 columns">'+
'<ul class="menu simple">'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_snapshot_radio" value="persistent" class="provision_snapshot_persistent_radio">'+
' <i class="fa fa-fw fa-save"/> '+Locale.tr("Persistent")+
'</label>'+
'</li>'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_snapshot_radio" value="nonpersistent" class="provision_snapshot_nonpersisten_radio" checked>'+
' <i class="fa fa-fw fa-trash-o"/> '+Locale.tr("Non-persistent")+
'</label>'+
'</li>'+
'</ul>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-11 large-centered columns">'+
'<button href"#" class="provision_snapshot_create_button success button right">'+Locale.tr("Save Virtual Machine to Template")+'</button>'+
'</div>'+
'</div>'+
'<button class="close-button" aria-label="' + Locale.tr("Dismiss Alert") + ' type="button" data-close>' +
'<span aria-hidden="true">&times;</span>' +
'</button>'+
'</div>');
TemplateConfirmSaveAsTemplate());
});
context.on("click", ".provision_snapshot_create_button", function(){
context.on("click", ".provision_save_as_template_button", function(){
var button = $(this);
button.attr("disabled", "disabled");
var context = $(".provision_info_vm[vm_id]");
@ -586,200 +517,98 @@ define(function(require) {
});
}
context.on("click", ".provision_delete_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
'<div data-closable class="callout large secondary">'+
'<div class="row">'+
'<div class="large-9 columns">'+
'<span>'+
Locale.tr("Be careful, this action will immediately destroy your Virtual Machine")+
'<br>'+
Locale.tr("All the information will be lost!")+
'</span>'+
'</div>'+
'<div class="large-3 columns">'+
'<button href"#" class="provision_delete_button alert button right">'+Locale.tr("Delete")+'</button>'+
'</div>'+
'</div>'+
'<button class="close-button" aria-label="' + Locale.tr("Dismiss Alert") + ' type="button" data-close>' +
'<span aria-hidden="true">&times;</span>' +
'</button>'+
'</div>');
});
context.on("click", ".provision_terminate_confirm_button", function(){
var data = $(".provision_info_vm", context).data("vm");
context.on("click", ".provision_shutdownhard_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
'<div data-closable class="callout large secondary">'+
'<div class="row">'+
'<div class="large-9 columns">'+
'<span>'+
Locale.tr("Be careful, this action will immediately destroy your Virtual Machine")+
'<br>'+
Locale.tr("All the information will be lost!")+
'</span>'+
'</div>'+
'<div class="large-3 columns">'+
'<button href"#" class="provision_shutdownhard_button alert button right">'+Locale.tr("Delete")+'</button>'+
'</div>'+
'</div>'+
'<button class="close-button" aria-label="' + Locale.tr("Dismiss Alert") + ' type="button" data-close>' +
'<span aria-hidden="true">&times;</span>' +
'</button>'+
'</div>');
var hard = Config.isTabActionEnabled("provision-tab", "VM.terminate_hard") &&
StateActions.enabledStateAction("VM.terminate_hard", data.STATE, data.LCM_STATE);
var soft = Config.isTabActionEnabled("provision-tab", "VM.terminate") &&
StateActions.enabledStateAction("VM.terminate", data.STATE, data.LCM_STATE);
var opts = {};
if(hard && soft){
opts.both = true;
} else if(hard){
opts.hard = true;
}
$(".provision_confirm_action:first", context).html(TemplateConfirmTerminate({opts: opts}));
});
context.on("click", ".provision_poweroff_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
'<div data-closable class="callout large secondary">'+
'<div class="row">'+
'<div class="large-11 columns">'+
'<span>'+
Locale.tr("This action will power off this Virtual Machine. The Virtual Machine will remain in the poweroff state, and can be powered on later")+
'<br>'+
'<br>'+
Locale.tr("You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't effect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer).")+
'</span>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-12 columns">'+
'<button href"#" class="provision_poweroff_button button right">'+Locale.tr("Power off")+'</button>'+
'<ul class="menu simple">'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_poweroff_radio" value="poweroff_hard" class="provision_poweroff_hard_radio">'+
' <i class="fa fa-fw fa-bolt"/> '+Locale.tr("Power off the machine")+
'</label>'+
'</li>'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_poweroff_radio" value="poweroff" class="provision_poweroff_radio" checked>'+
' <i class="fa fa-fw fa-power-off"/> '+Locale.tr("Send the power off signal")+
'</label>'+
'</li>'+
'</ul>'+
'</div>'+
'</div>'+
'<button class="close-button" aria-label="' + Locale.tr("Dismiss Alert") + ' type="button" data-close>' +
'<span aria-hidden="true">&times;</span>' +
'</button>'+
'</div>');
var data = $(".provision_info_vm", context).data("vm");
var hard = Config.isTabActionEnabled("provision-tab", "VM.poweroff_hard") &&
StateActions.enabledStateAction("VM.poweroff_hard", data.STATE, data.LCM_STATE);
var soft = Config.isTabActionEnabled("provision-tab", "VM.poweroff") &&
StateActions.enabledStateAction("VM.poweroff", data.STATE, data.LCM_STATE);
var opts = {};
if(hard && soft){
opts.both = true;
} else if(hard){
opts.hard = true;
}
$(".provision_confirm_action:first", context).html(TemplateConfirmPoweroff({opts: opts}));
});
context.on("click", ".provision_undeploy_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
'<div data-closable class="callout large secondary">'+
'<div class="row">'+
'<div class="large-11 columns">'+
'<span>'+
Locale.tr("This action will power off this Virtual Machine and will be undeployed from the physical machine")+
'<br>'+
'<br>'+
Locale.tr("You can send the power off signal to the Virtual Machine (this is equivalent to execute the command from the console). If that doesn't effect your Virtual Machine, try to Power off the machine (this is equivalent to pressing the power off button in a physical computer).")+
'</span>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-12 columns">'+
'<button href"#" class="provision_undeploy_button button right">'+Locale.tr("Power off and undeploy")+'</button>'+
'<ul class="menu simple">'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_undeploy_radio" value="undeploy_hard" class="provision_undeploy_hard_radio">'+
' <i class="fa fa-fw fa-bolt"/> '+Locale.tr("Power off and undeploy the VM")+
'</label>'+
'</li>'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_undeploy_radio" value="undeploy" class="provision_undeploy_radio" checked>'+
' <i class="fa fa-fw fa-power-off"/> '+Locale.tr("Send the power off signal and undeploy the VM")+
'</label>'+
'</li>'+
'</ul>'+
'</div>'+
'</div>'+
'<button class="close-button" aria-label="' + Locale.tr("Dismiss Alert") + ' type="button" data-close>' +
'<span aria-hidden="true">&times;</span>' +
'</button>'+
'</div>');
var data = $(".provision_info_vm", context).data("vm");
var hard = Config.isTabActionEnabled("provision-tab", "VM.undeploy_hard") &&
StateActions.enabledStateAction("VM.undeploy_hard", data.STATE, data.LCM_STATE);
var soft = Config.isTabActionEnabled("provision-tab", "VM.undeploy") &&
StateActions.enabledStateAction("VM.undeploy", data.STATE, data.LCM_STATE);
var opts = {};
if(hard && soft){
opts.both = true;
} else if(hard){
opts.hard = true;
}
$(".provision_confirm_action:first", context).html(TemplateConfirmUndeploy({opts: opts}));
});
context.on("click", ".provision_reboot_confirm_button", function(){
$(".provision_confirm_action:first", context).html(
'<div data-closable class="callout large secondary">'+
'<div class="row">'+
'<div class="large-11 columns">'+
'<span>'+
Locale.tr("This action will reboot this Virtual Machine.")+
'<br>'+
'<br>'+
Locale.tr("You can send the reboot signal to the Virtual Machine (this is equivalent to execute the reboot command form the console). If that doesn't effect your Virtual Machine, try to Reboot the machine (this is equivalent to pressing the reset button a physical computer).")+
'</span>'+
'</div>'+
'</div>'+
'<br>'+
'<div class="row">'+
'<div class="large-12 columns">'+
'<button href"#" class="provision_reboot_button button right">'+Locale.tr("Reboot")+'</button>'+
'<ul class="menu simple">'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_reboot_radio" value="reset" class="provision_reboot_hard_radio">'+
' <i class="fa fa-fw fa-bolt"/> '+Locale.tr("Reboot the machine")+
'</label>'+
'</li>'+
'<li>'+
'<label class="left">'+
'<input type="radio" name="provision_reboot_radio" value="reboot" class="provision_reboot_radio" checked>'+
' <i class="fa fa-fw fa-power-off"/> '+Locale.tr("Send the reboot signal")+
'</label>'+
'</li>'+
'</ul>'+
'</div>'+
'</div>'+
'<button class="close-button" aria-label="' + Locale.tr("Dismiss Alert") + ' type="button" data-close>' +
'<span aria-hidden="true">&times;</span>' +
'</button>'+
'</div>');
var data = $(".provision_info_vm", context).data("vm");
var hard = Config.isTabActionEnabled("provision-tab", "VM.reboot_hard") &&
StateActions.enabledStateAction("VM.reboot_hard", data.STATE, data.LCM_STATE);
var soft = Config.isTabActionEnabled("provision-tab", "VM.reboot") &&
StateActions.enabledStateAction("VM.reboot", data.STATE, data.LCM_STATE);
var opts = {};
if(hard && soft){
opts.both = true;
} else if(hard){
opts.hard = true;
}
$(".provision_confirm_action:first", context).html(TemplateConfirmReboot({opts: opts}));
});
context.on("click", ".provision_delete_button", function(){
context.on("click", ".provision_terminate_button", function(){
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
var terminate_action = $('input[name=provision_terminate_radio]:checked').val()
OpenNebula.VM.del({
OpenNebula.VM[terminate_action]({
data : {
id: vm_id
},
success: function(request, response){
$(".provision_back", context).click();
$(".provision_vms_list_refresh_button", context).click();
button.removeAttr("disabled");
},
error: function(request, response){
Notifier.onError(request, response);
button.removeAttr("disabled");
}
})
return false;
});
context.on("click", ".provision_shutdownhard_button", function(){
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");
OpenNebula.VM.shutdown_hard({
data : {
id: vm_id
},
success: function(request, response){
$(".provision_back", context).click();
$(".provision_vms_list_refresh_button", context).click();
update_provision_vm_info(vm_id, context);
button.removeAttr("disabled");
},
error: function(request, response){
@ -861,7 +690,7 @@ define(function(require) {
return false;
});
context.on("click", ".provision_poweron_button", function(){
context.on("click", ".provision_resume_button", function(){
var button = $(this);
button.attr("disabled", "disabled");
var vm_id = $(".provision_info_vm", context).attr("vm_id");

View File

@ -56,24 +56,21 @@ define(function(require) {
error: Notifier.onError
},
"VM.refresh": _commonActions.refresh(),
"VM.delete": _commonActions.del(),
"VM.chown": _commonActions.multipleAction('chown'),
"VM.chgrp": _commonActions.multipleAction('chgrp'),
"VM.hold": _commonActions.multipleAction('hold'),
"VM.release": _commonActions.multipleAction('release'),
"VM.suspend": _commonActions.multipleAction('suspend'),
"VM.resume": _commonActions.multipleAction('resume'),
"VM.stop": _commonActions.multipleAction('stop'),
"VM.reboot_hard": _commonActions.multipleAction('reset'),
"VM.delete_recreate": _commonActions.multipleAction('resubmit'),
"VM.reboot": _commonActions.multipleAction('reboot'),
"VM.reboot_hard": _commonActions.multipleAction('reboot_hard'),
"VM.poweroff": _commonActions.multipleAction('poweroff'),
"VM.poweroff_hard": _commonActions.multipleAction('poweroff_hard'),
"VM.undeploy": _commonActions.multipleAction('undeploy'),
"VM.undeploy_hard": _commonActions.multipleAction('undeploy_hard'),
"VM.shutdown": _commonActions.multipleAction('shutdown'),
"VM.shutdown_hard": _commonActions.multipleAction('shutdown_hard'),
"VM.terminate": _commonActions.multipleAction('terminate'),
"VM.terminate_hard": _commonActions.multipleAction('terminate_hard'),
"VM.recover": _commonActions.multipleAction('recover'),
"VM.resched": _commonActions.multipleAction('resched'),
"VM.unresched": _commonActions.multipleAction('unresched'),
@ -198,7 +195,7 @@ define(function(require) {
},
notify: true
},
"VM.saveas_template" : {
"VM.save_as_template" : {
type: "single",
call: function() {
var dialog = Sunstone.getDialog(SAVE_AS_TEMPLATE_DIALOG_ID);

View File

@ -140,33 +140,18 @@ define(function(require) {
tip: Locale.tr("Shuts down the given VM. The VM is saved in the system Datastore."),
custom_classes : "state-dependent"
},
"VM.shutdown" : {
"VM.terminate" : {
type: "confirm",
text: Locale.tr("Shutdown"),
text: Locale.tr("Terminate"),
layout: "vmsdelete_buttons",
tip: Locale.tr("This will initiate the shutdown process in the selected VMs"),
tip: Locale.tr("This will initiate the terminate process in the selected VMs"),
custom_classes : "state-dependent"
},
"VM.shutdown_hard" : {
"VM.terminate_hard" : {
type: "confirm",
text: Locale.tr("Shutdown") + ' <span class="label secondary radius">' + Locale.tr("hard") + '</span>',
text: Locale.tr("Terminate") + ' <span class="label secondary radius">' + Locale.tr("hard") + '</span>',
layout: "vmsdelete_buttons",
tip: Locale.tr("This will initiate the shutdown-hard (forced) process in the selected VMs"),
custom_classes : "state-dependent"
},
"VM.delete" : {
type: "confirm",
text: Locale.tr("Delete"),
layout: "vmsdelete_buttons",
tip: Locale.tr("This will delete the selected VMs from the database"),
custom_classes : "state-dependent"
},
"VM.delete_recreate" : {
type: "confirm",
text: Locale.tr("Delete") + ' <span class="label secondary radius">' + Locale.tr("recreate") + '</span>',
layout: "vmsrepeat_buttons",
tip: Locale.tr("This will delete and recreate VMs to PENDING state"),
tip: Locale.tr("This will initiate the terminate-hard (forced) process in the selected VMs"),
custom_classes : "state-dependent"
},
"VM.resched" : {
@ -188,14 +173,19 @@ define(function(require) {
text: Locale.tr("Recover"),
layout: "vmsplanification_buttons",
custom_select: '<select class="resource_list_select">\
<option value="2">' + Locale.tr("retry") + '</option>\
<option value="1">' + Locale.tr("success") + '</option>\
<option value="0">' + Locale.tr("failure") + '</option>\
</select>' ,
<option value="2">' + Locale.tr("retry") + '</option>\
<option value="1">' + Locale.tr("success") + '</option>\
<option value="0">' + Locale.tr("failure") + '</option>\
<option value="3">' + Locale.tr("delete") + '</option>\
<option value="4">' + Locale.tr("delete-recreate") + '</option>\
</select>' ,
tip: Locale.tr("Recovers a stuck VM that is waiting for a driver operation. \
The recovery may be done by failing, succeeding or retrying the current operation. \
YOU NEED TO MANUALLY CHECK THE VM STATUS ON THE HOST, to decide if the operation \
was successful or not, or if it can be retried."),
was successful or not, or if it can be retried.\
<br/>\
<br/>Delete: This will delete the selected VMs\
<br/>Delete-recreate: This will delete and recreate VMs to PENDING state"),
custom_classes : "state-dependent"
},
"VM.startvnc" : {
@ -210,7 +200,7 @@ define(function(require) {
custom_classes: "only-sunstone-info spice-sunstone-info",
tip: Locale.tr("SPICE")
},
"VM.saveas_template" : {
"VM.save_as_template" : {
type: "action",
text: '<i class="fa fa-save"/>',
tip: Locale.tr("This Virtual Machine will be saved in a new Template. You can then create a new Virtual Machine using this Template"),

View File

@ -20,47 +20,47 @@ define(function(require) {
var STATE_ACTIONS = {};
STATE_ACTIONS[OpenNebulaVM.STATES.INIT] =
["VM.delete", "VM.delete_recreate", "VM.resize"];
["VM.resize", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.PENDING] =
["VM.delete", "VM.delete_recreate", "VM.hold", "VM.deploy", "VM.updateconf"];
["VM.hold", "VM.deploy", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.HOLD] =
["VM.delete", "VM.delete_recreate", "VM.release", "VM.deploy", "VM.updateconf"];
["VM.release", "VM.deploy", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.ACTIVE] =
["VM.delete", "VM.delete_recreate", "VM.recover"];
["VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.STOPPED] =
["VM.delete", "VM.delete_recreate", "VM.resume", "VM.deploy"];
["VM.resume", "VM.deploy", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.SUSPENDED] =
["VM.delete", "VM.resume", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.stop", "VM.shutdown_hard"];
["VM.resume", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.stop", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.DONE] =
[];
STATE_ACTIONS[OpenNebulaVM.STATES.FAILED] =
["VM.delete", "VM.delete_recreate", "VM.resize"];
[];
STATE_ACTIONS[OpenNebulaVM.STATES.POWEROFF] =
["VM.delete", "VM.resume", "VM.resize", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.migrate", "VM.undeploy", "VM.undeploy_hard", "VM.shutdown_hard", "VM.saveas_template", "VM.updateconf"];
["VM.resume", "VM.resize", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_revert", "VM.disk_snapshot_delete", "VM.migrate", "VM.undeploy", "VM.undeploy_hard", "VM.save_as_template", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.UNDEPLOYED] =
["VM.delete", "VM.delete_recreate", "VM.resume", "VM.resize", "VM.deploy", "VM.updateconf"];
["VM.resume", "VM.resize", "VM.deploy", "VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.CLONING] =
["VM.delete", "VM.delete_recreate", "VM.updateconf"];
["VM.updateconf", "VM.terminate_hard", "VM.recover"];
STATE_ACTIONS[OpenNebulaVM.STATES.CLONING_FAILURE] =
["VM.delete", "VM.delete_recreate", "VM.recover", "VM.updateconf"];
["VM.updateconf", "VM.terminate_hard", "VM.recover"];
var LCM_STATE_ACTIONS = {};
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.LCM_INIT ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.PROLOG ] = ["VM.updateconf"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.BOOT ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.RUNNING ] =
["VM.shutdown", "VM.shutdown_hard", "VM.stop", "VM.suspend", "VM.reboot", "VM.reboot_hard", "VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_delete"];
["VM.stop", "VM.suspend", "VM.reboot", "VM.reboot_hard", "VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.attachdisk", "VM.detachdisk", "VM.attachnic", "VM.detachnic", "VM.disk_saveas", "VM.disk_snapshot_create", "VM.disk_snapshot_delete", "VM.terminate", "VM.terminate_hard"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.MIGRATE ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.SAVE_STOP ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.SAVE_SUSPEND ] = [];
@ -74,7 +74,7 @@ define(function(require) {
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.FAILURE ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.CLEANUP_RESUBMIT ] = ["VM.updateconf"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.UNKNOWN ] =
["VM.shutdown", "VM.shutdown_hard", "VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.resume"];
["VM.resched", "VM.unresched", "VM.poweroff", "VM.poweroff_hard", "VM.undeploy", "VM.undeploy_hard", "VM.migrate", "VM.migrate_live", "VM.resume", "VM.terminate", "VM.terminate_hard"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.HOTPLUG ] = [];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.SHUTDOWN_POWEROFF ] = ["VM.updateconf"];
LCM_STATE_ACTIONS[ OpenNebulaVM.LCM_STATES.BOOT_UNKNOWN ] = [];

View File

@ -119,7 +119,7 @@ define(function(require) {
tip = this.button.tip
}
$('#confirm_with_select_tip', dialog).text(tip);
$('#confirm_with_select_tip', dialog).html(tip);
var action = Sunstone.getAction(this.actionId);
var elements = action.elements();