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

Merge branch 'master' of git.opennebula.org:one

Conflicts:
	src/sunstone/public/js/plugins/datastores-tab.js
This commit is contained in:
Carlos Martín 2013-07-12 18:32:29 +02:00
commit d6b66c2af8
33 changed files with 1910 additions and 717 deletions

View File

@ -1476,7 +1476,8 @@ SUNSTONE_ETC_FILES="src/sunstone/etc/sunstone-server.conf \
src/sunstone/etc/sunstone-oneflow.conf"
SUNSTONE_ETC_VIEW_FILES="src/sunstone/etc/sunstone-views/admin.yaml \
src/sunstone/etc/sunstone-views/user.yaml"
src/sunstone/etc/sunstone-views/user.yaml \
src/sunstone/etc/sunstone-views/cloud.yaml"
SUNSTONE_MODELS_FILES="src/sunstone/models/OpenNebulaJSON.rb \
src/sunstone/models/SunstoneServer.rb \

View File

@ -66,3 +66,6 @@ env.Man('onegroup')
env.Man('onezone')
env.Man('onevdc')
env.Man('oneflow')
env.Man('oneflow-template')

View File

@ -0,0 +1,90 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ONEFLOW\-TEMPLATE" "1" "July 2013" "" "oneflow-template(1) -- Manage oneFlow Templates"
.
.SH "NAME"
\fBoneflow\-template\fR
.
.SH "SYNOPSIS"
\fBoneflow\-template\fR \fIcommand\fR [\fIargs\fR] [\fIoptions\fR]
.
.SH "OPTIONS"
.
.nf
\-j, \-\-json Print the resource in JSON
\-t, \-\-top Top for the command
\-d, \-\-delay x Sets the delay in seconds for top command
\-s, \-\-server url Service endpoint
\-u, \-\-username name User name
\-p, \-\-password pass User password
\-V, \-\-version Show version and copyright information
\-h, \-\-help Show this message
.
.fi
.
.SH "COMMANDS"
.
.IP "\(bu" 4
list List the available Service Templates valid options: json
.
.IP "\(bu" 4
top List the available Service Templates continuously valid options: json, top, delay
.
.IP "\(bu" 4
create \fIfile\fR Create a new Service Template valid options: json
.
.IP "\(bu" 4
show \fItemplate_id\fR Show detailed information of a given Service Template valid options: json
.
.IP "\(bu" 4
delete \fIrange|templateid_list\fR Delete a given Service Template
.
.IP "\(bu" 4
instantiate \fItemplate_id\fR Instantiate a Service Template valid options: json, top
.
.IP "\(bu" 4
chgrp \fIrange|templateid_list\fR \fIgroupid\fR Changes the service template group
.
.IP "\(bu" 4
chown \fIrange|templateid_list\fR \fIuserid\fR [\fIgroupid\fR] Changes the service template owner and group
.
.IP "\(bu" 4
chmod \fIrange|templateid_list\fR \fIoctet\fR Changes the service template permissions
.
.IP "\(bu" 4
update \fItemplateid\fR [\fIfile\fR] Update the template contents\. If a path is not provided the editor will be launched to modify the current content\.
.
.IP "" 0
.
.SH "ARGUMENT FORMATS"
.
.IP "\(bu" 4
file Path to a file
.
.IP "\(bu" 4
range List of id\'s in the form 1,8\.\.15
.
.IP "\(bu" 4
text String
.
.IP "\(bu" 4
groupid OpenNebula GROUP name or id
.
.IP "\(bu" 4
userid OpenNebula USER name or id
.
.IP "\(bu" 4
template_id OpenNebula SERVICE TEMPLATE name or id
.
.IP "\(bu" 4
templateid_list Comma\-separated list of OpenNebula SERVICE TEMPLATE names or ids
.
.IP "" 0
.
.SH "LICENSE"
OpenNebula 4\.1\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs
.
.P
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

100
share/man/oneflow.1 Normal file
View File

@ -0,0 +1,100 @@
.\" generated with Ronn/v0.7.3
.\" http://github.com/rtomayko/ronn/tree/0.7.3
.
.TH "ONEFLOW" "1" "July 2013" "" "oneflow(1) -- Manage oneFlow Services"
.
.SH "NAME"
\fBoneflow\fR
.
.SH "SYNOPSIS"
\fBoneflow\fR \fIcommand\fR [\fIargs\fR] [\fIoptions\fR]
.
.SH "OPTIONS"
.
.nf
\-j, \-\-json Print the resource in JSON
\-t, \-\-top Top for the command
\-d, \-\-delay x Sets the delay in seconds for top command
\-f, \-\-force Force the new cardinality even if it is outside
the limits
\-p, \-\-period x Seconds between each group of actions
\-n, \-\-number x Number of VMs to apply the action to each period
\-s, \-\-server url Service endpoint
\-u, \-\-username name User name
\-p, \-\-password pass User password
\-V, \-\-version Show version and copyright information
\-h, \-\-help Show this message
.
.fi
.
.SH "COMMANDS"
.
.IP "\(bu" 4
list List the available services valid options: json
.
.IP "\(bu" 4
show \fIservice_id\fR Show detailed information of a given service valid options: json
.
.IP "\(bu" 4
top [\fIservice_id\fR] Top the services or the extended information of the target service if a id is specified valid options: json, top, delay
.
.IP "\(bu" 4
delete \fIrange|service_id_list\fR Delete a given service
.
.IP "\(bu" 4
shutdown \fIrange|service_id_list\fR Shutdown a service\. From RUNNING or WARNING shuts down the Service
.
.IP "\(bu" 4
recover \fIrange|service_id_list\fR Recover a failed service, cleaning the failed VMs\. From FAILED_DEPLOYING continues deploying the Service From FAILED_SCALING continues scaling the Service From FAILED_UNDEPLOYING continues shutting down the Service From COOLDOWN the Service is set to running ignoring the cooldown duration From WARNING failed VMs are deleted, and new VMs are instantiated
.
.IP "\(bu" 4
scale \fIservice_id\fR \fIrole_name\fR \fIcardinality\fR Scale a role to the given cardinality valid options: force
.
.IP "\(bu" 4
chgrp \fIrange|service_id_list\fR \fIgroupid\fR Changes the service group
.
.IP "\(bu" 4
chown \fIrange|service_id_list\fR \fIuserid\fR [\fIgroupid\fR] Changes the service owner and group
.
.IP "\(bu" 4
chmod \fIrange|service_id_list\fR \fIoctet\fR Changes the service permissions
.
.IP "\(bu" 4
action \fIservice_id\fR \fIrole_name\fR \fIvm_action\fR Perform an action on all the Virtual Machines of a given role\. Actions supported: shutdown,shutdown\-hard,undeploy,undeploy\-hard,hold,release,stop,suspend,resume,boot,delete,delete\-recreate,reboot,reboot\-hard,poweroff,poweroff\-hard,snapshot\-create valid options: period, number
.
.IP "" 0
.
.SH "ARGUMENT FORMATS"
.
.IP "\(bu" 4
file Path to a file
.
.IP "\(bu" 4
range List of id\'s in the form 1,8\.\.15
.
.IP "\(bu" 4
text String
.
.IP "\(bu" 4
groupid OpenNebula GROUP name or id
.
.IP "\(bu" 4
userid OpenNebula USER name or id
.
.IP "\(bu" 4
service_id OpenNebula SERVICE name or id
.
.IP "\(bu" 4
service_id_list Comma\-separated list of OpenNebula SERVICE names or ids
.
.IP "\(bu" 4
vm_action Actions supported: shutdown, shutdown\-hard, undeploy, undeploy\-hard, hold, release, stop, suspend, resume, boot, delete, delete\-recreate, reboot, reboot\-hard, poweroff, poweroff\-hard, snapshot\-create
.
.IP "" 0
.
.SH "LICENSE"
OpenNebula 4\.1\.0 Copyright 2002\-2013, OpenNebula Project (OpenNebula\.org), C12G Labs
.
.P
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

View File

@ -1,6 +1,6 @@
#!/bin/bash
#
# chkconfig: 2345 9 90
# chkconfig: 2345 9 99
# description: network reconfigure
#
# -------------------------------------------------------------------------- #
@ -21,12 +21,12 @@
### BEGIN INIT INFO
# Provides: vmcontext
# Required-Start:
# Required-Start: $all
# Required-Stop:
# Should-Start: networking
# Should-Stop: networking
# Default-Start:
# Default-Stop: 0 6
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: OpenNebula contextualization script
### END INIT INFO
@ -50,10 +50,8 @@ function execute_scripts {
done
}
CDROM_DEVICE=$(ls /dev/cdrom* /dev/scd* /dev/sr* | sort | head -n 1)
if [ -e "$CDROM_DEVICE" ]; then
mount -t iso9660 $CDROM_DEVICE /mnt
if [ -e "/dev/disk/by-label/CONTEXT" ]; then
mount -t iso9660 -L CONTEXT -o ro /mnt
if [ -f /mnt/context.sh ]; then
export_rc_vars /mnt/context.sh
fi

View File

@ -19,19 +19,13 @@
rm -f /etc/udev/rules.d/70-persistent-cd.rules
rm -f /etc/udev/rules.d/70-persistent-net.rules
RUNLEVEL=$(runlevel | cut -d' ' -f2)
(
cd /etc/rc${RUNLEVEL}.d
ln -sf ../init.d/vmcontext S99vmcontext
)
# Debian based distros
if [ -d /etc/network ]; then
cp /etc/network/interfaces /etc/network/interfaces.$(date "+%s")
# Register Service
update-rc.d vmcontext defaults 9 99
# Prepare network files
cp /etc/network/interfaces /etc/network/interfaces.$(date "+%s")
cat > /etc/network/interfaces <<EOT
# The loopback network interface
auto lo
@ -41,6 +35,10 @@ fi
# RedHat based distros
if [ -d /etc/sysconfig/network-scripts ]; then
# Register Service
chkconfig --add vmcontext
# Prepare network files
rm -f /etc/sysconfig/network-scripts/ifcfg-eth*
fi

View File

@ -1,6 +1,28 @@
---
logo: images/opennebula-sunstone-v4.0.png
available_tabs:
- dashboard-tab
- system-tab
- users-tab
- groups-tab
- acls-tab
- vresources-tab
- vms-tab
- templates-tab
- images-tab
- files-tab
- infra-tab
- clusters-tab
- hosts-tab
- datastores-tab
- vnets-tab
- marketplace-tab
- oneflow-dashboard
- oneflow-services
- oneflow-templates
users:
cloud:
- cloud
groups:
oneadmin:
- admin

View File

@ -1,24 +1,24 @@
small_logo: images/opennebula-sunstone-v4.0-small.png
enabled_tabs:
- dashboard-tab
- system-tab
- users-tab
- groups-tab
- acls-tab
- vresources-tab
- vms-tab
- templates-tab
- images-tab
- files-tab
- infra-tab
- clusters-tab
- hosts-tab
- datastores-tab
- vnets-tab
- marketplace-tab
#- oneflow-dashboard
#- oneflow-services
#- oneflow-templates
dashboard-tab: true
system-tab: true
users-tab: true
groups-tab: true
acls-tab: true
vresources-tab: true
vms-tab: true
templates-tab: true
images-tab: true
files-tab: true
infra-tab: true
clusters-tab: true
hosts-tab: true
datastores-tab: true
vnets-tab: true
marketplace-tab: true
oneflow-dashboard: false
oneflow-services: false
oneflow-templates: false
tabs:
dashboard-tab:
panel_tabs:
@ -116,6 +116,7 @@ tabs:
actions:
VM.refresh: true
VM.create_dialog: true
VM.easy_provision: false
VM.chown: true
VM.chgrp: true
VM.chmod: true
@ -163,6 +164,7 @@ tabs:
actions:
Template.refresh: true
Template.create_dialog: true
Template.easy_provision: false
Template.update_dialog: true
Template.instantiate_vms: true
Template.chown: true

View File

@ -0,0 +1,349 @@
small_logo: images/opennebula-sunstone-v4.0-small.png
enabled_tabs:
dashboard-tab: true
system-tab: false
users-tab: false
groups-tab: false
acls-tab: false
vresources-tab: false
vms-tab: true
templates-tab: false
images-tab: false
files-tab: false
infra-tab: false
clusters-tab: false
hosts-tab: false
datastores-tab: false
vnets-tab: false
marketplace-tab: false
oneflow-dashboard: false
oneflow-services: false
oneflow-templates: false
tabs:
dashboard-tab:
panel_tabs:
actions:
widgets_three_per_row:
#- users
widgets_two_per_row:
#- network
#- storage
#- hosts
#- vms
widgets_one_per_row:
- vms
system-tab:
panel_tabs:
actions:
users-tab:
panel_tabs:
user_info_panel: true
user_quotas_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Name
- 3 # Group
- 4 # Auth driver
- 5 # VMs
- 6 # Memory
- 7 # CPU
#- 8 # Group ID
actions:
User.refresh: true
User.create_dialog: true
User.update_password: true
User.quotas_dialog: true
User.chgrp: true
User.chauth: true
User.delete: true
groups-tab:
panel_tabs:
group_quotas_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Name
- 3 # Users
- 4 # VMs
- 5 # Memory
- 6 # CPU
actions:
Group.refresh: true
Group.create_dialog: true
Group.quotas_dialog: true
Group.delete: true
acls-tab:
panel_tabs:
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Applies to
- 3 # Affected resources
- 4 # Resource ID / Owned by
- 5 # Allowed operations
#- 6 # ACL String
actions:
Acl.refresh: true
Acl.create_dialog: true
Acl.delete: true
vresources-tab:
panel_tabs:
actions:
vms-tab:
panel_tabs:
vm_info_tab: true
vm_capacity_tab: true
vm_hotplugging_tab: true
vm_network_tab: true
vm_snapshot_tab: true
vm_placement_tab: false
vm_actions_tab: true
vm_template_tab: false
vm_log_tab: false
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Owner
- 3 # Group
- 4 # Name
- 5 # Status
#- 6 # Used CPU
#- 7 # Used Memory
- 8 # Host
- 9 # IPs
#- 10 # Start Time
- 11 # VNC
actions:
VM.refresh: true
VM.create_dialog: false
VM.easy_provision: true
VM.chown: false
VM.chgrp: false
VM.chmod: true
VM.deploy: false
VM.migrate: false
VM.migrate_live: false
VM.hold: true
VM.release: true
VM.suspend: true
VM.resume: true
VM.stop: true
VM.boot: true
VM.reboot: true
VM.reboot_hard: true
VM.poweroff: true
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.resize: true
VM.attachdisk: true
VM.detachdisk: true
VM.saveas: true
VM.attachnic: true
VM.detachnic: true
VM.snapshot_create: true
VM.snapshot_revert: true
VM.snapshot_delete: true
VM.resched: false
VM.unresched: false
templates-tab:
panel_tabs:
template_info_tab: true
template_template_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Owner
- 3 # Group
- 4 # Name
- 5 # Registration time
actions:
Template.refresh: true
Template.create_dialog: false
Template.easy_provision: true
Template.update_dialog: true
Template.instantiate_vms: true
Template.chown: false
Template.chgrp: false
Template.chmod: true
Template.clone_dialog: true
Template.delete: true
template_creation_tabs:
general: true
storage: true
network: true
os_booting: true
features: true
input_output: true
context: true
scheduling: false
images-tab:
panel_tabs:
image_info_panel: true
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
actions:
Image.refresh: true
Image.create_dialog: true
Image.chown: false
Image.chgrp: false
Image.chmod: true
Image.enable: true
Image.disable: true
Image.persistent: true
Image.nonpersistent: true
Image.clone_dialog: true
Image.delete: true
files-tab:
panel_tabs:
file_info_panel: true
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
actions:
File.refresh: true
File.create_dialog: true
File.chown: false
File.chgrp: false
File.chmod: true
File.enable: true
File.disable: true
File.delete: true
infra-tab:
panel_tabs:
actions:
clusters-tab:
panel_tabs:
cluster_info_tab: true
cluster_host_tab: true
cluster_vnet_tab: true
cluster_datastore_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Name
- 3 # Hosts
- 4 # VNets
- 5 # Datastores
actions:
Cluster.refresh: true
Cluster.create_dialog: true
Cluster.update_dialog: true
Cluster.delete: true
hosts-tab:
panel_tabs:
host_info_tab: true
host_monitoring_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Name
- 3 # Cluster
- 4 # RVMs
#- 5 # Real CPU
- 6 # Allocated CPU
#- 7 # Real MEM
- 8 # Allocated MEM
- 9 # Status
#- 10 # IM MAD
#- 11 # VM MAD
#- 12 # Last monitored on
actions:
Host.refresh: true
Host.create_dialog: true
Host.addtocluster: true
Host.enable: true
Host.disable: true
Host.delete: true
datastores-tab:
panel_tabs:
datastore_info_tab: false
datastore_image_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Owner
- 3 # Group
- 4 # Name
- 5 # Cluster
#- 6 # Basepath
#- 7 # TM
#- 8 # DS
#- 9 # Type
actions:
Datastore.refresh: true
Datastore.create_dialog: false
Datastore.addtocluster: false
Datastore.chown: false
Datastore.chgrp: false
Datastore.chmod: true
Datastore.delete: false
vnets-tab:
panel_tabs:
vnet_info_tab: false
vnet_leases_tab: true
table_columns:
- 0 # Checkbox
- 1 # ID
- 2 # Owner
- 3 # Group
- 4 # Name
- 5 # Cluster
- 6 # Type
#- 7 # Bridge
- 8 # Leases
actions:
Network.refresh: true
Network.create_dialog: false
Network.addtocluster: false
Network.chown: false
Network.chgrp: false
Network.chmod: true
Network.delete: false
Network.addleases: false
Network.hold_lease: false
Network.remove_lease: false
Network.release_lease: false
marketplace-tab:
panel_tabs:
marketplace_info_tab: true
table_columns:
- 0 # Checkbox
#- 1 # ID
- 2 # Name
- 3 # Publisher
- 4 # Hypervisor
- 5 # Arch
- 6 # Format
#- 7 # Tags
actions:
Marketplace.refresh: true
Marketplace.import: true

View File

@ -1,24 +1,24 @@
small_logo: images/opennebula-sunstone-v4.0-small.png
enabled_tabs:
- dashboard-tab
#- system-tab
#- users-tab
#- groups-tab
#- acls-tab
- vresources-tab
- vms-tab
- templates-tab
- images-tab
- files-tab
- infra-tab
#- clusters-tab
#- hosts-tab
- datastores-tab
- vnets-tab
- marketplace-tab
#- oneflow-dashboard
#- oneflow-services
#- oneflow-templates
dashboard-tab: true
system-tab: false
users-tab: false
groups-tab: false
acls-tab: false
vresources-tab: true
vms-tab: true
templates-tab: true
images-tab: true
files-tab: true
infra-tab: true
clusters-tab: false
hosts-tab: false
datastores-tab: true
vnets-tab: true
marketplace-tab: true
oneflow-dashboard: false
oneflow-services: false
oneflow-templates: false
tabs:
dashboard-tab:
panel_tabs:
@ -117,6 +117,7 @@ tabs:
actions:
VM.refresh: true
VM.create_dialog: true
VM.easy_provision: false
VM.chown: false
VM.chgrp: false
VM.chmod: true
@ -164,6 +165,7 @@ tabs:
actions:
Template.refresh: true
Template.create_dialog: true
Template.easy_provision: false
Template.update_dialog: true
Template.instantiate_vms: true
Template.chown: false

View File

@ -78,7 +78,12 @@ module OpenNebulaJSON
end
def instantiate(params=Hash.new)
super(params['vm_name'])
if params['template']
template = template_to_str(params['template'])
super(params['vm_name'], false, template)
else
super(params['vm_name'])
end
end
def clone(params=Hash.new)

View File

@ -56,6 +56,10 @@ class SunstoneViews
return available_views
end
def available_tabs
@views_config['available_tabs']
end
def logo
@views_config['logo']
end

View File

@ -6654,19 +6654,20 @@ ul.button-group {
/* line 611, ../sass/app.scss */
.value_td {
text-overflow: ellipsis;
word-break: break-all;
}
/* line 615, ../sass/app.scss */
/* line 616, ../sass/app.scss */
small {
color: #b6b6b6 !important;
}
/* line 619, ../sass/app.scss */
/* line 620, ../sass/app.scss */
.header-dashboard {
margin-top: -5px;
}
/* line 623, ../sass/app.scss */
/* line 624, ../sass/app.scss */
.span-dashboard {
background: #fcfcfc;
color: #6f6f6f;
@ -6674,43 +6675,43 @@ small {
box-shadow: 0 0 2px 0px #6f6f6f;
}
/* line 632, ../sass/app.scss */
/* line 633, ../sass/app.scss */
.button.dropdown.small::after {
border-color: #9f9f9f transparent transparent transparent;
border-width: 4px;
}
/* line 637, ../sass/app.scss */
/* line 638, ../sass/app.scss */
.footer-opennebula {
font-size: 10px;
color: #b6b6b6 !important;
}
/* line 642, ../sass/app.scss */
/* line 643, ../sass/app.scss */
a.footer.button {
margin: 5px;
}
/* line 647, ../sass/app.scss */
/* line 648, ../sass/app.scss */
.user-login {
float: right;
}
/* line 651, ../sass/app.scss */
/* line 652, ../sass/app.scss */
.user-login i.header-icon {
color: #6f6f6f;
font-weight: 300;
font-size: 23px;
}
/* line 657, ../sass/app.scss */
/* line 658, ../sass/app.scss */
.user-login .button {
color: #6f6f6f;
font-size: 60%;
line-height: 0;
}
/* line 663, ../sass/app.scss */
/* line 664, ../sass/app.scss */
.user-login .button.secondary {
background: #f2f2f2;
border: 0px;
@ -6718,100 +6719,100 @@ a.footer.button {
font-weight: 300;
}
/* line 671, ../sass/app.scss */
/* line 672, ../sass/app.scss */
.user-login .button.secondary:hover, .user-login .button.secondary:focus {
background-color: #d0d0d0;
color: #6f6f6f;
}
/* line 676, ../sass/app.scss */
/* line 677, ../sass/app.scss */
.user-login .button.dropdown.tiny::after {
border: solid 5px;
border-color: #b6b6b6 transparent transparent transparent;
right: 7px;
}
/* line 682, ../sass/app.scss */
/* line 683, ../sass/app.scss */
.header-resource {
text-align: center;
}
/* line 686, ../sass/app.scss */
/* line 687, ../sass/app.scss */
.header-resource {
float: left;
}
/* line 690, ../sass/app.scss */
/* line 691, ../sass/app.scss */
.header {
text-align: center;
}
/* line 694, ../sass/app.scss */
/* line 695, ../sass/app.scss */
.button.dropdown.tiny ul.no-hover.show-dropdown {
top: 34px !important;
}
/* line 698, ../sass/app.scss */
/* line 699, ../sass/app.scss */
.graph_legend {
text-align: center;
}
/* line 702, ../sass/app.scss */
/* line 703, ../sass/app.scss */
.graph_legend table {
background: inherit;
border: 0px;
width: 100%;
}
/* line 708, ../sass/app.scss */
/* line 709, ../sass/app.scss */
.graph_legend h3 {
margin-top: 0px;
}
/* line 712, ../sass/app.scss */
/* line 713, ../sass/app.scss */
.graph_legend .subheader {
margin-bottom: 5px;
}
/* line 716, ../sass/app.scss */
/* line 717, ../sass/app.scss */
.dashboard hr {
margin: 0;
margin-bottom: 8px;
}
/* line 721, ../sass/app.scss */
/* line 722, ../sass/app.scss */
.graph {
margin-bottom: 15px !important;
}
/* line 725, ../sass/app.scss */
/* line 726, ../sass/app.scss */
.dashboard-panel {
height: 450px;
}
/* line 729, ../sass/app.scss */
/* line 730, ../sass/app.scss */
.vm_log_error {
color: #ff8d81;
}
/* line 733, ../sass/app.scss */
/* line 734, ../sass/app.scss */
.noUiSlider {
margin: 10px;
}
/* line 737, ../sass/app.scss */
/* line 738, ../sass/app.scss */
.log-tab {
background: #6f6f6f;
color: #f2f2f2;
padding: 20px;
}
/* line 743, ../sass/app.scss */
/* line 744, ../sass/app.scss */
.reveal-modal ul.tabs-content {
margin: 0 0 0px;
}
/* line 747, ../sass/app.scss */
/* line 748, ../sass/app.scss */
.reveal-body {
height: 80%;
overflow-y: overlay;
@ -6819,28 +6820,28 @@ a.footer.button {
padding: 5px 20px;
}
/* line 754, ../sass/app.scss */
/* line 755, ../sass/app.scss */
.reveal-footer {
position: absolute;
bottom: 20px;
width: 90%;
}
/* line 760, ../sass/app.scss */
/* line 761, ../sass/app.scss */
.max-height {
max-height: 85%;
position: absolute;
height: 100%;
}
/* line 766, ../sass/app.scss */
/* line 767, ../sass/app.scss */
.ui-layout-content {
overflow-y: overlay;
overflow-x: hidden;
padding: 0;
}
/* line 774, ../sass/app.scss */
/* line 775, ../sass/app.scss */
div.time-picker {
position: absolute;
height: 191px;
@ -6853,20 +6854,20 @@ div.time-picker {
margin: 0;
}
/* line 784, ../sass/app.scss */
/* line 785, ../sass/app.scss */
div.time-picker-12hours {
width: 6em;
/* needed for IE */
}
/* line 788, ../sass/app.scss */
/* line 789, ../sass/app.scss */
div.time-picker ul {
list-style-type: none;
margin: 0;
padding: 0;
}
/* line 793, ../sass/app.scss */
/* line 794, ../sass/app.scss */
div.time-picker li {
cursor: pointer;
height: 20px;
@ -6874,124 +6875,124 @@ div.time-picker li {
padding: 4px 3px;
}
/* line 799, ../sass/app.scss */
/* line 800, ../sass/app.scss */
div.time-picker li.selected {
background: #0063CE;
color: #fff;
}
/* line 805, ../sass/app.scss */
/* line 806, ../sass/app.scss */
.timepicker {
float: left;
width: 50px !important;
}
/* line 810, ../sass/app.scss */
/* line 811, ../sass/app.scss */
.jdpicker {
float: left;
width: 90px !important;
}
/* line 815, ../sass/app.scss */
/* line 816, ../sass/app.scss */
.columns {
line-height: 2;
}
/* line 819, ../sass/app.scss */
/* line 820, ../sass/app.scss */
.transparent_table, .transparent_table tr {
background: none !important;
border: 0px !important;
}
/* line 824, ../sass/app.scss */
/* line 825, ../sass/app.scss */
form {
margin: 0 !important;
}
/* line 828, ../sass/app.scss */
/* line 829, ../sass/app.scss */
#template_create_tabs {
width: 180px;
}
/* line 833, ../sass/app.scss */
/* line 834, ../sass/app.scss */
.dataTables_scrollHead {
height: 30px;
}
/* line 837, ../sass/app.scss */
/* line 838, ../sass/app.scss */
.dataTables_scrollBody {
margin-top: -3px;
}
/* line 841, ../sass/app.scss */
/* line 842, ../sass/app.scss */
.show_hide {
cursor: pointer;
}
/* line 845, ../sass/app.scss */
/* line 846, ../sass/app.scss */
.show_hide:hover > h4 > small {
color: #6f6f6f !important;
}
/* line 849, ../sass/app.scss */
/* line 850, ../sass/app.scss */
.label.allocated {
background-color: #2ba6cb;
}
/* line 852, ../sass/app.scss */
/* line 853, ../sass/app.scss */
.label.real {
background-color: #707d85;
}
/* line 855, ../sass/app.scss */
/* line 856, ../sass/app.scss */
.label.total {
background-color: #ac5a62;
}
/* line 859, ../sass/app.scss */
/* line 860, ../sass/app.scss */
.tabs dd a, .tabs li a {
padding: 0px 13px;
}
/* line 863, ../sass/app.scss */
/* line 864, ../sass/app.scss */
.ui-layout-resizer-west {
background: none;
}
/* line 868, ../sass/app.scss */
/* line 869, ../sass/app.scss */
.ui-layout-resizer-west:hover {
background: none;
width: 30px !important;
}
/* line 874, ../sass/app.scss */
/* line 875, ../sass/app.scss */
.ui-layout-toggler-west:hover {
width: 30px !important;
background: #2ba6cb !important;
}
/* line 879, ../sass/app.scss */
/* line 880, ../sass/app.scss */
.ui-layout-resizer-south:hover {
height: 25px !important;
}
/* line 883, ../sass/app.scss */
/* line 884, ../sass/app.scss */
.ui-layout-resizer-south:hover .ui-layout-toggler-south {
height: 25px !important;
}
/* line 889, ../sass/app.scss */
/* line 890, ../sass/app.scss */
.ui-layout-toggler-south:hover {
height: 25px !important;
background: #2ba6cb !important;
}
/* line 900, ../sass/app.scss */
/* line 901, ../sass/app.scss */
div.dataTables_wrapper {
margin-bottom: 1.25em;
}
/* line 906, ../sass/app.scss */
/* line 907, ../sass/app.scss */
div.dataTables_length label,
div.dataTables_filter label,
div.dataTables_info {
@ -6999,46 +7000,46 @@ div.dataTables_info {
font-weight: normal;
}
/* line 911, ../sass/app.scss */
/* line 912, ../sass/app.scss */
div.dataTables_length {
padding-top: 0px;
}
/* line 914, ../sass/app.scss */
/* line 915, ../sass/app.scss */
div.dataTables_length label {
float: left;
text-align: left;
}
/* line 919, ../sass/app.scss */
/* line 920, ../sass/app.scss */
div.dataTables_length select {
width: 75px;
}
/* line 923, ../sass/app.scss */
/* line 924, ../sass/app.scss */
div.dataTables_filter label {
float: right;
}
/* line 926, ../sass/app.scss */
/* line 927, ../sass/app.scss */
div.dataTables_filter input {
display: inline-block !important;
width: auto !important;
}
/* line 931, ../sass/app.scss */
/* line 932, ../sass/app.scss */
div.dataTables_info {
padding-top: 1px;
}
/* line 935, ../sass/app.scss */
/* line 936, ../sass/app.scss */
div.dataTables_paginate {
float: right;
margin: 0;
padding-top: 2px;
}
/* line 941, ../sass/app.scss */
/* line 942, ../sass/app.scss */
table.dataTable {
clear: both;
margin-bottom: 0.5em !important;
@ -7046,7 +7047,7 @@ table.dataTable {
width: 100%;
}
/* line 952, ../sass/app.scss */
/* line 953, ../sass/app.scss */
table.dataTable thead .sorting,
table.dataTable thead .sorting_asc,
table.dataTable thead .sorting_desc,
@ -7056,50 +7057,50 @@ table.dataTable thead .sorting_desc_disabled {
*cursor: hand;
}
/* line 957, ../sass/app.scss */
/* line 958, ../sass/app.scss */
table.dataTable thead .sorting_asc {
background: url("../images/sort_asc_disabled.png") no-repeat center right;
}
/* line 958, ../sass/app.scss */
/* line 959, ../sass/app.scss */
table.dataTable thead .sorting_desc {
background: url("../images/sort_desc_disabled.png") no-repeat center right;
}
/* line 960, ../sass/app.scss */
/* line 961, ../sass/app.scss */
table.dataTable thead .sorting_asc_disabled {
background: url("../images/sort_asc_disabled.png") no-repeat center right;
}
/* line 961, ../sass/app.scss */
/* line 962, ../sass/app.scss */
table.dataTable thead .sorting_desc_disabled {
background: url("../images/sort_desc_disabled.png") no-repeat center right;
}
/* line 963, ../sass/app.scss */
/* line 964, ../sass/app.scss */
table.dataTable th:active {
outline: none;
}
/* Scrolling */
/* line 968, ../sass/app.scss */
/* line 969, ../sass/app.scss */
div.dataTables_scrollHead table {
margin-bottom: 0 !important;
}
/* line 972, ../sass/app.scss */
/* line 973, ../sass/app.scss */
div.dataTables_scrollBody table {
border-top: none;
margin-bottom: 0 !important;
}
/* line 978, ../sass/app.scss */
/* line 979, ../sass/app.scss */
div.dataTables_scrollBody tbody tr:first-child th,
div.dataTables_scrollBody tbody tr:first-child td {
border-top: none;
}
/* line 982, ../sass/app.scss */
/* line 983, ../sass/app.scss */
div.dataTables_scrollFoot table {
border-top: none;
}
@ -7107,42 +7108,42 @@ div.dataTables_scrollFoot table {
/*
* TableTools styles
*/
/* line 993, ../sass/app.scss */
/* line 994, ../sass/app.scss */
.table tbody tr.active td,
.table tbody tr.active th {
background-color: #08C;
color: white;
}
/* line 999, ../sass/app.scss */
/* line 1000, ../sass/app.scss */
.table tbody tr.active:hover td,
.table tbody tr.active:hover th {
background-color: #0075b0 !important;
}
/* line 1004, ../sass/app.scss */
/* line 1005, ../sass/app.scss */
.table-striped tbody tr.active:nth-child(odd) td,
.table-striped tbody tr.active:nth-child(odd) th {
background-color: #017ebc;
}
/* line 1011, ../sass/app.scss */
/* line 1012, ../sass/app.scss */
table.policies_table th, table.policies_table td {
font-size: 13px;
}
/* line 1014, ../sass/app.scss */
/* line 1015, ../sass/app.scss */
table.policies_table input {
margin: 0px !important;
height: 23px !important;
font-size: 13px;
}
/* line 1021, ../sass/app.scss */
/* line 1022, ../sass/app.scss */
.key_td {
font-weight: bold;
}
/* line 1025, ../sass/app.scss */
/* line 1026, ../sass/app.scss */
.detach-vnc-icon {
top: 11px;
right: 40px;
@ -7150,7 +7151,7 @@ table.policies_table input {
color: #aaa;
}
/* line 1032, ../sass/app.scss */
/* line 1033, ../sass/app.scss */
.detach-vnc-icon:hover {
color: #222;
}

View File

@ -1066,8 +1066,7 @@ var OpenNebula = {
OpenNebula.Action.simple_action(params,OpenNebula.Template.resource,"unpublish");
},
"instantiate" : function(params) {
var vm_name = params.data.extra_param ? params.data.extra_param : "";
var action_obj = { "vm_name" : vm_name };
var action_obj = params.data.extra_param ? params.data.extra_param : {};
OpenNebula.Action.simple_action(params,OpenNebula.Template.resource,
"instantiate",action_obj);
},

View File

@ -599,35 +599,37 @@ function setAclAutorefresh(){
$(document).ready(function(){
var tab_name = 'acls-tab';
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",2,3,4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_acls = $("#datatable_acls",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",2,3,4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#acl_search').keyup(function(){
dataTable_acls.fnFilter( $(this).val() );
})
$('#acl_search').keyup(function(){
dataTable_acls.fnFilter( $(this).val() );
})
dataTable_acls.on('draw', function(){
recountCheckboxes(dataTable_acls);
})
dataTable_acls.on('draw', function(){
recountCheckboxes(dataTable_acls);
})
Sunstone.runAction("Acl.list");
Sunstone.runAction("Acl.list");
setupCreateAclDialog();
setAclAutorefresh();
setupCreateAclDialog();
setAclAutorefresh();
initCheckAllBoxes(dataTable_acls);
tableCheckboxesListener(dataTable_acls);
//shortenedInfoFields('#datatable_acls');
initCheckAllBoxes(dataTable_acls);
tableCheckboxesListener(dataTable_acls);
//shortenedInfoFields('#datatable_acls');
infoListener(dataTable_acls);
infoListener(dataTable_acls);
$('div#acls_tab div.legend_div').hide();
$('div#acls_tab div.legend_div').hide();
}
})

View File

@ -1407,32 +1407,34 @@ function clusters_sel() {
$(document).ready(function(){
var tab_name = "clusters-tab"
//prepare host datatable
dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//prepare host datatabl
dataTable_clusters = $("#datatable_clusters",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#cluster_search').keyup(function(){
dataTable_clusters.fnFilter( $(this).val() );
})
$('#cluster_search').keyup(function(){
dataTable_clusters.fnFilter( $(this).val() );
})
dataTable_clusters.on('draw', function(){
recountCheckboxes(dataTable_clusters);
})
dataTable_clusters.on('draw', function(){
recountCheckboxes(dataTable_clusters);
})
Sunstone.runAction("Cluster.list");
Sunstone.runAction("Cluster.list");
dialogs_context.append('<div title=\"'+tr("Create cluster")+'\" id="create_cluster_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create cluster")+'\" id="create_cluster_dialog"></div>');
setClusterAutorefresh();
clusterResourceViewListeners();
setClusterAutorefresh();
clusterResourceViewListeners();
initCheckAllBoxes(dataTable_clusters);
tableCheckboxesListener(dataTable_clusters);
infoListener(dataTable_clusters, "Cluster.showinfo");
initCheckAllBoxes(dataTable_clusters);
tableCheckboxesListener(dataTable_clusters);
infoListener(dataTable_clusters, "Cluster.showinfo");
}
});

View File

@ -34,7 +34,7 @@ setInterval(function(){
Config = {
"isTabEnabled": function(tab_name){
var enabled = config['view']['tabs'][tab_name]['enabled'];
var enabled = config['view']['enabled_tabs'][tab_name];
return enabled;
},
"isTabActionEnabled": function(tab_name, action_name, panel_name){

View File

@ -1116,39 +1116,42 @@ function setDatastoreAutorefresh(){
}
$(document).ready(function(){
var tab_name = 'datastores-tab';
dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "sWidth": "200px", "aTargets": [5] },
{ "bVisible": true, "aTargets": config['view']['tabs']['datastores-tab']['table_columns']},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_datastores = $("#datatable_datastores",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "sWidth": "200px", "aTargets": [5] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#datastore_search').keyup(function(){
dataTable_datastores.fnFilter( $(this).val() );
})
$('#datastore_search').keyup(function(){
dataTable_datastores.fnFilter( $(this).val() );
})
dataTable_datastores.on('draw', function(){
recountCheckboxes(dataTable_datastores);
})
dataTable_datastores.on('draw', function(){
recountCheckboxes(dataTable_datastores);
})
Sunstone.runAction("Datastore.list");
Sunstone.runAction("Datastore.list");
setupCreateDatastoreDialog();
setDatastoreAutorefresh();
setupCreateDatastoreDialog();
setDatastoreAutorefresh();
initCheckAllBoxes(dataTable_datastores);
tableCheckboxesListener(dataTable_datastores);
infoListener(dataTable_datastores,'Datastore.showinfo');
initCheckAllBoxes(dataTable_datastores);
tableCheckboxesListener(dataTable_datastores);
infoListener(dataTable_datastores,'Datastore.showinfo');
// Reset filter in case the view was filtered because it was accessed
// from a single cluster.
$('div#menu li#li_datastores_tab').live('click',function(){
dataTable_datastores.fnFilter('',5);
});
// Reset filter in case the view was filtered because it was accessed
// from a single cluster.
$('div#menu li#li_datastores_tab').live('click',function(){
dataTable_datastores.fnFilter('',5);
});
$('div#datastores_tab div.legend_div').hide();
$('div#datastores_tab div.legend_div').hide();
}
})

View File

@ -969,32 +969,34 @@ function is_persistent_file(id){
$(document).ready(function(){
var tab_name = 'files-tab';
dataTable_files = $("#datatable_files",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_files = $("#datatable_files",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#file_search').keyup(function(){
dataTable_files.fnFilter( $(this).val() );
})
$('#file_search').keyup(function(){
dataTable_files.fnFilter( $(this).val() );
})
dataTable_files.on('draw', function(){
recountCheckboxes(dataTable_files);
})
dataTable_files.on('draw', function(){
recountCheckboxes(dataTable_files);
})
Sunstone.runAction("File.list");
Sunstone.runAction("File.list");
setupCreateFileDialog();
setupTips($create_file_dialog);
setFileAutorefresh();
setupCreateFileDialog();
setupTips($create_file_dialog);
setFileAutorefresh();
initCheckAllBoxes(dataTable_files);
tableCheckboxesListener(dataTable_files);
infoListener(dataTable_files,'File.showinfo');
initCheckAllBoxes(dataTable_files);
tableCheckboxesListener(dataTable_files);
infoListener(dataTable_files,'File.showinfo');
$('div#files_tab div.legend_div').hide();
$('div#files_tab div.legend_div').hide();
}
});

View File

@ -609,32 +609,34 @@ function setGroupAutorefresh(){
$(document).ready(function(){
var tab_name = 'groups-tab';
dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_groups = $("#datatable_groups",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",4,5,6] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#group_search').keyup(function(){
dataTable_groups.fnFilter( $(this).val() );
})
$('#group_search').keyup(function(){
dataTable_groups.fnFilter( $(this).val() );
})
dataTable_groups.on('draw', function(){
recountCheckboxes(dataTable_groups);
})
dataTable_groups.on('draw', function(){
recountCheckboxes(dataTable_groups);
})
Sunstone.runAction("Group.list");
setupCreateGroupDialog();
setupGroupQuotasDialog();
setGroupAutorefresh();
Sunstone.runAction("Group.list");
setupCreateGroupDialog();
setupGroupQuotasDialog();
setGroupAutorefresh();
initCheckAllBoxes(dataTable_groups);
tableCheckboxesListener(dataTable_groups);
infoListener(dataTable_groups, 'Group.showinfo');
initCheckAllBoxes(dataTable_groups);
tableCheckboxesListener(dataTable_groups);
infoListener(dataTable_groups, 'Group.showinfo');
$('div#groups_tab div.legend_div').hide();
$('div#groups_tab_non_admin div.legend_div').hide();
$('div#groups_tab div.legend_div').hide();
$('div#groups_tab_non_admin div.legend_div').hide();
}
})

View File

@ -968,42 +968,44 @@ function hostMonitorError(req,error_json){
$(document).ready(function(){
var tab_name = 'hosts-tab';
//prepare host datatable
dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7,8] },
{ "sWidth": "35px", "aTargets": [0] }, //check, ID, RVMS, Status,
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//prepare host datatable
dataTable_hosts = $("#datatable_hosts",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7,8] },
{ "sWidth": "35px", "aTargets": [0] }, //check, ID, RVMS, Status,
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#hosts_search').keyup(function(){
dataTable_hosts.fnFilter( $(this).val() );
})
$('#hosts_search').keyup(function(){
dataTable_hosts.fnFilter( $(this).val() );
})
dataTable_hosts.on('draw', function(){
recountCheckboxes(dataTable_hosts);
})
dataTable_hosts.on('draw', function(){
recountCheckboxes(dataTable_hosts);
})
Sunstone.runAction("Host.list");
Sunstone.runAction("Host.list");
setupCreateHostDialog();
setupCreateHostDialog();
setHostAutorefresh();
setHostAutorefresh();
initCheckAllBoxes(dataTable_hosts);
tableCheckboxesListener(dataTable_hosts);
infoListener(dataTable_hosts, "Host.showinfo");
initCheckAllBoxes(dataTable_hosts);
tableCheckboxesListener(dataTable_hosts);
infoListener(dataTable_hosts, "Host.showinfo");
// This listener removes any filter on hosts table when its menu item is
// selected. The cluster plugins will filter hosts when the hosts
// in a cluster are shown. So we have to make sure no filter has been
// left in place when we want to see all hosts.
$('div#menu li#li_hosts_tab').live('click',function(){
dataTable_hosts.fnFilter('',3);
});
// This listener removes any filter on hosts table when its menu item is
// selected. The cluster plugins will filter hosts when the hosts
// in a cluster are shown. So we have to make sure no filter has been
// left in place when we want to see all hosts.
$('div#menu li#li_hosts_tab').live('click',function(){
dataTable_hosts.fnFilter('',3);
});
// Hide help
$('div#hosts_tab div.legend_div',main_tabs_context).hide();
// Hide help
$('div#hosts_tab div.legend_div',main_tabs_context).hide();
}
});

View File

@ -16,6 +16,8 @@
/*Images tab plugin*/
size_images = 0;
var images_tab_content = '\
<form class="custom" id="image_form" action="">\
<div class="panel">\
@ -1349,32 +1351,34 @@ function popUpImageCloneDialog(){
$(document).ready(function(){
var tab_name = 'images-tab';
dataTable_images = $("#datatable_images",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_images = $("#datatable_images",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#image_search').keyup(function(){
dataTable_images.fnFilter( $(this).val() );
})
$('#image_search').keyup(function(){
dataTable_images.fnFilter( $(this).val() );
})
dataTable_images.on('draw', function(){
recountCheckboxes(dataTable_images);
})
dataTable_images.on('draw', function(){
recountCheckboxes(dataTable_images);
})
Sunstone.runAction("Image.list");
Sunstone.runAction("Image.list");
setupCreateImageDialog();
setupImageCloneDialog();
setImageAutorefresh();
setupCreateImageDialog();
setupImageCloneDialog();
setImageAutorefresh();
initCheckAllBoxes(dataTable_images);
tableCheckboxesListener(dataTable_images);
infoListener(dataTable_images,'Image.showinfo');
initCheckAllBoxes(dataTable_images);
tableCheckboxesListener(dataTable_images);
infoListener(dataTable_images,'Image.showinfo');
$('div#images_tab div.legend_div').hide();
$('div#images_tab div.legend_div').hide();
}
});

View File

@ -292,46 +292,48 @@ function onlyOneCheckboxListener(dataTable) {
$(document).ready(function(){
var tab_name = 'marketplace-tab';
dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({
"bSortClasses": true,
"aoColumns": [
{ "bSortable": false,
"mData": function ( o, val, data ) {
//we render 1st column as a checkbox directly
return '<input class="check_item" type="checkbox" id="marketplace_'+
o['_id']['$oid']+
'" name="selected_items" value="'+
o['_id']['$oid']+'"/>'
if (Config.isTabEnabled(tab_name)) {
dataTable_marketplace = $("#datatable_marketplace", main_tabs_context).dataTable({
"bSortClasses": true,
"aoColumns": [
{ "bSortable": false,
"mData": function ( o, val, data ) {
//we render 1st column as a checkbox directly
return '<input class="check_item" type="checkbox" id="marketplace_'+
o['_id']['$oid']+
'" name="selected_items" value="'+
o['_id']['$oid']+'"/>'
},
"sWidth" : "60px"
},
"sWidth" : "60px"
},
{ "mDataProp": "_id.$oid", "sWidth" : "200px" },
{ "mDataProp": "name" },
{ "mDataProp": "publisher" },
{ "mDataProp": "files.0.hypervisor", "sWidth" : "100px"},
{ "mDataProp": "files.0.os-arch", "sWidth" : "100px"},
{ "mDataProp": "files.0.format", "sWidth" : "100px"},
{ "mDataProp": "tags"}
],
"aoColumnDefs": [
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
{ "mDataProp": "_id.$oid", "sWidth" : "200px" },
{ "mDataProp": "name" },
{ "mDataProp": "publisher" },
{ "mDataProp": "files.0.hypervisor", "sWidth" : "100px"},
{ "mDataProp": "files.0.os-arch", "sWidth" : "100px"},
{ "mDataProp": "files.0.format", "sWidth" : "100px"},
{ "mDataProp": "tags"}
],
"aoColumnDefs": [
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#marketplace_search').keyup(function(){
dataTable_marketplace.fnFilter( $(this).val() );
})
$('#marketplace_search').keyup(function(){
dataTable_marketplace.fnFilter( $(this).val() );
})
dataTable_marketplace.on('draw', function(){
recountCheckboxes(dataTable_marketplace);
})
dataTable_marketplace.on('draw', function(){
recountCheckboxes(dataTable_marketplace);
})
tableCheckboxesListener(dataTable_marketplace);
onlyOneCheckboxListener(dataTable_marketplace);
tableCheckboxesListener(dataTable_marketplace);
onlyOneCheckboxListener(dataTable_marketplace);
infoListenerMarket(dataTable_marketplace);
infoListenerMarket(dataTable_marketplace);
Sunstone.runAction('Marketplace.list');
Sunstone.runAction('Marketplace.list');
}
});

View File

@ -1806,28 +1806,30 @@ function setServiceAutorefresh() {
$(document).ready(function(){
var tab_name = "oneflow-services";
dataTable_services = $("#datatable_services",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_services = $("#datatable_services",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#services_search').keyup(function(){
dataTable_services.fnFilter( $(this).val() );
})
$('#services_search').keyup(function(){
dataTable_services.fnFilter( $(this).val() );
})
dataTable_services.on('draw', function(){
recountCheckboxes(dataTable_services);
})
dataTable_services.on('draw', function(){
recountCheckboxes(dataTable_services);
})
Sunstone.runAction("Service.list");
Sunstone.runAction("Service.list");
setServiceAutorefresh();
setServiceAutorefresh();
initCheckAllBoxes(dataTable_services);
tableCheckboxesListener(dataTable_services);
infoListener(dataTable_services,'Service.showinfo');
initCheckAllBoxes(dataTable_services);
tableCheckboxesListener(dataTable_services);
infoListener(dataTable_services,'Service.showinfo');
}
});

View File

@ -1445,30 +1445,32 @@ function setServiceTemplateAutorefresh() {
$(document).ready(function(){
var tab_name = "oneflow-templates";
dataTable_service_templates = $("#datatable_service_templates",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_service_templates = $("#datatable_service_templates",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#service_templates_search').keyup(function(){
dataTable_service_templates.fnFilter( $(this).val() );
})
$('#service_templates_search').keyup(function(){
dataTable_service_templates.fnFilter( $(this).val() );
})
dataTable_service_templates.on('draw', function(){
recountCheckboxes(dataTable_service_templates);
})
dataTable_service_templates.on('draw', function(){
recountCheckboxes(dataTable_service_templates);
})
Sunstone.runAction("ServiceTemplate.list");
Sunstone.runAction("ServiceTemplate.list");
setServiceTemplateAutorefresh();
setServiceTemplateAutorefresh();
initCheckAllBoxes(dataTable_service_templates);
tableCheckboxesListener(dataTable_service_templates);
infoListener(dataTable_service_templates,'ServiceTemplate.showinfo');
initCheckAllBoxes(dataTable_service_templates);
tableCheckboxesListener(dataTable_service_templates);
infoListener(dataTable_service_templates,'ServiceTemplate.showinfo');
$('div#service_templates_tab div.legend_div').hide();
$('div#service_templates_tab div.legend_div').hide();
}
});

View File

@ -15,144 +15,295 @@
/* -------------------------------------------------------------------------- */
/*Templates tab plugin*/
var templates_tab_content = '\
<form class="custom" id="template_form" action="">\
<div class="panel">\
<div class="row">\
<div class="twelve columns">\
<h4 class="subheader header">\
<span class="header-resource">\
<i class="icon-file-alt"></i> '+tr("Templates")+'\
</span>\
<span class="header-info">\
<span/> <small></small>&emsp;\
</span>\
<span class="user-login">\
</span>\
</h4>\
</div>\
</div>\
<div class="row">\
<div class="ten columns">\
<div class="action_blocks">\
<div class="panel">\
<div class="row">\
<div class="twelve columns">\
<h4 class="subheader header">\
<span class="header-resource">\
<i class="icon-file-alt"></i> '+tr("Templates")+'\
</span>\
<span class="header-info">\
<span/> <small></small>&emsp;\
</span>\
<span class="user-login">\
</span>\
</h4>\
</div>\
</div>\
<div class="row">\
<div class="ten columns">\
<div class="action_blocks">\
</div>\
</div>\
<div class="two columns">\
<input id="template_search" type="text" placeholder="'+tr("Search")+'" />\
</div>\
<br>\
<br>\
</div>\
</div>\
<div class="two columns">\
<input id="template_search" type="text" placeholder="'+tr("Search")+'" />\
</div>\
<br>\
<br>\
</div>\
</div>\
<div class="row">\
<div class="twelve columns">\
<table id="datatable_templates" class="datatable twelve">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value=""></input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Registration time")+'</th>\
</tr>\
</thead>\
<tbody id="tbodytemplates">\
</tbody>\
</table>\
</div>\
<table id="datatable_templates" class="datatable twelve">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value=""></input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Registration time")+'</th>\
</tr>\
</thead>\
<tbody id="tbodytemplates">\
</tbody>\
</table>\
</div>\
</div>\
</form>';
var create_template_tmpl = '<div class="panel">'+
'<h3><small id="create_template_header">'+tr("Create VM Template")+'</small><small id="update_template_header" class="hidden">'+tr("Update VM Template")+'</small></h3>'+
'</div>'+
'<div class="reveal-body">'+
'<dl class="tabs">' +
'<dd id="wizard_mode" class="active"><a href="#easy">'+tr("Wizard")+'</a></dd>' +
'<dd id="advanced_mode"><a id="advanced_mode_a" href="#manual">'+tr("Advanced mode")+'</a></dd>' +
'</dl>' +
'<ul class="tabs-content">' +
'<li class="active" id="easyTab">' +
'<form class="custom creation">'+
'<div class="">'+
'<div class="columns three">'+
'<dl id="template_create_tabs" class="tabs vertical">'+
'</dl>'+
'</div>'+
'<div class="columns nine">'+
'<ul id="template_create_tabs_content" class="tabs-content">'+
'</ul>'+
'</div>'+
var create_template_tmpl = '\
<div class="panel">'+
'<h3><small id="create_template_header">'+tr("Create VM Template")+'</small><small id="update_template_header" class="hidden">'+tr("Update VM Template")+'</small></h3>'+
'</div>'+
'<div class="reveal-body">'+
'<dl class="tabs">' +
'<dd id="wizard_mode" class="active"><a href="#easy">'+tr("Wizard")+'</a></dd>' +
'<dd id="advanced_mode"><a id="advanced_mode_a" href="#manual">'+tr("Advanced mode")+'</a></dd>' +
'</dl>' +
'<ul class="tabs-content">' +
'<li class="active" id="easyTab">' +
'<form class="custom creation">'+
'<div class="">'+
'<div class="columns three">'+
'<dl id="template_create_tabs" class="tabs vertical">'+
'</dl>'+
'</div>'+
'<div class="reveal-footer">'+
'<hr>'+
'<button class="success button radius" id="create_template_form_easy" value="OpenNebula.Template.create" style="float: right">'+tr("Create")+'</button>'+
'<button class="button hidden radius" id="template_template_update_button" value="Template.update_template" style="float: right">'+tr("Update")+'</button>'+
'<button class="button secondary radius" id="template_template_reset_button" value="reset" type="reset">'+tr("Reset")+'</button>'+
'<button class="button secondary hidden radius" id="template_template_reset_button_update" value="reset" type="reset">'+tr("Reset")+'</button>'+
'<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>'+
'<div class="columns nine">'+
'<ul id="template_create_tabs_content" class="tabs-content">'+
'</ul>'+
'</div>'+
'</form>'+
'</li>' +
'<li id="manualTab">' +
'<form id="create_template_form_manual" action="">' +
'<h4><small>'+tr("Write the Virtual Machine template here")+'</small></h4>' +
'<textarea id="template" rows="15" style="width:100%;"></textarea>' +
'<div class="reveal-footer">' +
'<hr>' +
'<div class="form_buttons">' +
'<button class="button success right radius" id="create_template_submit_manual" value="template/create">'+tr("Create")+'</button>' +
'<button class="button hidden radius" id="manual_template_update_button" value="Template.update_template" style="float: right">'+tr("Update")+'</button>'+
'<button class="button secondary radius" id="manual_template_reset_button_update" value="reset" type="reset">'+tr("Reset")+'</button>'+
'<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>' +
'</div>' +
'</div>'+
'<div class="reveal-footer">'+
'<hr>'+
'<button class="success button radius" id="create_template_form_easy" value="OpenNebula.Template.create" style="float: right">'+tr("Create")+'</button>'+
'<button class="button hidden radius" id="template_template_update_button" value="Template.update_template" style="float: right">'+tr("Update")+'</button>'+
'<button class="button secondary radius" id="template_template_reset_button" value="reset" type="reset">'+tr("Reset")+'</button>'+
'<button class="button secondary hidden radius" id="template_template_reset_button_update" value="reset" type="reset">'+tr("Reset")+'</button>'+
'<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>'+
'</div>'+
'</form>'+
'</li>' +
'<li id="manualTab">' +
'<form id="create_template_form_manual" action="">' +
'<h4><small>'+tr("Write the Virtual Machine template here")+'</small></h4>' +
'<textarea id="template" rows="15" style="width:100%;"></textarea>' +
'<div class="reveal-footer">' +
'<hr>' +
'<div class="form_buttons">' +
'<button class="button success right radius" id="create_template_submit_manual" value="template/create">'+tr("Create")+'</button>' +
'<button class="button hidden radius" id="manual_template_update_button" value="Template.update_template" style="float: right">'+tr("Update")+'</button>'+
'<button class="button secondary radius" id="manual_template_reset_button_update" value="reset" type="reset">'+tr("Reset")+'</button>'+
'<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>' +
'</div>' +
'</form>' +
'</li>' +
'</ul>' +
'</div>'+
'<a class="close-reveal-modal">&#215;</a>';
'</div>' +
'</form>' +
'</li>' +
'</ul>' +
'</div>'+
'<a class="close-reveal-modal">&#215;</a>';
var instantiate_vm_template_tmpl ='\
<div class="panel">\
<h3>\
<small id="create_vnet_header">'+tr("Instantiate VM Template")+'</small>\
</h3>\
</div>\
<form id="instantiate_vm_template_form" action="">\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="vm_name">'+tr("VM Name")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_name" id="vm_name" />\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Defaults to template name when emtpy")+'.</div>\
</div>\
</div>\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="vm_n_times">'+tr("Deploy # VMs")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
</div>\
<div class="one columns">\
<div class="tip">'+tr("You can use the wildcard &#37;i. When creating several VMs, &#37;i will be replaced with a different number starting from 0 in each of them")+'.</div>\
</div>\
</div>\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="instantiate_vm_tenplate_proceed" value="Template.instantiate_vms">'+tr("Instantiate")+'</button>\
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
</div>\
<a class="close-reveal-modal">&#215;</a>\
<div class="panel">\
<h3>\
<small id="create_vnet_header">'+tr("Instantiate VM Template")+'</small>\
</h3>\
</div>\
<form id="instantiate_vm_template_form" action="">\
<div class="row">\
<div class="seven columns">\
<div class="four columns">\
<label class="inline right" for="vm_name">'+tr("VM Name")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_name" id="vm_name" />\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Defaults to template name when emtpy. You can use the wildcard &#37;i. When creating several VMs, &#37;i will be replaced with a different number starting from 0 in each of them")+'.</div>\
</div>\
</div>\
<div class="five columns">\
<div class="six columns">\
<label class="inline right" for="vm_n_times">'+tr("# VMs")+':</label>\
</div>\
<div class="five columns">\
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Number of Virtual Machines that will be created using this template")+'.</div>\
</div>\
</div>\
</div>\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="instantiate_vm_tenplate_proceed" value="Template.instantiate_vms">'+tr("Instantiate")+'</button>\
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
</div>\
<a class="close-reveal-modal">&#215;</a>\
</form>';
var easy_provision_vm_template_tmpl ='\
<div class="panel">\
<h3>\
<small id="create_vnet_header">'+tr("Instantiate VM Template")+'</small>\
</h3>\
</div>\
<div class="reveal-body">\
<form id="instantiate_vm_template_form" action="">\
<div class="row">\
<fieldset>\
<legend>'+tr("Step 1: Specify a name and the number of instances")+'</legend>\
<div class="seven columns">\
<div class="four columns">\
<label class="inline right" for="vm_name">'+tr("VM Name")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_name" id="vm_name" />\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Defaults to template name when emtpy. You can use the wildcard &#37;i. When creating several VMs, &#37;i will be replaced with a different number starting from 0 in each of them")+'.</div>\
</div>\
</div>\
<div class="five columns">\
<div class="six columns">\
<label class="inline right" for="vm_n_times">'+tr("# VMs")+':</label>\
</div>\
<div class="five columns">\
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Number of Virtual Machines that will be created using this template")+'.</div>\
</div>\
</div>\
</fieldset>\
</div>\
<br>\
<br>\
<br>\
<div class="row">\
<fieldset>\
<legend>'+tr("Step 3: Select an instance type")+'</legend>\
<div class="row collapse">\
<div class="seven columns">\
<button id="refresh_template_templates_table_button_class" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>\
</div>\
<div class="five columns">\
<input id="template_templates_table_search" type="text" placeholder="'+tr("Search")+'"/>\
</div>\
</div>\
<table id="template_templates_table" class="datatable twelve">\
<thead>\
<tr>\
<th></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Registration time")+'</th>\
</tr>\
</thead>\
<tbody id="tbodytemplates">\
</tbody>\
</table>\
<div class="row hidden">\
<div class="four columns">\
<label class="right inline" for="TEMPLATE_ID">'+tr("TEMPLATE_ID")+':</label>\
</div>\
<div class="six columns">\
<input type="text" id="TEMPLATE_ID" name="TEMPLATE_ID"/>\
</div>\
<div class="two columns">\
<div class="tip">\
</div>\
</div>\
</div>\
<br>\
<div id="selected_template" class="vm_param kvm_opt xen_opt vmware_opt">\
<span id="select_template" class="radius secondary label">'+tr("Please select a template from the list")+'</span>\
<span id="template_selected" class="radius secondary label hidden">'+tr("You selected the following template:")+'</span>\
<span class="radius label" type="text" id="TEMPLATE_NAME" name="template"></span>\
</div>\
</fieldset>\
</div>\
<br>\
<br>\
<br>\
<div class="row">\
<fieldset>\
<legend>'+tr("Step 3: Select an operating system")+'</legend>\
<div class="row collapse">\
<div class="seven columns">\
<button id="refresh_template_images_table_button_class" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>\
</div>\
<div class="five columns">\
<input id="template_images_table_search" type="text" placeholder="'+tr("Search")+'"/>\
</div>\
</div>\
<table id="template_images_table" class="datatable twelve">\
<thead>\
<tr>\
<th></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Datastore")+'</th>\
<th>'+tr("Size")+'</th>\
<th>'+tr("Type")+'</th>\
<th>'+tr("Registration time")+'</th>\
<th>'+tr("Persistent")+'</th>\
<th>'+tr("Status")+'</th>\
<th>'+tr("#VMS")+'</th>\
<th>'+tr("Target")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyimages">\
</tbody>\
</table>\
<div class="row hidden">\
<div class="four columns">\
<label class="right inline" for="IMAGE_ID">'+tr("IMAGE_ID")+':</label>\
</div>\
<div class="six columns">\
<input type="text" id="IMAGE_ID" name="IMAGE_ID"/>\
</div>\
<div class="two columns">\
<div class="tip">\
</div>\
</div>\
</div>\
<br>\
<div id="selected_image" class="vm_param kvm_opt xen_opt vmware_opt">\
<span id="select_image" class="radius secondary label">'+tr("Please select an image from the list")+'</span>\
<span id="image_selected" class="radius secondary label hidden">'+tr("You selected the following image:")+'</span>\
<span class="radius label" type="text" id="IMAGE_NAME" name="image"></span>\
</div>\
</fieldset>\
</div>\
<div class="form_buttons reveal-footer">\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="instantiate_vm_tenplate_proceed" value="Template.instantiate_vms">'+tr("Instantiate")+'</button>\
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
</div>\
</div>\
<a class="close-reveal-modal">&#215;</a>\
</form>\
</div>';
var dataTable_templates;
var $create_template_dialog;
@ -171,6 +322,13 @@ var template_actions = {
call: popUpCreateTemplateDialog
},
"Template.easy_provision" : {
type: "custom",
call: function() {
popUpInstantiateVMTemplateDialog(true);
}
},
"Template.list" : {
type: "list",
call: OpenNebula.Template.list,
@ -289,13 +447,29 @@ var template_actions = {
nodes = getSelectedNodes(dataTable_templates);
if (nodes.length == 1)
{
popUpInstantiateVMTemplateDialog();
popUpInstantiateVMTemplateDialog(false);
}
else
{
Sunstone.runAction("Template.instantiate", nodes);
}
Sunstone.runAction("VM.refresh");
}
},
"Template.instantiate_and_merge" : {
type: "custom",
call: function(){
nodes = getSelectedNodes(dataTable_templates);
if (nodes.length == 1)
{
popUpMergeVMTemplateDialog();
}
else
{
notifyError(tr("Please select only one template in the table"))
}
Sunstone.runAction("VM.refresh");
}
},
@ -350,6 +524,11 @@ var template_buttons = {
type: "create_dialog",
layout: "create"
},
"Template.easy_provision" : {
type: "create_dialog",
text: "Launch",
layout: "create"
},
"Template.update_dialog" : {
type: "action",
layout: "more_select",
@ -1151,9 +1330,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){
'</div>';
$("#refresh_template_images_table_button_class"+str_disk_tab_id).die();
$("#refresh_template_images_table_button_class"+str_disk_tab_id).live('click', function(){
// Retrieve the images to fill the datatable
update_datatable_template_images($('table[id='+str_datatable_id+']').dataTable());
});
@ -1223,6 +1400,27 @@ function update_datatable_template_images(datatable, fnDrawCallback) {
});
}
function update_datatable_template_templates(datatable, fnDrawCallback) {
if (fnDrawCallback) {
datatable.on('draw', fnDrawCallback);
}
OpenNebula.Template.list({
timeout: true,
success: function (request, templates_list){
var template_list_array = [];
$.each(templates_list,function(){
var template_element_array = templateElementArray(this);
if (template_element_array)
template_list_array.push(template_element_array);
});
updateView(template_list_array, datatable);
}
});
}
function update_datatable_template_files(datatable, fnDrawCallback) {
if (fnDrawCallback) {
datatable.on('draw', fnDrawCallback);
@ -4496,15 +4694,120 @@ function setTemplateAutorefresh() {
// Instantiate dialog
// Sets up the instiantiate template dialog and all the processing associated to it
function setupInstantiateTemplateDialog(){
function setupInstantiateTemplateDialog(easy_provision){
dialogs_context.append('<div title=\"'+tr("Instantiate VM Template")+'\" id="instantiate_vm_template_dialog"></div>');
//Insert HTML in place
$instantiate_vm_template_dialog = $('#instantiate_vm_template_dialog')
var dialog = $instantiate_vm_template_dialog;
dialog.html(instantiate_vm_template_tmpl);
dialog.addClass("reveal-modal");
if (easy_provision) {
dialog.html(easy_provision_vm_template_tmpl);
dialog.addClass("reveal-modal large max-height");
var dataTable_template_images = $('#template_images_table', dialog).dataTable({
"iDisplayLength": 4,
"bAutoWidth":false,
"sDom" : '<"H">t<"F"p>',
"aoColumnDefs": [
{ "sWidth": "35px", "aTargets": [0,1] },
{ "bVisible": false, "aTargets": [2,3,7,8,5,9,12]}
],
"fnDrawCallback": function(oSettings) {
var nodes = this.fnGetNodes();
$.each(nodes, function(){
if ($(this).find("td:eq(1)").html() == $('#IMAGE_ID', dialog).val()) {
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
}
})
}
});
// Retrieve the images to fill the datatable
update_datatable_template_images(dataTable_template_images);
$('#template_images_table_search', dialog).keyup(function(){
dataTable_template_images.fnFilter( $(this).val() );
})
$('#template_images_table tbody', dialog).delegate("tr", "click", function(e){
var aData = dataTable_template_images.fnGetData(this);
$("td.markrow", dataTable_template_images).removeClass('markrow');
$('tbody input.check_item', dataTable_template_images).removeAttr('checked');
$('#image_selected', dialog).show();
$('#select_image', dialog).hide();
$('.alert-box', dialog).hide();
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
$('#IMAGE_NAME', dialog).text(aData[4]);
$('#IMAGE_ID', dialog).val(aData[1]);
return true;
});
$("#refresh_template_images_table_button_class").die();
$("#refresh_template_images_table_button_class").live('click', function(){
update_datatable_template_images($('#template_images_table').dataTable());
});
var dataTable_template_templates = $('#template_templates_table', dialog).dataTable({
"iDisplayLength": 4,
"bAutoWidth":false,
"sDom" : '<"H">t<"F"p>',
"aoColumnDefs": [
{ "sWidth": "35px", "aTargets": [0,1] },
{ "bVisible": false, "aTargets": [1,2,3,5]}
],
"fnDrawCallback": function(oSettings) {
var nodes = this.fnGetNodes();
$.each(nodes, function(){
if ($(this).find("td:eq(1)").html() == $('#TEMPLATE_ID', dialog).val()) {
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
}
})
}
});
// Retrieve the images to fill the datatable
update_datatable_template_templates(dataTable_template_templates);
$('#template_templates_table_search', dialog).keyup(function(){
dataTable_template_templates.fnFilter( $(this).val() );
})
$('#template_templates_table tbody', dialog).delegate("tr", "click", function(e){
var aData = dataTable_template_templates.fnGetData(this);
$("td.markrow", dataTable_template_templates).removeClass('markrow');
$('tbody input.check_item', dataTable_template_templates).removeAttr('checked');
$('#template_selected', dialog).show();
$('#select_template', dialog).hide();
$('.alert-box', dialog).hide();
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
$('#TEMPLATE_NAME', dialog).text(aData[4]);
$('#TEMPLATE_ID', dialog).val(aData[1]);
return true;
});
$("#refresh_template_templates_table_button_class").die();
$("#refresh_template_templates_table_button_class").live('click', function(){
update_datatable_template_templates($('#template_templates_table').dataTable());
});
} else {
dialog.html(instantiate_vm_template_tmpl);
dialog.addClass("reveal-modal large");
dialog.removeClass("max-height")
}
setupTips(dialog);
@ -4513,36 +4816,53 @@ function setupInstantiateTemplateDialog(){
var n_times = $('#vm_n_times',this).val();
var n_times_int=1;
var selected_nodes = getSelectedNodes(dataTable_templates);
var template_id = ""+selected_nodes[0];
var template_id
if ($("#TEMPLATE_ID", this).val()) {
template_id = $("#TEMPLATE_ID", this).val();
} else {
var selected_nodes = getSelectedNodes(dataTable_templates);
template_id = ""+selected_nodes[0];
}
if (n_times.length){
n_times_int=parseInt(n_times,10);
};
var extra_info = "";
var extra_msg = "";
if (n_times_int > 1) {
extra_info = n_times_int+" times";
extra_msg = n_times_int+" times";
}
notifySubmit("Template.instantiate",template_id, extra_info);
notifySubmit("Template.instantiate",template_id, extra_msg);
var extra_info = {};
if ($("#IMAGE_ID", this).val()) {
image_id = $("#IMAGE_ID", this).val();
extra_info['template'] = {
'disk': {
'image_id': image_id
}
}
}
if (!vm_name.length){ //empty name use OpenNebula core default
for (var i=0; i< n_times_int; i++){
Sunstone.runAction("Template.instantiate_quiet", template_id, "");
extra_info['vm_name'] = "";
Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info);
};
}
else
{
if (vm_name.indexOf("%i") == -1){//no wildcard, all with the same name
for (var i=0; i< n_times_int; i++){
Sunstone.runAction("Template.instantiate_quiet", template_id, vm_name);
extra_info['vm_name'] = vm_name;
Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info);
};
} else { //wildcard present: replace wildcard
var name = "";
for (var i=0; i< n_times_int; i++){
name = vm_name.replace(/%i/gi,i);
Sunstone.runAction("Template.instantiate_quiet", template_id, name);
extra_info['vm_name'] = vm_name.replace(/%i/gi,i);
Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info);
};
};
}
@ -4553,7 +4873,8 @@ function setupInstantiateTemplateDialog(){
}
// Open creation dialog
function popUpInstantiateVMTemplateDialog(){
function popUpInstantiateVMTemplateDialog(easy_provision){
setupInstantiateTemplateDialog(easy_provision);
$instantiate_vm_template_dialog.reveal();
}
@ -4561,34 +4882,34 @@ function popUpInstantiateVMTemplateDialog(){
$(document).ready(function(){
var tab_name = 'templates-tab';
dataTable_templates = $("#datatable_templates",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_templates = $("#datatable_templates",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#template_search').keyup(function(){
dataTable_templates.fnFilter( $(this).val() );
})
$('#template_search').keyup(function(){
dataTable_templates.fnFilter( $(this).val() );
})
dataTable_templates.on('draw', function(){
recountCheckboxes(dataTable_templates);
})
dataTable_templates.on('draw', function(){
recountCheckboxes(dataTable_templates);
})
Sunstone.runAction("Template.list");
setupInstantiateTemplateDialog();
setupCreateTemplateDialog();
setupTemplateCloneDialog();
setTemplateAutorefresh();
Sunstone.runAction("Template.list");
setupCreateTemplateDialog();
setupTemplateCloneDialog();
setTemplateAutorefresh();
initCheckAllBoxes(dataTable_templates);
tableCheckboxesListener(dataTable_templates);
infoListener(dataTable_templates,'Template.showinfo');
$('div#templates_tab div.legend_div').hide();
initCheckAllBoxes(dataTable_templates);
tableCheckboxesListener(dataTable_templates);
infoListener(dataTable_templates,'Template.showinfo');
$('div#templates_tab div.legend_div').hide();
}
});

View File

@ -913,40 +913,42 @@ function setUserAutorefresh(){
$(document).ready(function(){
var tab_name = 'users-tab';
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_users = $("#datatable_users",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7] },
{ "sWidth": "35px", "aTargets": [0] },
{ "sWidth": "150px", "aTargets": [5,6,7] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
//if we are not oneadmin, our tab will not even be in the DOM.
dataTable_users = $("#datatable_users",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",5,6,7] },
{ "sWidth": "35px", "aTargets": [0] },
{ "sWidth": "150px", "aTargets": [5,6,7] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#user_search').keyup(function(){
dataTable_users.fnFilter( $(this).val() );
})
$('#user_search').keyup(function(){
dataTable_users.fnFilter( $(this).val() );
})
dataTable_users.on('draw', function(){
recountCheckboxes(dataTable_users);
})
dataTable_users.on('draw', function(){
recountCheckboxes(dataTable_users);
})
Sunstone.runAction("User.list");
Sunstone.runAction("User.list");
setupCreateUserDialog();
setupUpdatePasswordDialog();
setupChangeAuthenticationDialog();
setupUserQuotasDialog();
setUserAutorefresh();
//Setup quota icons
//Also for group tab
setupQuotaIcons();
setupCreateUserDialog();
setupUpdatePasswordDialog();
setupChangeAuthenticationDialog();
setupUserQuotasDialog();
setUserAutorefresh();
//Setup quota icons
//Also for group tab
setupQuotaIcons();
initCheckAllBoxes(dataTable_users);
tableCheckboxesListener(dataTable_users);
infoListener(dataTable_users,'User.showinfo');
initCheckAllBoxes(dataTable_users);
tableCheckboxesListener(dataTable_users);
infoListener(dataTable_users,'User.showinfo');
$('div#users_tab div.legend_div').hide();
$('div#users_tab_non_admin div.legend_div').hide();
$('div#users_tab div.legend_div').hide();
$('div#users_tab_non_admin div.legend_div').hide();
}
});

View File

@ -89,54 +89,203 @@ var vms_tab_content = '\
</table>\
</form>';
//var create_vm_tmpl ='\
// <div class="panel">\
// <h3>\
// <small id="create_vnet_header">'+tr("Create Virtual Machine")+'</small>\
// </h3>\
// </div>\
// <form id="create_vm_form" action="">\
// <div class="row centered">\
// <div class="four columns">\
// <label class="inline right" for="vm_name">'+tr("VM Name")+':</label>\
// </div>\
// <div class="seven columns">\
// <input type="text" name="vm_name" id="vm_name" />\
// </div>\
// <div class="one columns">\
// <div class="tip">'+tr("Defaults to template name when emtpy")+'.</div>\
// </div>\
// </div>\
// <div class="row centered">\
// <div class="four columns">\
// <label class="inline right" for="template_id">'+tr("Select template")+':</label>\
// </div>\
// <div class="seven columns">\
// <select id="template_id">\
// </select>\
// </div>\
// <div class="one columns">\
// <div class=""></div>\
// </div>\
// </div>\
// <div class="row centered">\
// <div class="four columns">\
// <label class="inline right" for="vm_n_times">'+tr("Deploy # VMs")+':</label>\
// </div>\
// <div class="seven columns">\
// <input type="text" name="vm_n_times" id="vm_n_times" value="1">\
// </div>\
// <div class="one columns">\
// <div class="tip">'+tr("You can use the wildcard &#37;i. When creating several VMs, &#37;i will be replaced with a different number starting from 0 in each of them")+'.</div>\
// </div>\
// </div>\
// <hr>\
// <div class="form_buttons">\
// <button class="button radius right success" id="create_vm_proceed" value="VM.create">'+tr("Create")+'</button>\
// <button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
// </div>\
//<a class="close-reveal-modal">&#215;</a>\
//</form>';
var create_vm_tmpl ='\
<div class="panel">\
<h3>\
<small id="create_vnet_header">'+tr("Create Virtual Machine")+'</small>\
</h3>\
<div class="panel">\
<h3>\
<small id="create_vnet_header">'+tr("Create Virtual Machine")+'</small>\
</h3>\
</div>\
<div class="reveal-body">\
<form id="create_vm_form" action="">\
<div class="row">\
<fieldset>\
<legend>'+tr("Step 1: Specify a name and the number of instances")+'</legend>\
<div class="seven columns">\
<div class="four columns">\
<label class="inline right" for="vm_name">'+tr("VM Name")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_name" id="vm_name" />\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Defaults to template name when emtpy. You can use the wildcard &#37;i. When creating several VMs, &#37;i will be replaced with a different number starting from 0 in each of them")+'.</div>\
</div>\
</div>\
<form id="create_vm_form" action="">\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="vm_name">'+tr("VM Name")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_name" id="vm_name" />\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Defaults to template name when emtpy")+'.</div>\
</div>\
<div class="five columns">\
<div class="six columns">\
<label class="inline right" for="vm_n_times">'+tr("# VMs")+':</label>\
</div>\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="template_id">'+tr("Select template")+':</label>\
</div>\
<div class="seven columns">\
<select id="template_id">\
</select>\
</div>\
<div class="one columns">\
<div class=""></div>\
</div>\
<div class="five columns">\
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
</div>\
<div class="row centered">\
<div class="four columns">\
<label class="inline right" for="vm_n_times">'+tr("Deploy # VMs")+':</label>\
</div>\
<div class="seven columns">\
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
</div>\
<div class="one columns">\
<div class="tip">'+tr("You can use the wildcard &#37;i. When creating several VMs, &#37;i will be replaced with a different number starting from 0 in each of them")+'.</div>\
</div>\
<div class="one columns">\
<div class="tip">'+tr("Number of Virtual Machines that will be created using this template")+'.</div>\
</div>\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="create_vm_proceed" value="VM.create">'+tr("Create")+'</button>\
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
</div>\
<a class="close-reveal-modal">&#215;</a>\
</form>';
</fieldset>\
</div>\
<br>\
<br>\
<br>\
<div class="row">\
<fieldset>\
<legend>'+tr("Step 2: Select an instance type")+'</legend>\
<div class="row collapse">\
<div class="seven columns">\
<button id="refresh_template_templates_table_button_class" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>\
</div>\
<div class="five columns">\
<input id="template_templates_table_search" type="text" placeholder="'+tr("Search")+'"/>\
</div>\
</div>\
<table id="template_templates_table" class="datatable twelve">\
<thead>\
<tr>\
<th></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Registration time")+'</th>\
</tr>\
</thead>\
<tbody id="tbodytemplates">\
</tbody>\
</table>\
<div class="row hidden">\
<div class="four columns">\
<label class="right inline" for="TEMPLATE_ID">'+tr("TEMPLATE_ID")+':</label>\
</div>\
<div class="six columns">\
<input type="text" id="TEMPLATE_ID" name="TEMPLATE_ID"/>\
</div>\
<div class="two columns">\
<div class="tip">\
</div>\
</div>\
</div>\
<br>\
<div id="selected_template" class="vm_param kvm_opt xen_opt vmware_opt">\
<span id="select_template" class="radius secondary label">'+tr("Please select a template from the list")+'</span>\
<span id="template_selected" class="radius secondary label hidden">'+tr("You selected the following template:")+'</span>\
<span class="radius label" type="text" id="TEMPLATE_NAME" name="template"></span>\
</div>\
</fieldset>\
</div>\
<br>\
<br>\
<br>\
<div id="select_image_step" class="row">\
<fieldset>\
<legend>'+tr("Step 3: Select an operating system")+'</legend>\
<div class="row collapse">\
<div class="seven columns">\
<button id="refresh_template_images_table_button_class" type="button" class="button small radius secondary"><i class="icon-refresh" /></button>\
</div>\
<div class="five columns">\
<input id="template_images_table_search" type="text" placeholder="'+tr("Search")+'"/>\
</div>\
</div>\
<table id="template_images_table" class="datatable twelve">\
<thead>\
<tr>\
<th></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Datastore")+'</th>\
<th>'+tr("Size")+'</th>\
<th>'+tr("Type")+'</th>\
<th>'+tr("Registration time")+'</th>\
<th>'+tr("Persistent")+'</th>\
<th>'+tr("Status")+'</th>\
<th>'+tr("#VMS")+'</th>\
<th>'+tr("Target")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyimages">\
</tbody>\
</table>\
<div class="row hidden">\
<div class="four columns">\
<label class="right inline" for="IMAGE_ID">'+tr("IMAGE_ID")+':</label>\
</div>\
<div class="six columns">\
<input type="text" id="IMAGE_ID" name="IMAGE_ID"/>\
</div>\
<div class="two columns">\
<div class="tip">\
</div>\
</div>\
</div>\
<br>\
<div id="selected_image" class="vm_param kvm_opt xen_opt vmware_opt">\
<span id="select_image" class="radius secondary label">'+tr("Please select an image from the list")+'</span>\
<span id="image_selected" class="radius secondary label hidden">'+tr("You selected the following image:")+'</span>\
<span class="radius label" type="text" id="IMAGE_NAME" name="image"></span>\
</div>\
</fieldset>\
</div>\
<div class="form_buttons reveal-footer">\
<hr>\
<div class="form_buttons">\
<button class="button radius right success" id="instantiate_vm_tenplate_proceed" value="Template.instantiate_vms">'+tr("Create")+'</button>\
<button class="close-reveal-modal button secondary radius" type="button" value="close">' + tr("Close") + '</button>\
</div>\
</div>\
<a class="close-reveal-modal">&#215;</a>\
</form>\
</div>';
var vmachine_list_json = {};
var dataTable_vMachines;
@ -157,7 +306,16 @@ var vm_actions = {
"VM.create_dialog" : {
type: "custom",
call: popUpCreateVMDialog
call: function(){
popUpCreateVMDialog(false);
}
},
"VM.easy_provision" : {
type: "custom",
call: function(){
popUpCreateVMDialog(true);
}
},
"VM.list" : {
@ -692,6 +850,12 @@ var vm_buttons = {
layout: "create",
alwaysActive: true
},
"VM.easy_provision" : {
type: "action",
layout: "create",
text: tr("Launch"),
alwaysActive: true
},
"VM.chown" : {
type: "confirm_with_select",
text: tr("Change owner"),
@ -2732,28 +2896,123 @@ function setup_vm_snapshot_tab(){
// Sets up the create-template dialog and all the processing associated to it,
// which is a lot.
function setupCreateVMDialog(){
function setupCreateVMDialog(include_select_image){
dialogs_context.append('<div title=\"'+tr("Create Virtual Machine")+'\" id="create_vm_dialog"></div>');
//Insert HTML in place
$create_vm_dialog = $('#create_vm_dialog')
var dialog = $create_vm_dialog;
dialog.html(create_vm_tmpl);
dialog.addClass("reveal-modal large max-height");
//Prepare jquery dialog
//dialog.dialog({
// autoOpen: false,
// modal: true,
// width: 400
//});
dialog.addClass("reveal-modal");
var dataTable_template_templates = $('#template_templates_table', dialog).dataTable({
"iDisplayLength": 4,
"bAutoWidth":false,
"sDom" : '<"H">t<"F"p>',
"aoColumnDefs": [
{ "sWidth": "35px", "aTargets": [0,1] },
{ "bVisible": false, "aTargets": [1,2,3,5]}
],
"fnDrawCallback": function(oSettings) {
var nodes = this.fnGetNodes();
$.each(nodes, function(){
if ($(this).find("td:eq(1)").html() == $('#TEMPLATE_ID', dialog).val()) {
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
}
})
}
});
// Retrieve the images to fill the datatable
update_datatable_template_templates(dataTable_template_templates);
$('#template_templates_table_search', dialog).keyup(function(){
dataTable_template_templates.fnFilter( $(this).val() );
})
$('#template_templates_table tbody', dialog).delegate("tr", "click", function(e){
var aData = dataTable_template_templates.fnGetData(this);
$("td.markrow", dataTable_template_templates).removeClass('markrow');
$('tbody input.check_item', dataTable_template_templates).removeAttr('checked');
$('#template_selected', dialog).show();
$('#select_template', dialog).hide();
$('.alert-box', dialog).hide();
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
$('#TEMPLATE_NAME', dialog).text(aData[4]);
$('#TEMPLATE_ID', dialog).val(aData[1]);
return true;
});
$("#refresh_template_templates_table_button_class").die();
$("#refresh_template_templates_table_button_class").live('click', function(){
update_datatable_template_templates($('#template_templates_table').dataTable());
});
if (include_select_image) {
$("#select_image_step", dialog).show();
var dataTable_template_images = $('#template_images_table', dialog).dataTable({
"iDisplayLength": 4,
"bAutoWidth":false,
"sDom" : '<"H">t<"F"p>',
"aoColumnDefs": [
{ "sWidth": "35px", "aTargets": [0,1] },
{ "bVisible": false, "aTargets": [2,3,7,8,5,9,12]}
],
"fnDrawCallback": function(oSettings) {
var nodes = this.fnGetNodes();
$.each(nodes, function(){
if ($(this).find("td:eq(1)").html() == $('#IMAGE_ID', dialog).val()) {
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
}
})
}
});
// Retrieve the images to fill the datatable
update_datatable_template_images(dataTable_template_images);
$('#template_images_table_search', dialog).keyup(function(){
dataTable_template_images.fnFilter( $(this).val() );
})
$('#template_images_table tbody', dialog).delegate("tr", "click", function(e){
var aData = dataTable_template_images.fnGetData(this);
$("td.markrow", dataTable_template_images).removeClass('markrow');
$('tbody input.check_item', dataTable_template_images).removeAttr('checked');
$('#image_selected', dialog).show();
$('#select_image', dialog).hide();
$('.alert-box', dialog).hide();
$("td", this).addClass('markrow');
$('input.check_item', this).attr('checked','checked');
$('#IMAGE_NAME', dialog).text(aData[4]);
$('#IMAGE_ID', dialog).val(aData[1]);
return true;
});
$("#refresh_template_images_table_button_class").die();
$("#refresh_template_images_table_button_class").live('click', function(){
update_datatable_template_images($('#template_images_table').dataTable());
});
} else {
$("#select_image_step", dialog).hide();
}
//$('button',dialog).button();
setupTips(dialog);
$('#create_vm_form',dialog).submit(function(){
var vm_name = $('#vm_name',this).val();
var template_id = $('#template_id',this).val();
var template_id = $('#TEMPLATE_ID',this).val();
var n_times = $('#vm_n_times',this).val();
var n_times_int=1;
@ -2766,29 +3025,40 @@ function setupCreateVMDialog(){
n_times_int=parseInt(n_times,10);
};
var extra_info = "";
var extra_msg = "";
if (n_times_int > 1) {
extra_info = n_times_int+" times";
extra_msg = n_times_int+" times";
}
notifySubmit("Template.instantiate",template_id, extra_info);
notifySubmit("Template.instantiate",template_id, extra_msg);
var extra_info = {};
if ($("#IMAGE_ID", this).val()) {
image_id = $("#IMAGE_ID", this).val();
extra_info['template'] = {
'disk': {
'image_id': image_id
}
}
}
if (!vm_name.length){ //empty name use OpenNebula core default
for (var i=0; i< n_times_int; i++){
Sunstone.runAction("Template.instantiate_quiet", template_id, "");
extra_info['vm_name'] = "";
Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info);
};
}
else
{
if (vm_name.indexOf("%i") == -1){ //no wildcard
if (vm_name.indexOf("%i") == -1){//no wildcard, all with the same name
for (var i=0; i< n_times_int; i++){
Sunstone.runAction("Template.instantiate_quiet", template_id, vm_name);
extra_info['vm_name'] = vm_name;
Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info);
};
} else { //wildcard present: replace wildcard
var name = "";
for (var i=0; i< n_times_int; i++){
name = vm_name.replace(/%i/gi,i);
Sunstone.runAction("Template.instantiate_quiet", template_id, name);
extra_info['vm_name'] = vm_name.replace(/%i/gi,i);
Sunstone.runAction("Template.instantiate_quiet", template_id, extra_info);
};
};
}
@ -2802,7 +3072,8 @@ function setupCreateVMDialog(){
}
// Open creation dialog
function popUpCreateVMDialog(){
function popUpCreateVMDialog(include_select_image){
setupCreateVMDialog(include_select_image);
$create_vm_dialog.reveal();
}
@ -2970,41 +3241,43 @@ function vmMonitorError(req,error_json){
$(document).ready(function(){
var tab_name = 'vms-tab';
dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",6,7,9,11] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_vMachines = $("#datatable_vmachines",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check",6,7,9,11] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#vms_search').keyup(function(){
dataTable_vMachines.fnFilter( $(this).val() );
})
$('#vms_search').keyup(function(){
dataTable_vMachines.fnFilter( $(this).val() );
})
dataTable_vMachines.on('draw', function(){
recountCheckboxes(dataTable_vMachines);
})
dataTable_vMachines.on('draw', function(){
recountCheckboxes(dataTable_vMachines);
})
//addElement([
// spinner,
// '','','','','','','','','','',''],dataTable_vMachines);
Sunstone.runAction("VM.list");
//addElement([
// spinner,
// '','','','','','','','','','',''],dataTable_vMachines);
Sunstone.runAction("VM.list");
setupCreateVMDialog();
setVMAutorefresh();
setupVNC();
hotpluggingOps();
setup_vm_network_tab();
setup_vm_capacity_tab();
setup_vm_snapshot_tab();
//setupCreateVMDialog();
setVMAutorefresh();
setupVNC();
hotpluggingOps();
setup_vm_network_tab();
setup_vm_capacity_tab();
setup_vm_snapshot_tab();
initCheckAllBoxes(dataTable_vMachines);
tableCheckboxesListener(dataTable_vMachines);
infoListener(dataTable_vMachines,'VM.showinfo');
initCheckAllBoxes(dataTable_vMachines);
tableCheckboxesListener(dataTable_vMachines);
infoListener(dataTable_vMachines,'VM.showinfo');
$('div#vms_tab div.legend_div').hide();
$('div#vms_tab div.legend_div').hide();
}
})

View File

@ -1563,38 +1563,40 @@ function setVNetAutorefresh() {
$(document).ready(function(){
var tab_name = 'vnets-tab';
dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
if (Config.isTabEnabled(tab_name)) {
dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "35px", "aTargets": [0] },
{ "bVisible": true, "aTargets": Config.tabTableColumns(tab_name)},
{ "bVisible": false, "aTargets": ['_all']}
]
});
$('#vnet_search').keyup(function(){
dataTable_vNetworks.fnFilter( $(this).val() );
})
$('#vnet_search').keyup(function(){
dataTable_vNetworks.fnFilter( $(this).val() );
})
dataTable_vNetworks.on('draw', function(){
recountCheckboxes(dataTable_vNetworks);
})
dataTable_vNetworks.on('draw', function(){
recountCheckboxes(dataTable_vNetworks);
})
Sunstone.runAction("Network.list");
Sunstone.runAction("Network.list");
setupCreateVNetDialog();
setupLeasesOps();
setVNetAutorefresh();
setupCreateVNetDialog();
setupLeasesOps();
setVNetAutorefresh();
initCheckAllBoxes(dataTable_vNetworks);
tableCheckboxesListener(dataTable_vNetworks);
infoListener(dataTable_vNetworks,'Network.showinfo');
initCheckAllBoxes(dataTable_vNetworks);
tableCheckboxesListener(dataTable_vNetworks);
infoListener(dataTable_vNetworks,'Network.showinfo');
// Reset list filter in case it was set because we were lookin
// at a single cluster view
$('div#menu li#li_vnets_tab').live('click',function(){
dataTable_vNetworks.fnFilter('',5);
});
// Reset list filter in case it was set because we were lookin
// at a single cluster view
$('div#menu li#li_vnets_tab').live('click',function(){
dataTable_vNetworks.fnFilter('',5);
});
$('div#vnets_tab div.legend_div').hide();
$('div#vnets_tab div.legend_div').hide();
}
});

View File

@ -64,10 +64,12 @@ var Sunstone = {
//Adds a new main tab. Refreshes the dom if wanted.
"addMainTab" : function(tab_id,tab_obj,refresh) {
SunstoneCfg["tabs"][tab_id] = tab_obj;
if (refresh){
insertTab(tab_id);
//$(document).foundationCustomForms();
if (Config.isTabEnabled(tab_id)) {
SunstoneCfg["tabs"][tab_id] = tab_obj;
if (refresh){
insertTab(tab_id);
//$(document).foundationCustomForms();
}
}
},
@ -548,21 +550,16 @@ function insertTab(tab_name){
var li_item = '<li id="li_'+tab_name+'" class="'+tabClass+' '+parent+'"><a href="#">'+tab_info.title+'<span class="icon-caret-left icon-large plusIcon right"></span></a></li>';
$('div#menu ul#navigation').append(li_item);
//if this is a submenu...
if (parent.length) {
var children = $('div#menu ul#navigation li.'+parent);
var children = $('div#menu ul#navigation #li_'+parent);
//if there are other submenus, insert after last of them
if (children.length)
$(children[children.length-1]).after(li_item);
else //instert after parent menu
$('div#menu ul#navigation li#li_'+parent).after(li_item);
} else { //not a submenu, instert in the end
$('div#menu ul#navigation').append(li_item);
};
if (parent){ //this is a subtab
$('div#menu li#li_'+tab_name).hide();//hide by default
$('div#menu li#li_'+parent+' span').css("display","inline-block");
if (children.length) {
$('div#menu li#li_'+tab_name).hide();//hide by default
$('div#menu li#li_'+parent+' span').css("display","inline-block");
}
};
if (showOnTop){

View File

@ -610,6 +610,7 @@ ul.button-group {
.value_td {
text-overflow:ellipsis;
word-break: break-all;
}
small {

View File

@ -64,7 +64,7 @@
<script src="js/plugins/config-tab.js" type="text/javascript"></script>
<!-- enabled tabs: -->
<%- view['enabled_tabs'].each do |tab_name| -%>
<%- $views_config.available_tabs.each do |tab_name| -%>
<script src="js/plugins/<%= tab_name %>.js" type="text/javascript"></script>
<%- end -%>
<!-- end tabs -->

View File

@ -93,7 +93,7 @@ for f in "${SRC[@]}"; do
[ -n "$ERROR" ] && exit_error
done
exec_and_set_error "$MKISOFS -o $ISO_FILE -J -R $ISO_DIR" \
exec_and_set_error "$MKISOFS -o $ISO_FILE -V CONTEXT -J -R $ISO_DIR" \
"Error creating iso fs"
[ -n "$ERROR" ] && exit_error