mirror of
https://github.com/OpenNebula/one.git
synced 2025-03-22 18:50:08 +03:00
Merge remote-tracking branch 'origin/feature-2977'
This commit is contained in:
commit
d487ebbe9e
@ -8,12 +8,43 @@ features:
|
||||
tabs:
|
||||
provision-tab:
|
||||
panel_tabs:
|
||||
vm_info_tab: false
|
||||
vm_capacity_tab: false
|
||||
vm_hotplugging_tab: false
|
||||
vm_network_tab: false
|
||||
vm_snapshot_tab: false
|
||||
vm_placement_tab: false
|
||||
vm_actions_tab: false
|
||||
vm_template_tab: false
|
||||
vm_log_tab: false
|
||||
provision_tabs:
|
||||
users: false
|
||||
flows: true
|
||||
templates: true
|
||||
actions:
|
||||
actions: &provisionactions
|
||||
Template.chmod: false
|
||||
Template.delete: true
|
||||
VM.resume: true
|
||||
VM.reboot: true
|
||||
VM.reboot_hard: true
|
||||
VM.poweroff: true
|
||||
VM.poweroff_hard: true
|
||||
VM.undeploy: false
|
||||
VM.undeploy_hard: false
|
||||
VM.shutdown_hard: true
|
||||
VM.delete: true
|
||||
VM.resize: false
|
||||
VM.attachdisk: false
|
||||
VM.detachdisk: false
|
||||
VM.disk_saveas: false
|
||||
VM.attachnic: false
|
||||
VM.detachnic: false
|
||||
VM.snapshot_create: false
|
||||
VM.snapshot_revert: false
|
||||
VM.snapshot_delete: false
|
||||
VM.disk_snapshot_create: false
|
||||
VM.disk_snapshot_revert: false
|
||||
VM.disk_snapshot_delete: false
|
||||
dashboard:
|
||||
quotas: true
|
||||
vms: true
|
||||
@ -33,3 +64,32 @@ tabs:
|
||||
user_showback_tab: true
|
||||
actions:
|
||||
User.quotas_dialog: false
|
||||
vms-tab:
|
||||
actions: *provisionactions
|
||||
images-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Datastore
|
||||
#- 6 # Size
|
||||
- 7 # Type
|
||||
#- 8 # Registration time
|
||||
#- 9 # Persistent
|
||||
- 10 # Status
|
||||
- 11 # #VMs
|
||||
#- 12 # Target
|
||||
vnets-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Reservation
|
||||
- 6 # Cluster
|
||||
#- 7 # Bridge
|
||||
- 8 # Leases
|
||||
#- 9 # VLAN ID
|
||||
|
@ -8,12 +8,43 @@ features:
|
||||
tabs:
|
||||
provision-tab:
|
||||
panel_tabs:
|
||||
vm_info_tab: false
|
||||
vm_capacity_tab: false
|
||||
vm_hotplugging_tab: false
|
||||
vm_network_tab: false
|
||||
vm_snapshot_tab: false
|
||||
vm_placement_tab: false
|
||||
vm_actions_tab: false
|
||||
vm_template_tab: false
|
||||
vm_log_tab: false
|
||||
provision_tabs:
|
||||
users: false
|
||||
flows: true
|
||||
templates: false
|
||||
actions:
|
||||
actions: &provisionactions
|
||||
Template.chmod: false
|
||||
Template.delete: true
|
||||
VM.resume: true
|
||||
VM.reboot: true
|
||||
VM.reboot_hard: true
|
||||
VM.poweroff: true
|
||||
VM.poweroff_hard: true
|
||||
VM.undeploy: false
|
||||
VM.undeploy_hard: false
|
||||
VM.shutdown_hard: true
|
||||
VM.delete: true
|
||||
VM.resize: false
|
||||
VM.attachdisk: false
|
||||
VM.detachdisk: false
|
||||
VM.disk_saveas: false
|
||||
VM.attachnic: false
|
||||
VM.detachnic: false
|
||||
VM.snapshot_create: false
|
||||
VM.snapshot_revert: false
|
||||
VM.snapshot_delete: false
|
||||
VM.disk_snapshot_create: false
|
||||
VM.disk_snapshot_revert: false
|
||||
VM.disk_snapshot_delete: false
|
||||
dashboard:
|
||||
quotas: true
|
||||
vms: true
|
||||
@ -31,4 +62,33 @@ tabs:
|
||||
user_accounting_tab: true
|
||||
user_showback_tab: true
|
||||
actions:
|
||||
User.quotas_dialog: false
|
||||
User.quotas_dialog: false
|
||||
vms-tab:
|
||||
actions: *provisionactions
|
||||
images-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Datastore
|
||||
#- 6 # Size
|
||||
- 7 # Type
|
||||
#- 8 # Registration time
|
||||
#- 9 # Persistent
|
||||
- 10 # Status
|
||||
- 11 # #VMs
|
||||
#- 12 # Target
|
||||
vnets-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Reservation
|
||||
- 6 # Cluster
|
||||
#- 7 # Bridge
|
||||
- 8 # Leases
|
||||
#- 9 # VLAN ID
|
||||
|
@ -8,12 +8,43 @@ features:
|
||||
tabs:
|
||||
provision-tab:
|
||||
panel_tabs:
|
||||
vm_info_tab: false
|
||||
vm_capacity_tab: false
|
||||
vm_hotplugging_tab: false
|
||||
vm_network_tab: false
|
||||
vm_snapshot_tab: false
|
||||
vm_placement_tab: false
|
||||
vm_actions_tab: false
|
||||
vm_template_tab: false
|
||||
vm_log_tab: false
|
||||
provision_tabs:
|
||||
users: true
|
||||
flows: true
|
||||
templates: true
|
||||
actions:
|
||||
actions: &provisionactions
|
||||
Template.chmod: true
|
||||
Template.delete: true
|
||||
VM.resume: true
|
||||
VM.reboot: true
|
||||
VM.reboot_hard: true
|
||||
VM.poweroff: true
|
||||
VM.poweroff_hard: true
|
||||
VM.undeploy: false
|
||||
VM.undeploy_hard: false
|
||||
VM.shutdown_hard: true
|
||||
VM.delete: true
|
||||
VM.resize: false
|
||||
VM.attachdisk: false
|
||||
VM.detachdisk: false
|
||||
VM.disk_saveas: false
|
||||
VM.attachnic: false
|
||||
VM.detachnic: false
|
||||
VM.snapshot_create: false
|
||||
VM.snapshot_revert: false
|
||||
VM.snapshot_delete: false
|
||||
VM.disk_snapshot_create: false
|
||||
VM.disk_snapshot_revert: false
|
||||
VM.disk_snapshot_delete: false
|
||||
dashboard:
|
||||
quotas: false
|
||||
vms: false
|
||||
@ -33,3 +64,33 @@ tabs:
|
||||
user_showback_tab: true
|
||||
actions:
|
||||
User.quotas_dialog: false
|
||||
vms-tab:
|
||||
actions: *provisionactions
|
||||
images-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Datastore
|
||||
#- 6 # Size
|
||||
- 7 # Type
|
||||
#- 8 # Registration time
|
||||
#- 9 # Persistent
|
||||
- 10 # Status
|
||||
- 11 # #VMs
|
||||
#- 12 # Target
|
||||
vnets-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Reservation
|
||||
- 6 # Cluster
|
||||
#- 7 # Bridge
|
||||
- 8 # Leases
|
||||
#- 9 # VLAN ID
|
||||
|
||||
|
@ -8,12 +8,43 @@ features:
|
||||
tabs:
|
||||
provision-tab:
|
||||
panel_tabs:
|
||||
vm_info_tab: false
|
||||
vm_capacity_tab: false
|
||||
vm_hotplugging_tab: false
|
||||
vm_network_tab: false
|
||||
vm_snapshot_tab: false
|
||||
vm_placement_tab: false
|
||||
vm_actions_tab: false
|
||||
vm_template_tab: false
|
||||
vm_log_tab: false
|
||||
provision_tabs:
|
||||
users: true
|
||||
flows: true
|
||||
templates: false
|
||||
actions:
|
||||
Template.chmod: true
|
||||
actions: &provisionactions
|
||||
Template.chmod: false
|
||||
Template.delete: true
|
||||
VM.resume: true
|
||||
VM.reboot: true
|
||||
VM.reboot_hard: true
|
||||
VM.poweroff: true
|
||||
VM.poweroff_hard: true
|
||||
VM.undeploy: false
|
||||
VM.undeploy_hard: false
|
||||
VM.shutdown_hard: true
|
||||
VM.delete: true
|
||||
VM.resize: false
|
||||
VM.attachdisk: false
|
||||
VM.detachdisk: false
|
||||
VM.disk_saveas: false
|
||||
VM.attachnic: false
|
||||
VM.detachnic: false
|
||||
VM.snapshot_create: false
|
||||
VM.snapshot_revert: false
|
||||
VM.snapshot_delete: false
|
||||
VM.disk_snapshot_create: false
|
||||
VM.disk_snapshot_revert: false
|
||||
VM.disk_snapshot_delete: false
|
||||
dashboard:
|
||||
quotas: false
|
||||
vms: false
|
||||
@ -32,3 +63,33 @@ tabs:
|
||||
user_showback_tab: true
|
||||
actions:
|
||||
User.quotas_dialog: false
|
||||
vms-tab:
|
||||
actions: *provisionactions
|
||||
images-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Datastore
|
||||
#- 6 # Size
|
||||
- 7 # Type
|
||||
#- 8 # Registration time
|
||||
#- 9 # Persistent
|
||||
- 10 # Status
|
||||
- 11 # #VMs
|
||||
#- 12 # Target
|
||||
vnets-tab:
|
||||
table_columns:
|
||||
- 0 # Checkbox
|
||||
- 1 # ID
|
||||
- 2 # Owner
|
||||
- 3 # Group
|
||||
- 4 # Name
|
||||
- 5 # Reservation
|
||||
- 6 # Cluster
|
||||
#- 7 # Bridge
|
||||
- 8 # Leases
|
||||
#- 9 # VLAN ID
|
||||
|
||||
|
@ -50,6 +50,15 @@ define(function(require) {
|
||||
}
|
||||
},
|
||||
|
||||
"isProvisionTabEnabled": function(tabName, panelTabName) {
|
||||
if (_config['view']['tabs'][tabName]) {
|
||||
var enabled = _config['view']['tabs'][tabName]['provision_tabs'][panelTabName];
|
||||
return enabled;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
},
|
||||
|
||||
"isFeatureEnabled": function(featureName) {
|
||||
if (_config['view']['features'] && _config['view']['features'][featureName]) {
|
||||
return true;
|
||||
|
@ -841,7 +841,7 @@ define(function(require) {
|
||||
provision_vdc_templates_datatable.fnFilter("^(?!\-$)", 2, true, false);
|
||||
provision_vdc_templates_datatable.fnFilter("^1$", 3, true, false);
|
||||
|
||||
if (Config.isTabPanelEnabled("provision-tab", "templates")) {
|
||||
if (Config.isProvisionTabEnabled("provision-tab", "templates")) {
|
||||
ProvisionTemplatesList.updateDatatable(provision_saved_templates_datatable);
|
||||
provision_saved_templates_datatable.fnFilter("^(?!\-$)", 2, true, false);
|
||||
provision_saved_templates_datatable.fnFilter("^0$", 3, true, false);
|
||||
@ -969,12 +969,43 @@ define(function(require) {
|
||||
$(".alert-box-error", context).html("");
|
||||
}
|
||||
|
||||
var _panels = [
|
||||
require('./vms-tab/panels/info'),
|
||||
require('./vms-tab/panels/capacity'),
|
||||
require('./vms-tab/panels/storage'),
|
||||
require('./vms-tab/panels/network'),
|
||||
require('./vms-tab/panels/snapshots'),
|
||||
require('./vms-tab/panels/placement'),
|
||||
require('./vms-tab/panels/actions'),
|
||||
require('./vms-tab/panels/template'),
|
||||
require('./vms-tab/panels/log')
|
||||
];
|
||||
|
||||
|
||||
var _dialogs = [
|
||||
//require('./vms-tab/dialogs/deploy'),
|
||||
//require('./vms-tab/dialogs/migrate'),
|
||||
require('./vms-tab/dialogs/resize'),
|
||||
require('./vms-tab/dialogs/attach-disk'),
|
||||
require('./vms-tab/dialogs/disk-snapshot'),
|
||||
require('./vms-tab/dialogs/disk-saveas'),
|
||||
require('./vms-tab/dialogs/attach-nic'),
|
||||
require('./vms-tab/dialogs/snapshot'),
|
||||
//require('./vms-tab/dialogs/vnc'),
|
||||
//require('./vms-tab/dialogs/spice'),
|
||||
//require('./vms-tab/dialogs/saveas-template')
|
||||
];
|
||||
|
||||
var Actions = require('./vms-tab/actions');
|
||||
|
||||
var Tab = {
|
||||
tabId: TAB_ID,
|
||||
list_header: "",
|
||||
actions: povision_actions,
|
||||
actions: $.extend(povision_actions, Actions),
|
||||
content: TemplateContent(),
|
||||
setup: _setup
|
||||
setup: _setup,
|
||||
panels: _panels,
|
||||
dialogs: _dialogs
|
||||
};
|
||||
|
||||
return Tab;
|
||||
@ -993,7 +1024,7 @@ define(function(require) {
|
||||
|
||||
ProvisionVmsList.generate($(".provision_vms_list_section"), {active: true});
|
||||
|
||||
if (Config.isTabPanelEnabled("provision-tab", "templates")) {
|
||||
if (Config.isProvisionTabEnabled("provision-tab", "templates")) {
|
||||
ProvisionTemplatesList.generate($(".provision_templates_list_section"), {active: true});
|
||||
}
|
||||
|
||||
|
@ -20,17 +20,17 @@
|
||||
{{> tabs/provision-tab/vms/create}}
|
||||
<div class="provision_vms_list_section hidden section_content"></div>
|
||||
|
||||
{{#isTabPanelEnabled "provision-tab" "templates"}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "templates"}}
|
||||
<div class="provision_templates_list_section hidden section_content"></div>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
|
||||
{{#isTabPanelEnabled "provision-tab" "users"}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "users"}}
|
||||
{{> tabs/provision-tab/group/info}}
|
||||
{{> tabs/provision-tab/users/create}}
|
||||
<div class="provision_users_list_section hidden section_content"></div>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
|
||||
{{#isTabPanelEnabled "provision-tab" "flows"}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "flows"}}
|
||||
{{> tabs/provision-tab/flows/create}}
|
||||
<div class="provision_flows_list_section hidden section_content"></div>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
|
@ -18,7 +18,7 @@
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<ul class="inline-list provision-header text-center">
|
||||
{{#isTabPanelEnabled "provision-tab" "users"}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "users"}}
|
||||
<li>
|
||||
<a href"#" class="medium off-color" id="provision_vdc_info_button">
|
||||
<i class="fa fa-fw fa-lg fa-bar-chart-o"/>
|
||||
@ -31,29 +31,29 @@
|
||||
{{tr "Users"}}
|
||||
</a>
|
||||
</li>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
<li>
|
||||
<a href"#" class="medium off-color provision_vms_list_button" id="">
|
||||
<i class="fa fa-fw fa-lg fa-th"/>
|
||||
{{tr "VMs"}}
|
||||
</a>
|
||||
</li>
|
||||
{{#isTabPanelEnabled "provision-tab" "templates"}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "templates"}}
|
||||
<li>
|
||||
<a href"#" class="medium off-color provision_templates_list_button">
|
||||
<i class="fa fa-fw fa-lg fa-save"/>
|
||||
{{tr "Templates"}}
|
||||
</a>
|
||||
</li>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{#isTabPanelEnabled "provision-tab" "flows"}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "flows"}}
|
||||
<li>
|
||||
<a href"#" class="medium off-color provision_flows_list_button" id="">
|
||||
<i class="fa fa-lg fa-fw fa-cubes"/>
|
||||
{{tr "Services"}}
|
||||
</a>
|
||||
</li>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
{{!
|
||||
<li style="border-left: 1px solid #efefef; height: 40px"></li>
|
||||
<li>
|
||||
|
@ -30,31 +30,46 @@
|
||||
<i class="fa fa-fw fa-lg fa-desktop"/></a>
|
||||
<a title="{{tr "You have to boot the Virtual Machine first"}}" class="left button small radius white provision_vnc_button_disabled tip-top" style="color: #999">
|
||||
<i class="fa fa-fw fa-lg fa-desktop"/></a>
|
||||
{{#isTabPanelEnabled "provision-tab" "templates"}}
|
||||
{{#isProvisionTabEnabled "provision-tab" "templates"}}
|
||||
<a href"#" title="{{tr "The main disk of the Virtual Machine will be saved in a new Image"}}" class="left button small radius success provision_snapshot_button tip-top">
|
||||
<i class="fa fa-fw fa-lg fa-save"/>
|
||||
</a>
|
||||
<a title="{{tr "You have to power-off the virtual machine first"}}" class="left button small radius white provision_snapshot_button_disabled tip-top" style="color: #999">
|
||||
<i class="fa fa-fw fa-lg fa-save"/>
|
||||
</a>
|
||||
{{/isTabPanelEnabled}}
|
||||
{{/isProvisionTabEnabled}}
|
||||
</li>
|
||||
<li class="right">
|
||||
{{#isTabActionEnabled "provision-tab" "VM.delete"}}
|
||||
<a href"#" title="{{tr "Delete"}}" class="button small radius alert provision_delete_confirm_button tip-top right">
|
||||
<i class="fa fa-fw fa-lg fa-trash-o"/>
|
||||
</a>
|
||||
{{/isTabActionEnabled}}
|
||||
{{#isTabActionEnabled "provision-tab" "VM.shutdown_hard"}}
|
||||
<a href"#" title="{{tr "Delete"}}" class="button small radius alert provision_shutdownhard_confirm_button tip-top right">
|
||||
<i class="fa fa-fw fa-lg fa-trash-o"/>
|
||||
</a>
|
||||
{{/isTabActionEnabled}}
|
||||
{{#isTabActionEnabled "provision-tab" "VM.poweroff"}}
|
||||
<a href"#" title="{{tr "Power off"}}" class="button small radius secondary provision_poweroff_confirm_button tip-top right">
|
||||
<i class="fa fa-fw fa-lg fa-power-off"/>
|
||||
</a>
|
||||
{{/isTabActionEnabled}}
|
||||
{{#isTabActionEnabled "provision-tab" "VM.undeploy"}}
|
||||
<a href"#" title="{{tr "Power off"}}" class="button small radius secondary provision_undeploy_confirm_button tip-top right">
|
||||
<i class="fa fa-fw fa-lg fa-power-off"/>
|
||||
</a>
|
||||
{{/isTabActionEnabled}}
|
||||
{{#isTabActionEnabled "provision-tab" "VM.resume"}}
|
||||
<a href"#" title="{{tr "Power on"}}" class="button small radius secondary provision_poweron_button tip-top right">
|
||||
<i class="fa fa-fw fa-lg fa-play"/>
|
||||
</a>
|
||||
{{/isTabActionEnabled}}
|
||||
{{#isTabActionEnabled "provision-tab" "VM.reboot"}}
|
||||
<a href"#" title="{{tr "Reboot"}}" class="button small radius secondary provision_reboot_confirm_button tip-top right">
|
||||
<i class="fa fa-fw fa-lg fa-repeat"/>
|
||||
</a>
|
||||
{{/isTabActionEnabled}}
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
@ -78,7 +93,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_cpu_graph" style="height: 100px;"></div>
|
||||
<div class="large-12 columns centered graph vm_cpu_provision_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
@ -95,7 +110,7 @@
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_memory_graph" style="height: 100px;"></div>
|
||||
<div class="large-12 columns centered graph vm_memory_provision_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
@ -107,75 +122,80 @@
|
||||
<div class="large-12 columns">
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net RX"}}</small>
|
||||
</h4>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net RX"}}</small>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_rx_provision_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_rx_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_rx_graph" style="height: 100px;"></div>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net TX"}}</small>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_tx_provision_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_tx_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_rx_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net TX"}}</small>
|
||||
</h4>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net Download Speed"}}</small>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_rx_speed_provision_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_rx_speed_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_tx_graph" style="height: 100px;"></div>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net Upload Speed"}}</small>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_tx_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net Download Speed"}}</small>
|
||||
</h4>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_tx_speed_provision_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_rx_speed_graph" style="height: 100px;"></div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_tx_speed_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_rx_speed_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="large-3 medium-6 columns">
|
||||
<div class="row text-center">
|
||||
<div class="large-12 columns">
|
||||
<h4 class="subheader" style="margin: 0px">
|
||||
<small>{{tr "Net Upload Speed"}}</small>
|
||||
</h4>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="large-12 columns">
|
||||
<div class="large-12 columns centered graph vm_net_tx_speed_graph" style="height: 100px;"></div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row graph_legend">
|
||||
<div class="large-12 columns centered vm_net_tx_speed_legend"></div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br>
|
||||
<br></div>
|
||||
<br>
|
||||
<div class="row">
|
||||
<div class="large-12 columns provision-right-info"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
@ -16,6 +16,7 @@
|
||||
|
||||
define(function(require) {
|
||||
require('foundation.alert');
|
||||
var Sunstone = require('sunstone');
|
||||
var OpenNebula = require('opennebula');
|
||||
var OpenNebulaVM = require('opennebula/vm');
|
||||
var Locale = require('utils/locale');
|
||||
@ -27,6 +28,7 @@ define(function(require) {
|
||||
|
||||
var TemplateVmsList = require('hbs!./list');
|
||||
|
||||
var TAB_ID = require('../tabId');
|
||||
var _accordionId = 0;
|
||||
|
||||
return {
|
||||
@ -247,6 +249,9 @@ define(function(require) {
|
||||
},
|
||||
error: Notifier.onError,
|
||||
success: function(request, response){
|
||||
$(".provision-right-info").html("");
|
||||
Sunstone.insertPanels(TAB_ID, response, TAB_ID, $(".provision-right-info", context));
|
||||
|
||||
var data = response.VM
|
||||
var state = get_provision_vm_state(data);
|
||||
|
||||
@ -254,6 +259,7 @@ define(function(require) {
|
||||
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();
|
||||
@ -265,6 +271,7 @@ define(function(require) {
|
||||
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();
|
||||
@ -276,18 +283,32 @@ define(function(require) {
|
||||
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).show();
|
||||
$(".provision_shutdownhard_confirm_button", context).hide();
|
||||
$(".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();
|
||||
@ -300,6 +321,7 @@ define(function(require) {
|
||||
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();
|
||||
@ -392,27 +414,27 @@ define(function(require) {
|
||||
monitor_resources : "MONITORING/CPU",
|
||||
labels : "Real CPU",
|
||||
humanize_figures : false,
|
||||
div_graph : $(".vm_cpu_graph", context)
|
||||
div_graph : $(".vm_cpu_provision_graph", context)
|
||||
},
|
||||
{
|
||||
monitor_resources : "MONITORING/MEMORY",
|
||||
labels : "Real MEM",
|
||||
humanize_figures : true,
|
||||
div_graph : $(".vm_memory_graph", context)
|
||||
div_graph : $(".vm_memory_provision_graph", context)
|
||||
},
|
||||
{
|
||||
labels : "Network reception",
|
||||
monitor_resources : "MONITORING/NETRX",
|
||||
humanize_figures : true,
|
||||
convert_from_bytes : true,
|
||||
div_graph : $(".vm_net_rx_graph", context)
|
||||
div_graph : $(".vm_net_rx_provision_graph", context)
|
||||
},
|
||||
{
|
||||
labels : "Network transmission",
|
||||
monitor_resources : "MONITORING/NETTX",
|
||||
humanize_figures : true,
|
||||
convert_from_bytes : true,
|
||||
div_graph : $(".vm_net_tx_graph", context)
|
||||
div_graph : $(".vm_net_tx_provision_graph", context)
|
||||
},
|
||||
{
|
||||
labels : "Network reception speed",
|
||||
@ -421,7 +443,7 @@ define(function(require) {
|
||||
convert_from_bytes : true,
|
||||
y_sufix : "B/s",
|
||||
derivative : true,
|
||||
div_graph : $(".vm_net_rx_speed_graph", context)
|
||||
div_graph : $(".vm_net_rx_speed_provision_graph", context)
|
||||
},
|
||||
{
|
||||
labels : "Network transmission speed",
|
||||
@ -430,7 +452,7 @@ define(function(require) {
|
||||
convert_from_bytes : true,
|
||||
y_sufix : "B/s",
|
||||
derivative : true,
|
||||
div_graph : $(".vm_net_tx_speed_graph", context)
|
||||
div_graph : $(".vm_net_tx_speed_provision_graph", context)
|
||||
}
|
||||
];
|
||||
|
||||
@ -446,7 +468,7 @@ define(function(require) {
|
||||
})
|
||||
}
|
||||
|
||||
if (Config.isTabPanelEnabled("provision-tab", "templates")) {
|
||||
if (Config.isProvisionTabEnabled("provision-tab", "templates")) {
|
||||
context.on("click", ".provision_snapshot_button", function(){
|
||||
$(".provision_confirm_action:first", context).html(
|
||||
'<div data-alert class="alert-box secondary radius">'+
|
||||
@ -582,6 +604,37 @@ define(function(require) {
|
||||
'</div>');
|
||||
});
|
||||
|
||||
context.on("click", ".provision_undeploy_confirm_button", function(){
|
||||
$(".provision_confirm_action:first", context).html(
|
||||
'<div data-alert class="alert-box secondary radius">'+
|
||||
'<div class="row">'+
|
||||
'<div class="large-11 columns">'+
|
||||
'<span style="font-size: 14px; line-height: 20px">'+
|
||||
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">'+
|
||||
'<a href"#" class="provision_undeploy_button button radius right" style="margin-right: 15px">'+Locale.tr("Power off and undeploy")+'</a>'+
|
||||
'<label class="left" style="margin-left: 25px">'+
|
||||
'<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>'+
|
||||
'<label class="left" style="margin-left: 25px">'+
|
||||
'<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>'+
|
||||
'</div>'+
|
||||
'</div>'+
|
||||
'<a href="#" class="close" style="top: 20px">×</a>'+
|
||||
'</div>');
|
||||
});
|
||||
|
||||
context.on("click", ".provision_reboot_confirm_button", function(){
|
||||
$(".provision_confirm_action:first", context).html(
|
||||
'<div data-alert class="alert-box secondary radius">'+
|
||||
@ -682,6 +735,29 @@ define(function(require) {
|
||||
return false;
|
||||
});
|
||||
|
||||
context.on("click", ".provision_undeploy_button", function(){
|
||||
var button = $(this);
|
||||
button.attr("disabled", "disabled");
|
||||
var vm_id = $(".provision_info_vm", context).attr("vm_id");
|
||||
var undeploy_action = $('input[name=provision_undeploy_radio]:checked').val()
|
||||
|
||||
OpenNebula.VM[undeploy_action]({
|
||||
data : {
|
||||
id: vm_id
|
||||
},
|
||||
success: function(request, response){
|
||||
update_provision_vm_info(vm_id, context);
|
||||
button.removeAttr("disabled");
|
||||
},
|
||||
error: function(request, response){
|
||||
Notifier.onError(request, response);
|
||||
button.removeAttr("disabled");
|
||||
}
|
||||
})
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
context.on("click", ".provision_reboot_button", function(){
|
||||
var button = $(this);
|
||||
button.attr("disabled", "disabled");
|
||||
@ -933,11 +1009,15 @@ define(function(require) {
|
||||
case OpenNebulaVM.STATES.STOPPED:
|
||||
case OpenNebulaVM.STATES.SUSPENDED:
|
||||
case OpenNebulaVM.STATES.POWEROFF:
|
||||
case OpenNebulaVM.STATES.UNDEPLOYED:
|
||||
case OpenNebulaVM.STATES.DONE:
|
||||
state_color = 'off';
|
||||
state_str = Locale.tr("OFF");
|
||||
|
||||
break;
|
||||
case OpenNebulaVM.STATES.UNDEPLOYED:
|
||||
state_color = 'undeployed';
|
||||
state_str = Locale.tr("UNDEPLOYED");
|
||||
|
||||
break;
|
||||
default:
|
||||
state_color = 'powering_off';
|
||||
|
@ -15,6 +15,7 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require) {
|
||||
var Config = require('sunstone-config');
|
||||
var Sunstone = require('sunstone');
|
||||
var Notifier = require('utils/notifier');
|
||||
var Locale = require('utils/locale');
|
||||
@ -38,7 +39,21 @@ define(function(require) {
|
||||
|
||||
var _actions = {
|
||||
"VM.list": _commonActions.list(),
|
||||
"VM.show": _commonActions.show(),
|
||||
"VM.show": {
|
||||
type: "single",
|
||||
call: OpenNebulaVM.show,
|
||||
callback: function(request, response) {
|
||||
if (Config.isTabEnabled("provision-tab")) {
|
||||
$(".provision_refresh_info", ".provision_list_vms").click();
|
||||
} else {
|
||||
Sunstone.getDataTable(TAB_ID).updateElement(request, response);
|
||||
if (Sunstone.rightInfoVisible($('#' + TAB_ID))) {
|
||||
Sunstone.insertPanels(TAB_ID, response);
|
||||
}
|
||||
}
|
||||
},
|
||||
error: Notifier.onError
|
||||
},
|
||||
"VM.refresh": _commonActions.refresh(),
|
||||
"VM.delete": _commonActions.del(),
|
||||
"VM.chown": _commonActions.multipleAction('chown'),
|
||||
|
@ -0,0 +1,32 @@
|
||||
/* -------------------------------------------------------------------------- */
|
||||
/* Copyright 2002-2015, OpenNebula Project (OpenNebula.org), C12G Labs */
|
||||
/* */
|
||||
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
|
||||
/* not use this file except in compliance with the License. You may obtain */
|
||||
/* a copy of the License at */
|
||||
/* */
|
||||
/* http://www.apache.org/licenses/LICENSE-2.0 */
|
||||
/* */
|
||||
/* Unless required by applicable law or agreed to in writing, software */
|
||||
/* distributed under the License is distributed on an "AS IS" BASIS, */
|
||||
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
|
||||
/* See the License for the specific language governing permissions and */
|
||||
/* limitations under the License. */
|
||||
/* -------------------------------------------------------------------------- */
|
||||
|
||||
define(function(require) {
|
||||
var Handlebars = require('hbs/handlebars');
|
||||
var Config = require('sunstone-config');
|
||||
|
||||
var isProvisionTabEnabled = function(tabName, panel, options) {
|
||||
if (Config.isProvisionTabEnabled(tabName, panel)) {
|
||||
return options.fn(this);
|
||||
} else {
|
||||
return options.inverse(this);
|
||||
}
|
||||
};
|
||||
|
||||
Handlebars.registerHelper('isProvisionTabEnabled', isProvisionTabEnabled);
|
||||
|
||||
return isProvisionTabEnabled;
|
||||
})
|
@ -393,7 +393,7 @@ define(function(require) {
|
||||
var row_id_index = this.dataTable.attr("row_id");
|
||||
|
||||
if (row_id_index != undefined) {
|
||||
$.each($(this.dataTable.fnGetNodes()), function() {
|
||||
$.each($(that.dataTable.fnGetNodes()), function() {
|
||||
if ($('td.markrow', this).length != 0) {
|
||||
var aData = that.dataTable.fnGetData(this);
|
||||
|
||||
@ -403,7 +403,7 @@ define(function(require) {
|
||||
});
|
||||
}
|
||||
|
||||
$.each($(this.dataTable.fnGetNodes()), function() {
|
||||
$.each($(that.dataTable.fnGetNodes()), function() {
|
||||
if ($('td.markrowchecked', this).length != 0) {
|
||||
if (!isNaN($($('td', $(this))[1]).html())) {
|
||||
checked_row_ids.push($($('td', $(this))[1]).html());
|
||||
@ -416,11 +416,11 @@ define(function(require) {
|
||||
// dataTable.fnSettings is undefined when the table has been detached from
|
||||
// the DOM
|
||||
|
||||
if (this.dataTable && this.dataTable.fnSettings()) {
|
||||
var dTable_settings = this.dataTable.fnSettings();
|
||||
if (that.dataTable && that.dataTable.fnSettings()) {
|
||||
var dTable_settings = that.dataTable.fnSettings();
|
||||
var prev_start = dTable_settings._iDisplayStart;
|
||||
|
||||
this.dataTable.fnClearTable(false);
|
||||
that.dataTable.fnClearTable(false);
|
||||
|
||||
var item_list;
|
||||
if (fromArray) {
|
||||
@ -435,7 +435,6 @@ define(function(require) {
|
||||
});
|
||||
}
|
||||
|
||||
var that = this;
|
||||
if (item_list.length > 0) {
|
||||
that.dataTable.fnAddData(item_list, false);
|
||||
}
|
||||
@ -451,11 +450,11 @@ define(function(require) {
|
||||
|
||||
dTable_settings.iInitDisplayStart = new_start;
|
||||
|
||||
this.dataTable.fnDraw(true);
|
||||
that.dataTable.fnDraw(true);
|
||||
};
|
||||
|
||||
if (selected_row_id != undefined) {
|
||||
$.each($(this.dataTable.fnGetNodes()), function() {
|
||||
$.each($(that.dataTable.fnGetNodes()), function() {
|
||||
|
||||
var aData = that.dataTable.fnGetData(this);
|
||||
|
||||
@ -466,7 +465,7 @@ define(function(require) {
|
||||
}
|
||||
|
||||
if (checked_row_ids.length != 0) {
|
||||
$.each($(this.dataTable.fnGetNodes()), function() {
|
||||
$.each($(that.dataTable.fnGetNodes()), function() {
|
||||
var current_id = $($('td', this)[1]).html();
|
||||
|
||||
if (isNaN(current_id)) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user