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

Merge branch 'master' into feature-862

This commit is contained in:
Ruben S. Montero 2012-01-03 03:01:43 +01:00
commit a77b5d4acd
136 changed files with 10158 additions and 1597 deletions

View File

@ -210,6 +210,15 @@ public:
int resubmit(
int vid);
/**
* Reboots a VM preserving any resource and RUNNING state
* @param vid VirtualMachine identification
* @return 0 on success, -1 if the VM does not exits or -2 if the VM is
* in a wrong a state
*/
int reboot(
int vid);
private:
/**
* Thread id for the Dispatch Manager

View File

@ -67,6 +67,7 @@ public:
LIVE_MIGRATE, /**< Sent by the DM to live-migrate a VM */
SHUTDOWN, /**< Sent by the DM to shutdown a running VM */
RESTART, /**< Sent by the DM to restart a deployed VM */
REBOOT, /**< Sent by the DM to reboot a running VM */
DELETE, /**< Sent by the DM to delete a VM */
CLEAN, /**< Sent by the DM to cleanup a VM for resubmission*/
FINALIZE
@ -194,6 +195,8 @@ private:
void restart_action(int vid);
void reboot_action(int vid);
void delete_action(int vid);
void clean_action(int vid);

View File

@ -407,7 +407,7 @@ private:
// Configuration
// ---------------------------------------------------------------
NebulaTemplate * nebula_configuration;
OpenNebulaTemplate * nebula_configuration;
// ---------------------------------------------------------------
// Nebula Pools

View File

@ -20,16 +20,25 @@
#include "Template.h"
#include <map>
/**
* This class provides the basic abstraction for OpenNebula configuration files
*/
class NebulaTemplate : public Template
{
{
public:
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
NebulaTemplate(string& etc_location, string& var_location);
NebulaTemplate(const string& etc_location, const char * _conf_name)
{
conf_file = etc_location + _conf_name;
}
~NebulaTemplate(){};
virtual ~NebulaTemplate(){};
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
static const char * conf_name;
int get(const char * name, vector<const Attribute*>& values) const
{
string _name(name);
@ -50,41 +59,95 @@ public:
Template::get(_name,values);
};
void get(const char *name, unsigned int& values) const
{
int ival;
NebulaTemplate::get(name, ival);
values = static_cast<unsigned int>(ival);
};
void get(const char * name, time_t& values) const
{
const SingleAttribute * sattr;
vector<const Attribute *> attr;
const SingleAttribute * sattr;
vector<const Attribute *> attr;
string _name(name);
string _name(name);
if ( Template::get(_name,attr) == 0 )
{
values = 0;
return;
values = 0;
return;
}
sattr = dynamic_cast<const SingleAttribute *>(attr[0]);
if ( sattr != 0 )
{
istringstream is;
is.str(sattr->value());
is >> values;
istringstream is;
is.str(sattr->value());
is >> values;
}
else
values = 0;
values = 0;
};
private:
friend class Nebula;
// -----------------------------------------------------------------------
// -----------------------------------------------------------------------
/**
* Parse and loads the configuration in the template
*/
int load_configuration();
protected:
/**
* Full path to the configuration file
*/
string conf_file;
/**
* Defaults for the configuration file
*/
map<string, Attribute*> conf_default;
/**
* Sets the defaults value for the template
*/
virtual void set_conf_default() = 0;
};
// -----------------------------------------------------------------------------
// -----------------------------------------------------------------------------
class OpenNebulaTemplate : public NebulaTemplate
{
public:
OpenNebulaTemplate(const string& etc_location, const string& _var_location):
NebulaTemplate(etc_location, conf_name), var_location(_var_location)
{};
int load_configuration();
~OpenNebulaTemplate(){};
private:
/**
* Name for the configuration file, oned.conf
*/
static const char * conf_name;
/**
* Path for the var directory, for defaults
*/
string var_location;
/**
* Sets the defaults value for the template
*/
void set_conf_default();
};

View File

@ -51,6 +51,7 @@ public:
CANCEL_PREVIOUS,
MIGRATE,
RESTORE,
REBOOT,
POLL,
TIMER,
DRIVER_CANCEL,
@ -262,6 +263,13 @@ private:
void restore_action(
int vid);
/**
* Reboots a running VM.
* @param vid the id of the VM.
*/
void reboot_action(
int vid);
/**
* Polls a VM.
* @param vid the id of the VM.

View File

@ -127,6 +127,15 @@ private:
const int oid,
const string& drv_msg) const;
/**
* Sends a reboot request to the MAD: "REBOOT ID XML_DRV_MSG"
* @param oid the virtual machine id.
* @param drv_msg xml data for the mad operation
*/
void reboot (
const int oid,
const string& drv_msg) const;
/**
* Sends a cancel request to the MAD: "CANCEL ID XML_DRV_MSG"
* @param oid the virtual machine id.

View File

@ -253,6 +253,9 @@ SUNSTONE_DIRS="$SUNSTONE_LOCATION/models \
$SUNSTONE_LOCATION/public/js/plugins \
$SUNSTONE_LOCATION/public/js/user-plugins \
$SUNSTONE_LOCATION/public/css \
$SUNSTONE_LOCATION/public/locale \
$SUNSTONE_LOCATION/public/locale/en_US \
$SUNSTONE_LOCATION/public/locale/ru \
$SUNSTONE_LOCATION/public/vendor \
$SUNSTONE_LOCATION/public/vendor/jQueryLayout \
$SUNSTONE_LOCATION/public/vendor/dataTables \
@ -282,6 +285,31 @@ OZONES_DIRS="$OZONES_LOCATION/lib \
$OZONES_LOCATION/public/images \
$OZONES_LOCATION/public/css"
SELF_SERVICE_DIRS="\
$LIB_LOCATION/ruby/cloud/occi/ui \
$LIB_LOCATION/ruby/cloud/occi/ui/templates \
$LIB_LOCATION/ruby/cloud/occi/ui/views \
$LIB_LOCATION/ruby/cloud/occi/ui/public \
$LIB_LOCATION/ruby/cloud/occi/ui/public/css \
$LIB_LOCATION/ruby/cloud/occi/ui/public/customize \
$LIB_LOCATION/ruby/cloud/occi/ui/public/images \
$LIB_LOCATION/ruby/cloud/occi/ui/public/js \
$LIB_LOCATION/ruby/cloud/occi/ui/public/js/plugins \
$LIB_LOCATION/ruby/cloud/occi/ui/public/locale \
$LIB_LOCATION/ruby/cloud/occi/ui/public/locale/en_US \
$LIB_LOCATION/ruby/cloud/occi/ui/public/locale/es_ES \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQueryLayout \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/dataTables \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQueryUI \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQueryUI/images \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQuery \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jGrowl \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/flot \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/crypto-js \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/fileuploader \
$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/xml2json"
OZONES_CLIENT_DIRS="$LIB_LOCATION/ruby \
$LIB_LOCATION/ruby/OpenNebula \
$LIB_LOCATION/ruby/cli \
@ -308,14 +336,14 @@ CONF_CLI_DIRS="$ETC_LOCATION/cli"
if [ "$CLIENT" = "yes" ]; then
MAKE_DIRS="$MAKE_DIRS $LIB_ECO_CLIENT_DIRS $LIB_OCCI_CLIENT_DIRS \
$LIB_OCA_CLIENT_DIRS $LIB_CLI_CLIENT_DIRS $CONF_CLI_DIRS \
$ETC_LOCATION $OZONES_CLIENT_DIRS"
$ETC_LOCATION $OZONES_CLIENT_DIRS $SELF_SERVICE_DIRS"
elif [ "$SUNSTONE" = "yes" ]; then
MAKE_DIRS="$MAKE_DIRS $SUNSTONE_DIRS $LIB_OCA_CLIENT_DIRS"
elif [ "$OZONES" = "yes" ]; then
MAKE_DIRS="$MAKE_DIRS $OZONES_DIRS $OZONES_CLIENT_DIRS $LIB_OCA_CLIENT_DIRS"
else
MAKE_DIRS="$MAKE_DIRS $SHARE_DIRS $ETC_DIRS $LIB_DIRS $VAR_DIRS \
$OZONES_DIRS $OZONES_CLIENT_DIRS $SUNSTONE_DIRS"
$OZONES_DIRS $OZONES_CLIENT_DIRS $SUNSTONE_DIRS $SELF_SERVICE_DIRS"
fi
#-------------------------------------------------------------------------------
@ -426,6 +454,8 @@ INSTALL_SUNSTONE_FILES=(
SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT:$SUNSTONE_LOCATION/public/vendor/jQueryLayout
SUNSTONE_PUBLIC_VENDOR_FLOT:$SUNSTONE_LOCATION/public/vendor/flot
SUNSTONE_PUBLIC_IMAGES_FILES:$SUNSTONE_LOCATION/public/images
SUNSTONE_PUBLIC_LOCALE_EN_US:$SUNSTONE_LOCATION/public/locale/en_US
SUNSTONE_PUBLIC_LOCALE_RU:$SUNSTONE_LOCATION/public/locale/ru
)
INSTALL_SUNSTONE_ETC_FILES=(
@ -465,6 +495,28 @@ INSTALL_OZONES_ETC_FILES=(
OZONES_ETC_FILES:$ETC_LOCATION
)
INSTALL_SELF_SERVICE_FILES=(
SELF_SERVICE_TEMPLATE_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/templates
SELF_SERVICE_VIEWS_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/views
SELF_SERVICE_PUBLIC_JS_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/public/js
SELF_SERVICE_PUBLIC_JS_PLUGINS_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/public/js/plugins
SELF_SERVICE_PUBLIC_CSS_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/public/css
SELF_SERVICE_PUBLIC_CUSTOMIZE_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/public/customize
SELF_SERVICE_PUBLIC_VENDOR_DATATABLES:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/dataTables
SELF_SERVICE_PUBLIC_VENDOR_JGROWL:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jGrowl
SELF_SERVICE_PUBLIC_VENDOR_JQUERY:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQuery
SELF_SERVICE_PUBLIC_VENDOR_JQUERYUI:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQueryUI
SELF_SERVICE_PUBLIC_VENDOR_JQUERYUIIMAGES:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQueryUI/images
SELF_SERVICE_PUBLIC_VENDOR_JQUERYLAYOUT:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/jQueryLayout
SELF_SERVICE_PUBLIC_VENDOR_FLOT:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/flot
SELF_SERVICE_PUBLIC_VENDOR_CRYPTOJS:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/crypto-js
SELF_SERVICE_PUBLIC_VENDOR_FILEUPLOADER:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/fileuploader
SELF_SERVICE_PUBLIC_VENDOR_XML2JSON:$LIB_LOCATION/ruby/cloud/occi/ui/public/vendor/xml2json
SELF_SERVICE_PUBLIC_IMAGES_FILES:$LIB_LOCATION/ruby/cloud/occi/ui/public/images
SELF_SERVICE_PUBLIC_LOCALE_EN_US:$LIB_LOCATION/ruby/cloud/occi/ui/public/locale/en_US
SELF_SERVICE_PUBLIC_LOCALE_ES_ES:$LIB_LOCATION/ruby/cloud/occi/ui/public/locale/es_ES
)
INSTALL_ETC_FILES=(
ETC_FILES:$ETC_LOCATION
VMWARE_ETC_FILES:$ETC_LOCATION
@ -528,7 +580,6 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \
src/mad/ruby/ssh_stream.rb \
src/vnm_mad/one_vnm.rb \
src/mad/ruby/Ganglia.rb \
src/mad/ruby/vmwarelib.rb \
src/oca/ruby/OpenNebula.rb \
src/tm_mad/TMScript.rb \
src/authm_mad/remotes/ssh/ssh_auth.rb \
@ -587,6 +638,7 @@ VMM_EXEC_KVM_SCRIPTS="src/vmm_mad/remotes/kvm/cancel \
src/vmm_mad/remotes/kvm/migrate \
src/vmm_mad/remotes/kvm/migrate_local \
src/vmm_mad/remotes/kvm/restore \
src/vmm_mad/remotes/kvm/reboot \
src/vmm_mad/remotes/kvm/save \
src/vmm_mad/remotes/kvm/poll \
src/vmm_mad/remotes/kvm/poll_ganglia \
@ -601,6 +653,7 @@ VMM_EXEC_XEN_SCRIPTS="src/vmm_mad/remotes/xen/cancel \
src/vmm_mad/remotes/xen/xenrc \
src/vmm_mad/remotes/xen/migrate \
src/vmm_mad/remotes/xen/restore \
src/vmm_mad/remotes/xen/reboot \
src/vmm_mad/remotes/xen/save \
src/vmm_mad/remotes/xen/poll \
src/vmm_mad/remotes/xen/poll_ganglia \
@ -614,10 +667,12 @@ VMM_EXEC_VMWARE_SCRIPTS="src/vmm_mad/remotes/vmware/cancel \
src/vmm_mad/remotes/vmware/deploy \
src/vmm_mad/remotes/vmware/migrate \
src/vmm_mad/remotes/vmware/restore \
src/vmm_mad/remotes/vmware/reboot \
src/vmm_mad/remotes/vmware/save \
src/vmm_mad/remotes/vmware/poll \
src/vmm_mad/remotes/vmware/checkpoint \
src/vmm_mad/remotes/vmware/shutdown"
src/vmm_mad/remotes/vmware/shutdown \
src/vmm_mad/remotes/vmware/vmware_driver.rb"
#-------------------------------------------------------------------------------
# Information Manager Probes, to be installed under $REMOTES_LOCATION/im
@ -727,7 +782,9 @@ LVM_TM_COMMANDS_LIB_FILES="src/tm_mad/lvm/tm_clone.sh \
VMWARE_TM_COMMANDS_LIB_FILES="src/tm_mad/vmware/tm_clone.sh \
src/tm_mad/vmware/tm_ln.sh \
src/tm_mad/vmware/tm_mv.sh"
src/tm_mad/vmware/tm_mv.sh \
src/tm_mad/vmware/functions.sh \
src/tm_mad/vmware/tm_context.sh"
#-------------------------------------------------------------------------------
# Image Repository drivers, to be installed under $REMOTES_LOCATION/image
@ -761,6 +818,7 @@ ONEDB_MIGRATOR_FILES="src/onedb/2.0_to_2.9.80.rb \
ETC_FILES="share/etc/oned.conf \
share/etc/defaultrc \
src/scheduler/etc/sched.conf \
src/cli/etc/group.default"
VMWARE_ETC_FILES="src/vmm_mad/remotes/vmware/vmwarerc"
@ -1040,7 +1098,8 @@ SUNSTONE_PUBLIC_JS_FILES="src/sunstone/public/js/layout.js \
src/sunstone/public/js/login.js \
src/sunstone/public/js/sunstone.js \
src/sunstone/public/js/sunstone-util.js \
src/sunstone/public/js/opennebula.js"
src/sunstone/public/js/opennebula.js \
src/sunstone/public/js/locale.js"
SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\
src/sunstone/public/js/plugins/dashboard-tab.js \
@ -1052,7 +1111,8 @@ SUNSTONE_PUBLIC_JS_PLUGINS_FILES="\
src/sunstone/public/js/plugins/users-tab.js \
src/sunstone/public/js/plugins/vms-tab.js \
src/sunstone/public/js/plugins/acls-tab.js \
src/sunstone/public/js/plugins/vnets-tab.js"
src/sunstone/public/js/plugins/vnets-tab.js \
src/sunstone/public/js/plugins/config-tab.js"
SUNSTONE_PUBLIC_CSS_FILES="src/sunstone/public/css/application.css \
src/sunstone/public/css/layout.css \
@ -1109,6 +1169,19 @@ src/sunstone/public/vendor/flot/LICENSE.txt \
src/sunstone/public/vendor/flot/NOTICE \
src/sunstone/public/vendor/flot/README.txt"
SUNSTONE_PUBLIC_VENDOR_CRYPTOJS="\
src/sunstone/public/vendor/crypto-js/NOTICE \
src/sunstone/public/vendor/crypto-js/2.3.0-crypto-sha1.js \
src/sunstone/public/vendor/crypto-js/NEW-BSD-LICENSE.txt"
SUNSTONE_PUBLIC_VENDOR_FILEUPLOADER="\
src/sunstone/public/vendor/fileuploader/NOTICE \
src/sunstone/public/vendor/fileuploader/fileuploader.js"
SUNSTONE_PUBLIC_VENDOR_XML2JSON="\
src/sunstone/public/vendor/xml2json/NOTICE \
src/sunstone/public/vendor/xml2json/jquery.xml2json.pack.js"
SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
src/sunstone/public/images/login_over.png \
src/sunstone/public/images/login.png \
@ -1123,6 +1196,16 @@ SUNSTONE_PUBLIC_IMAGES_FILES="src/sunstone/public/images/ajax-loader.gif \
src/sunstone/public/images/green_bullet.png \
src/sunstone/public/images/vnc_off.png \
src/sunstone/public/images/vnc_on.png"
SUNSTONE_PUBLIC_LOCALE_EN_US="\
src/sunstone/public/locale/en_US/en_US.js \
"
SUNSTONE_PUBLIC_LOCALE_RU="
src/sunstone/public/locale/ru/ru.js \
src/sunstone/public/locale/ru/ru_datatable.txt"
#-----------------------------------------------------------------------------
# Ozones files
@ -1183,8 +1266,9 @@ OZONES_PUBLIC_JS_FILES="src/ozones/Server/public/js/ozones.js \
src/ozones/Server/public/js/ozones-util.js \
src/sunstone/public/js/layout.js \
src/sunstone/public/js/sunstone.js \
src/sunstone/public/js/sunstone-util.js"
src/sunstone/public/js/sunstone-util.js \
src/sunstone/public/js/locale.js"
OZONES_PUBLIC_CSS_FILES="src/ozones/Server/public/css/application.css \
src/ozones/Server/public/css/layout.css \
src/ozones/Server/public/css/login.css"
@ -1214,6 +1298,71 @@ OZONES_BIN_CLIENT_FILES="src/ozones/Client/bin/onevdc \
OZONES_RUBY_LIB_FILES="src/oca/ruby/OpenNebula.rb"
#-----------------------------------------------------------------------------
# Self-Service files
#-----------------------------------------------------------------------------
SELF_SERVICE_TEMPLATE_FILES="src/cloud/occi/lib/ui/templates/login.html"
SELF_SERVICE_VIEWS_FILES="src/cloud/occi/lib/ui/views/index.erb"
SELF_SERVICE_PUBLIC_JS_FILES="src/cloud/occi/lib/ui/public/js/layout.js \
src/cloud/occi/lib/ui/public/js/occi.js \
src/cloud/occi/lib/ui/public/js/locale.js \
src/cloud/occi/lib/ui/public/js/login.js \
src/sunstone/public/js/sunstone.js \
src/sunstone/public/js/sunstone-util.js"
SELF_SERVICE_PUBLIC_JS_PLUGINS_FILES="src/cloud/occi/lib/ui/public/js/plugins/compute.js \
src/cloud/occi/lib/ui/public/js/plugins/configuration.js \
src/cloud/occi/lib/ui/public/js/plugins/dashboard.js \
src/cloud/occi/lib/ui/public/js/plugins/network.js \
src/cloud/occi/lib/ui/public/js/plugins/storage.js"
SELF_SERVICE_PUBLIC_CSS_FILES="src/cloud/occi/lib/ui/public/css/application.css \
src/cloud/occi/lib/ui/public/css/layout.css \
src/cloud/occi/lib/ui/public/css/login.css"
SELF_SERVICE_PUBLIC_CUSTOMIZE_FILES="src/cloud/occi/lib/ui/public/customize/custom.js"
SELF_SERVICE_PUBLIC_VENDOR_DATATABLES=$SUNSTONE_PUBLIC_VENDOR_DATATABLES
SELF_SERVICE_PUBLIC_VENDOR_JGROWL=$SUNSTONE_PUBLIC_VENDOR_JGROWL
SELF_SERVICE_PUBLIC_VENDOR_JQUERY=$SUNSTONE_PUBLIC_VENDOR_JQUERY
SELF_SERVICE_PUBLIC_VENDOR_JQUERYUI=$SUNSTONE_PUBLIC_VENDOR_JQUERYUI
SELF_SERVICE_PUBLIC_VENDOR_JQUERYUIIMAGES=$SUNSTONE_PUBLIC_VENDOR_JQUERYUIIMAGES
SELF_SERVICE_PUBLIC_VENDOR_JQUERYLAYOUT=$SUNSTONE_PUBLIC_VENDOR_JQUERYLAYOUT
SELF_SERVICE_PUBLIC_VENDOR_FLOT=$SUNSTONE_PUBLIC_VENDOR_FLOT
SELF_SERVICE_PUBLIC_VENDOR_CRYPTOJS=$SUNSTONE_PUBLIC_VENDOR_CRYPTOJS
SELF_SERVICE_PUBLIC_VENDOR_FILEUPLOADER=$SUNSTONE_PUBLIC_VENDOR_FILEUPLOADER
SELF_SERVICE_PUBLIC_VENDOR_XML2JSON=$SUNSTONE_PUBLIC_VENDOR_XML2JSON
SELF_SERVICE_PUBLIC_IMAGES_FILES="\
src/cloud/occi/lib/ui/public/images/ajax-loader.gif \
src/cloud/occi/lib/ui/public/images/green_bullet.png \
src/cloud/occi/lib/ui/public/images/login_over.png \
src/cloud/occi/lib/ui/public/images/login.png \
src/cloud/occi/lib/ui/public/images/network_icon.png \
src/cloud/occi/lib/ui/public/images/one-compute.png \
src/cloud/occi/lib/ui/public/images/one-network.png \
src/cloud/occi/lib/ui/public/images/one-storage.png \
src/cloud/occi/lib/ui/public/images/opennebula-selfservice-big.png \
src/cloud/occi/lib/ui/public/images/opennebula-selfservice-icon.png \
src/cloud/occi/lib/ui/public/images/opennebula-selfservice-small.png \
src/cloud/occi/lib/ui/public/images/panel.png \
src/cloud/occi/lib/ui/public/images/panel_short.png \
src/cloud/occi/lib/ui/public/images/pbar.gif \
src/cloud/occi/lib/ui/public/images/red_bullet.png \
src/cloud/occi/lib/ui/public/images/Refresh-icon.png \
src/cloud/occi/lib/ui/public/images/server_icon.png \
src/cloud/occi/lib/ui/public/images/storage_icon.png \
src/cloud/occi/lib/ui/public/images/vnc_off.png \
src/cloud/occi/lib/ui/public/images/vnc_on.png \
src/cloud/occi/lib/ui/public/images/yellow_bullet.png"
SELF_SERVICE_PUBLIC_LOCALE_EN_US="src/cloud/occi/lib/ui/public/locale/en_US/en_US.js"
SELF_SERVICE_PUBLIC_LOCALE_ES_ES="src/cloud/occi/lib/ui/public/locale/es_ES/es_ES.js \
src/cloud/occi/lib/ui/public/locale/es_ES/es_datatable.txt"
#-----------------------------------------------------------------------------
# ACCT files
#-----------------------------------------------------------------------------
@ -1292,7 +1441,7 @@ elif [ "$OZONES" = "yes" ]; then
INSTALL_SET="${INSTALL_OZONES_RUBY_FILES[@]} ${INSTALL_OZONES_FILES[@]}"
else
INSTALL_SET="${INSTALL_FILES[@]} ${INSTALL_OZONES_FILES[@]} \
${INSTALL_SUNSTONE_FILES[@]}"
${INSTALL_SUNSTONE_FILES[@]} ${INSTALL_SELF_SERVICE_FILES[@]}"
fi
for i in ${INSTALL_SET[@]}; do

View File

@ -43,18 +43,10 @@ fi
KILL_9_SECONDS=5
#------------------------------------------------------------------------------
# Function that checks for running daemons and gets PORT from conf
# Function that checks for running daemons
#------------------------------------------------------------------------------
setup()
{
PORT=$(sed -n '/^[ \t]*PORT/s/^.*PORT\s*=\s*\([0-9]\+\)\s*.*$/\1/p' \
$ONE_CONF)
if [ $? -ne 0 ]; then
echo "Can not find PORT in $ONE_CONF."
exit 1
fi
if [ -f $LOCK_FILE ]; then
if [ -f $ONE_PID ]; then
ONEPID=`cat $ONE_PID`
@ -150,17 +142,7 @@ start()
fi
# Start the scheduler
# The following command line arguments are supported by mm_shed:
# [-p port] to connect to oned - default: 2633
# [-t timer] seconds between two scheduling actions - default: 30
# [-m machines limit] max number of VMs managed in each scheduling action
# - default: 300
# [-d dispatch limit] max number of VMs dispatched in each scheduling action
# - default: 30
# [-h host dispatch] max number of VMs dispatched to a given host in each
# scheduling action - default: 1
$ONE_SCHEDULER -p $PORT -t 30 -m 300 -d 30 -h 1&
$ONE_SCHEDULER&
LASTRC=$?
LASTPID=$!

View File

@ -182,6 +182,19 @@ cmd=CommandParser::CmdParser.new(ARGV) do
end
end
reboot_desc = <<-EOT.unindent
Reboots the given VM, this is equivalent to execute the reboot command
from the VM console.
States: RUNNING
EOT
command :reboot, reboot_desc, [:range,:vmid_list] do
helper.perform_actions(args[0],options,"rebooting") do |vm|
vm.reboot
end
end
deploy_desc = <<-EOT.unindent
Deploys the given VM in the specified Host. This command forces the
deployment, in a standard installation the Scheduler is in charge

View File

@ -34,6 +34,9 @@
# x509, for x509 certificate encryption of tokens
:core_auth: cipher
# Life-time in seconds for token renewal (that used to handle OpenNebula auths)
:token_expiration_delta: 1800
# VM types allowed and its template file (inside templates directory)
:instance_types:
:small:
@ -48,3 +51,6 @@
:template: large.erb
:cpu: 8
:memory: 8192
# Default language setting for Self-Service UI
:lang: en_US

View File

@ -48,6 +48,9 @@ $: << RUBY_LIB_LOCATION+"/cloud" # For the Repository Manager
require 'rubygems'
require 'sinatra'
require 'yaml'
require 'erb'
require 'tempfile'
require 'json'
require 'OCCIServer'
require 'CloudAuth'
@ -71,6 +74,9 @@ CloudServer.print_configuration(conf)
##############################################################################
# Sinatra Configuration
##############################################################################
use Rack::Session::Pool, :key => 'occi'
set :public, Proc.new { File.join(root, "ui/public") }
set :views, settings.root + '/ui/views'
set :config, conf
if CloudServer.is_port_open?(settings.config[:server],
@ -98,22 +104,89 @@ set :cloud_auth, cloud_auth
##############################################################################
before do
begin
username = settings.cloud_auth.auth(request.env, params)
rescue Exception => e
error 500, e.message
end
unless request.path=='/ui/login' || request.path=='/ui'
if !authorized?
begin
username = settings.cloud_auth.auth(request.env, params)
rescue Exception => e
error 500, e.message
end
else
username = session[:user]
end
if username.nil?
error 401, ""
else
client = settings.cloud_auth.client(username)
@occi_server = OCCIServer.new(client, settings.config)
if username.nil? #unable to authenticate
error 401, ""
else
client = settings.cloud_auth.client(username)
@occi_server = OCCIServer.new(client, settings.config)
end
end
end
after do
unless request.path=='/ui/login' || request.path=='/ui'
unless session[:remember]
if params[:timeout] == true
env['rack.session.options'][:defer] = true
else
env['rack.session.options'][:expire_after] = 60*10
end
end
end
end
# Response treatment
helpers do
def authorized?
session[:ip] && session[:ip]==request.ip ? true : false
end
def build_session
begin
username = settings.cloud_auth.auth(request.env, params)
rescue Exception => e
error 500, e.message
end
if username.nil?
error 401, ""
else
client = settings.cloud_auth.client(username)
@occi_server = OCCIServer.new(client, settings.config)
user_id = OpenNebula::User::SELF
user = OpenNebula::User.new_with_id(user_id, client)
rc = user.info
if OpenNebula.is_error?(rc)
# Add a log message
return [500, ""]
end
session[:ip] = request.ip
session[:user] = username
session[:remember] = params[:remember]
if params[:remember]
env['rack.session.options'][:expire_after] = 30*60*60*24
end
if params[:lang]
session[:lang] = params[:lang]
else
session[:lang] = settings.config[:lang]
end
return [204, ""]
end
end
def destroy_session
session.clear
return [204, ""]
end
def treat_response(result,rc)
if OpenNebula::is_error?(result)
halt rc, result.message
@ -234,3 +307,55 @@ get '/user/:id' do
result,rc = @occi_server.get_user(request, params)
treat_response(result,rc)
end
##############################################
## UI
##############################################
post '/config' do
begin
body = JSON.parse(request.body.read)
rescue
[500, "POST Config: Error parsing configuration JSON"]
end
body.each do | key,value |
case key
when "lang" then session[:lang]=value
end
end
end
get '/ui/login' do
File.read(File.dirname(__FILE__)+'/ui/templates/login.html')
end
post '/ui/login' do
build_session
end
post '/ui/logout' do
destroy_session
end
get '/ui' do
if !authorized?
return File.read(File.dirname(__FILE__)+'/ui/templates/login.html')
end
time = Time.now + 60
response.set_cookie("occi-user",
:value=>"#{session[:user]}",
:expires=>time)
erb :index
end
post '/ui/upload' do
file = Tempfile.new('uploaded_image')
request.params['file'] = file.path #so we can re-use occi post_storage()
file.write(request.env['rack.input'].read)
#file.close # this would allow that file is garbage-collected
result,rc = @occi_server.post_storage(request)
treat_response(result,rc)
end

View File

@ -0,0 +1,589 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
body {
font: 9pt Arial, Verdana, Geneva, Helvetica, sans-serif;
}
p {
margin:0 10px 10px;
}
a {
color: #000C96; text-decoration: none;
}
a:hover {
color: #127FE4; text-decoration: none;
}
select, button {
padding: 2px;
}
h2 {
float:left;
font-size:20px;
margin-bottom: 5px;
padding-bottom: 0}
h3 {
border-bottom: 1px solid #CCCCCC;
color: #353735;
font-size: 14px;
font-weight: normal;
padding: 5px 8px;
margin: 0 0;
}
table#dashboard_table{
width:100%;
margin: 0;
}
table#dashboard_table tr {
vertical-align: top;
}
table#dashboard_table > tbody > tr > td{
width:50%;
}
div.panel {
background-color: #ffffff;
padding:0;
margin: 10px;
border: 1px #ddd solid;
min-height: 50px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
-moz-box-shadow: 5px 5px 5px #888;
-webkit-box-shadow: 5px 5px 5px #888;
box-shadow: 5px 5px 5px #888;
}
div.panel h3 {
border: 0;
padding:5px 10px 5px 10px;
margin: 0;
color: white;
font-weight: bold;
background-color: #353735;
-webkit-border-radius: 3px 3px 0 0;
-moz-border-radius: 3px 3px 0 0;
}
div.panel .new-resource {
float: right;
}
div.panel h3 a {
color: white;
font-weight: bold;
}
div.panel_info {
padding: 5px;
}
div.panel_info table.info_table {
background: none;
width: 100%;
margin:0;
}
div.panel_info table.info_table tr {
border: 0;
border-bottom: 1px dotted #ccc;
}
div.panel_info table.info_table > tbody > tr > td {
border: 0;
width: 100%!important;
}
div.panel_info table.info_table td.value_td {
text-align: right;
}
.green {
color: green!important;
}
.red {
color: #B81515!important;
}
ul.multi_action_menu { list-style: none; position: absolute; text-align: left; padding:0; border: 1px solid #D3D3D3; background-color: #F0EDED;}
ul.multi_action_menu li { cursor: pointer; padding: 2px 5px;}
ul.multi_action_menu li:hover { background-color: #D3D3D3;}
div.action_block {
display:inline;
margin-right: 5px;
border-right: 1px solid #D3D3D3;
}
div.action_blocks {
margin-bottom: 0.5em;
text-align: right;
margin-top: 0.5em;
}
input, textarea, select {
border: 0;
border: 1px #bbbbbb solid;
}
input, textarea {
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
}
form.create_form{
margin:0;
padding:0;}
fieldset{
margin:0 0;
border:none;
border-top:1px solid #ccc;
padding: 10px 5px;}
fieldset div{
margin-bottom:.5em;
padding:0;
display:block;
}
fieldset input,
fieldset textarea{
width:140px;
/*border-top:1px solid #555;
border-left:1px solid #555;
border-bottom:1px solid #ccc;
border-right:1px solid #ccc;*/
padding:1px;color:#333;
vertical-align: top;
margin: 0 2px;
margin-bottom: 4px;
}
fieldset select{
width:144px;
/*border-top:1px solid #555;
border-left:1px solid #555;
border-bottom:1px solid #ccc;
border-right:1px solid #ccc;*/
padding:1px;
color:#333;
vertical-align: top;
margin: 0 2px;
margin-bottom: 4px;
}
/*Chrome hack*/
input[type="radio"],input[type="checkbox"] {
width:20px;
}
legend{
margin-top:0;
margin-bottom: 5px;
padding:0 .5em;
color:#036;
background:transparent;
font-size:1.0em;
font-weight:bold;
}
label{
float: left;
width:100px;
padding:0 1em;
text-align:left;
}
.dataTables_wrapper label {
float: none;
width: auto;
padding: 0 0;
text-align:right;
}
div.tip {
display: inline-block;
padding-left: 5px;
vertical-align: middle;
float:none;
}
div.tip span.ui-icon{
display:inline-block;
}
div.tip span.man_icon {
display:none;
}
.img_man .man_icon {
display:inline-block!important;
}
span.tipspan,div.full_info {
position: fixed;
display:block;
padding:4px;
-webkit-border-radius: 3px;
-moz-border-radius: 3px;
border-radius: 3px;
border: 1px solid #353735;
margin-left:2px;
margin-right:5px;
background-color: white;
color: #353735;
font-size:10px;
}
.vm_section input {
float:none;
}
.vm_section legend{
display:none!important;
}
.vm_section fieldset {
border:none!important;
}
div.show_hide {
float:none;
clear:both;
}
.vm_param label{
float:left;
}
fieldset div.vm_section {
margin-top:-8px;
margin-bottom:0px;
}
input:focus,
textarea:focus{
background:#efefef;
color:#000;
}
.form_buttons {
margin-top:6px;
text-align:left;
margin-bottom:20px;
}
.add_remove_button {
font-size:0.8em !important;
height:25px !important;
margin-bottom:4px;
}
.add_button {
margin-left:148px;
width:58px !important;
}
.remove_button {
}
tr.odd, tr.even {
background-color: #ffffff;
border: 1px #e9e9e9 solid;
height:30px!important;
}
tr.odd td, tr.even td{
border-left: 1px #e9e9e9 solid;
}
tr.odd:hover{
background-color: #0098C3 !important;
color: white;
}
tr.even:hover{
color: white;
background-color: #0098C3 !important;
}
.show_hide label{
width: 100%;
}
.clear {
clear: both;
}
/* Create dialogs */
/* host: */
#create_host_form fieldset label {
width: 200px;
}
.action_block_info{
width: 235px;
margin: auto;
}
.icon_right {
display: inline-block;
margin-left: 20px;
position: relative;
top: 2px;
}
.icon_left {
float: left;
margin-right: 20px;
position: relative;
top: 0px;
/*border:1px solid;*/
}
.info_table{
background: none repeat scroll 0 0 #FFFFFF;
border-collapse: collapse;
margin: 20px;
text-align: left;
display: inline-block;
width:85%;
vertical-align:top;
overflow:auto;
}
.info_table > thead th,h3 {
border-bottom: 2px solid #353735;
color: #353735;
font-size: 14px;
font-weight: normal;
padding: 10px 8px;
}
.info_table > tbody > tr > td{
border-bottom: 1px solid #CCCCCC;
color: #353735;
padding-top: 6px;
padding-bottom: 6px;
padding-left: 8px;
padding-right: 8px;
}
/*.info_table > tbody, .info_table > thead, info_table > tbody > tr {
width: 100%;
}*/
.info_table td.key_td{
min-width: 150px;
text-align:left;
font-weight:bold;
}
.info_table td.graph_td{
padding-top:0px!important;
padding-bottom:0px!important;
vertical-align:middle!important;
}
.info_table td.value_td{
text-align:left;
width:100%;
}
#dialog > div > div {
margin: 0;
padding: 0;
}
.loading_img {
vertical-align:middle;
display:inline;
overflow:hide;
}
.top_button {
font-size: 0.8em!important;
height: 25px;
margin: 3px 2px;
vertical-align: middle;
/*width: 89px;*/
}
.top_button button {
font-size: 0.9em;
height: 25px;
vertical-align: middle;
}
.image_button {
font-size: 0.8em;
margin: 3px 2px;
vertical-align: middle;
border:0;
}
/*
.multi_action_slct{
font-size: 0.7em;
vertical-align:middle;
margin:3px 0;
height: 25px;
}*/
.ui-icon-refresh{
position:relative!important;
top:14px!important;
}
#vm_log {
padding: 0 20px 0 20px !important;
}
#vm_log h3 {
border-bottom: 2px solid #353735;
}
#vm_log pre {
font-size: 0.9em;
}
#vm_log .vm_log_error {
color: red;
font-weight: bold;
}
/* Growl */
.jGrowl-notification h1 {
font-size: 1.2em;
}
.jGrowl-notification, .jGrowl-notify-submit {
border: 2px #444444 solid;
background-color: #F3F3F3!important;
color: #666666;
}
.jGrowl-notify-error {
border: 2px #660000 solid;
background-color: #F39999!important;
color: #660000;
}
.jGrowl-notify-error table td.key_error {
text-transform: capitalize;
width: 100%;
font-weight: bold;
}
.jGrowl-notify-error table td.key_error:after {
content:":";
}
.refresh_image {
position: relative;
top: 8px;
cursor: pointer;
}
.ui-widget-overlay { background: #353735; opacity: .60; filter:Alpha(Opacity=60); }
.ui-tabs .ui-tabs-nav li a {
/*padding: .5em 1em;*/
padding: .3em 1em;
}
ul.action_list{
/*background: #EDEDED;*/
border: 1px solid #525252;
background-image: -webkit-gradient(
linear,
left bottom,
left top,
color-stop(0.25, #E9E9E9),
color-stop(0.63, #F5F5F5)
);
background-image: -moz-linear-gradient(
center bottom,
#E9E9E9 25%,
#F5F5F5 63%
);
position:absolute;
z-index:1;
list-style-type:none;
text-align:left;
padding:5px 5px;
-webkit-border-radius:4px;
-webkit-border-bottom-right-radius:5px;
-webkit-border-bottom-left-radius:5px;
-moz-border-radius:4px;
-moz-border-radius-bottomright:5px;
-moz-border-radius-bottomleft:5px;
border-radius:4px;
border-bottom-right-radius:5px;
border-bottom-left-radius:5px;
}
ul.action_list li a{
font-size: 0.8em;
color:#575C5B;
}
ul.action_list li a:hover{
color:#0098C3;
}
.progress_bar{
height:10px;
background: #8F9392;
}
.ui-widget{
font: 10pt Arial, Verdana, Geneva, Helvetica, sans-serif;
}
.ui-layout-resizer-open-hover, /* hover-color to 'resize' */
.ui-layout-resizer-dragging {
background: #EEE;
}
.dashboard_p {
color: #353735;
text-align:justify;
}
.dashboard_p p{
padding-top:5px;
}
.dashboard_p img {
padding-left:10px;
padding-right: 10px;
border:0;
}

View File

@ -0,0 +1,183 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
body {
background: #f5f5f5;
}
.outer-center, .inner-center {
padding: 0;
}
.outer-center {
border: 0;
}
.inner-south {
padding: 0;
}
#dialog div {
border: 0;
}
.tab {
padding: 5px 10px 0 10px;
}
body {
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 13px;
}
#header {
padding: 0 10px 0 10px;
background-color: #353735;
border:0;
}
#footer {
padding-top: 9px;
font-size: 0.8em;
color: white;
text-align: center;
background-color: #353735;
border:0;
}
#footer a {
color: white;
text-decoration: underline;
}
#logo {
padding-top: 6px;
font-weight: bold;
color: white;
float:left;
}
#login-info {
padding-top: 4px;
float: right;
padding-right: 5px;
}
#links {
padding-top: 4px;
margin-right: 40px;
float: right;
}
#login-info, #login-info a, #links, #links a {
color: white;
}
#login-info, #login-info a {
font-weight: bold;
}
.sunstone-color {
color: #0098C3;
}
#logo-wrapper {
float: right;
margin-top: 0px;
margin-right: 20px;
}
#menu {
padding-right: 0;
padding-left: 0;
border:0;
border-right: 1px solid #353735;
background-image: -webkit-gradient(
linear,
left top,
right top,
color-stop(0.95, rgb(99,102,99)),
color-stop(1, rgb(53,55,53))
);
background-image: -moz-linear-gradient(
left center,
rgb(99,102,99) 95%,
rgb(53,55,53) 100%
);
}
#navigation {
list-style: none;
padding: 0;
}
#navigation li {
line-height: 2em;
text-align: right;
padding-right: 10px;
}
#navigation li a {
color: #ffffff;
}
#navigation li:hover, .navigation-active-li {
background-image: -webkit-gradient(
linear,
left top,
right top,
color-stop(0.95, #0098C3),
color-stop(1, rgb(53,55,53))
);
background-image: -moz-linear-gradient(
left center,
#0098C3 95%,
rgb(53,55,53) 100%
);
/*
background-image: -webkit-gradient(
linear,
right top,
left top,
color-stop(0, rgb(0,152,192)),
color-stop(1, rgb(255,255,255))
);
background-image: -moz-linear-gradient(
right center,
rgb(0,152,192) 0%,
rgb(255,255,255) 100%
);
*/
}
.navigation-active-li-a {
font-weight: bold;
}
#navigation li:hover a, .navigation-active-li-a {
color: #ffffff !important;
}
#language {
float:right;
margin-top:2px;
margin-right:25px;
width: 100px;
}
#language select {
width: 100px;
height: 22px;
}

View File

@ -0,0 +1,162 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
body {
background: #FAFAFA;
margin: 0px;
}
#header {
height: 30px;
background-color: #353735;
padding: 0 10px 0 10px;
}
#logo {
padding-top: 6px;
font-size: 1.1em;
font-weight: bold;
color: white;
font-family: Arial, Verdana, Geneva, Helvetica, sans-serif;
font-size: 13px;
}
#wrapper{
margin-left: auto;
margin-right: auto;
width: 900px;
text-align: center;
}
div#logo_sunstone {
position: relative;
height: 100px;
width: 600px;
top: 80px;
margin-left: auto;
margin-right: auto;
background: url(../images/opennebula-selfservice-big.png) no-repeat center;
vertical-align: center;
}
div#login {
width: 400px;
height: 300px;
position: relative;
margin-left: auto;
margin-right: auto;
top: 90px;
padding-left: 80px;
padding-right: 80px;
background: url(../images/panel.png) no-repeat center ;
vertical-align: center;
}
.box {
font-size:0.8em;
width: 300px;
height: 25px;
background: #FFFFFF;
margin-left: auto;
margin-right: auto;
margin-bottom: 10px;
border-bottom-color: gray;
border-bottom-left-radius: 5px;
border-bottom-right-radius: 5px;
border-bottom-style: solid;
border-bottom-width: 1px;
border-left-color: gray;
border-left-style: solid;
border-left-width: 1px;
border-right-color: gray;
border-right-style: solid;
border-right-width: 1px;
border-top-color: gray;
border-top-left-radius: 5px;
border-top-right-radius: 5px;
border-top-style: solid;
border-top-width: 1px;
-moz-border-radius: 5px;
-moz-border-radius-topleft: 5px;
-moz-border-radius-topright: 5px;
-moz-border-radius-bottomright: 5px;
-moz-border-radius-bottomleft: 5px;
}
div#login input#login_btn {
width: 130px;
height: 45px;
cursor: pointer;
margin-left: auto;
margin-right: 43px;
margin-top: 20px;
background-color: transparent;
border:0;
float: right;
background: url(../images/login.png) no-repeat center ;
}
div#login input#login_btn:hover {
width: 130px;
height: 45px;
cursor: pointer;
margin-left: auto;
margin-right: 43px;
margin-top: 20px;
background-color: transparent;
border:0;
float: right;
background: url(../images/login_over.png) no-repeat center ;
}
.error_message {
display: none;
position: relative;
top: 80px;
font-family: Arial, Helvetica, sans-serif;
color:red;
font-size:1.6em;
}
#label_remember {
color:#353735;
font-size:0.4em;
font-family: Arial, Helvetica, sans-serif;
}
.content {
padding-top:40px;
font-size:1.8em;
margin-bottom:0px;
margin-left:50px;
text-align:left;
font-family: Arial, Helvetica, sans-serif;
}
#check_remember {
margin-top: 35px;
margin-left:0px;
}

View File

@ -0,0 +1,105 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
//OpenNebula Self-Service customization file.
//Use tr("String") to enable text translation.
//You can use HTML and the following variables.
var $vm_count = '<span class="vm_count" />';
var $storage_count = '<span class="storage_count" />';
var $network_count = '<span class="network_count" />';
//Login logo 591x43px - not implemented
var logo_big = "images/opennebula-selfservice-big.png";
//Top left logo 179x14px - not implemented
var logo_small = "images/opennebula-selfservice-small.png";
////////////////////////////////////////////////////////////////
// Dashboard tab customization
////////////////////////////////////////////////////////////////
////
//Dashboard Welcome box
////
var dashboard_welcome_title = tr("Welcome to OpenNebula Self-Service");
var dashboard_welcome_image = "images/opennebula-selfservice-icon.png"
var dashboard_welcome_html = '<p>'+tr("OpenNebula Self-Service is a simplified user interface to manage OpenNebula compute, storage and network resources. It is focused on easiness and usability and features a limited set of operations directed towards end-users.")+'</p>\
<p>'+tr("Additionally, OpenNebula Self-Service allows easy customization of the interface (e.g. this text) and brings multi-language support.")+'</p>\
<p>'+tr("Have a cloudy experience!")+'</p>';
////
//Dashboard useful links box
//Array of { href: "address", text: "text" },...
////
var dashboard_links = [
{ href: "http://opennebula.org/documentation:documentation",
text: tr("Documentation")
},
{ href: "http://opennebula.org/support:support",
text: tr("Support")
},
{ href: "http://opennebula.org/community:community",
text: tr("Community")
}
];
////
//Dashboard right-side boxes
////
var compute_box_title = tr("Compute");
var compute_box_image = "images/server_icon.png"; //scaled to 100px width
var compute_box_html = '<p>'+tr("Compute resources are Virtual Machines attached to storage and network resources. OpenNebula Self-Service allows you to easily create, remove and manage them, including the possibility of pausing a Virtual Machine or taking a snapshot of one of their disks.")+'</p>';
var storage_box_title = tr("Storage");
var storage_box_image = "images/storage_icon.png"; //scaled to 100px width
var storage_box_html = '<p>'+tr("Storage pool is formed by several images. These images can contain from full operating systems to be used as base for compute resources, to simple data. OpenNebula Self-Service offers you the possibility to create or upload your own images.")+'</p>';
var network_box_title = tr("Network");
var network_box_image = "images/network_icon.png";
var network_box_html = '<p>'+tr("Your compute resources connectivity is performed using pre-defined virtual networks. You can create and manage these networks using OpenNebula Self-Service.")+'</p>';
///////////////////////////////////////////////////////////
//Compute tab
///////////////////////////////////////////////////////////
var compute_dashboard_image = "images/one-compute.png";
var compute_dashboard_html = '<p>' + tr("This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking \'new\' and filling-in an easy wizard.")+'</p>\
<p>'+tr("You can also manage compute resources and perform actions such as stop, resume, shutdown or cancel.")+'</p>\
<p>'+tr("Additionally, you can take a \'snapshot\' of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.")+'</p>\
<p>'+tr("There are currently")+' <b>'+$vm_count+'</b> '+
tr("virtual machines")+'.</p>';
///////////////////////////////////////////////////////////
//Storage tab
///////////////////////////////////////////////////////////
var storage_dashboard_image = "images/one-storage.png";
var storage_dashboard_html = '<p>'+tr("The Storage view offers you an overview of your current images. Storage elements are attached to compute resources at creation time. They can also be extracted from running virtual machines by taking an snapshot.")+'</p>\
<p>'+tr("You can add new storages by clicking \'new\'. Image files will be uploaded to OpenNebula and set ready to be used.")+'</p>\
<p>'+tr("Additionally, you can run several operations on defined storages, such as defining their persistance. Persistent images can only be used by 1 virtual machine, and the changes made by it have effect on the base image. Non-persistent images are cloned before being used in a Virtual Machine, therefore changes are lost unless a snapshot is taken prior to Virtual Machine shutdown.")+'</p>\
<p>'+tr("There are currently")+' <b>'+$storage_count+'</b> '+
tr("images")+'.</p>';
///////////////////////////////////////////////////////////
//Network tab
///////////////////////////////////////////////////////////
var network_dashboard_image = "image/one-network.png";
var network_dashboard_html = '<p>'+tr("In this view you can easily manage OpenNebula Network resources. You can add or remove virtual networks.")+'</p>\
<p>'+tr("Compute resources can be attached to these networks at creation time. Virtual machines will be provided with an IP and the correct parameters to ensure connectivity.")+'</p>\
<p>'+
tr("There are currently")+' <b>'+$network_count+'</b> '+
tr("networks")+'.</p>';

Binary file not shown.

After

Width:  |  Height:  |  Size: 447 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 673 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.0 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.2 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.9 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 9.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 849 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 551 B

View File

@ -0,0 +1,110 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
var activeTab;
var outerLayout, innerLayout;
function hideDialog(){
innerLayout.close("east");
}
function popDialog(content){
$("#dialog").html(content);
innerLayout.open("east");
}
function popDialogLoading(){
var loading = '<div style="margin-top:'+Math.round($("#dialog").height()/6)+'px; text-align: center; width: 100%"><img src="images/pbar.gif" alt="loading..." /></div>';
popDialog(loading);
}
function showTab(tabname){
activeTab = tabname;
//clean selected menu
$("#navigation li").removeClass("navigation-active-li");
$("#navigation li a").removeClass("navigation-active-li-a");
//select menu
var li = $("#navigation li:has(a[href='"+activeTab+"'])")
var li_a = $("#navigation li a[href='"+activeTab+"']")
li.addClass("navigation-active-li");
li_a.addClass("navigation-active-li-a");
//show tab
$(".tab").hide();
$(activeTab).show();
//~ if (activeTab == '#dashboard') {
//~ emptyDashboard();
//~ preloadTables();
//~ }
innerLayout.close("south");
}
$(document).ready(function () {
$(".tab").hide();
$(".outer-west ul li.subTab a").live("click",function(){
var tab = $(this).attr('href');
showTab(tab);
return false;
});
$(".outer-west ul li.topTab a").live("click",function(){
var tab = $(this).attr('href');
//toggle subtabs trick
$('li.'+tab.substr(1)).toggle();
showTab(tab);
return false;
});
outerLayout = $('body').layout({
applyDefaultStyles: false
, center__paneSelector: ".outer-center"
, west__paneSelector: ".outer-west"
, west__size: 133
, north__size: 26
, south__size: 26
, spacing_open: 0 // ALL panes
, spacing_closed: 0 // ALL panes
//, north__spacing_open: 0
//, south__spacing_open: 0
, north__maxSize: 200
, south__maxSize: 200
, south__closable: false
, north__closable: false
, west__closable: false
, south__resizable: false
, north__resizable: false
, west__resizable: false
});
var factor = 0.45;
var dialog_height = Math.floor($(".outer-center").width()*factor);
innerLayout = $('div.outer-center').layout({
fxName: "slide"
, initClosed: true
, center__paneSelector: ".inner-center"
, east__paneSelector: ".inner-east"
, east__size: dialog_height
, east__minSize: 400
, spacing_open: 5 // ALL panes
, spacing_closed: 5 // ALL panes
});
});

View File

@ -0,0 +1,56 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
var lang=""
var locale = {};
var datatable_lang = "";
function tr(str){
var tmp = locale[str];
if ( tmp == null || tmp == "" ) {
//console.debug("Missing translation: "+str);
tmp = str;
}
return tmp;
};
//Pops up loading new language dialog. Retrieves the user template, updates the LANG variable.
//Updates template and session configuration and reloads the view.
function setLang(lang_str){
var dialog = $('<div title="'+tr("Changing language")+'">'+tr("Loading new language... please wait")+' '+spinner+'</div>').dialog({
draggable:false,
modal:true,
resizable:false,
buttons:{},
width: 460,
minHeight: 50
});
if (('localStorage' in window) && (window['localStorage'] !== null)){
localStorage['lang']=lang_str;
};
$.post('config',JSON.stringify({lang:lang_str}),function(){window.location.href = "./ui"});
};
$(document).ready(function(){
//Update static translations
$('#doc_link').text(tr("Documentation"));
$('#support_link').text(tr("Support"));
$('#community_link').text(tr("Community"));
$('#welcome').text(tr("Welcome"));
$('#logout').text(tr("Sign out"));
});

View File

@ -0,0 +1,71 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
function auth_success(req, response){
window.location.href = "./ui";
}
function auth_error(req, error){
var status = error.error.http_status;
switch (status){
case 401:
$("#one_error").hide();
$("#auth_error").fadeIn("slow");
break;
case 500:
$("#auth_error").hide();
$("#one_error").fadeIn("slow");
break;
};
}
function authenticate(){
var username = $("#username").val();
var password = $("#password").val();
password = Crypto.SHA1(password);
var remember = $("#check_remember").is(":checked");
var obj = { data: {username: username,
password: password},
remember: remember,
success: auth_success,
error: auth_error
};
if (('localStorage' in window) && (window['localStorage'] !== null) && (localStorage['lang'])){
obj['lang'] = localStorage['lang'];
};
OCCI.Auth.login(obj);
}
$(document).ready(function(){
$("#login_form").submit(function (){
authenticate();
return false;
});
//compact login elements according to screen height
if (screen.height <= 600){
$('div#logo_sunstone').css("top","15px");
$('div#login').css("top","10px");
$('.error_message').css("top","10px");
};
$("input#username.box").focus();
});

View File

@ -0,0 +1,623 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
//Convert json into the XML that OCCI server can understand
function json2xml(element,root_key) {
var xml = "";
if (!root_key) root_key="ROOT";
if (typeof element == "object") { //Its an object
$.each(element, function(key,value){
if (value.constructor == Array){
for (var i = 0; i < value.length; i++){
xml += json2xml(value[i],key);
};
//do not wrap arrays in root_key
return xml;
} else
xml += json2xml(value,key);
});
} else { //its a simple value. Base condition
xml += element.toString();
};
return "<" + root_key.toUpperCase() + ">" + xml + "</" + root_key.toUpperCase() + ">";
};
$.ajaxSetup({
converters: {
"xml ONEjson": function(xml){
return $.xml2json(xml);
},
}
});
var OCCI = {
"Error": function(resp)
{
var error = {
error : {
message: resp.responseText,
http_status : resp.status}
};
return error;
},
"is_error": function(obj)
{
return obj.error ? true : false;
},
"Helper": {
"resource_state": function(type, value)
{
switch(type)
{
case "HOST","host":
return ["INIT",
"MONITORING",
"MONITORED",
"ERROR",
"DISABLED"][value];
break;
case "HOST_SIMPLE","host_simple":
return ["ON",
"ON",
"ON",
"ERROR",
"OFF"][value];
break;
case "VM","vm":
return ["INIT",
"PENDING",
"HOLD",
"ACTIVE",
"STOPPED",
"SUSPENDED",
"DONE",
"FAILED"][value];
break;
case "VM_LCM","vm_lcm":
return ["LCM_INIT",
"PROLOG",
"BOOT",
"RUNNING",
"MIGRATE",
"SAVE_STOP",
"SAVE_SUSPEND",
"SAVE_MIGRATE",
"PROLOG_MIGRATE",
"PROLOG_RESUME",
"EPILOG_STOP",
"EPILOG",
"SHUTDOWN",
"CANCEL",
"FAILURE",
"CLEANUP",
"UNKNOWN"][value];
break;
case "IMAGE","image":
return ["INIT",
"READY",
"USED",
"DISABLED",
"LOCKED",
"ERROR"][value];
break;
default:
return;
}
},
"image_type": function(value)
{
return ["OS", "CDROM", "DATABLOCK"][value];
},
"action": function(action, params)
{
obj = {
"action": {
"perform": action
}
}
if (params)
{
obj.action.params = params;
}
return obj;
},
"request": function(resource, method, data) {
var r = {
"request": {
"resource" : resource,
"method" : method
}
}
if (data)
{
if (typeof(data) != "array")
{
data = [data];
}
r.request.data = data;
}
return r;
},
"pool": function(resource, response)
{
var pool_name = resource + "_COLLECTION";
var type = resource;
var pool;
if (typeof(pool_name) == "undefined")
{
return Error('Incorrect Pool');
}
var p_pool = [];
if (response[pool_name]) {
pool = response[pool_name][type];
} else { pull = null };
if (pool == null)
{
return p_pool;
}
else if (pool.length)
{
for (i=0;i<pool.length;i++)
{
p_pool[i]={};
p_pool[i][type]=pool[i];
}
return(p_pool);
}
else
{
p_pool[0] = {};
p_pool[0][type] = pool;
return(p_pool);
}
}
},
"Action": {
//server requests helper methods
"create": function(params,resource){
var callback = params.success;
var callback_error = params.error;
var data = json2xml(params.data,resource);
var request = OCCI.Helper.request(resource,"create", data);
$.ajax({
url: resource.toLowerCase(),
type: "POST",
dataType: "xml ONEjson",
data: data,
success: function(response){
var res = {};
res[resource] = response;
return callback ? callback(request, res) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
"delete": function(params,resource){
var callback = params.success;
var callback_error = params.error;
var id = params.data.id;
var request = OCCI.Helper.request(resource,"delete", id);
$.ajax({
url: resource.toLowerCase() + "/" + id,
type: "DELETE",
dataType: "xml ONEjson",
success: function(){
return callback ? callback(request) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
"list": function(params,resource){
var callback = params.success;
var callback_error = params.error;
var timeout = params.timeout || false;
var request = OCCI.Helper.request(resource,"list");
$.ajax({
url: resource.toLowerCase(),
type: "GET",
data: {timeout: timeout},
dataType: "xml ONEjson",
success: function(response){
var res = {};
res[resource+"_COLLECTION"] = response;
return callback ?
callback(request, OCCI.Helper.pool(resource,res)) : null;
},
error: function(response)
{
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
//Subresource examples: "fetch_template", "log"...
"show": function(params,resource){
var callback = params.success;
var callback_error = params.error;
var id = params.data.id;
var request = OCCI.Helper.request(resource,"show", id);
var url = resource.toLowerCase() + "/" + id;
$.ajax({
url: url,
type: "GET",
dataType: "xml ONEjson",
success: function(response){
var res = {};
res[resource] = response;
return callback ? callback(request, res) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
//Example: Simple action: publish. Simple action with action obj: deploy
//OCCI, rewrite
"update": function(params,resource,method,action_obj){
var callback = params.success;
var callback_error = params.error;
var id = params.data.id;
var body = json2xml(params.data.body,resource);
var request = OCCI.Helper.request(resource,method, id);
$.ajax({
url: resource.toLowerCase() + "/" + id,
type: "PUT",
data: body,
dataType: "xml ONEjson",
success: function(response){
var res = {};
res[resource] = response;
return callback ? callback(request,res) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
/*
"monitor": function(params,resource,all){
var callback = params.success;
var callback_error = params.error;
var data = params.data;
var method = "monitor";
var action = OpenNebula.Helper.action(method);
var request = OpenNebula.Helper.request(resource,method, data);
var url = resource.toLowerCase();
url = all ? url + "/monitor" : url + "/" + params.data.id + "/monitor";
$.ajax({
url: url,
type: "GET",
data: data['monitor'],
dataType: "json",
success: function(response){
return callback ? callback(request, response) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OpenNebula.Error(response)) : null;
}
});
}
*/
},
"Auth": {
"resource": "AUTH",
"login": function(params)
{
var callback = params.success;
var callback_error = params.error;
var username = params.data.username;
var password = params.data.password;
var remember = params.remember;
var lang = params.lang;
var resource = OCCI.Auth.resource;
var request = OCCI.Helper.request(resource,"login");
$.ajax({
url: "ui/login",
type: "POST",
data: {remember: remember, lang: lang},
beforeSend : function(req) {
req.setRequestHeader( "Authorization",
"Basic " + btoa(username + ":" + password)
)
},
success: function(response){
return callback ? callback(request, response) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
"logout": function(params)
{
var callback = params.success;
var callback_error = params.error;
var resource = OCCI.Auth.resource;
var request = OCCI.Helper.request(resource,"logout");
$.ajax({
url: "ui/logout",
type: "POST",
success: function(response){
return callback ? callback(request, response) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
}
},
"Network": {
"resource": "NETWORK",
"create": function(params){
OCCI.Action.create(params,OCCI.Network.resource);
},
"delete": function(params){
OCCI.Action.delete(params,OCCI.Network.resource);
},
"list": function(params){
OCCI.Action.list(params,OCCI.Network.resource);
},
"show": function(params){
OCCI.Action.show(params,OCCI.Network.resource);
},
"publish": function(params){
params.data.body = { "PUBLIC": "YES" };
OCCI.Action.update(params,OCCI.Network.resource,"publish");
},
"unpublish": function(params){
params.data.body = { "PUBLIC": "NO" };
OCCI.Action.update(params,OCCI.Network.resource,"unpublish");
},
},
"VM": {
"resource": "COMPUTE",
"create": function(params){
OCCI.Action.create(params,OCCI.VM.resource);
},
"delete": function(params){
OCCI.Action.delete(params,OCCI.VM.resource);
},
"list": function(params){
OCCI.Action.list(params,OCCI.VM.resource);
},
"show": function(params){
OCCI.Action.show(params,OCCI.VM.resource);
},
"shutdown": function(params){
params.data.body = { state : "SHUTDOWN" };
OCCI.Action.update(params,OCCI.VM.resource,"shutdown");
},
"stop": function(params){
params.data.body = { state : "STOPPED" };
OCCI.Action.update(params,OCCI.VM.resource,"stop");
},
"cancel": function(params){
params.data.body = { state : "CANCEL" };
OCCI.Action.update(params,OCCI.VM.resource,"cancel");
},
"suspend": function(params){
params.data.body = { state : "SUSPENDED" };
OCCI.Action.update(params,OCCI.VM.resource,"suspend");
},
"resume": function(params){
params.data.body = { state : "RESUME" };
OCCI.Action.update(params,OCCI.VM.resource,"resume");
},
"done": function(params){
params.data.body = { state : "DONE" };
OCCI.Action.update(params,OCCI.VM.resource,"done");
},
"saveas" : function(params){
var obj = params.data.extra_param;
var disk_id = obj.disk_id;
var im_name = obj.image_name;
params.data.body = '<DISK id="'+disk_id+'"><SAVE_AS name="'+im_name+'" /></DISK>';
OCCI.Action.update(params,OCCI.VM.resource,"saveas");
},
/* "vnc" : function(params,startstop){
var callback = params.success;
var callback_error = params.error;
var id = params.data.id;
var resource = OCCI.VM.resource;
var method = startstop;
var action = OCCI.Helper.action(method);
var request = OCCI.Helper.request(resource,method, id);
$.ajax({
url: "vm/" + id + "/" + method,
type: "POST",
dataType: "json",
success: function(response){
return callback ? callback(request, response) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
"startvnc" : function(params){
OCCI.VM.vnc(params,"startvnc");
},
"stopvnc" : function(params){
OCCI.VM.vnc(params,"stopvnc");
},
"monitor" : function(params){
OCCI.Action.monitor(params,OCCI.VM.resource,false);
},
"monitor_all" : function(params){
OCCI.Action.monitor(params,OCCI.VM.resource,true);
}*/
},
"Image": {
"resource": "STORAGE",
"create": function(params){
var callback = params.success;
var callback_error = params.error;
var data = {occixml : json2xml(params.data,OCCI.Image.resource)};
var request = OCCI.Helper.request(OCCI.Image.resource,"create", data);
$.ajax({
type: 'POST',
url: "storage",
data: data,
dataType: "xml ONEjson",
success: function(response){
var res = {};
res["STORAGE"] = response;
return callback ? callback(request, res) : null;
},
error: function(response){
return callback_error ?
callback_error(request, OCCI.Error(response)) : null;
}
});
},
"delete": function(params){
OCCI.Action.delete(params,OCCI.Image.resource);
},
"list": function(params){
OCCI.Action.list(params,OCCI.Image.resource);
},
"show": function(params){
OCCI.Action.show(params,OCCI.Image.resource);
},
"publish": function(params){
params.data.body = { "PUBLIC":"YES" };
OCCI.Action.update(params,OCCI.Image.resource,"publish");
},
"unpublish": function(params){
params.data.body = { "PUBLIC":"NO" };
OCCI.Action.update(params,OCCI.Image.resource,"unpublish");
},
"persistent": function(params){
params.data.body = { "PERSISTENT":"YES" };
OCCI.Action.update(params,OCCI.Image.resource,"persistent");
},
"nonpersistent": function(params){
params.data.body = { "PERSISTENT":"NO" };
OCCI.Action.update(params,OCCI.Image.resource,"nonpersistent");
},
},
"Template" : {
"resource" : "VMTEMPLATE",
"create" : function(params){
OCCI.Action.create(params,OCCI.Template.resource);
},
"delete" : function(params){
OCCI.Action.delete(params,OCCI.Template.resource);
},
"list" : function(params){
OCCI.Action.list(params,OCCI.Template.resource);
},
"show" : function(params){
OCCI.Action.show(params,OCCI.Template.resource);
},
"chown" : function(params){
OCCI.Action.chown(params,OCCI.Template.resource);
},
"chgrp" : function(params){
OCCI.Action.chgrp(params,OCCI.Template.resource);
},
"update" : function(params){
var action_obj = {"template_raw" : params.data.extra_param };
OCCI.Action.simple_action(params,
OCCI.Template.resource,
"update",
action_obj);
},
"fetch_template" : function(params){
OCCI.Action.show(params,OCCI.Template.resource,"template");
},
"publish" : function(params){
OCCI.Action.simple_action(params,OCCI.Template.resource,"publish");
},
"unpublish" : function(params){
OCCI.Action.simple_action(params,OCCI.Template.resource,"unpublish");
},
"instantiate" : function(params) {
var vm_name = params.data.extra_param ? params.data.extra_param : "";
var action_obj = { "vm_name" : vm_name };
OCCI.Action.simple_action(params,OCCI.Template.resource,
"instantiate",action_obj);
}
},
"Instance_type" : {
"resource" : "INSTANCE_TYPE",
"list" : function(params){
OCCI.Action.list(params,OCCI.Instance_type.resource);
},
},
}

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,62 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
var config_tab_content =
'<form>\
<table id="config_table" style="width:100%">\
<tr>\
<td>\
<div class="panel">\
<h3>' + tr("Self-Service UI Configuration") + '</h3>\
<div class="panel_info">\
\
<table class="info_table">\
<tr>\
<td class="key_td">' + tr("Language") + '</td>\
<td class="value_td">\
<select id="lang_sel" style="width:20em;">\
<option value="en_US">'+tr("English")+'</option>\
<option value="es_ES">'+tr("Spanish")+'</option>\
</select>\
</td>\
</tr>\
</table>\
\
</div>\
</div>\
</td>\
</tr>\
</table></form>';
var config_tab = {
title: tr("Configuration"),
content: config_tab_content
}
Sunstone.addMainTab('config_tab',config_tab);
$(document).ready(function(){
if (lang)
$('table#config_table #lang_sel option[value="'+lang+'"]').attr('selected','selected');
$('table#config_table #lang_sel').change(function(){
setLang($(this).val());
});
$('#li_config_tab a').click(function(){
hideDialog();
});
});

View File

@ -0,0 +1,200 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
var dashboard_tab_content =
'<table id="dashboard_table">\
<tr>\
<td style="width:50%">\
<table id="information_table" style="width:100%">\
<tr>\
<td>\
<div class="panel">\
<h3>' + dashboard_welcome_title + '</h3>\
<div class="panel_info dashboard_p">\
<img style="float:left;width:100px;" src="'+
dashboard_welcome_image+'" />'+
dashboard_welcome_html+'\
</div>\
</div>\
</td>\
</tr>\
<tr>\
<td>\
<div class="panel">\
<h3>' + tr("Current resources") + '</h3>\
<div class="panel_info">\
\
<table class="info_table">\
<tr>\
<td class="key_td">'+tr("Compute")+'</td>\
<td class="value_td">'+$vm_count+'</span></td>\
</tr>\
<tr>\
<td class="key_td">' + tr("Storage") + '</td>\
<td class="value_td">'+$storage_count+'</span></td>\
</tr>\
<tr>\
<td class="key_td">' + tr("Network") + '</td>\
<td class="value_td">'+$network_count+'</span></td>\
</tr>\
</table>\
\
</div>\
</div>\
</td>\
</tr>\
<tr>\
<td>\
<div class="panel">\
<h3>' + tr("Useful links") + '</h3>\
<div class="panel_info dashboard_p">'+
generateDashboardLinks() +'\
</div>\
</div>\
</td>\
</tr>\
</table>\
</td>\
<td style="width:50%">\
<table id="hosts" style="width:100%">\
<tr>\
<td>\
<div class="panel">\
<h3>' + compute_box_title + '</h3>\
<div class="panel_info dashboard_p">\
<img style="float:right;width:100px;" src="'+
compute_box_image + '" />'+
compute_box_html +
'<p><span class="ui-icon ui-icon-arrowreturnthick-1-e" style="display:inline-block;vertical-align:middle;"/><a class="action_link" href="#vms_tab" action="VM.create_dialog">'+tr("Create new compute resource")+'</a><br />\
<span class="ui-icon ui-icon-arrowreturnthick-1-e" style="display:inline-block;vertical-align:middle;"/><a class="tab_link" href="#vms_tab">'+tr("See more")+'</a></p>\
</div>\
</div>\
</td>\
</tr>\
<tr>\
<td>\
<div class="panel">\
<h3>' + storage_box_title + '</h3>\
<div class="panel_info dashboard_p">\
<img style="float:right;width:100px;" src="'+
storage_box_image +'" />' +
storage_box_html +
'<p><span class="ui-icon ui-icon-arrowreturnthick-1-e" style="display:inline-block;vertical-align:middle;"/><a class="action_link" href="#images_tab" action="Image.create_dialog">'+tr("Create new storage resource")+'</a><br />\
<span class="ui-icon ui-icon-arrowreturnthick-1-e" style="display:inline-block;vertical-align:middle;"/><a class="tab_link" href="#images_tab">'+tr("See more")+'</a></p>\
</div>\
</div>\
</td>\
</tr>\
<tr>\
<td>\
<div class="panel">\
<h3>' + network_box_title + '</h3>\
<div class="panel_info dashboard_p">\
<p><img style="float:right;width:100px;" src="' +
network_box_image +'" />' +
network_box_html +
'<p><span class="ui-icon ui-icon-arrowreturnthick-1-e" style="display:inline-block;vertical-align:middle;"/><a class="action_link" href="#vnets_tab" action="Network.create_dialog">'+tr("Create new network resource")+'</a><br />\
<span class="ui-icon ui-icon-arrowreturnthick-1-e" style="display:inline-block;vertical-align:middle;"/><a class="tab_link" href="#vnets_tab">'+tr("See more")+'</a><br /></p>\
</div>\
</div>\
</td>\
</tr>\
</table>\
</td>\
</tr></table>';
var dashboard_tab = {
title: tr("Dashboard"),
content: dashboard_tab_content
}
Sunstone.addMainTab('dashboard_tab',dashboard_tab);
function quickstart_setup(){
$('#dashboard_table #quickstart_form input',main_tabs_context).click(function(){
Sunstone.runAction($(this).val());
});
};
function generateDashboardLinks(){
var links="<ul>";
for (var i=0; i<dashboard_links.length;i++){
links+='<li><a href="'+dashboard_links[i].href+'" target="_blank">'+dashboard_links[i].text+'</a></li>';
};
links+="</ul>";
return links;
};
$(document).ready(function(){
//Dashboard link listener
$("#dashboard_table h3 a",main_tabs_context).live("click", function (){
var tab = $(this).attr('href');
showTab(tab);
return false;
});
$('.tab_link').click(function(){
var to= $(this).attr('href');
$('.outer-west ul li.topTab a[href="'+to+'"]').trigger("click");
return false;
});
$('.action_link').click(function(){
var to= $(this).attr('href');
$('.outer-west ul li.topTab a[href="'+to+'"]').trigger("click");
var action = $(this).attr('action');
Sunstone.runAction(action);
//var to= $(this).attr('href');
//$('.outer-west ul li.topTab a[href="'+to+'"]').trigger("click");
return false;
});
emptyDashboard();
quickstart_setup();
$('#li_dashboard_tab a').click(function(){
hideDialog();
});
});
//puts the dashboard values into "retrieving"
function emptyDashboard(){
$("#dashboard_tab .value_td span",main_tabs_context).html(spinner);
}
function updateDashboard(what,json_info){
var db = $('#dashboard_tab',main_tabs_context);
switch (what){
case "vms":
var total_vms=json_info.length;
$('.vm_count',db).html(total_vms);
break;
case "vnets":
var total_vnets=json_info.length;
$('.network_count',db).html(total_vnets);
break;
case "images":
var total_images=json_info.length;
$('.storage_count',db).html(total_images);
break;
}
}

View File

@ -0,0 +1,436 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
/*Virtual networks tab plugin*/
var vnets_tab_content =
'<form id="virtualNetworks_form" action="javascript:alert(\'js error!\');">\
<div class="action_blocks">\
</div>\
<table id="datatable_vnetworks" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Name")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyvnetworks">\
</tbody>\
</table>\
</form>';
var create_vn_tmpl =
'<div id="vn_tabs">\
<div id="easy">\
<form id="create_vn_form_easy" action="">\
<fieldset>\
<label for="name">'+tr("Name")+':</label>\
<input type="text" name="name" id="name" /><br />\
</fieldset>\
<div class="clear"></div>\
<div id="ranged">\
<fieldset>\
<label for="net_address">'+tr("Network Address")+':</label>\
<input type="text" name="net_address" id="net_address" /><div class="clear" />\
<label for="net_size">'+tr("Network Size")+':</label>\
<input type="text" name="net_size" id="net_size" /><br />\
</fieldset>\
</div>\
<div class="clear"></div>\
</fieldset>\
<div class="form_buttons">\
<button class="vnet_close_dialog_link"/>\
<button class="button" id="create_vn" value="vn/create" />\
<button class="button" type="reset" id="reset_vn" value="reset" />\
</div>\
</form>\
</div>\
</div>';
var vnet_dashboard = '<div class="dashboard_p">\
<img src="images/one-network.png" alt="one-network" />' +
network_dashboard_html +
'</div>';
var dataTable_vNetworks;
var $create_vn_dialog;
//Setup actions
var vnet_actions = {
"Network.create" : {
type: "create",
call: OCCI.Network.create,
callback: addVNetworkElement,
error: onError,
notify: true
},
"Network.create_dialog" : {
type: "custom",
call: popUpCreateVnetDialog
},
"Network.list" : {
type: "list",
call: OCCI.Network.list,
callback: updateVNetworksView,
error: onError
},
"Network.show" : {
type: "single",
call: OCCI.Network.show,
callback: updateVNetworkElement,
error: onError
},
"Network.showinfo" : {
type: "single",
call: OCCI.Network.show,
callback: updateVNetworkInfo,
error: onError
},
"Network.refresh" : {
type: "custom",
call: function(){
waitingNodes(dataTable_vNetworks);
Sunstone.runAction("Network.list");
}
},
"Network.autorefresh" : {
type: "custom",
call: function() {
OCCI.Network.list({timeout: true, success: updateVNetworksView, error: onError});
}
},
// "Network.publish" : {
// type: "multiple",
// call: OCCI.Network.publish,
// //callback: vnShow,
// elements: vnElements,
// error: onError,
// notify: true
// },
// "Network.unpublish" : {
// type: "multiple",
// call: OCCI.Network.unpublish,
// //callback: vnShow,
// elements: vnElements,
// error: onError,
// notify: true
// },
"Network.delete" : {
type: "multiple",
call: OCCI.Network.delete,
callback: deleteVNetworkElement,
elements: vnElements,
error: onError,
notify: true
},
};
var vnet_buttons = {
"Network.refresh" : {
type: "image",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Network.create_dialog" : {
type: "create_dialog",
text: tr("+ New")
},
// "Network.publish" : {
// type: "action",
// text: tr("Publish")
// },
// "Network.unpublish" : {
// type: "action",
// text: tr("Unpublish")
// },
"Network.delete" : {
type: "action",
text: tr("Delete")
}
}
var vnet_info_panel = {
"vnet_info_tab" : {
title: tr("Network information"),
content: ""
},
}
var vnet_create_panel = {
"vnet_create_panel" : {
title: tr("Create network"),
content: create_vn_tmpl
},
}
var vnets_tab = {
title: tr("Networks"),
content: vnets_tab_content,
buttons: vnet_buttons
}
Sunstone.addActions(vnet_actions);
Sunstone.addMainTab('vnets_tab',vnets_tab);
Sunstone.addInfoPanel('vnet_info_panel',vnet_info_panel);
Sunstone.addInfoPanel('vnet_create_panel',vnet_create_panel);
function vnElements(){
return getSelectedNodes(dataTable_vNetworks);
}
//returns an array with the VNET information fetched from the JSON object
function vNetworkElementArray(vn_json){
var network = vn_json.NETWORK;
if (network.name){
id = network.href.split("/");
id = id[id.length-1];
name = network.name;
}
else {
id = network.ID;
name = network.NAME;
};
return [
'<input class="check_item" type="checkbox" id="vnetwork_'+id+'" name="selected_items" value="'+id+'"/>',
id,
name
];
};
//Adds a listener to show the extended info when clicking on a row
function vNetworkInfoListener(){
$('#tbodyvnetworks tr',dataTable_vNetworks).live("click", function(e){
if ($(e.target).is('input')) {return true;}
popDialogLoading();
var aData = dataTable_vNetworks.fnGetData(this);
var id = $(aData[0]).val();
Sunstone.runAction("Network.showinfo",id);
return false;
});
}
//Callback to update a vnet element after an action on it
function updateVNetworkElement(request, vn_json){
id = vn_json.NETWORK.ID;
element = vNetworkElementArray(vn_json);
updateSingleElement(element,dataTable_vNetworks,'#vnetwork_'+id);
}
//Callback to delete a vnet element from the table
function deleteVNetworkElement(req){
deleteElement(dataTable_vNetworks,'#vnetwork_'+req.request.data);
}
//Callback to add a new element
function addVNetworkElement(request,vn_json){
var element = vNetworkElementArray(vn_json);
addElement(element,dataTable_vNetworks);
}
//updates the list of virtual networks
function updateVNetworksView(request, network_list){
var network_list_array = [];
$.each(network_list,function(){
network_list_array.push(vNetworkElementArray(this));
});
updateView(network_list_array,dataTable_vNetworks);
//dependency with dashboard
updateDashboard("vnets",network_list);
}
//updates the information panel tabs and pops the panel up
function updateVNetworkInfo(request,vn){
var vn_info = vn.NETWORK;
var info_tab_content =
'<table id="info_vn_table" class="info_table">\
<thead>\
<tr><th colspan="2">'+tr("Virtual Network")+' '+vn_info.ID+' '+
tr("information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+vn_info.ID+'</td>\
<tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+vn_info.NAME+'</td>\
<tr>\
</table>\
<div class="form_buttons">\
<button class="vnet_close_dialog_link"/></div>';
var info_tab = {
title: tr("Virtual Network information"),
content: info_tab_content
};
Sunstone.updateInfoPanelTab("vnet_info_panel","vnet_info_tab",info_tab);
Sunstone.popUpInfoPanel("vnet_info_panel");
$('#dialog .vnet_close_dialog_link').button({
text:false,
icons: { primary: "ui-icon-closethick" }
});
}
function popUpCreateVnetDialog() {
//$create_vn_dialog.dialog('open');
//Handle submission of the easy mode
Sunstone.popUpInfoPanel("vnet_create_panel");
var dialog=$('#dialog');
$create_vn_dialog = dialog;
$('#create_vn',dialog).button({
icons: {
primary: "ui-icon-check"
},
text: false
});
$('#reset_vn',dialog).button({
icons: {
primary: "ui-icon-scissors"
},
text: false
});
$('.vnet_close_dialog_link',dialog).button({
icons: {
primary: "ui-icon-closethick"
},
text: false
});
$('#create_vn_form_easy',dialog).submit(function(){
//Fetch values
var name = $('#name',this).val();
if (!name.length){
notifyError(tr("Virtual Network name missing!"));
return false;
}
var bridge = $('#bridge',this).val();
//TODO: Name and bridge provided?!
var network_json = null;
var network_addr = $('#net_address',this).val();
var network_size = $('#net_size',this).val();
if (!network_addr.length){
notifyError(tr("Please provide a network address"));
return false;
};
//we form the object for the request
network_json = {
"SIZE" : network_size,
"ADDRESS" : network_addr,
"NAME" : name
};
Sunstone.runAction("Network.create",network_json);
popUpVNetDashboard();
return false;
});
}
function popUpVNetDashboard(){
var count = dataTable_vNetworks.fnGetNodes().length;
popDialog(vnet_dashboard);
$('#dialog .network_count').text(count);
}
function setVNetAutorefresh() {
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_vNetworks);
var filter = $("#datatable_vnetworks_filter input",
dataTable_vNetworks.parents("#datatable_vnetworks_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Network.autorefresh");
}
},INTERVAL+someTime());
};
//The DOM is ready and the ready() from sunstone.js
//has been executed at this point.
$(document).ready(function(){
dataTable_vNetworks = $("#datatable_vnetworks",main_tabs_context).dataTable({
"bJQueryUI": true,
"bSortClasses": false,
"bAutoWidth":false,
"sPaginationType": "full_numbers",
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] },
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_vNetworks.fnClearTable();
addElement([
spinner,
'',''],dataTable_vNetworks);
Sunstone.runAction("Network.list");
setVNetAutorefresh();
initCheckAllBoxes(dataTable_vNetworks);
tableCheckboxesListener(dataTable_vNetworks);
vNetworkInfoListener();
$('#li_vnets_tab a').click(function(){
popUpVNetDashboard();
//return false;
});
$('.vnet_close_dialog_link').live("click",function(){
popUpVNetDashboard();
return false;
});
});

View File

@ -0,0 +1,640 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OCCI.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
/*Images tab plugin*/
var images_tab_content =
'<form id="image_form" action="" action="javascript:alert(\'js error!\');">\
<div class="action_blocks">\
</div>\
<table id="datatable_images" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Name")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyimages">\
</tbody>\
</table>\
</form>';
var create_image_tmpl =
'<div id="img_tabs">\
<div id="img_easy">\
<form id="create_image_form_easy" method="POST" enctype="multipart/form-data" action="javascript:alert(\'js errors?!\')">\
<p style="font-size:0.8em;text-align:right;"><i>'+
tr("Fields marked with")+' <span style="display:inline-block;" class="ui-icon ui-icon-alert" /> '+
tr("are mandatory")+'</i><br />\
<fieldset>\
<div class="img_param">\
<label for="img_name">'+tr("Name")+':</label>\
<input type="text" name="img_name" id="img_name" />\
<div class="tip">'+tr("Name that the Image will get.")+'</div>\
</div>\
<div class="img_param">\
<label for="img_desc">'+tr("Description")+':</label>\
<textarea name="img_desc" id="img_desc" style="height:4em"></textarea>\
<div class="tip">'+tr("Human readable description of the image.")+'</div>\
</div>\
</fieldset>\
<fieldset>\
<div class="img_param">\
<label for="img_type">'+tr("Type")+':</label>\
<select name="img_type" id="img_type">\
<option value="OS">'+tr("OS")+'</option>\
<option value="CDROM">'+tr("CD-ROM")+'</option>\
<option value="DATABLOCK">'+tr("Datablock")+'</option>\
</select>\
<div class="tip">'+tr("Type of the image")+'</div>\
</div>\
<div class="img_param">\
<label for="img_size">'+tr("Size")+':</label>\
<input type="text" name="img_size" id="img_size" />\
<div class="tip">'+tr("Size of the datablock in MB.")+'</div>\
</div>\
<div class="img_param">\
<label for="img_fstype">'+tr("FS type")+':</label>\
<input type="text" name="img_fstype" id="img_fstype" />\
<div class="tip">'+tr("Type of file system to be built. This can be any value understood by mkfs unix command.")+'</div>\
</div>\
<div class="img_param" id="upload_div">\
<label for="file-uploader" style="width: 60px">'+tr("Upload image")+':</label>\
<div id="file-uploader">\
</div><div class="clear" />\
<label for="upload-progress">'+tr("Upload progress")+':</label>\
<div id="upload-progress"></div>\
</div>\
<!--\
<div class="img_param">\
<label for="img_public">'+tr("Public")+':</label>\
<input type="checkbox" id="img_public" name="img_public" value="YES" />\
<div class="tip">'+tr("Public scope of the image")+'</div>\
</div>\
<div class="img_param">\
<label for="img_persistent">'+tr("Persistent")+':</label>\
<input type="checkbox" id="img_persistent" name="img_persistent" value="YES" />\
<div class="tip">'+tr("Persistence of the image")+'</div>\
</div>\
<div class="img_param">\
-->\
<div class="form_buttons">\
<button class="image_close_dialog_link"/>\
<button class="button" id="create_image" value="Image.create" />\
<button class="button" type="reset" id="reset_image" value="reset" />\
</div>\
</form>\
</div>\
</div>';
var image_dashboard = '<div class="dashboard_p">\
<img src="'+storage_dashboard_image+'" alt="one-storage" />'+
storage_dashboard_html +
'</div>';
var dataTable_images;
var $create_image_dialog;
var image_actions = {
"Image.create" : {
type: "create",
call: OCCI.Image.create,
callback: addImageElement,
error: onError,
notify:true
},
"Image.create_dialog" : {
type: "custom",
call: popUpCreateImageDialog
},
"Image.list" : {
type: "list",
call: OCCI.Image.list,
callback: updateImagesView,
error: onError
},
"Image.show" : {
type : "single",
call: OCCI.Image.show,
callback: updateImageElement,
error: onError
},
"Image.showinfo" : {
type: "single",
call: OCCI.Image.show,
callback: updateImageInfo,
error: onError
},
"Image.refresh" : {
type: "custom",
call: function () {
waitingNodes(dataTable_images);
Sunstone.runAction("Image.list");
},
},
"Image.autorefresh" : {
type: "custom",
call: function() {
OCCI.Image.list({timeout: true, success: updateImagesView, error: onError});
}
},
"Image.persistent" : {
type: "multiple",
call: OCCI.Image.persistent,
elements: imageElements,
error: onError,
notify: true
},
"Image.nonpersistent" : {
type: "multiple",
call: OCCI.Image.nonpersistent,
elements: imageElements,
error: onError,
notify: true
},
// "Image.publish" : {
// type: "multiple",
// call: OCCI.Image.publish,
// callback: function (req) {
// //Sunstone.runAction("Image.show",req.request.data[0]);
// },
// elements: imageElements,
// error: onError,
// notify: true
// },
// "Image.unpublish" : {
// type: "multiple",
// call: OCCI.Image.unpublish,
// callback: function (req) {
// //Sunstone.runAction("Image.show",req.request.data[0]);
// },
// elements: imageElements,
// error: onError,
// notify: true
// },
"Image.delete" : {
type: "multiple",
call: OCCI.Image.delete,
callback: deleteImageElement,
elements: imageElements,
error: onError,
notify: true
},
}
var image_buttons = {
"Image.refresh" : {
type: "image",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Image.create_dialog" : {
type: "create_dialog",
text: tr('+ New')
},
"Image.persistent" : {
type: "action",
text: tr("Make persistent")
},
"Image.nonpersistent" : {
type: "action",
text: tr("Make non persistent")
},
// "action_list" : {
// type: "select",
// actions: {
// "Image.publish" : {
// type: "action",
// text: tr("Publish")
// },
// "Image.unpublish" : {
// type: "action",
// text: tr("Unpublish")
// },
// }
// },
"Image.delete" : {
type: "action",
text: tr("Delete")
}
}
var image_info_panel = {
"image_info_tab" : {
title: tr("Image information"),
content: ""
},
};
var image_create_panel = {
"image_create_panel" : {
title: tr("Add storage"),
content: create_image_tmpl
},
};
var images_tab = {
title: tr("Storage"),
content: images_tab_content,
buttons: image_buttons
}
Sunstone.addActions(image_actions);
Sunstone.addMainTab('images_tab',images_tab);
Sunstone.addInfoPanel('image_info_panel',image_info_panel);
Sunstone.addInfoPanel('image_create_panel',image_create_panel);
function imageElements() {
return getSelectedNodes(dataTable_images);
}
// Returns an array containing the values of the image_json and ready
// to be inserted in the dataTable
function imageElementArray(image_json){
//Changing this? It may affect to the is_public() and is_persistent() functions.
var image = image_json.STORAGE;
var id,name;
if (image.name){
id = image.href.split("/");
id = id[id.length-1];
name = image.name;
}
else {
id = image.ID;
name = image.NAME;
};
return [
'<input class="check_item" type="checkbox" id="image_'+id+'" name="selected_items" value="'+id+'"/>',
id,
name
];
}
// Set up the listener on the table TDs to show the info panel
function imageInfoListener(){
$('#tbodyimages tr',dataTable_images).live("click",function(e){
var target = $(e.target);
if (target.is('input') || target.is('select') || target.is('option'))
return true;
popDialogLoading();
var aData = dataTable_images.fnGetData(this);
var id = $(aData[0]).val();
Sunstone.runAction("Image.showinfo",id);
return false;
});
}
// Callback to update an element in the dataTable
function updateImageElement(request, image_json){
var id = image_json.STORAGE.ID;
var element = imageElementArray(image_json);
updateSingleElement(element,dataTable_images,'#image_'+id);
}
// Callback to remove an element from the dataTable
function deleteImageElement(req){
deleteElement(dataTable_images,'#image_'+req.request.data);
}
// Callback to add an image element
function addImageElement(request, image_json){
var element = imageElementArray(image_json);
addElement(element,dataTable_images);
}
// Callback to refresh the list of images
function updateImagesView(request, images_list){
var image_list_array = [];
$.each(images_list,function(){
image_list_array.push(imageElementArray(this));
});
updateView(image_list_array,dataTable_images);
updateDashboard("images",images_list);
}
// Callback to update the information panel tabs and pop it up
function updateImageInfo(request,img){
var img_info = img.STORAGE;
var info_tab = {
title: tr("Image information"),
content:
'<form><table id="info_img_table" class="info_table" style="width:80%;">\
<thead>\
<tr><th colspan="2">'+tr("Image")+' "'+img_info.NAME+'" '+
tr("information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+img_info.ID+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+img_info.NAME+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+img_info.DESCRIPTION+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Type")+'</td>\
<td class="value_td">'+OCCI.Helper.image_type(img_info.TYPE)+'</td>\
</tr>\
</tr>\
<td class="key_td">'+tr("Persistent")+'</td>\
<td class="value_td"><input type="checkbox" '+(img_info.PERSISTENT == "YES" ? 'checked="checked"' : "")+' /></td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Filesystem type")+'</td>\
<td class="value_td">'+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'</td>\
</tr>\
<tr>\
<td class="key_td">'+tr("Size (Mb)")+'</td>\
<td class="value_td">'+img_info.SIZE+'</td>\
</tr>\
</table></form>\
<div class="form_buttons">\
<button class="image_close_dialog_link"/></div>'
};
Sunstone.updateInfoPanelTab("image_info_panel","image_info_tab",info_tab);
Sunstone.popUpInfoPanel("image_info_panel");
$('#dialog .image_close_dialog_link').button({
text:false,
icons: { primary: "ui-icon-closethick" }
});
$('#dialog input').click(function(){
if ($(this).is(':checked'))
Sunstone.runAction("Image.persistent",[img_info.ID])
else
Sunstone.runAction("Image.nonpersistent",[img_info.ID])
});
}
function popUpCreateImageDialog(){
Sunstone.popUpInfoPanel("image_create_panel");
var dialog = $('#dialog');
$create_image_dialog = dialog;
$('#create_image',dialog).button({
icons: {
primary: "ui-icon-check"
},
text: false
});
$('#reset_image',dialog).button({
icons: {
primary: "ui-icon-scissors"
},
text: false
});
$('.image_close_dialog_link',dialog).button({
icons: {
primary: "ui-icon-closethick"
},
text: false
});
setupTips(dialog);
$('#img_fstype',dialog).parents('div.img_param').hide();
$('#img_size',dialog).parents('div.img_param').hide();
/*
$('#img_public',dialog).click(function(){
$('#img_persistent',$create_image_dialog).removeAttr('checked');
});
$('#img_persistent',dialog).click(function(){
$('#img_public',$create_image_dialog).removeAttr('checked');
});
*/
$('#img_type',dialog).change(function(){
if ($(this).val() == "DATABLOCK"){
$('#img_fstype',$create_image_dialog).parents('div.img_param').show();
$('#img_size',$create_image_dialog).parents('div.img_param').show();
$('#upload_div',$create_image_dialog).hide();
} else {
$('#img_fstype',$create_image_dialog).parents('div.img_param').hide();
$('#img_size',$create_image_dialog).parents('div.img_param').hide();
$('#upload_div',$create_image_dialog).show();
};
});
$('#upload-progress',dialog).progressbar({value:0});
$('#upload-progress',dialog).css({
border: "1px solid #AAAAAA",
position: "relative",
// bottom: "29px",
width: "210px",
// left: "133px",
height: "15px",
display: "inline-block",
});
$('#upload-progress div',dialog).css("border","1px solid #AAAAAA");
var img_obj;
var uploader = new qq.FileUploaderBasic({
button: $('#file-uploader',$create_image_dialog)[0],
action: 'ui/upload',
multiple: false,
params: {},
showMessage: function(message){
notifyMessage(message);
},
onSubmit: function(id, fileName){
var xml = json2xml(img_obj,"STORAGE");
uploader.setParams({
occixml : xml,
file: fileName
});
$('#upload-progress',dialog).show();
},
onProgress: function(id, fileName, loaded, total){
$('#upload-progress',dialog).progressbar("option","value",Math.floor(loaded*100/total));
},
onComplete: function(id, fileName, responseJSON){
popUpImageDashboard();
notifyMessage("Image uploaded correctly");
Sunstone.runAction("Image.list");
return false;
},
onCancel: function(id, fileName){
},
});
var file_input = false;
uploader._button._options.onChange = function(input) {
file_input = input; return false;
};
$('#file-uploader input').removeAttr("style");
var processCreateImageForm = function(){
var dialog = $create_image_dialog;
var img_json = {};
var name = $('#img_name',dialog).val();
if (!name){
notifyError(tr("You must specify a name"));
return false;
};
img_json["NAME"] = name;
var desc = $('#img_desc',dialog).val();
if (desc){
img_json["DESCRIPTION"] = desc;
}
var type = $('#img_type',dialog).val();
img_json["TYPE"]= type;
if (type == "DATABLOCK"){
var fstype = $('#img_fstype',dialog).val();
var im_size = $('#img_size',dialog).val();
if (!fstype || !im_size){
notifyError(tr("You must specify size and FS type"));
return false;
};
img_json["FSTYPE"] = fstype;
img_json["SIZE"] = im_size;
} else {
if (!$('#file-uploader input').val()){
notifyError(tr("You must select a file to upload"));
return false;
};
}
//img_json["PUBLIC"] = $('#img_public:checked',this).length ? "YES" : "NO";
//img_json["PERSISTENT"] = $('#img_persistent:checked',this).length ? "YES" : "NO";
return img_json;
};
$('#create_image_form_easy',dialog).submit(function(){
var type = $('#img_type',dialog).val();
img_obj = processCreateImageForm();
if (!img_obj) return false;
if (type == "DATABLOCK"){
Sunstone.runAction("Image.create",img_obj);
popUpImageDashboard();
} else {
uploader._onInputChange(file_input);
};
return false;
});
}
function popUpImageDashboard(){
var count = dataTable_images.fnGetNodes().length;
popDialog(image_dashboard);
$('#dialog .storage_count').text(count);
};
// Set the autorefresh interval for the datatable
function setImageAutorefresh() {
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_images);
var filter = $("#datatable_images_filter input",
dataTable_images.parents("#datatable_images_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Image.autorefresh");
}
},INTERVAL+someTime());
};
/*
function is_public_image(id){
var data = getElementData(id,"#image",dataTable_images)[7];
return $(data).attr('checked');
};
function is_persistent_image(id){
var data = getElementData(id,"#image",dataTable_images)[8];
return $(data).attr('checked');
};
*/
//The DOM is ready at this point
$(document).ready(function(){
dataTable_images = $("#datatable_images",main_tabs_context).dataTable({
"bJQueryUI": true,
"bSortClasses": false,
"bAutoWidth":false,
"sPaginationType": "full_numbers",
"aoColumnDefs": [
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] },
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_images.fnClearTable();
addElement([
spinner,
'',''],dataTable_images);
Sunstone.runAction("Image.list");
setImageAutorefresh();
initCheckAllBoxes(dataTable_images);
tableCheckboxesListener(dataTable_images);
imageInfoListener();
$('#li_images_tab a').click(function(){
popUpImageDashboard();
//return false;
});
$('.image_close_dialog_link').live("click",function(){
popUpImageDashboard();
return false;
});
})

View File

@ -0,0 +1,157 @@
//Translated by
lang="en_US"
datatable_lang=""
locale={
"Additionally, OpenNebula Self-Service allows easy customization of the interface (e.g. this text) and brings multi-language support.":"",
"Additionally, you can run several operations on defined storages, such as defining their persistance. Persistent images can only be used by 1 virtual machine, and the changes made by it have effect on the base image. Non-persistent images are cloned before being used in a Virtual Machine, therefore changes are lost unless a snapshot is taken prior to Virtual Machine shutdown.":"",
"Additionally, you can take a \'snapshot\' of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.":"",
"Add storage":"",
"All":"",
"are mandatory":"",
"Cancel":"",
"Cannot contact server: is it running and reachable?":"",
"Canvas not supported.":"",
"CD-ROM":"",
"Changing language":"",
"Community":"",
"Compute":"",
"Compute resource":"",
"Compute resources are Virtual Machines attached to storage and network resources. OpenNebula Self-Service allows you to easily create, remove and manage them, including the possibility of pausing a Virtual Machine or taking a snapshot of one of their disks.":"",
"Compute resources can be attached to these networks at creation time. Virtual machines will be provided with an IP and the correct parameters to ensure connectivity.":"",
"Configuration":"",
"Confirmation of action":"",
"CPU":"",
"Create network":"",
"Create new compute resource":"",
"Create new network resource":"",
"Create new storage resource":"",
"Create Virtual Machine":"",
"Create # VMs":"",
"Current resources":"",
"Dashboard":"",
"Datablock":"",
"Delete":"",
"Description":"",
"disk id":"",
"Disks":"",
"Disks information":"",
"Documentation":"",
"Do you want to proceed?":"",
"English":"",
"Error":"",
"Fields marked with":"",
"Filesystem type":"",
"FS type":"",
"Have a cloudy experience!":"",
"Human readable description of the image.":"",
"ID":"",
"Image":"",
"Image information":"",
"Image name":"",
"images":"",
"Images":"",
"Info":"",
"information":"",
"Instance type":"",
"In this view you can easily manage OpenNebula Network resources. You can add or remove virtual networks.":"",
"IP":"",
"Language":"",
"Loading":"",
"MAC":"",
"Make non persistent":"",
"Make persistent":"",
"Memory":"",
"Monitoring information":"",
"Name":"",
"Name that the Image will get.":"",
"Network":"",
"Network Address":"",
"Network information":"",
"Network is unreachable: is OpenNebula running?":"",
"Network reception":"",
"networks":"",
"Networks":"",
"Networks information":"",
"Network Size":"",
"Network transmission":"",
"+ New":"",
"No disk id or image name specified":"",
"No disks defined":"",
"No networks defined":"",
"OK":"",
"OpenNebula Self-Service is a simplified user interface to manage OpenNebula compute, storage and network resources. It is focused on easiness and usability and features a limited set of operations directed towards end-users.":"",
"Open VNC Session":"",
"OS":"",
"Persistence of the image":"",
"Persistent":"",
"Please, choose and modify the template you want to update":"",
"Please provide a network address":"",
"Please select":"",
"Previous action":"",
"Public":"",
"Public scope of the image":"",
"Publish":"",
"Refresh list":"",
"Resume":"",
"Retrieving":"",
"Saveas for VM with ID":"",
"See more":"",
"Select a template":"",
"Select disk":"",
"Self-Service UI Configuration":"",
"Shutdown":"",
"Sign out":"",
"Size":"",
"Size (Mb)":"",
"Size of the datablock in MB.":"",
"Skipping VM ":"",
"Spanish":"",
"State":"",
"Stop":"",
"Storage":"",
"Storage pool is formed by several images. These images can contain from full operating systems to be used as base for compute resources, to simple data. OpenNebula Self-Service offers you the possibility to create or upload your own images.":"",
"String":"",
"style":"",
"Submitted":"",
"Support":"",
"Suspend":"",
"Take snapshot":"",
"Target":"",
"There are currently":"",
"The Storage view offers you an overview of your current images. Storage elements are attached to compute resources at creation time. They can also be extracted from running virtual machines by taking an snapshot.":"",
"This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking \'new\' and filling-in an easy wizard.":"",
"This will cancel selected VMs":"",
"This will delete the selected VMs from the database":"",
"This will resume the selected VMs in stopped or suspended states":"",
"This will shutdown the selected VMs":"",
"This will suspend the selected VMs":"",
"Type":"",
"Type of file system to be built. This can be any value understood by mkfs unix command.":"",
"Type of the image":"",
"Unauthorized":"",
"Unpublish":"",
"Update":"",
"Update template":"",
"Upload image":"",
"Upload progress":"",
"Useful links":"",
"Virtual Machine information":"",
"virtual machines":"",
"Virtual Network":"",
"Virtual Network information":"",
"Virtual Network name missing!":"",
"VM information":"",
"VM Name":"",
"VNC connection":"",
"VNC Disabled":"",
"Welcome":"",
"Welcome to OpenNebula Self-Service":"",
"You can add new storages by clicking \'new\'. Image files will be uploaded to OpenNebula and set ready to be used.":"",
"You can also manage compute resources and perform actions such as stop, resume, shutdown or cancel.":"",
"You have to confirm this action.":"",
"You must select a file to upload":"",
"You must specify a name":"",
"You must specify size and FS type":"",
"You need to select something.":"",
"Your compute resources connectivity is performed using pre-defined virtual networks. You can create and manage these networks using OpenNebula Self-Service.":"",
};

View File

@ -0,0 +1,157 @@
//Translated by
lang="es_ES"
datatable_lang="es_datatable.txt"
locale={
"Additionally, OpenNebula Self-Service allows easy customization of the interface (e.g. this text) and brings multi-language support.":"Además, OpenNebula Self-Service permite una fácil personalización de la interfaz (por ejemplo, de este mismo texto) y viene con soporte para múltiples lenguajes.",
"Additionally, you can run several operations on defined storages, such as defining their persistance. Persistent images can only be used by 1 virtual machine, and the changes made by it have effect on the base image. Non-persistent images are cloned before being used in a Virtual Machine, therefore changes are lost unless a snapshot is taken prior to Virtual Machine shutdown.":"Además, puede ejecutar varias operaciones en los almacenamientos presentes, como definir su persistencia. Las imágenes persistentes sólo pueden ser usadas por 1 máquina virtual, y los cambios realizados por ella tiene efecto en la imágen base. Las imágenes no persistentes son clonadas antes de ser utilizadas en una máquina virtual, por tanto los cambios se pierden a menos que se tome una instantánea antes de apagar la máquina virtual.",
"Additionally, you can take a 'snapshot' of the storage attached to these resources. They will be saved as new resources, visible from the Storage view and re-usable.":"Además, puede tomar una 'instantánea' de los almacenamientos asociado a estos recursos. Ésta será salvaguardada como un nuevo recurso, visible y reutilizable desde la vista de almacenamientos.",
"Add storage":"Añadir almacenamiento",
"All":"Todos",
"are mandatory":"son obligatorios",
"Cancel":"Cancelar",
"Cannot contact server: is it running and reachable?":"No se puede contactar con el servidor: ¿está funcionando y es alcanzable?",
"Canvas not supported.":"Canvas no soportado",
"CD-ROM":"CD-ROM",
"Changing language":"Cambiando el lenguaje",
"Community":"Comunidad",
"Compute":"Máquinas Virtuales",
"Compute resource":"máquina virtual",
"Compute resources are Virtual Machines attached to storage and network resources. OpenNebula Self-Service allows you to easily create, remove and manage them, including the possibility of pausing a Virtual Machine or taking a snapshot of one of their disks.":"Las máquinas virtuales están asociadas a recursos de almacenamiento y de red. OpenNebula Self-Service le permite crearlos, borrarlos y administrarlos fácilmente, incluyendo la posibilidad de pausar una máquina virtual o de tomar una instantánea de alguno de sus discos.",
"Compute resources can be attached to these networks at creation time. Virtual machines will be provided with an IP and the correct parameters to ensure connectivity.":"Las máquinas virtuales pueden asociarse a estas redes en el momento de su creación. Las máquinas virtuales serán provistas de una IP y de los parámetros correctos para asegurar conectividad.",
"Configuration":"Configuración",
"Confirmation of action":"Confirmar operación",
"CPU":"CPU",
"Create network":"Crear red",
"Create new compute resource":"Crear nueva máquina virtual",
"Create new network resource":"Crear nueva red",
"Create new storage resource":"Crear nuevo almacenamiento",
"Create Virtual Machine":"Crear máquina virtual",
"Create # VMs":"Crear # MVs",
"Current resources":"Recursos actuales",
"Dashboard":"Portada",
"Datablock":"Datablock",
"Delete":"Borrar",
"Description":"Descripción",
"disk id":"id del disco",
"Disks":"Discos",
"Disks information":"Información de discos",
"Documentation":"Documentación",
"Do you want to proceed?":"¿Desea continuar?",
"English":"Inglés",
"Error":"Error",
"Fields marked with":"Campos marcados con",
"Filesystem type":"Sistema de ficheros",
"FS type":"tipo de FS",
"Have a cloudy experience!":"¡Nos vemos en las nubes!",
"Human readable description of the image.":"Descripción de la imagen.",
"ID":"ID",
"Image":"Imagen",
"Image information":"Información de la imagen",
"Image name":"Nombre de la imagen",
"images":"imágenes",
"Images":"Imágenes",
"Info":"Información",
"information":"Información",
"Instance type":"Tipo de instancia",
"In this view you can easily manage OpenNebula Network resources. You can add or remove virtual networks.":"En esta vista puede gestionar fácilmente los recursos de red de OpenNebula. Puede añadir o borrar redes virtuales.",
"IP":"IP",
"Language":"Lenguaje",
"Loading":"Cargando",
"MAC":"MAC",
"Make non persistent":"Hacer no persistente",
"Make persistent":"Hacer persistente",
"Memory":"Memoria",
"Monitoring information":"Información de monitorización",
"Name":"Nombre",
"Name that the Image will get.":"Nombre para la imagen.",
"Network":"Red",
"Network Address":"Dirección de red",
"Network information":"Información de red",
"Network is unreachable: is OpenNebula running?":"No se puede alcanzar la red: ¿está OpenNebula funcionando?",
"Network reception":"Recepción de red",
"networks":"redes",
"Networks":"Redes",
"Networks information":"Información de redes",
"Network Size":"Tamaño de red",
"Network transmission":"Transmisión de red",
"+ New":"+ Nuevo",
"No disk id or image name specified":"No se ha especificado ID de disco o nombre de la imagen",
"No disks defined":"No hay discos definidos",
"No networks defined":"No hay redes definidas",
"OK":"OK",
"OpenNebula Self-Service is a simplified user interface to manage OpenNebula compute, storage and network resources. It is focused on easiness and usability and features a limited set of operations directed towards end-users.":"OpenNebula Self-Service es una interfaz de usuario simplificada para administrar máquinas virtuales, almacenamiento y red de OpenNebula. Está basada en la facilidad de uso y cuenta con un número limitado de operaciones dirigidas a los usuarios finales.",
"Open VNC Session":"Abrir sesión VNC",
"OS":"OS",
"Persistence of the image":"Persistencia de la imagen",
"Persistent":"Persistente",
"Please, choose and modify the template you want to update":"Por favor, escoja y modifique la plantilla que desea actualizar",
"Please provide a network address":"Por favor, proporcione una dirección de red",
"Please select":"Por favor escoja",
"Previous action":"Acción anterior",
"Public":"Público",
"Public scope of the image":"",
"Publish":"Publicar",
"Refresh list":"Refrescar lista",
"Resume":"Reanudar",
"Retrieving":"Cargando",
"Saveas for VM with ID":"Instantánea a MV con ID",
"See more":"Ver más",
"Select a template":"Seleccione una plantilla",
"Select disk":"Seleccione un disco",
"Self-Service UI Configuration":"Configuración de la interfaz Self-Service",
"Shutdown":"Apagar",
"Sign out":"Desconectar",
"Size":"Tamaño",
"Size (Mb)":"Tamaño (Mb)",
"Size of the datablock in MB.":"Tamaño del datablcok en MB",
"Skipping VM ":"Saltando MV",
"Spanish":"Español",
"State":"Estado",
"Stop":"Detener",
"Storage":"Almacenamiento",
"Storage pool is formed by several images. These images can contain from full operating systems to be used as base for compute resources, to simple data. OpenNebula Self-Service offers you the possibility to create or upload your own images.":"La lista de almacenamiento está formada por varias imágenes. Estas imágenes pueden contener desde sistemas operativos completos para ser usados como base en máquinas virtuales, hasta simples datos. OpenNebula Self-Service ofrece la posibilidad de crear o subir sus propias imágenes.",
"String":"String",
"style":"estilo",
"Submitted":"Hecho",
"Support":"Soporte",
"Suspend":"Suspender",
"Take snapshot":"Tomar instantánea",
"Target":"Target",
"There are currently":"Actualmente hay",
"The Storage view offers you an overview of your current images. Storage elements are attached to compute resources at creation time. They can also be extracted from running virtual machines by taking an snapshot.":"La vista de almacenamiento le ofrece la visión general de sus imágenes. Los elementos de almacenamiento se asocian a máquinas virtuales en el momento de la creación. También pueden ser extraídos de una máquina virtual en ejecución tomando una instantánea",
"This is a list of your current compute resources. Virtual Machines use previously defined images and networks. You can easily create a new compute element by cliking 'new' and filling-in an easy wizard.":"Esta es una lista de sus máquinas virtuales actuales. Las máquinas virtuales utilizan imagenes y redes definidas previamente. Puede crear fácilmente una nueva máquina virtual haciendo click en 'New' y rellenado un sencillo formulario.",
"This will cancel selected VMs":"Esto cancelará las MVs seleccionadas",
"This will delete the selected VMs from the database":"Esto borrará las MVs seleccionadas de la base de datos",
"This will resume the selected VMs in stopped or suspended states":"Esto reanudará las MVs seleccionadas paradas o suspendidas",
"This will shutdown the selected VMs":"Esto apagará las MVs seleccionadas",
"This will suspend the selected VMs":"Esto suspenderá las MVs seleccionadas",
"Type":"Tipo",
"Type of file system to be built. This can be any value understood by mkfs unix command.":"Tipo de sistema de archivos a generar. Es válido cualquier valor entendido por el comando mkfs",
"Type of the image":"Tipo de la imagen",
"Unauthorized":"No autorizado",
"Unpublish":"Despublicar",
"Update":"Actualizar",
"Update template":"Actualizar plantilla",
"Upload image":"Subir imagen",
"Upload progress":"Progreso se subida",
"Useful links":"Enlances útiles",
"Virtual Machine information":"Información de máquina virtual",
"virtual machines":"máquinas virtuales",
"Virtual Network":"Red virtual",
"Virtual Network information":"Información de red virtual",
"Virtual Network name missing!":"¡Falta el nombre de la red!",
"VM information":"Información de MV",
"VM Name":"Nombre",
"VNC connection":"Conexión VNC",
"VNC Disabled":"VNC Desabilitado",
"Welcome":"Bienvenid@",
"Welcome to OpenNebula Self-Service":"Bienvenid@ a OpenNebula Self-Service",
"You can add new storages by clicking 'new'. Image files will be uploaded to OpenNebula and set ready to be used.":"Puede añadir nuevos almacenamientos haciendo click en 'new'. Los ficheros de imagen pueden ser subidos a OpenNebula y preparados para ser usado.",
"You can also manage compute resources and perform actions such as stop, resume, shutdown or cancel.":"También puede administrar las máquinas virtuales y realizar acciones como detener, reanudar, apagar o cancelar.",
"You have to confirm this action.":"Necesita confirmar esta acción",
"You must select a file to upload":"Debe seleccionar un fichero para subir",
"You must specify a name":"Debe especificar un nombre",
"You must specify size and FS type":"Debe especificar un tamaño y un tipo de FS",
"You need to select something.":"Debe seleccionar algo",
"Your compute resources connectivity is performed using pre-defined virtual networks. You can create and manage these networks using OpenNebula Self-Service.":"La conectividad de sus máquinas virtuales se realiza usando redes virtuales pre-definidas. Puede crear y administrar estas redes usando OpenNebula Self-Service.",
};

View File

@ -0,0 +1,17 @@
{
"sProcessing": "Procesando...",
"sLengthMenu": "Número de elementos",
"sZeroRecords": "No hay elementos",
"sInfo": "Mostrando del _START_ al _END_ de _TOTAL_",
"sInfoEmpty": "No hay elementos",
"sInfoFiltered": "(filtado de un total de _MAX_)",
"sInfoPostFix": "",
"sSearch": "Buscar:",
"sUrl": "",
"oPaginate": {
"sFirst": "Primero",
"sPrevious": "Anterior",
"sNext": "Siguiente",
"sLast": "Último"
}
}

View File

@ -0,0 +1,31 @@
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------- #
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
tr_strings = `grep -h -o -R -e 'tr("[[:print:]]*")' ../js/* ../customize/* | cut -d'"' -f 2 | sort -u`
puts "//Translated by"
puts 'lang="en_US"'
puts 'datatable_lang=""'
puts "locale={"
tr_strings.each_line do | line |
puts " \"#{line.chomp}\":\"\","
end
puts "};"

View File

@ -0,0 +1,52 @@
#!/usr/bin/js
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
if (!arguments[0] || !arguments[1]){
print("Usage: upgrade_translation.js <old_translation> <empty_template> > <new_translation>");
quit();
};
var from = arguments[0];
var to = arguments[1];
load(from);
var tr="";
var locale_old= {};
for (tr in locale){
locale_old[tr] = locale[tr];
};
var lang_old = lang;
var dt_lang_old = datatable_lang
load(to);
for (tr in locale){
if (locale_old[tr]){
locale[tr] = locale_old[tr]
};
};
print("//Translated by");
print('lang="'+lang_old+'"');
print('datatable_lang="'+dt_lang_old+'"');
print("locale={");
for (tr in locale){
print(' "'+tr+'":"'+locale[tr]+'",');
};
print("};");

View File

@ -0,0 +1,53 @@
<!DOCTYPE html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>OpenNebula Self-Service Login</title>
<link rel="stylesheet" type="text/css" href="css/login.css" />
<!-- Vendor Libraries -->
<script type="text/javascript" src="vendor/jQuery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="vendor/crypto-js/2.3.0-crypto-sha1.js"></script>
<!-- End Vendor Libraries -->
<script type="text/javascript" src="js/occi.js"></script>
<script type="text/javascript" src="js/login.js"></script>
</head>
<body>
<div id="header">
<div id="logo">
OpenNebula Self-Service portal
</div>
</div>
<div id="wrapper">
<div id="logo_sunstone">
</div>
<div id="auth_error" class="error_message">
Invalid username or password
</div>
<div id="one_error" class="error_message">
OpenNebula is not running
</div>
<form id="login_form">
<div class="border" id="login">
<div class="content">
Username
<input type="text" size="15" name="username" id="username" class="box"/>
Password
<input type="password" size="15" name="password" id="password" class="box"/>
<br />
<input type="checkbox" id="check_remember" />
<label id="label_remember" for="check_remember">Remember me</label>
<input type="submit" id="login_btn" value="" />
</div>
</div>
</form>
</div>
</body>
</html>

View File

@ -0,0 +1,90 @@
<!DOCTYPE html>
<html>
<head>
<title>OpenNebula Self-Service</title>
<meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
<!-- Vendor Libraries -->
<link rel="stylesheet" type="text/css" href="vendor/dataTables/demo_table_jui.css" />
<link rel="stylesheet" type="text/css" href="vendor/jQueryUI/jquery-ui-1.8.16.custom.css" />
<link rel="stylesheet" type="text/css" href="vendor/jGrowl/jquery.jgrowl.css" />
<link rel="stylesheet" type="text/css" href="vendor/jQueryLayout/layout-default-latest.css" />
<script type="text/javascript" src="vendor/jQuery/jquery-1.7.1.min.js"></script>
<script type="text/javascript" src="vendor/xml2json/jquery.xml2json.pack.js"></script>
<script type="text/javascript" src="vendor/jGrowl/jquery.jgrowl_minimized.js"></script>
<script type="text/javascript" src="vendor/jQueryUI/jquery-ui-1.8.16.custom.min.js"></script>
<script type="text/javascript" src="vendor/jQueryLayout/jquery.layout-latest.min.js"></script>
<script type="text/javascript" src="vendor/dataTables/jquery.dataTables.min.js"></script>
<script type="text/javascript" src="vendor/fileuploader/fileuploader.js"></script>
<!-- End Vendor Libraries -->
<!--Languages-->
<script type="text/javascript" src="js/locale.js"></script>
<%if session[:lang]%>
<script type="text/javascript" src="locale/<%=session[:lang]%>/<%=session[:lang]%>.js"></script>
<%end%>
<!--endLanguages-->
<link rel="stylesheet" type="text/css" href="css/application.css" />
<link rel="stylesheet" type="text/css" href="css/layout.css" />
<script type="text/javascript" src="js/layout.js"></script>
<script type="text/javascript" src="js/occi.js"></script>
<script type="text/javascript" src="js/sunstone.js"></script>
<script type="text/javascript" src="js/sunstone-util.js"></script>
<script type="text/javascript" src="customize/custom.js"></script>
<!--Base plugins-->
<script type="text/javascript" src="js/plugins/dashboard.js"></script>
<script type="text/javascript" src="js/plugins/compute.js"></script>
<script type="text/javascript" src="js/plugins/storage.js"></script>
<script type="text/javascript" src="js/plugins/network.js"></script>
<script type="text/javascript" src="js/plugins/configuration.js"></script>
</head>
<body>
<div class="outer-center">
<div class="inner-center">
</div>
<div id="dialog" class="inner-east"></div>
</div>
<div id="menu" class="outer-west">
<ul id="navigation" class="navigation">
</ul>
</div>
<div id="header" class="ui-layout-north">
<div id="logo">
<img src="images/opennebula-selfservice-small.png"/>
</div>
<div id="login-info">
<span id="welcome">Welcome</span> <span id="user"></span>&nbsp;|&nbsp;<a href="#" id="logout">Sign Out</a>
</div>
<!--
<div id="links">
<a href="http://opennebula.org/documentation:documentation" target="_blank">Documentation</a>&nbsp;|&nbsp;
<a href="http://opennebula.org/support:support" target="_blank">Support</a>&nbsp;|&nbsp;
<a href="http://opennebula.org/community:community" target="_blank">Community</a>
</div>
-->
</div>
<div id="footer" class="ui-layout-south">
Copyright 2002-2011 &copy; OpenNebula Project Leads (<a href="http://opennebula.org" target="_blank">OpenNebula.org</a>). All Rights Reserved. OpenNebula 3.1.0
</div>
<div id="dialogs">
</div>
<div id="plots">
</div>
<div id="info_panels"></div>
</body>
</html>

View File

@ -539,6 +539,50 @@ error:
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
int DispatchManager::reboot(int vid)
{
VirtualMachine * vm;
ostringstream oss;
vm = vmpool->get(vid,true);
if ( vm == 0 )
{
return -1;
}
oss << "Rebooting VM " << vid;
NebulaLog::log("DiM",Log::DEBUG,oss);
if (vm->get_state() == VirtualMachine::ACTIVE &&
vm->get_lcm_state() == VirtualMachine::RUNNING )
{
Nebula& nd = Nebula::instance();
LifeCycleManager * lcm = nd.get_lcm();
lcm->trigger(LifeCycleManager::REBOOT,vid);
}
else
{
goto error;
}
vm->unlock();
return 0;
error:
oss.str("");
oss << "Could not reboot VM " << vid << ", wrong state.";
NebulaLog::log("DiM",Log::ERROR,oss);
vm->unlock();
return -2;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
int DispatchManager::finalize(
int vid)
{

View File

@ -16,18 +16,31 @@
# limitations under the License. #
# ---------------------------------------------------------------------------- #
ONE_LOCATION=ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION)
ONE_LOCATION=ENV["ONE_LOCATION"]
if !ONE_LOCATION
ETC_LOCATION = "/etc/one" if !defined?(ETC_LOCATION)
RUBY_LIB_LOCATION = "/usr/lib/one/ruby" if !defined?(RUBY_LIB_LOCATION)
BIN_LOCATION = "/usr/bin"
LIB_LOCATION = "/usr/lib/one"
ETC_LOCATION = "/etc/one/"
VAR_LOCATION = "/var/lib/one"
RUBY_LIB_LOCATION = "/usr/lib/one/ruby"
else
ETC_LOCATION = ONE_LOCATION+"/etc" if !defined?(ETC_LOCATION)
RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" if !defined?(RUBY_LIB_LOCATION)
LIB_LOCATION = ONE_LOCATION + "/lib"
BIN_LOCATION = ONE_LOCATION + "/bin"
ETC_LOCATION = ONE_LOCATION + "/etc/"
VAR_LOCATION = ONE_LOCATION + "/var/"
RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby"
end
$: << RUBY_LIB_LOCATION
CONF_FILE = ETC_LOCATION + "/vmwarerc"
ENV['LANG'] = 'C'
require "scripts_common"
require 'yaml'
require "CommandManager"
require 'OpenNebula'
include OpenNebula
@ -38,6 +51,30 @@ rescue Exception => e
exit(-1)
end
# ######################################################################## #
# DRIVER HELPER FUNCTIONS #
# ######################################################################## #
#Generates an ESX command using ttyexpect
def esx_cmd(command)
cmd = "#{BIN_LOCATION}/tty_expect -u #{@user} -p #{@pass} #{command}"
end
#Performs a action usgin libvirt
def do_action(cmd)
rc = LocalCommand.run(esx_cmd(cmd))
if rc.code == 0
return [true, rc.stdout]
else
err = "Error executing: #{cmd} err: #{rc.stderr} out: #{rc.stdout}"
OpenNebula.log_error(err)
return [false, rc.code]
end
end
@result_str = ""
def add_info(name, value)
value = "0" if value.nil? or value.to_s.empty?
@result_str << "#{name}=#{value} "
@ -47,23 +84,31 @@ def print_info
puts @result_str
end
@result_str = ""
# ######################################################################## #
# Main Procedure #
# ######################################################################## #
@host = ARGV[2]
host = ARGV[2]
if !@host
if !host
exit -1
end
load ETC_LOCATION + "/vmwarerc"
conf = YAML::load(File.read(CONF_FILE))
if USERNAME.class!=String || PASSWORD.class!=String
warn "Bad ESX credentials, aborting"
exit -1
@uri = conf[:libvirt_uri].gsub!('@HOST@', host)
@user = conf[:username]
@pass = conf[:password]
# Poll the VMware hypervisor
rc, data = do_action("virsh -c #{@uri} --readonly nodeinfo")
if rc == false
exit info
end
data = perform_action("virsh -c #{LIBVIRT_URI} --readonly nodeinfo")
data.split(/\n/).each{|line|
if line.match('^CPU\(s\)')
$total_cpu = line.split(":")[1].strip.to_i * 100

View File

@ -61,6 +61,11 @@ vmware://*)
exec_and_log "cp -rf $SRC $DST" \
"Error copying $SRC to $DST"
BASE_DISK_FILE=`ls $DST | grep -v '.*-s[0-9]*\.vmdk'`
exec_and_log "mv -f $DST/$BASE_DISK_FILE $DST/disk.vmdk" \
"Error renaming disk file $BASE_DISK_FILE to disk.vmdk"
exec_and_log "chmod 0770 $DST"
;;
@ -86,4 +91,4 @@ esac
SIZE=`fs_du $DST`
echo "$DST $SIZE"
echo "$DST $SIZE"

View File

@ -92,12 +92,3 @@ function check_restricted {
echo 0
}
# Change the permissions of all the files inside directoriers (= VMware disks)
function fix_owner_perms {
find $IMAGE_REPOSITORY_PATH -type d \
-mindepth 1 \
-maxdepth 1 \
-execdir chown \
-R $SUDO_USER '{}' \;
}

View File

@ -53,7 +53,9 @@ http://*)
*)
log "Moving local image $SRC to the image repository"
if [ \( -L $SRC \) -a \( "`$READLINK $SRC`" = "$DST" \) ] ; then
if [ \( -L $SRC \) -a \
\( "`$READLINK -f $SRC`" = "`$READLINK -f $DST`" \) ] ; then
log "Not moving files to image repo, they are the same"
else
exec_and_log "mv -f $SRC $DST" "Could not move $SRC to $DST"
@ -63,7 +65,6 @@ esac
if [ -d $DST ]; then
exec_and_log "chmod 0770 $DST"
fix_owner_perms
else
exec_and_log "chmod 0660 $DST"
fi

View File

@ -427,6 +427,37 @@ void LifeCycleManager::cancel_action(int vid)
return;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
void LifeCycleManager::reboot_action(int vid)
{
VirtualMachine * vm;
vm = vmpool->get(vid,true);
if ( vm == 0 )
{
return;
}
if (vm->get_state() == VirtualMachine::ACTIVE &&
vm->get_lcm_state() == VirtualMachine::RUNNING)
{
Nebula& nd = Nebula::instance();
VirtualMachineManager * vmm = nd.get_vmm();
vmm->trigger(VirtualMachineManager::REBOOT,vid);
}
else
{
vm->log("LCM", Log::ERROR, "reboot_action, VM in a wrong state.");
}
vm->unlock();
return;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */

View File

@ -165,6 +165,10 @@ void LifeCycleManager::trigger(Actions action, int _vid)
aname = "RESTART";
break;
case REBOOT:
aname = "REBOOT";
break;
case DELETE:
aname = "DELETE";
break;
@ -298,6 +302,10 @@ void LifeCycleManager::do_action(const string &action, void * arg)
{
restart_action(vid);
}
else if (action == "REBOOT")
{
reboot_action(vid);
}
else if (action == "DELETE")
{
delete_action(vid);

View File

@ -87,7 +87,7 @@ class OpenNebulaDriver < ActionManager
:ssh_stream => nil
}.merge(ops)
params = parameters+" #{id} #{host}"
params = parameters + " #{id} #{host}"
command = action_command_line(aname, params, options[:script_name])
if action_is_local?(aname)

View File

@ -36,6 +36,7 @@ class VirtualMachineDriver < OpenNebulaDriver
ACTION = {
:deploy => "DEPLOY",
:shutdown => "SHUTDOWN",
:reboot => "REBOOT",
:cancel => "CANCEL",
:save => "SAVE",
:restore => "RESTORE",
@ -80,6 +81,7 @@ class VirtualMachineDriver < OpenNebulaDriver
register_action(ACTION[:deploy].to_sym, method("deploy"))
register_action(ACTION[:shutdown].to_sym, method("shutdown"))
register_action(ACTION[:reboot].to_sym, method("reboot"))
register_action(ACTION[:cancel].to_sym, method("cancel"))
register_action(ACTION[:save].to_sym, method("save"))
register_action(ACTION[:restore].to_sym, method("restore"))
@ -119,6 +121,11 @@ class VirtualMachineDriver < OpenNebulaDriver
send_message(ACTION[:shutdown],RESULT[:failure],id,error)
end
def reboot(id, drv_message)
error = "Action not implemented by driver #{self.class}"
send_message(ACTION[:reboot],RESULT[:failure],id,error)
end
def cancel(id, drv_message)
error = "Action not implemented by driver #{self.class}"
send_message(ACTION[:cancel],RESULT[:failure],id,error)

View File

@ -46,7 +46,7 @@ module OpenNebula
STDERR.puts format_error_message(message)
end
#This function formats an error message for OpenNebula Copyright e
#This function formats an error message for OpenNebula
def self.format_error_message(message)
error_str = "ERROR MESSAGE --8<------\n"
error_str << message

View File

@ -1,60 +0,0 @@
# ---------------------------------------------------------------------------- #
# Copyright 2010-2011, C12G Labs S.L #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
# ---------------------------------------------------------------------------- #
# ---------------------------------------------------------------------------- #
# Set up the environment for the driver #
# ---------------------------------------------------------------------------- #
ONE_LOCATION = ENV["ONE_LOCATION"] if !defined?(ONE_LOCATION)
if !ONE_LOCATION
BIN_LOCATION = "/usr/bin" if !defined?(BIN_LOCATION)
ETC_LOCATION = "/etc/one/" if !defined?(ETC_LOCATION)
RUBY_LIB_LOCATION = "/usr/lib/one/ruby" if !defined?(RUBY_LIB_LOCATION)
else
BIN_LOCATION = ONE_LOCATION + "/bin" if !defined?(BIN_LOCATION)
ETC_LOCATION = ONE_LOCATION + "/etc/" if !defined?(ETC_LOCATION)
if !defined?(RUBY_LIB_LOCATION)
RUBY_LIB_LOCATION = ONE_LOCATION + "/lib/ruby"
end
end
$: << RUBY_LIB_LOCATION
require "OpenNebulaDriver"
require "CommandManager"
# Do host sustitution in the libvirt URI
LIBVIRT_URI.gsub!('@HOST@', @host)
# Common functions
def perform_action(command)
command = BIN_LOCATION + "/tty_expect -u " + USERNAME + " -p " + PASSWORD + " " + command
action_result = LocalCommand.run(command)
if action_result.code == 0
return action_result.stdout
else
log(command, action_result.stderr, action_result.stdout)
return action_result.code
end
end
def log(cmd, stdout, stderr)
STDERR.puts "[VMWARE] cmd failed [" + cmd +
"]. Stderr: " + stderr + ". Stdout: " + stdout
end

View File

@ -56,7 +56,7 @@ void Nebula::start()
// Configuration
// -----------------------------------------------------------
nebula_configuration = new NebulaTemplate(etc_location, var_location);
nebula_configuration = new OpenNebulaTemplate(etc_location, var_location);
rc = nebula_configuration->load_configuration();

View File

@ -15,33 +15,75 @@
/* -------------------------------------------------------------------------- */
#include "NebulaTemplate.h"
#include "Nebula.h"
using namespace std;
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
const char * NebulaTemplate::conf_name="oned.conf";
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location)
int NebulaTemplate::load_configuration()
{
char * error = 0;
int rc;
string aname;
Attribute * attr;
map<string, Attribute *>::iterator iter, j;
set_conf_default();
rc = parse(conf_file.c_str(), &error);
if ( rc != 0 && error != 0)
{
cout << "\nError while parsing configuration file:\n" << error << endl;
free(error);
return -1;
}
for(iter=conf_default.begin();iter!=conf_default.end();)
{
aname = iter->first;
attr = iter->second;
j = attributes.find(aname);
if ( j == attributes.end() )
{
attributes.insert(make_pair(aname,attr));
iter++;
}
else
{
delete iter->second;
conf_default.erase(iter++);
}
}
return 0;
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
const char * OpenNebulaTemplate::conf_name="oned.conf";
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
void OpenNebulaTemplate::set_conf_default()
{
ostringstream os;
SingleAttribute * attribute;
VectorAttribute * vattribute;
string value;
conf_file = etc_location + conf_name;
// MANAGER_TIMER
value = "15";
attribute = new SingleAttribute("MANAGER_TIMER",value);
conf_default.insert(make_pair(attribute->name(),attribute));
/*
#*******************************************************************************
# Daemon configuration attributes
@ -170,49 +212,3 @@ NebulaTemplate::NebulaTemplate(string& etc_location, string& var_location)
conf_default.insert(make_pair(attribute->name(),attribute));
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
int NebulaTemplate::load_configuration()
{
char * error = 0;
map<string, Attribute *>::iterator iter, j;
int rc;
string aname;
Attribute * attr;
rc = parse(conf_file.c_str(), &error);
if ( rc != 0 && error != 0)
{
cout << "\nError while parsing configuration file:\n" << error << endl;
free(error);
return -1;
}
for(iter=conf_default.begin();iter!=conf_default.end();)
{
aname = iter->first;
attr = iter->second;
j = attributes.find(aname);
if ( j == attributes.end() )
{
attributes.insert(make_pair(aname,attr));
iter++;
}
else
{
delete iter->second;
conf_default.erase(iter++);
}
}
return 0;
}

View File

@ -248,6 +248,7 @@ public class VirtualMachine extends PoolElement{
* It is recommended to use the helper methods instead:
* <ul>
* <li>{@link VirtualMachine#shutdown()}</li>
* <li>{@link VirtualMachine#reboot()}</li>
* <li>{@link VirtualMachine#cancel()}</li>
* <li>{@link VirtualMachine#hold()}</li>
* <li>{@link VirtualMachine#release()}</li>
@ -259,7 +260,7 @@ public class VirtualMachine extends PoolElement{
* </ul>
*
* @param action The action name to be performed, can be:<br/>
* "shutdown", "hold", "release", "stop", "cancel", "suspend",
* "shutdown", "reboot", "hold", "release", "stop", "cancel", "suspend",
* "resume", "restart", "finalize".
* @return If an error occurs the error message contains the reason.
*/
@ -357,6 +358,15 @@ public class VirtualMachine extends PoolElement{
return action("shutdown");
}
/**
* Reboots a running VM.
* @return If an error occurs the error message contains the reason.
*/
public OneResponse reboot()
{
return action("reboot");
}
/**
* Cancels the running VM.
* @return If an error occurs the error message contains the reason.

View File

@ -143,6 +143,11 @@ module OpenNebula
action('shutdown')
end
# Shutdowns an already deployed VM
def reboot
action('reboot')
end
# Cancels a running VM
def cancel
action('cancel')

View File

@ -229,6 +229,10 @@ void VirtualMachineAction::request_execute(xmlrpc_c::paramList const& paramList,
{
rc = dm->resubmit(id);
}
else if (action == "reboot")
{
rc = dm->reboot(id);
}
switch (rc)
{

View File

@ -0,0 +1,51 @@
#*******************************************************************************
# OpenNebula Configuration file
#*******************************************************************************
#*******************************************************************************
# Daemon configuration attributes
#-------------------------------------------------------------------------------
# ONED_PORT: Port to connect to the OpenNebula daemon (oned)
#
# SCHED_INTERVAL: Seconds between two scheduling actions
#
# MAX_VM: Maximum number of Virtual Machines scheduled in each scheduling
# action
#
# MAX_DISPATCH: Maximum number of Virtual Machines actually dispatched to a
# host in each scheduling action
#
# MAX_HOST: Maximum number of Virtual Machines dispatched to a given host in
# each scheduling action
#
# DEFAULT_SCHED: Definition of the default scheduling algorithm
# - policy:
# 0 = Packing. Heuristic that minimizes the number of hosts in use by
# packing the VMs in the hosts to reduce VM fragmentation
# 1 = Striping. Heuristic that tries to maximize resources available for
# the VMs by spreading the VMs in the hosts
# 2 = Load-aware. Heuristic that tries to maximize resources available for
# the VMs by usingthose nodes with less load
# 3 = Custom.
# - rank: Custom arithmetic exprission to rank suitable hosts based in their
# attributes
#*******************************************************************************
ONED_PORT = 2633
SCHED_INTERVAL = 30
MAX_VM = 300
MAX_DISPATCH = 30
MAX_HOST = 1
DEFAULT_SCHED = [
policy = 1
]
#DEFAULT_SCHED = [
# policy = 3,
# rank = "- (RUNNING_VMS * 50 + FREE_CPU)"
#]

View File

@ -29,12 +29,16 @@ public:
RankPolicy(
VirtualMachinePoolXML * vmpool,
HostPoolXML * hpool,
float w=1.0):SchedulerHostPolicy(vmpool,hpool,w){};
const string& dr,
float w = 1.0)
:SchedulerHostPolicy(vmpool,hpool,w), default_rank(dr){};
~RankPolicy(){};
private:
string default_rank;
void policy(
VirtualMachineXML * vm)
{
@ -53,10 +57,10 @@ private:
srank = vm->get_rank();
if (srank == "")
if (srank.empty())
{
NebulaLog::log("RANK",Log::WARNING,"No rank defined for VM");
}
srank = default_rank;
}
for (i=0;i<hids.size();i++)
{

View File

@ -30,7 +30,7 @@ using namespace std;
/* -------------------------------------------------------------------------- */
extern "C" void * scheduler_action_loop(void *arg);
class SchedulerTemplate;
/**
* The Scheduler class. It represents the scheduler ...
*/
@ -41,20 +41,19 @@ public:
void start();
virtual void register_policies() = 0;
virtual void register_policies(const SchedulerTemplate& conf) = 0;
protected:
Scheduler(string& _url, time_t _timer,
int _machines_limit, int _dispatch_limit, int _host_dispatch_limit):
Scheduler():
hpool(0),
vmpool(0),
acls(0),
timer(_timer),
url(_url),
machines_limit(_machines_limit),
dispatch_limit(_dispatch_limit),
host_dispatch_limit(_host_dispatch_limit),
timer(0),
url(""),
machines_limit(0),
dispatch_limit(0),
host_dispatch_limit(0),
threshold(0.9),
client(0)
{

View File

@ -0,0 +1,47 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
#ifndef SCHEDULER_TEMPLATE_H_
#define SCHEDULER_TEMPLATE_H_
#include "NebulaTemplate.h"
class SchedulerTemplate : public NebulaTemplate
{
public:
SchedulerTemplate(const string& etc_location):
NebulaTemplate(etc_location, conf_name)
{};
~SchedulerTemplate(){};
string get_policy() const;
private:
/**
* Name for the configuration file, oned.conf
*/
static const char * conf_name;
/**
* Sets the defaults value for the template
*/
void set_conf_default();
};
#endif /*SCHEDULER_TEMPLATE_H_*/

View File

@ -21,7 +21,7 @@ import os
lib_name='scheduler_sched'
source_files=['Scheduler.cc']
source_files=['Scheduler.cc' , 'SchedulerTemplate.cc']
# Build library
sched_env.StaticLibrary(lib_name, source_files)
@ -36,6 +36,8 @@ sched_env.Prepend(LIBS=[
'nebula_pool',
'nebula_xml',
'nebula_common',
'nebula_core',
'nebula_template',
'crypto',
])

View File

@ -30,6 +30,7 @@
#include <cmath>
#include "Scheduler.h"
#include "SchedulerTemplate.h"
#include "RankPolicy.h"
#include "NebulaLog.h"
#include "PoolObjectAuth.h"
@ -65,33 +66,44 @@ extern "C" void * scheduler_action_loop(void *arg)
void Scheduler::start()
{
int rc;
ifstream file;
ifstream file;
ostringstream oss;
string etc_path;
int oned_port;
pthread_attr_t pattr;
// -----------------------------------------------------------
// Log system
// Log system & Configuration File
// -----------------------------------------------------------
try
{
ostringstream oss;
string log_file;
const char * nl = getenv("ONE_LOCATION");
if (nl == 0) //OpenNebula installed under root directory
{
oss << "/var/log/one/";
log_file = "/var/log/one/sched.log";
etc_path = "/etc/one/";
}
else
{
oss << nl << "/var/";
}
oss << nl << "/var/sched.log";
oss << "sched.log";
log_file = oss.str();
oss.str("");
oss << nl << "/etc/";
etc_path = oss.str();
}
NebulaLog::init_log_system(NebulaLog::FILE,
Log::DEBUG,
oss.str().c_str());
log_file.c_str());
NebulaLog::log("SCHED", Log::INFO, "Init Scheduler Log system");
}
@ -100,6 +112,42 @@ void Scheduler::start()
throw;
}
// -----------------------------------------------------------
// Configuration File
// -----------------------------------------------------------
SchedulerTemplate conf(etc_path);
if ( conf.load_configuration() != 0 )
{
throw runtime_error("Error reading configuration file.");
}
conf.get("ONED_PORT", oned_port);
oss.str("");
oss << "http://localhost:" << oned_port << "/RPC2";
url = oss.str();
conf.get("SCHED_INTERVAL", timer);
conf.get("MAX_VM", machines_limit);
conf.get("MAX_DISPATCH", dispatch_limit);
conf.get("MAX_HOST", host_dispatch_limit);
oss.str("");
oss << "Starting Scheduler Daemon" << endl;
oss << "----------------------------------------\n";
oss << " Scheduler Configuration File \n";
oss << "----------------------------------------\n";
oss << conf;
oss << "----------------------------------------";
NebulaLog::log("SCHED", Log::INFO, oss);
// -----------------------------------------------------------
// XML-RPC Client
// -----------------------------------------------------------
@ -129,7 +177,7 @@ void Scheduler::start()
// Load scheduler policies
// -----------------------------------------------------------
register_policies();
register_policies(conf);
// -----------------------------------------------------------
// Close stds, we no longer need them

View File

@ -0,0 +1,126 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
#include "SchedulerTemplate.h"
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
const char * SchedulerTemplate::conf_name="sched.conf";
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
void SchedulerTemplate::set_conf_default()
{
SingleAttribute * attribute;
VectorAttribute * vattribute;
string value;
/*
#*******************************************************************************
# Daemon configuration attributes
#-------------------------------------------------------------------------------
# ONED_PORT
# SCHED_INTERVAL
# MAX_VM
# MAX_DISPATCH
# MAX_HOST
# DEFAULT_SCHED
#-------------------------------------------------------------------------------
*/
// ONED_PORT
value = "2633";
attribute = new SingleAttribute("ONED_PORT",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// SCHED_INTERVAL
value = "30";
attribute = new SingleAttribute("SCHED_INTERVAL",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// MAX_VM
value = "300";
attribute = new SingleAttribute("MAX_VM",value);
conf_default.insert(make_pair(attribute->name(),attribute));
// MAX_DISPATCH
value = "30";
attribute = new SingleAttribute("MAX_DISPATCH",value);
conf_default.insert(make_pair(attribute->name(),attribute));
//MAX_HOST
value = "1";
attribute = new SingleAttribute("MAX_HOST",value);
conf_default.insert(make_pair(attribute->name(),attribute));
//DEFAULT_SCHED
map<string,string> vvalue;
vvalue.insert(make_pair("POLICY","1"));
vattribute = new VectorAttribute("DEFAULT_SCHED",vvalue);
conf_default.insert(make_pair(attribute->name(),vattribute));
}
/* -------------------------------------------------------------------------- */
/* -------------------------------------------------------------------------- */
string SchedulerTemplate::get_policy() const
{
int policy;
string rank;
istringstream iss;
vector<const Attribute *> vsched;
const VectorAttribute * sched;
get("DEFAULT_SCHED", vsched);
sched = static_cast<const VectorAttribute *> (vsched[0]);
iss.str(sched->vector_value("POLICY"));
iss >> policy;
switch (policy)
{
case 0: //Packing
rank = "RUNNING_VMS";
break;
case 1: //Striping
rank = "- RUNNING_VMS";
break;
case 2: //Load-aware
rank = "FREE_CPU";
break;
case 3: //Custom
rank = sched->vector_value("RANK");
break;
default:
rank = "";
}
return rank;
}

View File

@ -15,6 +15,7 @@
/* -------------------------------------------------------------------------- */
#include "Scheduler.h"
#include "SchedulerTemplate.h"
#include "RankPolicy.h"
#include <unistd.h>
#include <sys/types.h>
@ -31,16 +32,7 @@ class RankScheduler : public Scheduler
{
public:
RankScheduler(string url,
time_t timer,
unsigned int machines_limit,
unsigned int dispatch_limit,
unsigned int host_dispatch_limit
):Scheduler(url,
timer,
machines_limit,
dispatch_limit,
host_dispatch_limit),rp(0){};
RankScheduler():Scheduler(),rp(0){};
~RankScheduler()
{
@ -50,9 +42,9 @@ public:
}
};
void register_policies()
void register_policies(const SchedulerTemplate& conf)
{
rp = new RankPolicy(vmpool,hpool,1.0);
rp = new RankPolicy(vmpool, hpool, conf.get_policy(), 1.0);
add_host_policy(rp);
};
@ -64,56 +56,11 @@ private:
int main(int argc, char **argv)
{
RankScheduler * ss;
int port = 2633;
time_t timer= 30;
unsigned int machines_limit = 300;
unsigned int dispatch_limit = 30;
unsigned int host_dispatch_limit = 1;
char opt;
ostringstream oss;
while((opt = getopt(argc,argv,"p:t:m:d:h:")) != -1)
{
switch(opt)
{
case 'p':
port = atoi(optarg);
break;
case 't':
timer = atoi(optarg);
break;
case 'm':
machines_limit = atoi(optarg);
break;
case 'd':
dispatch_limit = atoi(optarg);
break;
case 'h':
host_dispatch_limit = atoi(optarg);
break;
default:
cerr << "usage: " << argv[0] << " [-p port] [-t timer] ";
cerr << "[-m machines limit] [-d dispatch limit] [-h host_dispatch_limit]\n";
exit(-1);
break;
}
};
/* ---------------------------------------------------------------------- */
oss << "http://localhost:" << port << "/RPC2";
ss = new RankScheduler(oss.str(),
timer,
machines_limit,
dispatch_limit,
host_dispatch_limit);
RankScheduler ss;
try
{
ss->start();
ss.start();
}
catch (exception &e)
{
@ -122,7 +69,5 @@ int main(int argc, char **argv)
return -1;
}
delete ss;
return 0;
}

View File

@ -45,3 +45,7 @@
:user:
:group:
oneadmin: true
- plugins/config-tab.js:
:ALL: true
:user:
:group:

View File

@ -17,4 +17,7 @@
# VNC Configuration
:vnc_proxy_base_port: 29876
:novnc_path:
:novnc_path:
# Default language setting
:lang: en_US

View File

@ -64,7 +64,7 @@ module OpenNebulaJSON
end
def update(params=Hash.new)
super(params['raw_template'])
super(params['template_raw'])
end
def addgroup(params=Hash.new)

View File

@ -62,6 +62,7 @@ module OpenNebulaJSON
when "restart" then self.restart
when "saveas" then self.save_as(action_hash['params'])
when "shutdown" then self.shutdown
when "reboot" then self.reboot
when "resubmit" then self.resubmit
when "chown" then self.chown(action_hash['params'])
else

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 599 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 484 B

After

Width:  |  Height:  |  Size: 597 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 449 B

After

Width:  |  Height:  |  Size: 551 B

View File

@ -0,0 +1,88 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
var lang=""
var locale = {};
var datatable_lang = "";
function tr(str){
var tmp = locale[str];
if ( tmp == null || tmp == "" ) {
//console.debug("Missing translation: "+str);
tmp = str;
}
return tmp;
};
//Pops up loading new language dialog. Retrieves the user template, updates the LANG variable.
//Updates template and session configuration and reloads the view.
function setLang(lang_str){
var lang_tmp="";
var dialog = $('<div title="'+tr("Changing language")+'">'+tr("Loading new language... please wait")+' '+spinner+'</div>').dialog({
draggable:false,
modal:true,
resizable:false,
buttons:{},
width: 460,
minHeight: 50
});
var updateUserTemplate = function(request,user_json){
var template = user_json.USER.TEMPLATE;
var template_str="";
template["LANG"] = lang_tmp;
//convert json to ONE template format - simple conversion
$.each(template,function(key,value){
template_str += (key + '=' + '"' + value + '"\n');
});
var obj = {
data: {
id: uid,
extra_param: template_str
},
error: onError
};
OpenNebula.User.update(obj);
$.post('config',JSON.stringify({lang:lang_tmp}),function(){window.location.href = "."});
};
lang_tmp = lang_str;
if (whichUI() == "sunstone"){
var obj = {
data : {
id: uid,
},
success: updateUserTemplate
};
OpenNebula.User.show(obj);
} else {
dialog.dialog('close');
};
};
$(document).ready(function(){
//Update static translations
$('#doc_link').text(tr("Documentation"));
$('#support_link').text(tr("Support"));
$('#community_link').text(tr("Community"));
$('#welcome').text(tr("Welcome"));
$('#logout').text(tr("Sign out"));
});

View File

@ -25,12 +25,12 @@ var acls_tab_content =
<table id="datatable_acls" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Applies to</th>\
<th>Affected resources</th>\
<th>Resource ID / Owned by</th>\
<th>Allowed operations</th>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Applies to")+'</th>\
<th>'+tr("Affected resources")+'</th>\
<th>'+tr("Resource ID / Owned by")+'</th>\
<th>'+tr("Allowed operations")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyaclss">\
@ -42,48 +42,48 @@ var create_acl_tmpl =
'<form id="create_acl_form" action="">\
<fieldset>\
<div>\
<label for="applies">This rule applies to:</label>\
<label for="applies">'+tr("This rule applies to")+':</label>\
<select name="applies" id="applies"></select>\
<div class="clear"></div>\
<label style="height:9em">Affected resources:</label>\
<input type="checkbox" name="res_host" class="resource_cb" value="HOST">Hosts</input><br />\
<input type="checkbox" name="res_vm" class="resource_cb" value="VM">Virtual Machines</input><br />\
<input type="checkbox" name="res_net" class="resource_cb" value="NET">Virtual Networks</input><br />\
<input type="checkbox" name="res_image" class="resource_cb" value="IMAGE">Images</input><br />\
<input type="checkbox" name="res_template" class="resource_cb" value="TEMPLATE">Templates</input><br />\
<input type="checkbox" name="res_user" class="resource_cb" value="USER">Users</input><br />\
<input type="checkbox" name="res_group" class="resource_cb" value="GROUP">Groups</input><br />\
<label style="height:9em">'+tr("Affected resources")+':</label>\
<input type="checkbox" name="res_host" class="resource_cb" value="HOST">'+tr("Hosts")+'</input><br />\
<input type="checkbox" name="res_vm" class="resource_cb" value="VM">'+tr("Virtual Machines")+'</input><br />\
<input type="checkbox" name="res_net" class="resource_cb" value="NET">'+tr("Virtual Networks")+'</input><br />\
<input type="checkbox" name="res_image" class="resource_cb" value="IMAGE">'+tr("Images")+'</input><br />\
<input type="checkbox" name="res_template" class="resource_cb" value="TEMPLATE">'+tr("Templates")+'</input><br />\
<input type="checkbox" name="res_user" class="resource_cb" value="USER">'+tr("Users")+'</input><br />\
<input type="checkbox" name="res_group" class="resource_cb" value="GROUP">'+tr("Groups")+'</input><br />\
<div class="clear"></div>\
<label for="mode_select" style="height:3em;">Resource subset:</label>\
<input type="radio" class="res_subgroup" name="mode_select" value="*" id="res_subgroup_all">All</input><br />\
<input type="radio" class="res_subgroup" name="mode_select" value="res_id" id="res_subgroup_id">Specific ID</input><br />\
<input type="radio" class="res_subgroup" name="mode_select" value="belonging_to" id="res_subgroup_group">Owned by group</input><br />\
<label for="mode_select" style="height:3em;">'+tr("Resource subset")+':</label>\
<input type="radio" class="res_subgroup" name="mode_select" value="*" id="res_subgroup_all">'+tr("All")+'</input><br />\
<input type="radio" class="res_subgroup" name="mode_select" value="res_id" id="res_subgroup_id">'+tr("Specific ID")+'</input><br />\
<input type="radio" class="res_subgroup" name="mode_select" value="belonging_to" id="res_subgroup_group">'+tr("Owned by group")+'</input><br />\
<div class="clear"></div>\
<label for="res_id">Resource ID:</label>\
<label for="res_id">'+tr("Resource ID")+':</label>\
<input type="text" name="res_id" id="res_id"></input>\
<div class="clear"></div>\
<label for="belonging_to">Group:</label>\
<label for="belonging_to">'+tr("Group")+':</label>\
<select name="belonging_to" id="belonging_to"></select>\
<div class="clear"></div>\
<label style="height:12em;">Allowed operations:</label>\
<input type="checkbox" name="right_create" class="right_cb" value="CREATE">Create</input><br />\
<input type="checkbox" name="right_delete" class="right_cb" value="DELETE">Delete</input><br />\
<input type="checkbox" name="right_use" class="right_cb" value="USE">Use</input><br />\
<input type="checkbox" name="right_manage" class="right_cb" value="MANAGE">Manage</input><br />\
<input type="checkbox" name="right_info" class="right_cb" value="INFO">Get Information</input><br />\
<input type="checkbox" name="right_info_pool" class="right_cb" value="INFO_POOL">Get Pool of resources</input><br />\
<input type="checkbox" name="right_info_pool_mine" class="right_cb" value="INFO_POOL_MINE">Get Pool of my/group\'s resources</input><br />\
<input type="checkbox" name="right_chown" class="right_cb" value="CHOWN">Change owner</input><br />\
<input type="checkbox" name="right_deploy" class="right_cb" value="DEPLOY">Deploy</input><br />\
<label style="height:12em;">'+tr("Allowed operations")+':</label>\
<input type="checkbox" name="right_create" class="right_cb" value="CREATE">'+tr("Create")+'</input><br />\
<input type="checkbox" name="right_delete" class="right_cb" value="DELETE">'+tr("Delete")+'</input><br />\
<input type="checkbox" name="right_use" class="right_cb" value="USE">'+tr("Use")+'</input><br />\
<input type="checkbox" name="right_manage" class="right_cb" value="MANAGE">'+tr("Manage")+'</input><br />\
<input type="checkbox" name="right_info" class="right_cb" value="INFO">'+tr("Get Information")+'</input><br />\
<input type="checkbox" name="right_info_pool" class="right_cb" value="INFO_POOL">'+tr("Get Pool of resources")+'</input><br />\
<input type="checkbox" name="right_info_pool_mine" class="right_cb" value="INFO_POOL_MINE">'+tr("Get Pool of my/group\'s resources")+'</input><br />\
<input type="checkbox" name="right_chown" class="right_cb" value="CHOWN">'+tr("Change owner")+'</input><br />\
<input type="checkbox" name="right_deploy" class="right_cb" value="DEPLOY">'+tr("Deploy")+'</input><br />\
<div class="clear"></div>\
<label for="acl_preview">ACL String preview:</label>\
<label for="acl_preview">'+tr("ACL String preview")+':</label>\
<input type="text" name="acl_preview" id="acl_preview" style="width:400px;"></input>\
</div>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_acl_submit" value="Acl.create">Create</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" id="create_acl_submit" value="Acl.create">'+tr("Create")+'</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>';
@ -143,21 +143,21 @@ var acl_actions = {
var acl_buttons = {
"Acl.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Acl.create_dialog" : {
type: "create_dialog",
text: "+ New"
text: tr("+ New")
},
"Acl.delete" : {
type: "action",
text: "Delete"
text: tr("Delete")
}
}
var acls_tab = {
title: "ACLs",
title: tr("ACLs"),
content: acls_tab_content,
buttons: acl_buttons
}
@ -179,14 +179,14 @@ function aclElements(){
function parseUserAcl(user){
var user_str="";
if (user[0] == '*'){
user_str = "All";
user_str = tr("All");
} else {
if (user[0] == '#'){
user_str="User ";
user_str=tr("User")+" ";
user_str+= getUserName(user.substring(1));
}
else if (user[0] == '@'){
user_str="Group ";
user_str=tr("Group ");
user_str+= getGroupName(user.substring(1));
};
};
@ -197,14 +197,14 @@ function parseUserAcl(user){
function parseResourceAcl(user){
var user_str="";
if (user[0] == '*'){
user_str = "All";
user_str = tr("All");
} else {
if (user[0] == '#'){
user_str="ID ";
user_str=tr("ID")+" ";
user_str+= user.substring(1);
}
else if (user[0] == '@'){
user_str="Group ";
user_str=tr("Group")+" ";
user_str+= getGroupName(user.substring(1));
};
};
@ -232,25 +232,25 @@ function parseAclString(string) {
for (var i=0; i<resources_array.length;i++){
switch (resources_array[i]){
case "HOST":
resources_str+="Hosts, ";
resources_str+=tr("Hosts")+", ";
break;
case "VM":
resources_str+="Virtual Machines, ";
resources_str+=tr("Virtual Machines")+", ";
break;
case "NET":
resources_str+="Virtual Networks, ";
resources_str+=tr("Virtual Networks")+", ";
break;
case "IMAGE":
resources_str+="Images, ";
resources_str+=(tr("Images")+", ");
break;
case "TEMPLATE":
resources_str+="VM Templates, ";
resources_str+=tr("VM Templates")+", ";
break;
case "USER":
resources_str+="Users, ";
resources_str+=tr("Users")+", ";
break;
case "GROUP":
resources_str+="Groups, ";
resources_str+=tr("Groups")+", ";
break;
};
};
@ -303,7 +303,7 @@ function updateAclsView(request,list){
}
function setupCreateAclDialog(){
dialogs_context.append('<div title="Create ACL" id="create_acl_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create ACL")+'\" id="create_acl_dialog"></div>');
$create_acl_dialog = $('#create_acl_dialog',dialogs_context);
var dialog = $create_acl_dialog;
dialog.html(create_acl_tmpl);
@ -316,9 +316,9 @@ function setupCreateAclDialog(){
height: height
});
$('#res_subgroup_all',dialog).attr("checked","checked");
$('#res_id',dialog).attr("disabled","disabled");
$('#belonging_to',dialog).attr("disabled","disabled");
$('#res_subgroup_all',dialog).attr('checked','checked');
$('#res_id',dialog).attr('disabled','disabled');
$('#belonging_to',dialog).attr('disabled','disabled');
$('button',dialog).button();
@ -327,16 +327,16 @@ function setupCreateAclDialog(){
var context = $(this).parent();
switch (value) {
case "*":
$('#res_id',context).attr("disabled","disabled");
$('#belonging_to',context).attr("disabled","disabled");
$('#res_id',context).attr('disabled','disabled');
$('#belonging_to',context).attr('disabled','disabled');
break;
case "res_id":
$('#res_id',context).removeAttr("disabled");
$('#belonging_to').attr("disabled","disabled");
$('#res_id',context).removeAttr('disabled');
$('#belonging_to').attr('disabled','disabled');
break;
case "belonging_to":
$('#res_id',context).attr("disabled","disabled");
$('#belonging_to',context).removeAttr("disabled");
$('#res_id',context).attr('disabled','disabled');
$('#belonging_to',context).removeAttr('disabled');
break;
};
});
@ -391,13 +391,13 @@ function setupCreateAclDialog(){
$('#create_acl_form',dialog).submit(function(){
var user = $('#applies',this).val();
if (!user.length) {
notifyError("Please specify to who this ACL applies");
notifyError(tr("Please specify to who this ACL applies"));
return false;
};
var resources = $('.resource_cb:checked',this).length;
if (!resources) {
notifyError("Please select at least one resource");
notifyError(tr("Please select at least one resource"));
return false;
}
@ -406,7 +406,7 @@ function setupCreateAclDialog(){
case "res_id":
var l=$('#res_id',this).val().length;
if (!l){
notifyError("Please provide a resource ID for the resource(s) in this rule");
notifyError(tr("Please provide a resource ID for the resource(s) in this rule"));
return false;
}
break;
@ -441,15 +441,15 @@ function popUpCreateAclDialog(){
var users = $('<select>'+users_select+'</select>');
$('.empty_value',users).remove();
$('option',users).addClass("user");
users.prepend('<option value="">---Users---</option>');
users.prepend('<option value="">---'+tr("Users")+'---</option>');
var groups = $('<select>'+groups_select+'</select>');
$('.empty_value',groups).remove();
$('option',groups).addClass("group");
groups.prepend('<option value="">---Groups---</option>');
groups.prepend('<option value="">---'+tr("Groups")+'---</option>');
var dialog = $create_acl_dialog;
$('#applies',dialog).html('<option value="*">All</option>'+
$('#applies',dialog).html('<option value="*">'+tr("All")+'</option>'+
users.html()+groups.html());
$('#belonging_to',dialog).html(groups_select);
@ -461,7 +461,7 @@ function popUpCreateAclDialog(){
function setAclAutorefresh(){
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_acls);
var filter = $("#datatable_acls_filter input",dataTable_acls.parents("#datatable_acls_wrapper")).attr("value");
var filter = $("#datatable_acls_filter input",dataTable_acls.parents("#datatable_acls_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Acl.autorefresh");
}
@ -480,7 +480,11 @@ $(document).ready(function(){
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_acls.fnClearTable();
addElement([

View File

@ -0,0 +1,58 @@
/* -------------------------------------------------------------------------- */
/* Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) */
/* */
/* Licensed under the Apache License, Version 2.0 (the "License"); you may */
/* not use this file except in compliance with the License. You may obtain */
/* a copy of the License at */
/* */
/* http://www.apache.org/licenses/LICENSE-2.0 */
/* */
/* Unless required by applicable law or agreed to in writing, software */
/* distributed under the License is distributed on an "AS IS" BASIS, */
/* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. */
/* See the License for the specific language governing permissions and */
/* limitations under the License. */
/* -------------------------------------------------------------------------- */
var config_tab_content =
'<form>\
<table id="config_table" style="width:100%">\
<tr>\
<td>\
<div class="panel">\
<h3>' + tr("Sunstone UI Configuration") + '</h3>\
<div class="panel_info">\
\
<table class="info_table">\
<tr>\
<td class="key_td">' + tr("Language") + '</td>\
<td class="value_td">\
<select id="lang_sel" style="width:20em;">\
<option value="en_US">'+tr("English")+'</option>\
<option value="ru">'+tr("Russian")+'</option>\
</select>\
</td>\
</tr>\
</table>\
\
</div>\
</div>\
</td>\
</tr>\
</table></form>';
var config_tab = {
title: tr("Configuration"),
content: config_tab_content
}
Sunstone.addMainTab('config_tab',config_tab);
$(document).ready(function(){
if (lang)
$('table#config_table #lang_sel option[value="'+lang+'"]').attr('selected','selected');
$('table#config_table #lang_sel').change(function(){
setLang($(this).val());
});
});

View File

@ -50,40 +50,44 @@ var dashboard_tab_content =
<tr>\
<td>\
<div class="panel">\
<h3>Summary of resources</h3>\
<h3>' + tr("Summary of resources") + '</h3>\
<div class="panel_info">\
\
<table class="info_table">\
<tr>\
<td class="key_td">Hosts (total/active)</td>\
<td class="key_td">' + tr("Hosts (total/active)") + '</td>\
<td class="value_td"><span id="total_hosts"></span><span id="active_hosts" class="green"></span></td>\
</tr>\
<tr>\
<td class="key_td">Groups</td>\
<td class="key_td">' + tr("Groups") + '</td>\
<td class="value_td"><span id="total_groups"></span></td>\
</tr>\
<tr>\
<td class="key_td">VM Templates (total/public)</td>\
<td class="key_td">' + tr("VM Templates (total/public)") + '</td>\
<td class="value_td"><span id="total_templates"></span><span id="public_templates"></span></td>\
</tr>\
<tr>\
<td class="key_td">VM Instances (total/<span class="green">running</span>/<span class="red">failed</span>)</td>\
<td class="key_td">' +
tr("VM Instances")+ ' (' +
tr("total") + '/<span class="green">' +
tr("running") + '</span>/<span class="red">' +
tr("failed") + '</span>)</td>\
<td class="value_td"><span id="total_vms"></span><span id="running_vms" class="green"></span><span id="failed_vms" class="red"></span></td>\
</tr>\
<tr>\
<td class="key_td">Virtual Networks (total/public)</td>\
<td class="key_td">' + tr("Virtual Networks (total/public)") + '</td>\
<td class="value_td"><span id="total_vnets"></span><span id="public_vnets"></span></td>\
</tr>\
<tr>\
<td class="key_td">Images (total/public)</td>\
<td class="key_td">' + tr("Images (total/public)") + '</td>\
<td class="value_td"><span id="total_images"></span><span id="public_images"></span></td>\
</tr>\
<tr>\
<td class="key_td">Users</td>\
<td class="key_td">' + tr("Users")+'</td>\
<td class="value_td"><span id="total_users"></span></td>\
</tr>\
<tr>\
<td class="key_td">ACL Rules</td>\
<td class="key_td">' + tr("ACL Rules") + '</td>\
<td class="value_td"><span id="total_acls"></span></td>\
</tr>\
</table>\
@ -95,18 +99,18 @@ var dashboard_tab_content =
<tr>\
<td>\
<div class="panel">\
<h3>Quickstart</h3>\
<h3>' + tr("Quickstart") + '</h3>\
<form id="quickstart_form"><fieldset>\
<table style="width:100%;"><tr style="vertical-align:middle;"><td style="width:70%">\
<label style="font-weight:bold;width:40px;height:10em;">New:</label>\
<input type="radio" name="quickstart" value="Host.create_dialog">Host</input><br />\
<input type="radio" name="quickstart" value="VM.create_dialog">VM Instance</input><br />\
<input type="radio" name="quickstart" value="Template.create_dialog">VM Template</input><br />\
<input type="radio" name="quickstart" value="Network.create_dialog">Virtual Network</input><br />\
<input type="radio" name="quickstart" value="Image.create_dialog">Image</input><br />\
<input type="radio" name="quickstart" value="User.create_dialog">User</input><br />\
<input type="radio" name="quickstart" value="Group.create_dialog">Group</input><br />\
<input type="radio" name="quickstart" value="Acl.create_dialog">Acl</input><br />\
<label style="font-weight:bold;width:40px;height:10em;">' + tr("New")+': </label>\
<input type="radio" name="quickstart" value="Host.create_dialog">' + tr("Host") + '</input><br />\
<input type="radio" name="quickstart" value="VM.create_dialog">' + tr("VM Instance") + '</input><br />\
<input type="radio" name="quickstart" value="Template.create_dialog">' + tr("VM Template") + '</input><br />\
<input type="radio" name="quickstart" value="Network.create_dialog">' + tr("Virtual Network") + '</input><br />\
<input type="radio" name="quickstart" value="Image.create_dialog">' + tr("Image") + '</input><br />\
<input type="radio" name="quickstart" value="User.create_dialog">' + tr("User") + '</input><br />\
<input type="radio" name="quickstart" value="Group.create_dialog">' + tr("Group") + '</input><br />\
<input type="radio" name="quickstart" value="Acl.create_dialog">' + tr("Acl") + '</input><br />\
</td></tr></table>\
</div>\
</td>\
@ -118,19 +122,19 @@ var dashboard_tab_content =
<tr>\
<td>\
<div class="panel">\
<h3>Historical monitoring information</h3>\
<h3>' + tr("Historical monitoring information") + '</h3>\
<div class="panel_info">\
<table class="info_table">\
<tr><td class="key_td graph_td">Hosts CPU</td>\
<tr><td class="key_td graph_td">' + tr("Hosts CPU") + '</td>\
<td class="graph_td" id="graph1_legend"></td></tr>\
<tr><td id="graph1" colspan="2">'+spinner+'</td></tr>\
<tr><td class="key_td graph_td">Hosts memory</td>\
<tr><td class="key_td graph_td">' + tr("Hosts memory") + '</td>\
<td class="graph_td" id="graph2_legend"></td></tr>\
<tr><td id="graph2" colspan="2">'+spinner+'</td></tr>\
<tr><td class="key_td graph_td">Total VM count</td>\
<tr><td class="key_td graph_td">' + tr("Total VM count") + '</td>\
<td class="graph_td" id="graph3_legend"></td></tr>\
<tr><td id="graph3" colspan="2">'+spinner+'</td></tr>\
<tr><td class="key_td graph_td">VM Network stats</td>\
<tr><td class="key_td graph_td">' + tr("VM Network stats") + '</td>\
<td class="graph_td" id="graph4_legend"></td></tr>\
<tr><td id="graph4" colspan="2">'+spinner+'</td></tr>\
</table>\
@ -143,7 +147,7 @@ var dashboard_tab_content =
</tr></table>';
var dashboard_tab = {
title: 'Dashboard',
title: tr("Dashboard"),
content: dashboard_tab_content
}
@ -163,7 +167,7 @@ function plot_global_graph(data,info){
for (var i=0; i<labels_array.length; i++) {
serie = {
label: labels_array[i],
label: tr(labels_array[i]),
data: monitoring[labels_array[i]]
};
series.push(serie);

View File

@ -50,24 +50,27 @@ var dashboard_tab_content =
<tr>\
<td>\
<div class="panel">\
<h3>Summary of resources</h3>\
<h3>'+tr("Summary of resources")+'</h3>\
<div class="panel_info">\
\
<table class="info_table">\
<tr>\
<td class="key_td">VM Templates (total/public)</td>\
<td class="key_td">'+tr("VM Templates (total/public)")+'</td>\
<td class="value_td"><span id="total_templates"></span><span id="public_templates"></span></td>\
</tr>\
<tr>\
<td class="key_td">VM Instances (total/<span class="green">running</span>/<span class="red">failed</span>)</td>\
<td class="key_td">'+tr("VM Instances")+' ('+
tr("total")+'/<span class="green">'+
tr("running")+'</span>/<span class="red">'+
tr("failed")+'</span>)</td>\
<td class="value_td"><span id="total_vms"></span><span id="running_vms" class="green"></span><span id="failed_vms" class="red"></span></td>\
</tr>\
<tr>\
<td class="key_td">Virtual Networks (total/public)</td>\
<td class="key_td">'+tr("Virtual Networks (total/public)")+'</td>\
<td class="value_td"><span id="total_vnets"></span><span id="public_vnets"></span></td>\
</tr>\
<tr>\
<td class="key_td">Images (total/public)</td>\
<td class="key_td">'+tr("Images (total/public)")+'</td>\
<td class="value_td"><span id="total_images"></span><span id="public_images"></span></td>\
</tr>\
</table>\
@ -79,14 +82,14 @@ var dashboard_tab_content =
<tr>\
<td>\
<div class="panel">\
<h3>Quickstart</h3>\
<h3>'+tr("Quickstart")+'</h3>\
<form id="quickstart_form"><fieldset>\
<table style="width:100%;"><tr style="vertical-align:middle;"><td style="width:70%">\
<label style="font-weight:bold;width:40px;height:4em;">New:</label>\
<input type="radio" name="quickstart" value="Template.create_dialog">VM Template</input><br />\
<input type="radio" name="quickstart" value="VM.create_dialog">VM Instance</input><br />\
<input type="radio" name="quickstart" value="Network.create_dialog">Virtual Network</input><br />\
<input type="radio" name="quickstart" value="Image.create_dialog">Image</input><br />\
<input type="radio" name="quickstart" value="Template.create_dialog">'+tr("VM Template")+'</input><br />\
<input type="radio" name="quickstart" value="VM.create_dialog">'+tr("VM Instance")+'</input><br />\
<input type="radio" name="quickstart" value="Network.create_dialog">'+tr("Virtual Network")+'</input><br />\
<input type="radio" name="quickstart" value="Image.create_dialog">'+tr("Image")+'</input><br />\
</td></tr></table>\
</div>\
</td>\
@ -98,19 +101,19 @@ var dashboard_tab_content =
<tr>\
<td>\
<div class="panel">\
<h3>Historical monitoring information</h3>\
<h3>'+tr("Historical monitoring information")+'</h3>\
<div class="panel_info">\
<table class="info_table">\
<tr><td class="key_td graph_td">Total VM count</td>\
<tr><td class="key_td graph_td">'+tr("Total VM count")+'</td>\
<td class="graph_td" id="graph1_legend"></td></tr>\
<tr><td id="graph1" colspan="2">'+spinner+'</td></tr>\
<tr><td class="key_td graph_td">Total VM CPU</td>\
<tr><td class="key_td graph_td">'+tr("Total VM CPU")+'</td>\
<td class="graph_td" id="graph2_legend"></td></tr>\
<tr><td id="graph2" colspan="2">'+spinner+'</td></tr>\
<tr><td class="key_td graph_td">Total VM Memory</td>\
<tr><td class="key_td graph_td">'+tr("Total VM Memory")+'</td>\
<td class="graph_td" id="graph3_legend"></td></tr>\
<tr><td id="graph3" colspan="2">'+spinner+'</td></tr>\
<tr><td class="key_td graph_td">VM Network stats</td>\
<tr><td class="key_td graph_td">'+tr("VM Network stats")+'</td>\
<td class="graph_td" id="graph4_legend"></td></tr>\
<tr><td id="graph4" colspan="2">'+spinner+'</td></tr>\
</table>\
@ -123,7 +126,7 @@ var dashboard_tab_content =
</tr></table>';
var dashboard_tab = {
title: 'Dashboard',
title: tr("Dashboard"),
content: dashboard_tab_content
}

View File

@ -25,10 +25,10 @@ var groups_tab_content =
<table id="datatable_groups" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Name</th>\
<th>Users</th>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Users")+'</th>\
</tr>\
</thead>\
<tbody id="tbodygroups">\
@ -40,14 +40,14 @@ var create_group_tmpl =
'<form id="create_group_form" action="">\
<fieldset style="border:none;">\
<div>\
<label for="name">Group name:</label>\
<label for="name">'+tr("Group name")+':</label>\
<input type="text" name="name" id="name" /><br />\
</div>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_group_submit" value="Group.create">Create</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" id="create_group_submit" value="Group.create">'+tr("Create")+'</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>';
@ -118,12 +118,12 @@ var group_actions = {
var group_buttons = {
"Group.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Group.create_dialog" : {
type: "create_dialog",
text: "+ New Group"
text: tr("+ New Group")
},
// "Group.chown" : {
// type: "confirm_with_select",
@ -135,12 +135,12 @@ var group_buttons = {
"Group.delete" : {
type: "action",
text: "Delete"
text: tr("Delete")
}
};
var groups_tab = {
title: 'Groups',
title: tr("Groups"),
content: groups_tab_content,
buttons: group_buttons
}
@ -228,7 +228,7 @@ function updateGroupsView(request, group_list){
//Prepares the dialog to create
function setupCreateGroupDialog(){
dialogs_context.append('<div title="Create group" id="create_group_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create group")+'\" id="create_group_dialog"></div>');
$create_group_dialog = $('#create_group_dialog',dialogs_context);
var dialog = $create_group_dialog;
@ -259,7 +259,7 @@ function popUpCreateGroupDialog(){
function setGroupAutorefresh(){
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_groups);
var filter = $("#datatable_groups_filter input",dataTable_groups.parents("#datatable_groups_wrapper")).attr("value");
var filter = $("#datatable_groups_filter input",dataTable_groups.parents("#datatable_groups_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Group.autorefresh");
}
@ -276,7 +276,11 @@ $(document).ready(function(){
{ "bSortable": false, "aTargets": ["check"] },
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_groups.fnClearTable();

View File

@ -19,13 +19,13 @@
var HOST_HISTORY_LENGTH = 40;
var host_graphs = [
{
title : "CPU Monitoring information",
title : tr("CPU Monitoring information"),
monitor_resources : "cpu_usage,used_cpu,max_cpu",
humanize_figures : false,
history_length : HOST_HISTORY_LENGTH
},
{
title: "Memory monitoring information",
title: tr("Memory monitoring information"),
monitor_resources : "mem_usage,used_mem,max_mem",
humanize_figures : true,
history_length : HOST_HISTORY_LENGTH
@ -40,13 +40,13 @@ var hosts_tab_content =
<table id="datatable_hosts" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Name</th>\
<th>Running VMs</th>\
<th>CPU Use</th>\
<th>Memory use</th>\
<th>Status</th>\
<th class="check"><input type="checkbox" class="check_all" value="">' + tr("All") + '</input></th>\
<th>' + tr("id") + '</th>\
<th>' + tr("Name") + '</th>\
<th>' + tr("Running VMs") + '</th>\
<th>' + tr("CPU Use") + '</th>\
<th>' + tr("Memory use") + '</th>\
<th>' + tr("Status") + '</th>\
</tr>\
</thead>\
<tbody id="tbodyhosts">\
@ -57,27 +57,27 @@ var hosts_tab_content =
var create_host_tmpl =
'<div class="create_form"><form id="create_host_form" action="">\
<fieldset>\
<legend style="display:none;">Host parameters</legend>\
<label for="name">Name: </label><input type="text" name="name" id="name" />\
<legend style="display:none;">' + tr("Host parameters") + '</legend>\
<label for="name">' + tr("Name") + ':</label><input type="text" name="name" id="name" />\
</fieldset>\
<h3>Drivers</h3>\
<h3>' + tr("Drivers") + '</h3>\
<fieldset>\
<div class="manager clear" id="vmm_mads">\
<label>Virtualization Manager:</label>\
<label>' + tr("Virtualization Manager") + ':</label>\
<select id="vmm_mad" name="vmm">\
<option value="vmm_kvm">KVM</option>\
<option value="vmm_xen">XEN</option>\
<option value="vmm_ec2">EC2</option>\
<option value="vmm_dummy">Dummy</option>\
<option value="vmm_kvm">' + tr("KVM") + '</option>\
<option value="vmm_xen">' + tr("XEN") + '</option>\
<option value="vmm_ec2">' + tr("EC2") + '</option>\
<option value="vmm_dummy">' + tr("Dummy") + '</option>\
</select>\
</div>\
<div class="manager clear" id="im_mads">\
<label>Information Manager:</label>\
<label>' + tr("Information Manager") + ':</label>\
<select id="im_mad" name="im">\
<option value="im_kvm">KVM</option>\
<option value="im_xen">XEN</option>\
<option value="im_ec2">EC2</option>\
<option value="im_dummy">Dummy</option>\
<option value="im_kvm">' + tr("KVM") + '</option>\
<option value="im_xen">' + tr("XEN") + '</option>\
<option value="im_ec2">' + tr("EC2") + '</option>\
<option value="im_dummy">' + tr("Dummy") + '</option>\
</select>\
</div>\
<div class="manager clear" id="vnm_mads">\
@ -91,18 +91,18 @@ var create_host_tmpl =
</select>\
</div>\
<div class="manager clear" id="tm_mads">\
<label>Transfer Manager:</label>\
<label>' + tr("Transfer Manager") + ':</label>\
<select id="tm_mad" name="tm">\
<option value="tm_shared">Shared</option>\
<option value="tm_ssh">SSH</option>\
<option value="tm_dummy">Dummy</option>\
<option value="tm_shared">' + tr("Shared") + '</option>\
<option value="tm_ssh">' + tr("SSH") + '</option>\
<option value="tm_dummy">' + tr("Dummy") + '</option>\
</select>\
</div>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<div><button class="button" id="create_host_submit" value="OpenNebula.Host.create">Create</button>\
<button class="button" type="reset" value="reset">Reset</button></div>\
<div><button class="button" id="create_host_submit" value="OpenNebula.Host.create">' + tr("Create") + '</button>\
<button class="button" type="reset" value="reset">' + tr("Reset") + '</button></div>\
</div>\
</fieldset>\
</form></div>';
@ -243,7 +243,7 @@ var host_actions = {
type: "single",
call: OpenNebula.Host.update,
callback: function() {
notifyMessage("Template updated correctly");
notifyMessage(tr("Template updated correctly"));
},
error: onError
}
@ -252,51 +252,51 @@ var host_actions = {
var host_buttons = {
"Host.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Host.create_dialog" : {
type: "create_dialog",
text: "+ New"
text: tr("+ New")
},
"Host.update_dialog" : {
type: "action",
text: "Update a template",
text: tr("Update a template"),
alwaysActive: true
},
"Host.enable" : {
type: "action",
text: "Enable"
text: tr("Enable")
},
"Host.disable" : {
type: "action",
text: "Disable"
text: tr("Disable")
},
"Host.delete" : {
type: "action",
text: "Delete host"
text: tr("Delete host")
}
};
var host_info_panel = {
"host_info_tab" : {
title: "Host information",
title: tr("Host information"),
content:""
},
"host_template_tab" : {
title: "Host template",
title: tr("Host template"),
content: ""
},
"host_monitoring_tab": {
title: "Monitoring information",
title: tr("Monitoring information"),
content: ""
}
};
var hosts_tab = {
title: 'Hosts',
title: tr("Hosts"),
content: hosts_tab_content,
buttons: host_buttons
}
@ -430,66 +430,66 @@ function updateHostInfo(request,host){
//Information tab
var info_tab = {
title : "Host information",
title : tr("Host information"),
content :
'<table id="info_host_table" class="info_table">\
<thead>\
<tr><th colspan="2">Host information - '+host_info.NAME+'</th></tr>\
<tr><th colspan="2">' + tr("Host information") + ' - '+host_info.NAME+'</th></tr>\
</thead>\
<tbody>\
<tr>\
<td class="key_td">ID</td>\
<td class="key_td">' + tr("id") + '</td>\
<td class="value_td">'+host_info.ID+'</td>\
</tr>\
<tr>\
<td class="key_td">State</td>\
<td class="value_td">'+OpenNebula.Helper.resource_state("host",host_info.STATE)+'</td>\
<td class="key_td">' + tr("State") + '</td>\
<td class="value_td">'+tr(OpenNebula.Helper.resource_state("host",host_info.STATE))+'</td>\
</tr>\
<tr>\
<td class="key_td">IM MAD</td>\
<td class="key_td">' + tr("IM MAD") + '</td>\
<td class="value_td">'+host_info.IM_MAD+'</td>\
</tr>\
<tr>\
<td class="key_td">VM MAD</td>\
<td class="key_td">' + tr("VM MAD") + '</td>\
<td class="value_td">'+host_info.VM_MAD+'</td>\
</tr>\
<tr>\
<td class="key_td">VN MAD</td>\
<td class="key_td">'+ tr("VN MAD") +'</td>\
<td class="value_td">'+host_info.VN_MAD+'</td>\
</tr>\
<tr>\
<td class="key_td">TM MAD</td>\
<td class="key_td">'+ tr("TM MAD") +'</td>\
<td class="value_td">'+host_info.TM_MAD+'</td>\
</tr>\
</tbody>\
</table>\
<table id="host_shares_table" class="info_table">\
<thead>\
<tr><th colspan="2">Host shares</th></tr>\
<tr><th colspan="2">' + tr("Host shares") + '</th></tr>\
</thead>\
<tbody>\
<tr>\
<td class="key_td">Max Mem</td>\
<td class="key_td">' + tr("Max Mem") + '</td>\
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'</td>\
</tr>\
<tr>\
<td class="key_td">Used Mem (real)</td>\
<td class="key_td">' + tr("Used Mem (real)") + '</td>\
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.USED_MEM)+'</td>\
</tr>\
<tr>\
<td class="key_td">Used Mem (allocated)</td>\
<td class="key_td">' + tr("Used Mem (allocated)") + '</td>\
<td class="value_td">'+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'</td>\
</tr>\
<tr>\
<td class="key_td">Used CPU (real)</td>\
<td class="key_td">' + tr("Used CPU (real)") + '</td>\
<td class="value_td">'+host_info.HOST_SHARE.USED_CPU+'</td>\
</tr>\
<tr>\
<td class="key_td">Used CPU (allocated)</td>\
<td class="key_td">' + tr("Used CPU (allocated)") + '</td>\
<td class="value_td">'+host_info.HOST_SHARE.CPU_USAGE+'</td>\
</tr>\
<tr>\
<td class="key_td">Running VMs</td>\
<td class="key_td">' + tr("Running VMs") + '</td>\
<td class="value_td">'+host_info.HOST_SHARE.RUNNING_VMS+'</td>\
</tr>\
</tbody>\
@ -498,16 +498,16 @@ function updateHostInfo(request,host){
//Template tab
var template_tab = {
title : "Host template",
title : tr("Host template"),
content :
'<table id="host_template_table" class="info_table" style="width:80%">\
<thead><tr><th colspan="2">Host template</th></tr></thead>'+
<thead><tr><th colspan="2">' + tr("Host template") + '</th></tr></thead>'+
prettyPrintJSON(host_info.TEMPLATE)+
'</table>'
}
var monitor_tab = {
title: "Monitoring information",
title: tr("Monitoring information"),
content : generateMonitoringDivs(host_graphs,"host_monitor_")
}
@ -527,7 +527,7 @@ function updateHostInfo(request,host){
//Prepares the host creation dialog
function setupCreateHostDialog(){
dialogs_context.append('<div title="Create host" id="create_host_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create host")+'\" id="create_host_dialog"></div>');
$create_host_dialog = $('div#create_host_dialog');
var dialog = $create_host_dialog;
@ -543,7 +543,7 @@ function setupCreateHostDialog(){
//Handle the form submission
$('#create_host_form',dialog).submit(function(){
if (!($('#name',this).val().length)){
notifyError("Host name missing!");
notifyError(tr("Host name missing!"));
return false;
}
var host_json = {
@ -574,7 +574,7 @@ function popUpCreateHostDialog(){
function setHostAutorefresh() {
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_hosts);
var filter = $("#datatable_hosts_filter input",dataTable_hosts.parents('#datatable_hosts_wrapper')).attr("value");
var filter = $("#datatable_hosts_filter input",dataTable_hosts.parents('#datatable_hosts_wrapper')).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Host.autorefresh");
}
@ -611,7 +611,11 @@ $(document).ready(function(){
{ "sWidth": "35px", "aTargets": [1] },
{ "sWidth": "100px", "aTargets": [6] },
{ "sWidth": "200px", "aTargets": [4,5] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
//preload it

View File

@ -23,18 +23,18 @@ var images_tab_content =
<table id="datatable_images" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Owner</th>\
<th>Group</th>\
<th>Name</th>\
<th>Size</th>\
<th>Type</th>\
<th>Registration time</th>\
<th>Public</th>\
<th>Persistent</th>\
<th>Status</th>\
<th>#VMS</th>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Size")+'</th>\
<th>'+tr("Type")+'</th>\
<th>'+tr("Registration time")+'</th>\
<th>'+tr("Public")+'</th>\
<th>'+tr("Persistent")+'</th>\
<th>'+tr("Status")+'</th>\
<th>'+tr("#VMS")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyimages">\
@ -44,114 +44,116 @@ var images_tab_content =
var create_image_tmpl =
'<div id="img_tabs">\
<ul><li><a href="#img_easy">Wizard</a></li>\
<li><a href="#img_manual">Advanced mode</a></li>\
<ul><li><a href="#img_easy">'+tr("Wizard")+'</a></li>\
<li><a href="#img_manual">'+tr("Advanced mode")+'</a></li>\
</ul>\
<div id="img_easy">\
<form id="create_image_form_easy" action="">\
<p style="font-size:0.8em;text-align:right;"><i>Fields marked with <span style="display:inline-block;" class="ui-icon ui-icon-alert" /> are mandatory</i><br />\
<p style="font-size:0.8em;text-align:right;"><i>'+
tr("Fields marked with")+' <span style="display:inline-block;" class="ui-icon ui-icon-alert" /> '+
tr("are mandatory")+'</i><br />\
<fieldset>\
<div class="img_param img_man">\
<label for="img_name">Name:</label>\
<label for="img_name">'+tr("Name")+':</label>\
<input type="text" name="img_name" id="img_name" />\
<div class="tip">Name that the Image will get. Every image must have a unique name.</div>\
<div class="tip">'+tr("Name that the Image will get. Every image must have a unique name.")+'</div>\
</div>\
<div class="img_param">\
<label for="img_desc">Description:</label>\
<label for="img_desc">'+tr("Description")+':</label>\
<textarea name="img_desc" id="img_desc" style="height:4em"></textarea>\
<div class="tip">Human readable description of the image for other users.</div>\
<div class="tip">'+tr("Human readable description of the image for other users.")+'</div>\
</div>\
</fieldset>\
<fieldset>\
<div class="img_param">\
<label for="img_type">Type:</label>\
<label for="img_type">'+tr("Type")+':</label>\
<select name="img_type" id="img_type">\
<option value="OS">OS</option>\
<option value="CDROM">CD-ROM</option>\
<option value="DATABLOCK">Datablock</option>\
<option value="OS">'+tr("OS")+'</option>\
<option value="CDROM">'+tr("CD-ROM")+'</option>\
<option value="DATABLOCK">'+tr("Datablock")+'</option>\
</select>\
<div class="tip">Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).</div>\
<div class="tip">'+tr("Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).")+'</div>\
</div>\
<div class="img_param">\
<label for="img_public">Public:</label>\
<label for="img_public">'+tr("Public")+':</label>\
<input type="checkbox" id="img_public" name="img_public" value="YES" />\
<div class="tip">Public scope of the image</div>\
<div class="tip">'+tr("Public scope of the image")+'</div>\
</div>\
<div class="img_param">\
<label for="img_persistent">Persistent:</label>\
<label for="img_persistent">'+tr("Persistent")+':</label>\
<input type="checkbox" id="img_persistent" name="img_persistent" value="YES" />\
<div class="tip">Persistence of the image</div>\
<div class="tip">'+tr("Persistence of the image")+'</div>\
</div>\
<div class="img_param">\
<label for="img_dev_prefix">Device prefix:</label>\
<label for="img_dev_prefix">'+tr("Device prefix")+':</label>\
<input type="text" name="img_dev_prefix" id="img_dev_prefix" />\
<div class="tip">Prefix for the emulated device this image will be mounted at. For instance, hd, sd. If omitted, the default value is the one defined in oned.conf (installation default is hd).</div>\
<div class="tip">'+tr("Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).")+'</div>\
</div>\
<div class="img_param">\
<label for="img_bus">Bus:</label>\
<label for="img_bus">'+tr("Bus")+':</label>\
<select name="img_bus" id="img_bus">\
<option value="ide">IDE</option>\
<option value="scsi">SCSI</option>\
<option value="virtio">Virtio (KVM)</option>\
<option value="ide">'+tr("IDE")+'</option>\
<option value="scsi">'+tr("SCSI")+'</option>\
<option value="virtio">'+tr("Virtio (KVM)")+'</option>\
</select>\
<div class="tip">Type of disk device to emulate.</div>\
<div class="tip">'+tr("Type of disk device to emulate.")+'</div>\
</div>\
<div class="img_param">\
<label for="img_driver">Driver:</label>\
<label for="img_driver">'+tr("Driver")+':</label>\
<input type="text" name="img_driver" id="img_driver" />\
<div class="tip">Specific image mapping driver. KVM: raw, qcow2 and Xen:tap:aio:, file:</div>\
<div class="tip">'+tr("Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:")+'</div>\
</div>\
</fieldset>\
<fieldset>\
<div class="" id="src_path_select">\
<label style="height:3em;">Path vs. source:</label>\
<label style="height:3em;">'+tr("Path vs. source")+':</label>\
<input type="radio" name="src_path" id="path_img" value="path" />\
<label style="float:none">Provide a path</label><br />\
<label style="float:none">'+tr("Provide a path")+'</label><br />\
<input type="radio" name="src_path" id="source_img" value="source" />\
<label style="float:none">Provide a source</label><br />\
<label style="float:none">'+tr("Provide a source")+'</label><br />\
<input type="radio" name="src_path" id="datablock_img" value="datablock" />\
<label style="float:none;vertical-align:top">Create an empty datablock</label>\
<div class="tip">Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.</div><br />\
<label style="float:none;vertical-align:top">'+tr("Create an empty datablock")+'</label>\
<div class="tip">'+tr("Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.")+'</div><br />\
</div>\
<div class="img_param">\
<label for="img_path">Path:</label>\
<label for="img_path">'+tr("Path")+':</label>\
<input type="text" name="img_path" id="img_path" />\
<div class="tip">Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.</div>\
<div class="tip">'+tr("Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.")+'</div>\
</div>\
<div class="img_param">\
<label for="img_source">Source:</label>\
<label for="img_source">'+tr("Source")+':</label>\
<input type="text" name="img_source" id="img_source" />\
<div class="tip">Source to be used in the DISK attribute. Useful for not file-based images.</div>\
<div class="tip">'+tr("Source to be used in the DISK attribute. Useful for not file-based images.")+'</div>\
</div>\
<div class="img_size">\
<label for="img_size">Size:</label>\
<label for="img_size">'+tr("Size")+':</label>\
<input type="text" name="img_size" id="img_size" />\
<div class="tip">Size of the datablock in MB.</div>\
<div class="tip">'+tr("Size of the datablock in MB.")+'</div>\
</div>\
<div class="img_param">\
<label for="img_fstype">FS type:</label>\
<label for="img_fstype">'+tr("FS type")+':</label>\
<input type="text" name="img_fstype" id="img_fstype" />\
<div class="tip">Type of file system to be built. This can be any value understood by mkfs unix command.</div>\
<div class="tip">'+tr("Type of file system to be built. This can be any value understood by mkfs unix command.")+'</div>\
</div>\
</fieldset>\
<fieldset>\
<div class="">\
<label for="custom_var_image_name">Name:</label>\
<label for="custom_var_image_name">'+tr("Name")+':</label>\
<input type="text" id="custom_var_image_name" name="custom_var_image_name" />\
<label for="custom_var_image_value">Value:</label>\
<label for="custom_var_image_value">'+tr("Value")+':</label>\
<input type="text" id="custom_var_image_value" name="custom_var_image_value" />\
<button class="add_remove_button add_button" id="add_custom_var_image_button" value="add_custom_image_var">Add</button>\
<button class="add_remove_button" id="remove_custom_var_image_button" value="remove_custom_image_var">Remove selected</button>\
<button class="add_remove_button add_button" id="add_custom_var_image_button" value="add_custom_image_var">'+tr("Add")+'</button>\
<button class="add_remove_button" id="remove_custom_var_image_button" value="remove_custom_image_var">'+tr("Remove selected")+'</button>\
<div class="clear"></div>\
<label for="custom_var_image_box">Custom attributes:</label>\
<label for="custom_var_image_box">'+tr("Custom attributes")+':</label>\
<select id="custom_var_image_box" name="custom_var_image_box" style="height:100px;" multiple>\
</select>\
</div>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_image_submit" value="user/create">Create</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" id="create_image_submit" value="user/create">'+tr("Create")+'</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>\
@ -159,16 +161,16 @@ var create_image_tmpl =
<div id="img_manual">\
<form id="create_image_form_manual" action="">\
<fieldset style="border-top:none;">\
<h3 style="margin-bottom:10px;">Write the image template here</h3>\
<h3 style="margin-bottom:10px;">'+tr("Write the image template here")+'</h3>\
<textarea id="template" rows="15" style="width:100%;">\
</textarea>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_vn_submit_manual" value="vn/create">\
Create\
'+tr("Create")+'\
</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>\
@ -177,27 +179,26 @@ var create_image_tmpl =
var update_image_tmpl =
'<form action="javascript:alert(\'js error!\');">\
<h3 style="margin-bottom:10px;">Please, choose and modify the image you want to update:</h3>\
<h3 style="margin-bottom:10px;">'+tr("Please, choose and modify the image you want to update")+':</h3>\
<fieldset style="border-top:none;">\
<label for="image_template_update_select">Select an image:</label>\
<label for="image_template_update_select">'+tr("Select an image")+':</label>\
<select id="image_template_update_select" name="image_template_update_select"></select>\
<div class="clear"></div>\
<div>\
<label for="image_template_update_public">Public:</label>\
<label for="image_template_update_public">'+tr("Public")+':</label>\
<input type="checkbox" name="image_template_update_public" id="image_template_update_public" />\
</div>\
<div>\
<label for="image_template_update_public">Persistent:</label>\
<label for="image_template_update_public">'+tr("Persistent")+':</label>\
<input type="checkbox" name="image_template_update_persistent" id="image_template_update_persistent" />\
</div>\
<label for="image_template_update_textarea">Template:</label>\
<label for="image_template_update_textarea">'+tr("Template")+':</label>\
<div class="clear"></div>\
<textarea id="image_template_update_textarea" style="width:100%; height:14em;"></textarea>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="image_template_update_button" value="Image.update_template">\
Update\
<button class="button" id="image_template_update_button" value="Image.update_template">'+tr("Update")+'\
</button>\
</div>\
</fieldset>\
@ -277,7 +278,7 @@ var image_actions = {
type: "single",
call: OpenNebula.Image.update,
callback: function() {
notifyMessage("Template updated correctly");
notifyMessage(tr("Template updated correctly"));
},
error: onError
},
@ -396,30 +397,30 @@ var image_actions = {
var image_buttons = {
"Image.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Image.create_dialog" : {
type: "create_dialog",
text: "+ New"
text: tr('+ New')
},
"Image.update_dialog" : {
type: "action",
text: "Update a template",
text: tr("Update a template"),
alwaysActive: true
},
"Image.chown" : {
type: "confirm_with_select",
text: "Change owner",
text: tr("Change owner"),
select: users_sel,
tip: "Select the new owner:",
tip: tr("Select the new owner")+":",
condition: mustBeAdmin
},
"Image.chgrp" : {
type: "confirm_with_select",
text: "Change group",
text: tr("Change group"),
select: groups_sel,
tip: "Select the new group:",
tip: tr("Select the new group")+":",
condition: mustBeAdmin
},
"action_list" : {
@ -427,51 +428,51 @@ var image_buttons = {
actions: {
"Image.enable" : {
type: "action",
text: "Enable"
text: tr("Enable")
},
"Image.disable" : {
type: "action",
text: "Disable"
text: tr("Disable")
},
"Image.publish" : {
type: "action",
text: "Publish"
text: tr("Publish")
},
"Image.unpublish" : {
type: "action",
text: "Unpublish"
text: tr("Unpublish")
},
"Image.persistent" : {
type: "action",
text: "Make persistent"
text: tr("Make persistent")
},
"Image.nonpersistent" : {
type: "action",
text: "Make non persistent"
text: tr("Make non persistent")
}
}
},
"Image.delete" : {
type: "action",
text: "Delete"
text: tr("Delete")
}
}
var image_info_panel = {
"image_info_tab" : {
title: "Image information",
title: tr("Image information"),
content: ""
},
"image_template_tab" : {
title: "Image template",
title: tr("Image template"),
content: ""
}
}
var images_tab = {
title: "Images",
title: tr("Images"),
content: images_tab_content,
buttons: image_buttons
}
@ -492,13 +493,13 @@ function imageElementArray(image_json){
var image = image_json.IMAGE;
var type = $('<select>\
<option value="OS">OS</option>\
<option value="CDROM">CD-ROM</option>\
<option value="DATABLOCK">Datablock</option>\
<option value="OS">'+tr("OS")+'</option>\
<option value="CDROM">'+tr("CD-ROM")+'</option>\
<option value="DATABLOCK">'+tr("Datablock")+'</option>\
</select>');
var value = OpenNebula.Helper.image_type(image.TYPE);
$('option[value="'+value+'"]',type).replaceWith('<option value="'+value+'" selected="selected">'+value+'</option>');
$('option[value="'+value+'"]',type).replaceWith('<option value="'+value+'" selected="selected">'+tr(value)+'</option>');
@ -570,75 +571,76 @@ function updateImagesView(request, images_list){
function updateImageInfo(request,img){
var img_info = img.IMAGE;
var info_tab = {
title: "Image information",
title: tr("Image information"),
content:
'<table id="info_img_table" class="info_table" style="width:80%;">\
<thead>\
<tr><th colspan="2">Image "'+img_info.NAME+'" information</th></tr>\
<tr><th colspan="2">'+tr("Image")+' "'+img_info.NAME+'" '+
tr("information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">ID</td>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+img_info.ID+'</td>\
</tr>\
<tr>\
<td class="key_td">Name</td>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+img_info.NAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Owner</td>\
<td class="key_td">'+tr("Owner")+'</td>\
<td class="value_td">'+img_info.UNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Group</td>\
<td class="key_td">'+tr("Group")+'</td>\
<td class="value_td">'+img_info.GNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Type</td>\
<td class="key_td">'+tr("Type")+'</td>\
<td class="value_td">'+OpenNebula.Helper.image_type(img_info.TYPE)+'</td>\
</tr>\
<tr>\
<td class="key_td">Register time</td>\
<td class="key_td">'+tr("Register time")+'</td>\
<td class="value_td">'+pretty_time(img_info.REGTIME)+'</td>\
</tr>\
<tr>\
<td class="key_td">Public</td>\
<td class="value_td">'+(parseInt(img_info.PUBLIC) ? "yes" : "no")+'</td>\
<td class="key_td">'+tr("Public")+'</td>\
<td class="value_td">'+(parseInt(img_info.PUBLIC) ? tr("yes") : tr("no"))+'</td>\
</tr>\
<tr>\
<td class="key_td">Persistent</td>\
<td class="value_td">'+(parseInt(img_info.PERSISTENT) ? "yes" : "no")+'</td>\
<td class="key_td">'+tr("Persistent")+'</td>\
<td class="value_td">'+(parseInt(img_info.PERSISTENT) ? tr("yes") : tr("no"))+'</td>\
</tr>\
<tr>\
<td class="key_td">Source</td>\
<td class="key_td">'+tr("Source")+'</td>\
<td class="value_td">'+(typeof img_info.SOURCE === "string" ? img_info.SOURCE : "--")+'</td>\
</tr>\
<tr>\
<td class="key_td">Path</td>\
<td class="key_td">'+tr("Path")+'</td>\
<td class="value_td">'+(typeof img_info.PATH === "string" ? img_info.PATH : "--")+'</td>\
</tr>\
<tr>\
<td class="key_td">Filesystem type</td>\
<td class="key_td">'+tr("Filesystem type")+'</td>\
<td class="value_td">'+(typeof img_info.FSTYPE === "string" ? img_info.FSTYPE : "--")+'</td>\
</tr>\
<tr>\
<td class="key_td">Size (Mb)</td>\
<td class="key_td">'+tr("Size (Mb)")+'</td>\
<td class="value_td">'+img_info.SIZE+'</td>\
</tr>\
<tr>\
<td class="key_td">State</td>\
<td class="key_td">'+tr("State")+'</td>\
<td class="value_td">'+OpenNebula.Helper.resource_state("image",img_info.STATE)+'</td>\
</tr>\
<tr>\
<td class="key_td">Running #VMS</td>\
<td class="key_td">'+tr("Running #VMS")+'</td>\
<td class="value_td">'+img_info.RUNNING_VMS+'</td>\
</tr>\
</table>'
}
var template_tab = {
title: "Image template",
title: tr("Image template"),
content: '<table id="img_template_table" class="info_table" style="width:80%;">\
<thead><tr><th colspan="2">Image template</th></tr></thead>'+
<thead><tr><th colspan="2">'+tr("Image template")+'</th></tr></thead>'+
prettyPrintJSON(img_info.TEMPLATE)+
'</table>'
}
@ -652,7 +654,7 @@ function updateImageInfo(request,img){
// Prepare the image creation dialog
function setupCreateImageDialog(){
dialogs_context.append('<div title="Create Image" id="create_image_dialog"></div>');
dialogs_context.append('<div title="'+tr("Create Image")+'" id="create_image_dialog"></div>');
$create_image_dialog = $('#create_image_dialog',dialogs_context);
var dialog = $create_image_dialog;
dialog.html(create_image_tmpl);
@ -669,8 +671,8 @@ function setupCreateImageDialog(){
$('#img_tabs',dialog).tabs();
$('button',dialog).button();
$('#img_type option',dialog).first().attr("selected","selected");
$('#datablock_img',dialog).attr("disabled","disabled");
$('#img_type option',dialog).first().attr('selected','selected');
$('#datablock_img',dialog).attr('disabled','disabled');
$('select#img_type',dialog).change(function(){
var value = $(this).val();
@ -680,23 +682,23 @@ function setupCreateImageDialog(){
$('#datablock_img',context).removeAttr("disabled");
break;
default:
$('#datablock_img',context).attr("disabled","disabled");
$('#path_img',context).attr("checked","checked");
$('#datablock_img',context).attr('disabled','disabled');
$('#path_img',context).attr('checked','checked');
$('#img_source,#img_fstype,#img_size',context).parent().hide();
$('#img_path',context).parent().show();
}
});
$('#img_source,#img_fstype,#img_size',dialog).parent().hide();
$('#path_img',dialog).attr("checked","checked");
$('#path_img',dialog).attr('checked','checked');
$('#img_path',dialog).parent().addClass("img_man");
$('#img_public',dialog).click(function(){
$('#img_persistent',$create_image_dialog).removeAttr("checked");
$('#img_persistent',$create_image_dialog).removeAttr('checked');
});
$('#img_persistent',dialog).click(function(){
$('#img_public',$create_image_dialog).removeAttr("checked");
$('#img_public',$create_image_dialog).removeAttr('checked');
});
@ -732,7 +734,7 @@ function setupCreateImageDialog(){
var name = $('#custom_var_image_name',$create_image_dialog).val();
var value = $('#custom_var_image_value',$create_image_dialog).val();
if (!name.length || !value.length) {
notifyError("Custom attribute name and value must be filled in");
notifyError(tr("Custom attribute name and value must be filled in"));
return false;
}
option= '<option value=\''+value+'\' name=\''+name+'\'>'+
@ -755,7 +757,7 @@ function setupCreateImageDialog(){
var exit = false;
$('.img_man',this).each(function(){
if (!$('input',this).val().length){
notifyError("There are mandatory parameters missing");
notifyError(tr("There are mandatory parameters missing"));
exit = true;
return false;
}
@ -799,7 +801,7 @@ function setupCreateImageDialog(){
source = $('#img_source',this).val();
img_json["SOURCE"] = source;
break;
case "datablock":
case "datablock":
size = $('#img_size',this).val();
fstype = $('#img_fstype',this).val();
img_json["SIZE"] = size;
@ -809,7 +811,7 @@ function setupCreateImageDialog(){
//Time to add custom attributes
$('#custom_var_image_box option',$create_image_dialog).each(function(){
var attr_name = $(this).attr("name");
var attr_name = $(this).attr('name');
var attr_value = $(this).val();
img_json[attr_name] = attr_value;
});
@ -839,7 +841,7 @@ function popUpCreateImageDialog(){
function setupImageTemplateUpdateDialog(){
//Append to DOM
dialogs_context.append('<div id="image_template_update_dialog" title="Update image template"></div>');
dialogs_context.append('<div id="image_template_update_dialog" title="'+tr("Update image template")+'"></div>');
var dialog = $('#image_template_update_dialog',dialogs_context);
//Put HTML in place
@ -860,21 +862,22 @@ function setupImageTemplateUpdateDialog(){
var id = $(this).val();
if (id && id.length){
var dialog = $('#image_template_update_dialog');
$('#image_template_update_textarea',dialog).val("Loading...");
$('#image_template_update_textarea',dialog).val(tr("Loading")+
"...");
var img_public = is_public_image(id);
var img_persistent = is_persistent_image(id)
if (img_public){
$('#image_template_update_public',dialog).attr("checked","checked")
$('#image_template_update_public',dialog).attr('checked','checked')
} else {
$('#image_template_update_public',dialog).removeAttr("checked")
$('#image_template_update_public',dialog).removeAttr('checked')
}
if (img_persistent){
$('#image_template_update_persistent',dialog).attr("checked","checked")
$('#image_template_update_persistent',dialog).attr('checked','checked')
} else {
$('#image_template_update_persistent',dialog).removeAttr("checked")
$('#image_template_update_persistent',dialog).removeAttr('checked')
}
Sunstone.runAction("Image.fetch_template",id);
@ -928,12 +931,12 @@ function popUpImageTemplateUpdateDialog(){
var dialog = $('#image_template_update_dialog');
$('#image_template_update_select',dialog).html(select);
$('#image_template_update_textarea',dialog).val("");
$('#image_template_update_public',dialog).removeAttr("checked")
$('#image_template_update_persistent',dialog).removeAttr("checked")
$('#image_template_update_public',dialog).removeAttr('checked')
$('#image_template_update_persistent',dialog).removeAttr('checked')
if (sel_elems.length >= 1){ //several items in the list are selected
//grep them
var new_select= sel_elems.length > 1? '<option value="">Please select</option>' : "";
var new_select= sel_elems.length > 1? '<option value="">'+tr("Please select")+'</option>' : "";
$('option','<select>'+select+'</select>').each(function(){
var val = $(this).val();
if ($.inArray(val,sel_elems) >= 0){
@ -942,7 +945,7 @@ function popUpImageTemplateUpdateDialog(){
});
$('#image_template_update_select',dialog).html(new_select);
if (sel_elems.length == 1) {
$('#image_template_update_select option',dialog).attr("selected","selected");
$('#image_template_update_select option',dialog).attr('selected','selected');
$('#image_template_update_select',dialog).trigger("change");
}
@ -958,7 +961,7 @@ function setImageAutorefresh() {
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_images);
var filter = $("#datatable_images_filter input",
dataTable_images.parents("#datatable_images_wrapper")).attr("value");
dataTable_images.parents("#datatable_images_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Image.autorefresh");
}
@ -967,23 +970,23 @@ function setImageAutorefresh() {
function is_public_image(id){
var data = getElementData(id,"#image",dataTable_images)[7];
return $(data).attr("checked");
return $(data).attr('checked');
};
function is_persistent_image(id){
var data = getElementData(id,"#image",dataTable_images)[8];
return $(data).attr("checked");
return $(data).attr('checked');
};
function setupImageActionCheckboxes(){
$('input.action_cb#cb_public_image',dataTable_images).live("click",function(){
var $this = $(this)
var id=$this.attr("elem_id");
if ($this.attr("checked")){
var id=$this.attr('elem_id');
if ($this.attr('checked')){
if (!is_persistent_image(id))
Sunstone.runAction("Image.publish",id);
else {
notifyError("Image cannot be public and persistent");
notifyError(tr("Image cannot be public and persistent"));
return false;
};
} else Sunstone.runAction("Image.unpublish",id);
@ -993,12 +996,12 @@ function setupImageActionCheckboxes(){
$('input.action_cb#cb_persistent_image',dataTable_images).live("click",function(){
var $this = $(this)
var id=$this.attr("elem_id");
if ($this.attr("checked")){
var id=$this.attr('elem_id');
if ($this.attr('checked')){
if (!is_public_image(id))
Sunstone.runAction("Image.persistent",id);
else {
notifyError("Image cannot be public and persistent");
notifyError(tr("Image cannot be public and persistent"));
return false;
};
} else Sunstone.runAction("Image.nonpersistent",id);
@ -1009,7 +1012,7 @@ function setupImageActionCheckboxes(){
$('select.action_cb#select_chtype_image', dataTable_images).live("change",function(){
var $this = $(this);
var value = $this.val();
var id = $this.attr("elem_id");
var id = $this.attr('elem_id');
Sunstone.runAction("Image.chtype", id, value);
});
@ -1030,7 +1033,11 @@ $(document).ready(function(){
{ "sWidth": "35px", "aTargets": [1,5,11] },
{ "sWidth": "100px", "aTargets": [6] },
{ "sWidth": "150px", "aTargets": [7] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_images.fnClearTable();
@ -1048,4 +1055,6 @@ $(document).ready(function(){
initCheckAllBoxes(dataTable_images);
tableCheckboxesListener(dataTable_images);
imageInfoListener();
})

File diff suppressed because it is too large Load Diff

View File

@ -27,11 +27,11 @@ var users_tab_content =
<table id="datatable_users" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Name</th>\
<th>Group</th>\
<th>Authentication driver</th>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Authentication driver")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyusers">\
@ -43,18 +43,18 @@ var create_user_tmpl =
'<form id="create_user_form" action="">\
<fieldset>\
<div>\
<label for="username">Username:</label>\
<label for="username">'+tr("Username")+':</label>\
<input type="text" name="username" id="username" /><br />\
<label for="pass">Password:</label>\
<label for="pass">'+tr("Password")+':</label>\
<input type="password" name="pass" id="pass" />\
<label for="driver">Authentication:</label>\
<label for="driver">'+tr("Authentication")+':</label>\
<select name="driver" id="driver">\
<option value="core" selected="selected">Core</option>\
<option value="ssh">SSH</option>\
<option value="x509">x509</option>\
<option value="server_cipher">Server (Cipher)</option>\
<option value="server_x509">Server (x509)</option>\
<option value="public">Public</option>\
<option value="core" selected="selected">'+tr("Core")+'</option>\
<option value="ssh">'+tr("SSH")+'</option>\
<option value="x509">'+tr("x509")+'</option>\
<option value="server_cipher">'+tr("Server (Cipher)")+'</option>\
<option value="server_x509">'+tr("Server (x509)")+'</option>\
<option value="public">'+tr("Public")+'</option>\
</select>\
</div>\
</fieldset>\
@ -69,15 +69,15 @@ var create_user_tmpl =
var update_pw_tmpl = '<form id="update_user_pw_form" action="">\
<fieldset>\
<div>\
<div>This will change the password for the selected users:</div>\
<label for="new_password">New password:</label>\
<div>'+tr("This will change the password for the selected users")+':</div>\
<label for="new_password">'+tr("New password")+':</label>\
<input type="password" name="new_password" id="new_password" />\
</div>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="update_pw_submit" value="user/create">Change</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" id="update_pw_submit" value="User.update">'+tr("Change")+'</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>';
@ -222,7 +222,7 @@ var user_actions = {
type: "single",
call: OpenNebula.User.update,
callback: function() {
notifyMessage("Template updated correctly");
notifyMessage(tr("Template updated correctly"));
},
error: onError
}
@ -232,40 +232,40 @@ var user_actions = {
var user_buttons = {
"User.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"User.create_dialog" : {
type: "create_dialog",
text: "+ New"
text: tr("+ New")
},
"User.update_dialog" : {
type: "action",
text: "Update a template",
text: tr("Update a template"),
alwaysActive: true
},
"User.update_password" : {
type : "action",
text : "Change password",
text : tr("Change password"),
},
"User.chgrp" : {
type: "confirm_with_select",
text: "Change group",
text: tr("Change group"),
select: groups_sel,
tip: "This will change the main group of the selected users. Select the new group:"
tip: tr("This will change the main group of the selected users. Select the new group")+":"
},
"User.chauth" : {
type: "confirm_with_select",
text: "Change authentication",
text: tr("Change authentication"),
select: function() {
return '<option value="core" selected="selected">Core</option>\
<option value="ssh">SSH</option>\
<option value="x509">x509</option>\
<option value="server_cipher">Server (Cipher)</option>\
<option value="server_x509">Server (x509)</option>\
<option value="public">Public</option>'
return '<option value="core" selected="selected">'+tr("Core")+'</option>\
<option value="ssh">'+tr("SSH")+'</option>\
<option value="x509">'+tr("x509")+'</option>\
<option value="server_cipher">'+tr("Server (Cipher)")+'</option>\
<option value="server_x509">'+tr("Server (x509)")+'</option>\
<option value="public">'+tr("Public")+'</option>'
},
tip: "Please choose the new type of authentication for the selected users:"
tip: tr("Please choose the new type of authentication for the selected users")+":"
},
// "User.addgroup" : {
// type: "confirm_with_select",
@ -288,7 +288,7 @@ var user_buttons = {
}
var users_tab = {
title: "Users",
title: tr("Users"),
content: users_tab_content,
buttons: user_buttons
}
@ -358,7 +358,7 @@ function updateUsersView(request,users_list){
// Prepare the user creation dialog
function setupCreateUserDialog(){
dialogs_context.append('<div title="Create user" id="create_user_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create user")+'\" id="create_user_dialog"></div>');
$create_user_dialog = $('#create_user_dialog',dialogs_context);
var dialog = $create_user_dialog;
dialog.html(create_user_tmpl);
@ -378,7 +378,7 @@ function setupCreateUserDialog(){
var driver = $('#driver', this).val();
if (!user_name.length || !user_password.length){
notifyError("User name and password must be filled in");
notifyError(tr("User name and password must be filled in"));
return false;
}
@ -395,7 +395,7 @@ function setupCreateUserDialog(){
}
function setupUpdatePasswordDialog(){
dialogs_context.append('<div title="Change password" id="update_user_pw_dialog"></div>');
dialogs_context.append('<div title="'+tr("Change password")+'" id="update_user_pw_dialog"></div>');
$update_pw_dialog = $('#update_user_pw_dialog',dialogs_context);
var dialog = $update_pw_dialog;
dialog.html(update_pw_tmpl);
@ -413,7 +413,7 @@ function setupUpdatePasswordDialog(){
var pw=$('#new_password',this).val();
if (!pw.length){
notifyError("Fill in a new password");
notifyError(tr("Fill in a new password"));
return false;
}
@ -439,7 +439,7 @@ function setUserAutorefresh(){
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_users);
var filter = $("#datatable_users_filter input",
dataTable_users.parents("#datatable_users_wrapper")).attr("value");
dataTable_users.parents("#datatable_users_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("User.autorefresh");
}
@ -458,7 +458,11 @@ $(document).ready(function(){
{ "sWidth": "60px", "aTargets": [0] },
{ "sWidth": "35px", "aTargets": [1] },
{ "sWidth": "150px", "aTargets": [4] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_users.fnClearTable();
addElement([

View File

@ -25,22 +25,22 @@ function loadVNC(){
loadVNC();
var vm_graphs = [
{ title : "CPU",
{ title : tr("CPU"),
monitor_resources : "cpu_usage",
humanize_figures : false,
history_length : VM_HISTORY_LENGTH
},
{ title : "Memory",
{ title : tr("Memory"),
monitor_resources : "mem_usage",
humanize_figures : true,
history_length : VM_HISTORY_LENGTH
},
{ title : "Network transmission",
{ title : tr("Network transmission"),
monitor_resources : "net_tx",
humanize_figures : true,
history_length : VM_HISTORY_LENGTH
},
{ title : "Network reception",
{ title : tr("Network reception"),
monitor_resources : "net_rx",
humanize_figures : true,
history_length : VM_HISTORY_LENGTH
@ -54,17 +54,17 @@ var vms_tab_content =
<table id="datatable_vmachines" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Owner</th>\
<th>Group</th>\
<th>Name</th>\
<th>Status</th>\
<th>CPU</th>\
<th>Memory</th>\
<th>Hostname</th>\
<th>Start Time</th>\
<th>VNC Access</th>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Status")+'</th>\
<th>'+tr("CPU")+'</th>\
<th>'+tr("Memory")+'</th>\
<th>'+tr("Hostname")+'</th>\
<th>'+tr("Start Time")+'</th>\
<th>'+tr("VNC Access")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyvmachines">\
@ -75,19 +75,19 @@ var vms_tab_content =
var create_vm_tmpl ='<form id="create_vm_form" action="">\
<fieldset>\
<div>\
<label for="vm_name">VM Name:</label>\
<label for="vm_name">'+tr("VM Name")+':</label>\
<input type="text" name="vm_name" id="vm_name" /><br />\
<label for="template_id">Select template:</label>\
<label for="template_id">'+tr("Select template")+':</label>\
<select id="template_id">\
</select><br />\
<label for="vm_n_times">Deploy # VMs:</label>\
<label for="vm_n_times">'+tr("Deploy # VMs")+':</label>\
<input type="text" name="vm_n_times" id="vm_n_times" value="1">\
</div>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_vm_proceed" value="VM.create">Create</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" id="create_vm_proceed" value="VM.create">'+tr("Create")+'</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>';
@ -372,36 +372,36 @@ var vm_actions = {
var vm_buttons = {
"VM.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"VM.create_dialog" : {
type: "action",
text: "+ New",
text: tr("+ New"),
alwaysActive: true
},
"VM.chown" : {
type: "confirm_with_select",
text: "Change owner",
text: tr("Change owner"),
select: users_sel,
tip: "Select the new owner:",
tip: tr("Select the new owner")+":",
condition: mustBeAdmin
},
"VM.chgrp" : {
type: "confirm_with_select",
text: "Change group",
text: tr("Change group"),
select: groups_sel,
tip: "Select the new group:",
tip: tr("Select the new group")+":",
condition: mustBeAdmin
},
"VM.shutdown" : {
type: "confirm",
text: "Shutdown",
tip: "This will initiate the shutdown process in the selected VMs"
text: tr("Shutdown"),
tip: tr("This will initiate the shutdown process in the selected VMs")
},
"action_list" : {
@ -409,97 +409,97 @@ var vm_buttons = {
actions: {
"VM.deploy" : {
type: "confirm_with_select",
text: "Deploy",
tip: "This will deploy the selected VMs on the chosen host",
text: tr("Deploy"),
tip: tr("This will deploy the selected VMs on the chosen host"),
select: hosts_sel,
condition: mustBeAdmin
},
"VM.migrate" : {
type: "confirm_with_select",
text: "Migrate",
tip: "This will migrate the selected VMs to the chosen host",
text: tr("Migrate"),
tip: tr("This will migrate the selected VMs to the chosen host"),
select: hosts_sel,
condition: mustBeAdmin
},
"VM.livemigrate" : {
type: "confirm_with_select",
text: "Live migrate",
tip: "This will live-migrate the selected VMs to the chosen host",
text: tr("Live migrate"),
tip: tr("This will live-migrate the selected VMs to the chosen host"),
select: hosts_sel,
condition: mustBeAdmin
},
"VM.hold" : {
type: "confirm",
text: "Hold",
tip: "This will hold selected pending VMs from being deployed"
text: tr("Hold"),
tip: tr("This will hold selected pending VMs from being deployed")
},
"VM.release" : {
type: "confirm",
text: "Release",
tip: "This will release held machines"
text: tr("Release"),
tip: tr("This will release held machines")
},
"VM.suspend" : {
type: "confirm",
text: "Suspend",
tip: "This will suspend selected machines"
text: tr("Suspend"),
tip: tr("This will suspend selected machines")
},
"VM.resume" : {
type: "confirm",
text: "Resume",
tip: "This will resume selected stopped or suspended VMs"
text: tr("Resume"),
tip: tr("This will resume selected stopped or suspended VMs")
},
"VM.stop" : {
type: "confirm",
text: "Stop",
text: tr("Stop"),
tip: "This will stop selected VMs"
},
"VM.restart" : {
type: "confirm",
text: "Restart",
tip: "This will redeploy selected VMs (in UNKNOWN or BOOT state)"
text: tr("Restart"),
tip: tr("This will redeploy selected VMs (in UNKNOWN or BOOT state)")
},
"VM.resubmit" : {
type: "confirm",
text: "Resubmit",
tip: "This will resubmits VMs to PENDING state"
text: tr("Resubmit"),
tip: tr("This will resubmits VMs to PENDING state")
},
"VM.saveasmultiple" : {
type: "action",
text: "Save as"
text: tr("Save as")
},
"VM.cancel" : {
type: "confirm",
text: "Cancel",
tip: "This will cancel selected VMs"
text: tr("Cancel"),
tip: tr("This will cancel selected VMs")
}
}
},
"VM.delete" : {
type: "confirm",
text: "Delete",
tip: "This will delete the selected VMs from the database"
text: tr("Delete"),
tip: tr("This will delete the selected VMs from the database")
}
}
var vm_info_panel = {
"vm_info_tab" : {
title: "Virtual Machine information",
title: tr("Virtual Machine information"),
content: ""
},
"vm_template_tab" : {
title: "VM template",
title: tr("VM template"),
content: ""
},
"vm_log_tab" : {
title: "VM log",
title: tr("VM log"),
content: ""
}
}
var vms_tab = {
title: "Virtual Machines",
title: tr("Virtual Machines"),
content: vms_tab_content,
buttons: vm_buttons
}
@ -617,73 +617,73 @@ function updateVMInfo(request,vm){
};
var info_tab = {
title : "VM information",
title : tr("VM information"),
content:
'<table id="info_vm_table" class="info_table">\
<thead>\
<tr><th colspan="2">Virtual Machine information - '+vm_info.NAME+'</th></tr>\
<tr><th colspan="2">'+tr("Virtual Machine information")+' - '+vm_info.NAME+'</th></tr>\
</thead>\
<tbody>\
<tr>\
<td class="key_td">ID</td>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+vm_info.ID+'</td>\
</tr>\
<tr>\
<td class="key_td">Name</td>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+vm_info.NAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Owner</td>\
<td class="key_td">'+tr("Owner")+'</td>\
<td class="value_td">'+vm_info.UNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Group</td>\
<td class="key_td">'+tr("Group")+'</td>\
<td class="value_td">'+vm_info.GNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">State</td>\
<td class="value_td">'+vm_state+'</td>\
<td class="key_td">'+tr("State")+'</td>\
<td class="value_td">'+tr(vm_state)+'</td>\
</tr>\
<tr>\
<td class="key_td">LCM State</td>\
<td class="value_td">'+OpenNebula.Helper.resource_state("vm_lcm",vm_info.LCM_STATE)+'</td>\
<td class="key_td">'+tr("LCM State")+'</td>\
<td class="value_td">'+tr(OpenNebula.Helper.resource_state("vm_lcm",vm_info.LCM_STATE))+'</td>\
</tr>\
<tr>\
<td class="key_td">Hostname</td>\
<td class="key_td">'+tr("Hostname")+'</td>\
<td class="value_td">'+ hostname +'</td>\
</tr>\
<tr>\
<td class="key_td">Start time</td>\
<td class="key_td">'+tr("Start time")+'</td>\
<td class="value_td">'+pretty_time(vm_info.STIME)+'</td>\
</tr>\
<tr>\
<td class="key_td">Deploy ID</td>\
<td class="key_td">'+tr("Deploy ID")+'</td>\
<td class="value_td">'+(typeof(vm_info.DEPLOY_ID) == "object" ? "-" : vm_info.DEPLOY_ID)+'</td>\
</tr></tbody>\
</table>\
<table id="vm_monitoring_table" class="info_table">\
<thead>\
<tr><th colspan="2">Monitoring information</th></tr>\
<tr><th colspan="2">'+tr("Monitoring information")+'</th></tr>\
</thead>\
<tbody>\
<tr>\
<td class="key_td">Net_TX</td>\
<td class="key_td">'+tr("Net_TX")+'</td>\
<td class="value_td">'+vm_info.NET_TX+'</td>\
</tr>\
<tr>\
<td class="key_td">Net_RX</td>\
<td class="key_td">'+tr("Net_RX")+'</td>\
<td class="value_td">'+vm_info.NET_RX+'</td>\
</tr>\
<tr>\
<td class="key_td">Used Memory</td>\
<td class="key_td">'+tr("Used Memory")+'</td>\
<td class="value_td">'+humanize_size(vm_info.MEMORY)+'</td>\
</tr>\
<tr>\
<td class="key_td">Used CPU</td>\
<td class="key_td">'+tr("Used CPU")+'</td>\
<td class="value_td">'+vm_info.CPU+'</td>\
</tr>\
<tr>\
<td class="key_td">VNC Session</td>\
<td class="key_td">'+tr("VNC Session")+'</td>\
<td class="value_td">'+vncIcon(vm_info)+'</td>\
</tr>\
</tbody>\
@ -691,21 +691,21 @@ function updateVMInfo(request,vm){
}
var template_tab = {
title: "VM Template",
title: tr("VM Template"),
content:
'<table id="vm_template_table" class="info_table" style="width:80%">\
<thead><tr><th colspan="2">VM template</th></tr></thead>'+
<thead><tr><th colspan="2">'+tr("VM template")+'</th></tr></thead>'+
prettyPrintJSON(vm_info.TEMPLATE)+
'</table>'
}
var log_tab = {
title: "VM log",
title: tr("VM log"),
content: '<div>'+spinner+'</div>'
}
var monitoring_tab = {
title: "Monitoring information",
title: tr("Monitoring information"),
content: generateMonitoringDivs(vm_graphs,"vm_monitor_")
}
@ -726,7 +726,7 @@ function updateVMInfo(request,vm){
// which is a lot.
function setupCreateVMDialog(){
dialogs_context.append('<div title="Create Virtual Machine" id="create_vm_dialog"></div>');
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;
@ -748,7 +748,7 @@ function setupCreateVMDialog(){
var n_times_int=1;
if (!template_id.length){
notifyError("You have not selected a template");
notifyError(tr("You have not selected a template"));
return false;
};
@ -778,7 +778,7 @@ function popUpCreateVMDialog(){
//Prepares a dialog to saveas a VM
function setupSaveasDialog(){
//Append to DOM
dialogs_context.append('<div id="saveas_vm_dialog" title="VM Save As"></div>');
dialogs_context.append('<div id="saveas_vm_dialog" title=\"'+tr("VM Save As")+'\"></div>');
$saveas_vm_dialog = $('#saveas_vm_dialog',dialogs_context);
var dialog = $saveas_vm_dialog;
@ -788,8 +788,8 @@ function setupSaveasDialog(){
<div id="saveas_tabs">\
</div>\
<div class="form_buttons">\
<button id="vm_saveas_proceed" value="">OK</button>\
<button id="vm_saveas_cancel" value="">Cancel</button>\
<button id="vm_saveas_proceed" value="">'+tr("OK")+'</button>\
<button id="vm_saveas_cancel" value="">'+tr("Cancel")+'</button>\
</div>\
</fieldset>\
</form>');
@ -812,8 +812,8 @@ function setupSaveasDialog(){
var type = $('#image_type',this).val();
if (!id.length || !disk_id.length || !image_name.length) {
notifyError("Skipping VM "+id+
". No disk id or image name specified");
notifyError(tr("Skipping VM ")+id+". "+
tr("No disk id or image name specified"));
}
else {
var obj = {
@ -850,25 +850,25 @@ function popUpSaveasDialog(elems){
var li = '<li><a href="#saveas_tab_'+this+'">VM '+this+'</a></li>'
$('#saveas_tabs ul',dialog).append(li);
var tab = '<div class="saveas_tab" id="saveas_tab_'+this+'">\
<div id="vm_id_text">Saveas for VM with ID <span id="vm_id">'+this+'</span></div>\
<div id="vm_id_text">'+tr("Saveas for VM with ID")+' <span id="vm_id">'+this+'</span></div>\
<fieldset>\
<div>\
<label for="vm_disk_id">Select disk:</label>\
<label for="vm_disk_id">'+tr("Select disk")+':</label>\
<select id="vm_disk_id" name="vm_disk_id">\
<option value="">Retrieving...</option>\
<option value="">'+tr("Retrieving")+'...</option>\
</select>\
</div>\
<div>\
<label for="image_name">Image name:</label>\
<label for="image_name">'+tr("Image name")+':</label>\
<input type="text" id="image_name" name="image_name" value="" />\
</div>\
<div>\
<label for="img_attr_value">Type:</label>\
<label for="img_attr_value">'+tr("Type")+':</label>\
<select id="image_type" name="image_type">\
<option value="">Default (current image type)</option>\
<option value="os">OS</option>\
<option value="datablock">Datablock</option>\
<option value="cdrom">CD-ROM</option>\
<option value="">'+tr("Default (current image type)")+'</option>\
<option value="os">'+tr("OS")+'</option>\
<option value="datablock">'+tr("Datablock")+'</option>\
<option value="cdrom">'+tr("CD-ROM")+'</oqption>\
</select>\
</div>\
</fieldset>\
@ -888,15 +888,15 @@ function saveasDisksCallback(req,response){
var gen_option = function(id, name, source){
if (name){
return '<option value="'+id+'">'+name+' (disk id: '+id+')</option>';
return '<option value="'+id+'">'+name+" ("+tr("disk id")+"): "+id+')</option>';
}
else {
return '<option value="'+id+'">'+source+' (disk id: '+id+')</option>';
return '<option value="'+id+'">'+source+" ("+tr("disk id")+"): "+id+')</option>';
}
}
var disks = vm_info.TEMPLATE.DISK;
if (!disks) { select = '<option value="">No disks defined</option>';}
if (!disks) { select = '<option value="">'+tr("No disks defined")+'</option>';}
else if (disks.constructor == Array) //several disks
{
for (var i=0;i<disks.length;i++){
@ -915,7 +915,7 @@ function setVMAutorefresh(){
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_vMachines);
var filter = $("#datatable_vmachines_filter input",
dataTable_vMachines.parents('#datatable_vmachines_wrapper')).attr("value");
dataTable_vMachines.parents('#datatable_vmachines_wrapper')).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("VM.autorefresh");
};
@ -960,14 +960,14 @@ function updateVNCState(rfb, state, oldstate, msg) {
function setupVNC(){
//Append to DOM
dialogs_context.append('<div id="vnc_dialog" title="VNC connection"></div>');
dialogs_context.append('<div id="vnc_dialog" title=\"'+tr("VNC connection")+'\"></div>');
$vnc_dialog = $('#vnc_dialog',dialogs_context);
var dialog = $vnc_dialog;
dialog.html('\
<div id="VNC_status_bar" class="VNC_status_bar" style="margin-top: 0px;">\
<table border=0 width="100%"><tr>\
<td><div id="VNC_status">Loading</div></td>\
<td><div id="VNC_status">'+tr("Loading")+'</div></td>\
<td width="1%"><div id="VNC_buttons">\
<input type=button value="Send CtrlAltDel"\
id="sendCtrlAltDelButton">\
@ -975,7 +975,7 @@ function setupVNC(){
</tr></table>\
</div>\
<canvas id="VNC_canvas" width="640px" height="20px">\
Canvas not supported.\
'+tr("Canvas not supported.")+'\
</canvas>\
');
@ -993,16 +993,16 @@ function setupVNC(){
});
dialog.bind( "dialogclose", function(event, ui) {
var id = $vnc_dialog.attr("vm_id");
var id = $vnc_dialog.attr('vm_id');
rfb.disconnect();
Sunstone.runAction("VM.stopvnc",id);
});
$('.vnc',main_tabs_context).live("click",function(){
//Which VM is it?
var id = $(this).attr("vm_id");
var id = $(this).attr('vm_id');
//Set attribute to dialog
$vnc_dialog.attr("vm_id",id);
$vnc_dialog.attr('vm_id',id);
//Request proxy server start
Sunstone.runAction("VM.startvnc",id);
return false;
@ -1037,10 +1037,10 @@ function vncIcon(vm){
var gr_icon;
if (graphics && graphics.TYPE == "vnc" && state == "RUNNING"){
gr_icon = '<a class="vnc" href="#" vm_id="'+vm.ID+'">';
gr_icon += '<img src="images/vnc_on.png" alt="Open VNC Session" /></a>';
gr_icon += '<img src="images/vnc_on.png" alt=\"'+tr("Open VNC Session")+'\" /></a>';
}
else {
gr_icon = '<img src="images/vnc_off.png" alt="VNC Disabled" />';
gr_icon = '<img src="images/vnc_off.png" alt=\"'+tr("VNC Disabled")+'\" />';
}
return gr_icon;
}
@ -1068,7 +1068,11 @@ $(document).ready(function(){
{ "sWidth": "35px", "aTargets": [1,10] },
{ "sWidth": "150px", "aTargets": [5,9] },
{ "sWidth": "100px", "aTargets": [2,3] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_vMachines.fnClearTable();

View File

@ -23,15 +23,15 @@ var vnets_tab_content =
<table id="datatable_vnetworks" class="display">\
<thead>\
<tr>\
<th class="check"><input type="checkbox" class="check_all" value="">All</input></th>\
<th>ID</th>\
<th>Owner</th>\
<th>Group</th>\
<th>Name</th>\
<th>Type</th>\
<th>Bridge</th>\
<th>Public</th>\
<th>Total Leases</th>\
<th class="check"><input type="checkbox" class="check_all" value="">'+tr("All")+'</input></th>\
<th>'+tr("ID")+'</th>\
<th>'+tr("Owner")+'</th>\
<th>'+tr("Group")+'</th>\
<th>'+tr("Name")+'</th>\
<th>'+tr("Type")+'</th>\
<th>'+tr("Bridge")+'</th>\
<th>'+tr("Public")+'</th>\
<th>'+tr("Total Leases")+'</th>\
</tr>\
</thead>\
<tbody id="tbodyvnetworks">\
@ -42,40 +42,40 @@ var vnets_tab_content =
var create_vn_tmpl =
'<div id="vn_tabs">\
<ul>\
<li><a href="#easy">Wizard</a></li>\
<li><a href="#manual">Advanced mode</a></li>\
<li><a href="#easy">'+tr("Wizard")+'</a></li>\
<li><a href="#manual">'+tr("Advanced mode")+'</a></li>\
</ul>\
<div id="easy">\
<form id="create_vn_form_easy" action="">\
<fieldset>\
<label for="name">Name:</label>\
<label for="name">'+tr("Name")+':</label>\
<input type="text" name="name" id="name" /><br />\
</fieldset>\
<fieldset>\
<label for="bridge">Bridge:</label>\
<label for="bridge">'+tr("Bridge")+':</label>\
<input type="text" name="bridge" id="bridge" /><br />\
</fieldset>\
<fieldset>\
<label style="height:2em;">Network type:</label>\
<input type="radio" name="fixed_ranged" id="fixed_check" value="fixed" checked="checked">Fixed network</input><br />\
<input type="radio" name="fixed_ranged" id="ranged_check" value="ranged">Ranged network</input><br />\
<label style="height:2em;">'+tr("Network type")+':</label>\
<input type="radio" name="fixed_ranged" id="fixed_check" value="fixed" checked="checked">'+tr("Fixed network")+'</input><br />\
<input type="radio" name="fixed_ranged" id="ranged_check" value="ranged">'+tr("Ranged network")+'</input><br />\
</fieldset>\
<div class="clear"></div>\
<div id="easy_tabs">\
<div id="fixed">\
<fieldset>\
<label for="leaseip">Lease IP:</label>\
<label for="leaseip">'+tr("Lease IP")+':</label>\
<input type="text" name="leaseip" id="leaseip" /><br />\
<label for="leasemac">Lease MAC (opt):</label>\
<label for="leasemac">'+tr("Lease MAC (opt):")+'</label>\
<input type="text" name="leasemac" id="leasemac" />\
<div class="clear"></div>\
<button class="add_remove_button add_button" id="add_lease" value="add/lease">\
Add\
'+tr("Add")+'\
</button>\
<button class="add_remove_button" id="remove_lease" value="remove/lease">\
Remove selected\
'+tr("Remove selected")+'\
</button>\
<label for="leases">Current leases:</label>\
<label for="leases">'+tr("Current leases")+':</label>\
<select id="leases" name="leases" style="height:10em;" multiple>\
<!-- insert leases -->\
</select><br />\
@ -83,15 +83,15 @@ var create_vn_tmpl =
</div>\
<div id="ranged">\
<fieldset>\
<label for="net_address">Network Address:</label>\
<label for="net_address">'+tr("Network Address")+':</label>\
<input type="text" name="net_address" id="net_address" /><br />\
<label for="net_mask">Network Mask:</label>\
<label for="net_mask">'+tr("Network Mask")+':</label>\
<input type="text" name="net_mask" id="net_mask" /><br />\
<label for="custom_pool" style="height:2em;">Define a subnet by IP range:</label>\
<label for="custom_pool" style="height:2em;">'+tr("Define a subnet by IP range")+':</label>\
<input type="checkbox" name="custom_pool" id="custom_pool" style="margin-bottom:2em;" value="yes" /><br />\
<label for="ip_start">IP start:</label>\
<label for="ip_start">'+tr("IP Start")+':</label>\
<input type="text" name="ip_start" id="ip_start" disabled="disabled" /><br />\
<label for="ip_end">IP end:</label>\
<label for="ip_end">'+tr("IP End")+':</label>\
<input type="text" name="ip_end" id="ip_end" disabled="disabled" />\
</fieldset>\
</div>\
@ -100,14 +100,14 @@ var create_vn_tmpl =
</fieldset>\
<fieldset>\
<div class="">\
<label for="custom_var_vnet_name">Name:</label>\
<label for="custom_var_vnet_name">'+tr("Name")+':</label>\
<input type="text" id="custom_var_vnet_name" name="custom_var_vnet_name" /><br />\
<label for="custom_var_vnet_value">Value:</label>\
<label for="custom_var_vnet_value">'+tr("Value")+':</label>\
<input type="text" id="custom_var_vnet_value" name="custom_var_vnet_value" /><br />\
<button class="add_remove_button add_button" id="add_custom_var_vnet_button" value="add_custom_vnet_var">Add</button>\
<button class="add_remove_button" id="remove_custom_var_vnet_button" value="remove_custom_vnet_var">Remove selected</button>\
<button class="add_remove_button add_button" id="add_custom_var_vnet_button" value="add_custom_vnet_var">'+tr("Add")+'</button>\
<button class="add_remove_button" id="remove_custom_var_vnet_button" value="remove_custom_vnet_var">'+tr("Remove selected")+'</button>\
<div class="clear"></div>\
<label for="custom_var_vnet_box">Custom attributes:</label>\
<label for="custom_var_vnet_box">'+tr("Custom attributes")+':</label>\
<select id="custom_var_vnet_box" name="custom_var_vnet_box" style="height:100px;" multiple>\
</select>\
</div>\
@ -115,16 +115,16 @@ var create_vn_tmpl =
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_vn_submit_easy" value="vn/create">\
Create\
'+tr("Create")+'\
</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>\
</div>\
<div id="manual">\
<form id="create_vn_form_manual" action="">\
<h3 style="margin-bottom:10px;">Write the Virtual Network template here</h3>\
<h3 style="margin-bottom:10px;">'+tr("Write the Virtual Network template here")+'</h3>\
<fieldset style="border-top:none;">\
<textarea id="template" rows="15" style="width:100%;"></textarea>\
<div class="clear"></div>\
@ -132,9 +132,9 @@ var create_vn_tmpl =
<fieldset>\
<div class="form_buttons">\
<button class="button" id="create_vn_submit_manual" value="vn/create">\
Create\
'+tr("Create")+'\
</button>\
<button class="button" type="reset" value="reset">Reset</button>\
<button class="button" type="reset" value="reset">'+tr("Reset")+'</button>\
</div>\
</fieldset>\
</form>\
@ -143,23 +143,23 @@ var create_vn_tmpl =
var update_vnet_tmpl =
'<form action="javascript:alert(\'js error!\');">\
<h3 style="margin-bottom:10px;">Please, choose and modify the virtual network you want to update:</h3>\
<h3 style="margin-bottom:10px;">'+tr("Please, choose and modify the virtual network you want to update")+':</h3>\
<fieldset style="border-top:none;">\
<label for="vnet_template_update_select">Select a network:</label>\
<label for="vnet_template_update_select">'+tr("Select a network")+':</label>\
<select id="vnet_template_update_select" name="vnet_template_update_select"></select>\
<div class="clear"></div>\
<div>\
<label for="vnet_template_update_public">Public:</label>\
<label for="vnet_template_update_public">'+tr("Public")+':</label>\
<input type="checkbox" name="vnet_template_update_public" id="vnet_template_update_public" />\
</div>\
<label for="vnet_template_update_textarea">Template:</label>\
<label for="vnet_template_update_textarea">'+tr("Template")+':</label>\
<div class="clear"></div>\
<textarea id="vnet_template_update_textarea" style="width:100%; height:14em;"></textarea>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="vnet_template_update_button" value="Network.update_template">\
Update\
'+tr("Update")+'\
</button>\
</div>\
</fieldset>\
@ -330,36 +330,36 @@ var vnet_actions = {
var vnet_buttons = {
"Network.refresh" : {
type: "image",
text: "Refresh list",
text: tr("Refresh list"),
img: "images/Refresh-icon.png"
},
"Network.create_dialog" : {
type: "create_dialog",
text: "+ New"
text: tr("+ New")
},
"Network.update_dialog" : {
type: "action",
text: "Update a template",
text: tr("Update a template"),
alwaysActive: true
},
"Network.publish" : {
type: "action",
text: "Publish"
text: tr("Publish")
},
"Network.unpublish" : {
type: "action",
text: "Unpublish"
text: tr("Unpublish")
},
"Network.chown" : {
type: "confirm_with_select",
text: "Change owner",
text: tr("Change owner"),
select: users_sel,
tip: "Select the new owner:",
tip: tr("Select the new owner")+":",
condition: mustBeAdmin
},
@ -367,29 +367,29 @@ var vnet_buttons = {
type: "confirm_with_select",
text: "Change group",
select: groups_sel,
tip: "Select the new group:",
tip: tr("Select the new group")+":",
condition: mustBeAdmin,
},
"Network.delete" : {
type: "action",
text: "Delete"
text: tr("Delete")
}
}
var vnet_info_panel = {
"vnet_info_tab" : {
title: "Virtual network information",
title: tr("Virtual network information"),
content: ""
},
"vnet_leases_tab" : {
title: "Lease management",
title: tr("Lease management"),
content: ""
},
}
var vnets_tab = {
title: "Virtual Networks",
title: tr("Virtual Networks"),
content: vnets_tab_content,
buttons: vnet_buttons
}
@ -481,49 +481,50 @@ function updateVNetworkInfo(request,vn){
var info_tab_content =
'<table id="info_vn_table" class="info_table">\
<thead>\
<tr><th colspan="2">Virtual Network '+vn_info.ID+' information</th></tr>\
<tr><th colspan="2">'+tr("Virtual Network")+' '+vn_info.ID+' '+
tr("information")+'</th></tr>\
</thead>\
<tr>\
<td class="key_td">ID</td>\
<td class="key_td">'+tr("ID")+'</td>\
<td class="value_td">'+vn_info.ID+'</td>\
<tr>\
<tr>\
<td class="key_td">Name</td>\
<td class="key_td">'+tr("Name")+'</td>\
<td class="value_td">'+vn_info.NAME+'</td>\
<tr>\
<tr>\
<td class="key_td">Owner</td>\
<td class="key_td">'+tr("Owner")+'</td>\
<td class="value_td">'+vn_info.UNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Group</td>\
<td class="key_td">'+tr("Group")+'</td>\
<td class="value_td">'+vn_info.GNAME+'</td>\
</tr>\
<tr>\
<td class="key_td">Public</td>\
<td class="key_td">'+tr("Public")+'</td>\
<td class="value_td">'+(parseInt(vn_info.PUBLIC) ? "yes" : "no" )+'</td>\
</tr>\
<tr>\
<td class="key_td">Physical device</td>\
<td class="key_td">'+tr("Physical device")+'</td>\
<td class="value_td">'+ (typeof(vn_info.PHYDEV) == "object" ? "--": vn_info.PHYDEV) +'</td>\
</tr>\
<tr>\
<td class="key_td">VNET ID</td>\
<td class="key_td">'+tr("VNET ID")+'</td>\
<td class="value_td">'+ (typeof(vn_info.VLAN_ID) == "object" ? "--": vn_info.VLAN_ID) +'</td>\
</tr>\
</table>';
info_tab_content += '\
<table id="vn_template_table" class="info_table">\
<thead><tr><th colspan="2">Virtual Network template (attributes)</th></tr></thead>'+
<thead><tr><th colspan="2">'+tr("Virtual Network template (attributes)")+'</th></tr></thead>'+
prettyPrintJSON(vn_info.TEMPLATE)+
'</table>'
'</table>';
var leases_tab_content = printLeases(vn_info);
var info_tab = {
title: "Virtual Network information",
title: tr("Virtual Network information"),
content: info_tab_content
};
@ -542,30 +543,30 @@ function updateVNetworkInfo(request,vn){
function printLeases(vn_info){
var html ='<form style="display:inline-block;width:80%" id="leases_form" vnid="'+vn_info.ID+'"><table id="vn_leases_info_table" class="info_table" style="width:100%;">\
<thead>\
<tr><th colspan="2">Leases information</th></tr>\
<tr><th colspan="2">'+tr("Leases information")+'</th></tr>\
</thead><tbody>';
if (vn_info.TYPE == "0"){
html += '<tr>\
<td class="key_td">IP Start</td>\
<td class="key_td">'+tr("IP Start")+'</td>\
<td class="value_td">'+vn_info.RANGE.IP_START+'</td>\
</tr>\
<tr>\
<td class="key_td">IP End</td>\
<td class="key_td">'+tr("IP End")+'</td>\
<td class="value_td">'+vn_info.RANGE.IP_END+'</td>\
</tr\>\
<tr>\
<td class="key_td">Network mask</td>\
<td class="key_td">'+tr("Network mask")+'</td>\
<td class="value_td">'+( vn_info.TEMPLATE.NETWORK_MASK ? vn_info.TEMPLATE.NETWORK_MASK : "--" )+'</td>\
</tr\>\
<tr><td class="key_td">\
<label for="panel_hold_lease">Hold lease:</label></td><td class="value_td"><input type="text" id="panel_hold_lease" style="width:9em;"/>\
<button id="panel_hold_lease_button">Hold</button>\
<label for="panel_hold_lease">'+tr("Hold lease")+':</label></td><td class="value_td"><input type="text" id="panel_hold_lease" style="width:9em;"/>\
<button id="panel_hold_lease_button">'+tr("Hold")+'</button>\
</td></tr>';
} else {
html += '<tr><td class="key_td">\
<label for="panel_add_lease">Add lease:</label></td><td class="value_td"><input type="text" id="panel_add_lease" style="width:9em;"/>\
<button id="panel_add_lease_button">Add</button>\
<label for="panel_add_lease">'+tr("Add lease")+':</label></td><td class="value_td"><input type="text" id="panel_add_lease" style="width:9em;"/>\
<button id="panel_add_lease_button">'+tr("Add")+'</button>\
</td></tr>';
};
@ -574,7 +575,7 @@ function printLeases(vn_info){
if (!leases) //empty
{
html+='<tr id="no_leases_tr"><td class="key_td">\
No leases to show\
'+tr("No leases to show")+'\
</td>\
<td class="value_td">\
</td></tr>';
@ -619,13 +620,13 @@ function printLeases(vn_info){
switch (state){
case 0:
html += '<a class="hold_lease" href="#">hold</a> | <a class="delete_lease" href="#">delete</a>';
html += '<a class="hold_lease" href="#">'+tr("hold")+'</a> | <a class="delete_lease" href="#">'+tr("delete")+'</a>';
break;
case 1:
html += 'Used by VM '+lease.VID;
html += tr("Used by VM")+' '+lease.VID;
break;
case 2:
html += '<a class="release_lease" href="#">release</a>';
html += '<a class="release_lease" href="#">'+tr("release")+'</a>';
break;
};
html += '</td></tr>';
@ -638,7 +639,7 @@ function printLeases(vn_info){
//Prepares the vnet creation dialog
function setupCreateVNetDialog() {
dialogs_context.append('<div title="Create Virtual Network" id="create_vn_dialog"></div>');
dialogs_context.append('<div title=\"'+tr("Create Virtual Network")+'\" id="create_vn_dialog"></div>');
$create_vn_dialog = $('#create_vn_dialog',dialogs_context)
var dialog = $create_vn_dialog;
dialog.html(create_vn_tmpl);
@ -677,7 +678,7 @@ function setupCreateVNetDialog() {
//We don't add anything to the list if there is nothing to add
if (lease_ip == null) {
notifyError("Please provide a lease IP");
notifyError(tr("Please provide a lease IP"));
return false;
};
@ -743,7 +744,7 @@ function setupCreateVNetDialog() {
//Fetch values
var name = $('#name',this).val();
if (!name.length){
notifyError("Virtual Network name missing!");
notifyError(tr("Virtual Network name missing!"));
return false;
}
var bridge = $('#bridge',this).val();
@ -783,7 +784,7 @@ function setupCreateVNetDialog() {
var ip_end = $('#ip_end',this).val();
if (!network_addr.length){
notifyError("Please provide a network address");
notifyError(tr("Please provide a network address"));
return false;
};
@ -807,7 +808,7 @@ function setupCreateVNetDialog() {
//Time to add custom attributes
$('#custom_var_vnet_box option',$create_vn_dialog).each(function(){
var attr_name = $(this).attr("name");
var attr_name = $(this).attr('name');
var attr_value = $(this).val();
network_json["vnet"][attr_name] = attr_value;
});
@ -835,7 +836,7 @@ function popUpCreateVnetDialog() {
function setupVNetTemplateUpdateDialog(){
//Append to DOM
dialogs_context.append('<div id="vnet_template_update_dialog" title="Update network template"></div>');
dialogs_context.append('<div id="vnet_template_update_dialog" title="'+tr("Update network template")+'"></div>');
var dialog = $('#vnet_template_update_dialog',dialogs_context);
//Put HTML in place
@ -856,14 +857,14 @@ function setupVNetTemplateUpdateDialog(){
var id = $(this).val();
if (id && id.length){
var dialog = $('#vnet_template_update_dialog');
$('#vnet_template_update_textarea',dialog).val("Loading...");
$('#vnet_template_update_textarea',dialog).val(tr("Loading")+"...");
var vnet_public = is_public_vnet(id);
if (vnet_public){
$('#vnet_template_update_public',dialog).attr("checked","checked")
$('#vnet_template_update_public',dialog).attr('checked','checked')
} else {
$('#vnet_template_update_public',dialog).removeAttr("checked")
$('#vnet_template_update_public',dialog).removeAttr('checked')
}
Sunstone.runAction("Network.fetch_template",id);
@ -909,7 +910,7 @@ function popUpVNetTemplateUpdateDialog(){
var dialog = $('#vnet_template_update_dialog');
$('#vnet_template_update_select',dialog).html(select);
$('#vnet_template_update_textarea',dialog).val("");
$('#vnet_template_update_public',dialog).removeAttr("checked")
$('#vnet_template_update_public',dialog).removeAttr('checked')
if (sel_elems.length >= 1){ //several items in the list are selected
//grep them
@ -922,7 +923,7 @@ function popUpVNetTemplateUpdateDialog(){
});
$('#vnet_template_update_select',dialog).html(new_select);
if (sel_elems.length == 1) {
$('#vnet_template_update_select option',dialog).attr("selected","selected");
$('#vnet_template_update_select option',dialog).attr('selected','selected');
$('#vnet_template_update_select',dialog).trigger("change");
}
@ -991,7 +992,7 @@ function setVNetAutorefresh() {
setInterval(function(){
var checked = $('input.check_item:checked',dataTable_vNetworks);
var filter = $("#datatable_vnetworks_filter input",
dataTable_vNetworks.parents("#datatable_vnetworks_wrapper")).attr("value");
dataTable_vNetworks.parents("#datatable_vnetworks_wrapper")).attr('value');
if (!checked.length && !filter.length){
Sunstone.runAction("Network.autorefresh");
}
@ -1006,8 +1007,8 @@ function is_public_vnet(id) {
function setupVNetActionCheckboxes(){
$('input.action_cb#cb_public_vnet',dataTable_vNetworks).live("click",function(){
var $this = $(this)
var id=$this.attr("elem_id");
if ($this.attr("checked"))
var id=$this.attr('elem_id');
if ($this.attr('checked'))
Sunstone.runAction("Network.publish",id);
else Sunstone.runAction("Network.unpublish",id);
@ -1029,7 +1030,11 @@ $(document).ready(function(){
{ "sWidth": "60px", "aTargets": [0,5,6,7,8] },
{ "sWidth": "35px", "aTargets": [1] },
{ "sWidth": "100px", "aTargets": [2,3] }
]
],
"oLanguage": (datatable_lang != "") ?
{
sUrl: "locale/"+lang+"/"+datatable_lang
} : ""
});
dataTable_vNetworks.fnClearTable();
@ -1040,7 +1045,6 @@ $(document).ready(function(){
setupCreateVNetDialog();
setupVNetTemplateUpdateDialog();
//setupAddRemoveLeaseDialog();
setupLeasesOps();
setupVNetActionCheckboxes();
setVNetAutorefresh();

View File

@ -112,13 +112,13 @@ function recountCheckboxes(dataTable){
};
//enable checkall box
if (total_length == checked_length){
$('.check_all',dataTable).attr("checked","checked");
$('.check_all',dataTable).attr('checked','checked');
} else {
$('.check_all',dataTable).removeAttr("checked");
$('.check_all',dataTable).removeAttr('checked');
};
} else { //no elements cheked
//disable action buttons, uncheck checkAll
$('.check_all',dataTable).removeAttr("checked");
$('.check_all',dataTable).removeAttr('checked');
$('.top_button, .list_button',context).button("disable");
last_action_b.button("disable");
};
@ -186,10 +186,12 @@ function stringJSON(json){
function notifySubmit(action, args, extra_param){
var action_text = action.replace(/OpenNebula\./,'').replace(/\./,' ');
var msg = "<h1>Submitted</h1>";
var msg = '<h1>'+tr("Submitted")+'</h1>';
if (!args || (typeof args == 'object' && args.constructor != Array)){
msg += action_text;
} else {
msg += action_text + ": " + args;
};
if (extra_param && extra_param.constructor != Object) {
@ -201,13 +203,13 @@ function notifySubmit(action, args, extra_param){
//Notification on error
function notifyError(msg){
msg = "<h1>Error</h1>" + msg;
msg = "<h1>"+tr("Error")+"</h1>" + msg;
$.jGrowl(msg, {theme: "jGrowl-notify-error", position: "bottom-right", sticky: true });
}
//Standard notification
function notifyMessage(msg){
msg = "<h1>Info</h1>" + msg;
msg = "<h1>"+tr("Info")+"</h1>" + msg;
$.jGrowl(msg, {theme: "jGrowl-notify-submit", position: "bottom-right"});
}
@ -248,7 +250,7 @@ function prettyPrintRowJSON(field,value,padding,weight, border_bottom,padding_to
border-bottom:'+border_bottom+';\
padding-top:'+padding_top_bottom+'px;\
padding-bottom:'+padding_top_bottom+'px;">'
+field+
+tr(field)+
'</td>\
<td class="value_td" style=\
"border-bottom:'+border_bottom+';\
@ -275,7 +277,7 @@ function prettyPrintRowJSON(field,value,padding,weight, border_bottom,padding_to
border-bottom:'+border_bottom+';\
padding-top:'+padding_top_bottom+'px;\
padding-bottom:'+padding_top_bottom+'px">'+
field+
tr(field)+
'</td>\
<td class="value_td" style="\
border-bottom:'+border_bottom+';\
@ -295,13 +297,13 @@ function initCheckAllBoxes(datatable){
//small css hack
$('input.check_all',datatable).css({"border":"2px"});
$('input.check_all',datatable).change(function(){
$('input.check_all',datatable).live("change",function(){
var table = $(this).parents('table');
var checked = $(this).attr("checked");
var checked = $(this).attr('checked');
if (checked) { //check all
$('tbody input.check_item',table).attr("checked","checked");
$('tbody input.check_item',table).attr('checked','checked');
} else { //uncheck all
$('tbody input.check_item',table).removeAttr("checked");
$('tbody input.check_item',table).removeAttr('checked');
};
recountCheckboxes(table);
});
@ -332,7 +334,7 @@ function onError(request,error_json) {
if (!message){
if (!onError.disabled){
notifyError("Cannot contact server: is it running and reachable?");
notifyError(tr("Cannot contact server: is it running and reachable?"));
onError.disabled=true;
}
return false;
@ -340,7 +342,7 @@ function onError(request,error_json) {
if (message.match(/^Network is unreachable .+$/)){
if (!onError.disabled){
notifyError("Network is unreachable: is OpenNebula running?");
notifyError(tr("Network is unreachable: is OpenNebula running?"));
onError.disabled=true;
};
return false;
@ -361,7 +363,7 @@ function onError(request,error_json) {
} else if (m = message.match(auth_error)) {
method = m[1];
object = m[3];
reason = "Unauthorized";
reason = tr("Unauthorized");
};
if (m) {
@ -496,9 +498,11 @@ function getSelectedNodes(dataTable){
function makeSelectOptions(dataTable,
id_col,name_col,
status_cols,
bad_status_values){
bad_status_values,no_empty_opt){
var nodes = dataTable.fnGetData();
var select = '<option class="empty_value" value="">Please select</option>';
var select = "";
if (!no_empty_opt)
select = '<option class="empty_value" value="">'+tr("Please select")+'</option>';
var array;
for (var j=0; j<nodes.length;j++){
var elem = nodes[j];
@ -632,23 +636,23 @@ function shortenedInfoFields(context){
function setupTemplateUpdateDialog(){
//Append to DOM
dialogs_context.append('<div id="template_update_dialog" title="Update template"></div>');
dialogs_context.append('<div id="template_update_dialog" title=\"'+tr("Update template")+'"></div>');
var dialog = $('#template_update_dialog',dialogs_context);
//Put HTML in place
dialog.html(
'<form action="javascript:alert(\'js error!\');">\
<h3 style="margin-bottom:10px;">Please, choose and modify the template you want to update:</h3>\
<h3 style="margin-bottom:10px;">'+tr("Please, choose and modify the template you want to update")+':</h3>\
<fieldset style="border-top:none;">\
<label for="template_update_select">Select a template:</label>\
<label for="template_update_select">'+tr("Select a template")+':</label>\
<select id="template_update_select" name="template_update_select"></select>\
<div class="clear"></div>\
<textarea id="template_update_textarea" style="width:100%; height:14em;">Select a template</textarea>\
<textarea id="template_update_textarea" style="width:100%; height:14em;">'+tr("Select a template")+'</textarea>\
</fieldset>\
<fieldset>\
<div class="form_buttons">\
<button class="button" id="template_update_button" value="">\
Update\
'+tr("Update")+'\
</button>\
</div>\
</fieldset>\
@ -706,7 +710,7 @@ function popUpTemplateUpdateDialog(elem_str,select_items,sel_elems){
if (sel_elems.length >= 1){ //several items in the list are selected
//grep them
var new_select= sel_elems.length > 1? '<option value="">Please select</option>' : "";
var new_select= sel_elems.length > 1? '<option value="">'+tr("Please select")+'</option>' : "";
$('option','<select>'+select_items+'</select>').each(function(){
var val = $(this).val();
if ($.inArray(val,sel_elems) >= 0){
@ -715,7 +719,7 @@ function popUpTemplateUpdateDialog(elem_str,select_items,sel_elems){
});
$('#template_update_select',dialog).html(new_select);
if (sel_elems.length == 1) {
$('#template_update_select option',dialog).attr("selected","selected");
$('#template_update_select option',dialog).attr('selected','selected');
$('#template_update_select',dialog).trigger("change");
}
};

View File

@ -314,7 +314,7 @@ $(document).ready(function(){
$('.action_button').live("click",function(){
var error = 0;
var table = null;
var value = $(this).attr("value");
var value = $(this).attr('value');
var action = SunstoneCfg["actions"][value];
if (!action) {
notifyError("Action "+value+" not defined.");
@ -366,6 +366,12 @@ $(document).ready(function(){
$('.action_blocks .action_list:visible',main_tabs_context).hide();
});
//Close open panel
$('.close_dialog_link').live("click",function(){
hideDialog();
return false;
});
//Start with the dashboard (supposing we have one).
showTab('#dashboard_tab');
@ -397,6 +403,9 @@ function setLogin(){
case "ozones":
username = cookie["ozones-user"];
break;
case "occi":
username = cookie["occi-user"];
break;
};
@ -411,6 +420,9 @@ function setLogin(){
case "ozones":
oZones.Auth.logout({success:redirect});
break;
case "occi":
OCCI.Auth.logout({success:function(){window.location.href = "ui";}});
break;
}
return false;
});
@ -419,8 +431,13 @@ function setLogin(){
//returns whether we are Sunstone, or oZones
//not the most elegant way, but better in its own function
function whichUI(){
return (typeof(OpenNebula)!="undefined"? "sunstone" : "ozones");
}
if (typeof(OpenNebula)!="undefined")
return "sunstone";
if (typeof(oZones)!="undefined")
return "ozones";
if (typeof(OCCI)!="undefined")
return "occi";
};
//Inserts all main tabs in the DOM
function insertTabs(){
@ -549,8 +566,8 @@ function initListButtons(){
$('.multi_action_slct',main_tabs_context).each(function(){
//prepare replacement buttons
var buttonset = $('<div style="display:inline-block;" class="top_button"></div');
var button1 = $('<button class="last_action_button action_button confirm_button confirm_with_select_button" value="">Previous action</button>').button();
button1.attr("disabled","disabled");
var button1 = $('<button class="last_action_button action_button confirm_button confirm_with_select_button" value="">'+tr("Previous action")+'</button>').button();
button1.attr('disabled','disabled');
var button2 = $('<button class="list_button" value="">See more</button>').button({
text:false,
icons: { primary: "ui-icon-triangle-1-s" }
@ -563,7 +580,7 @@ function initListButtons(){
var options = $('option', $(this));
var list = $('<ul class="action_list"></ul>');
$.each(options,function(){
var classes = $(this).attr("class");
var classes = $(this).attr('class');
var item = $('<li></li>');
var a = $('<a href="#" class="'+classes+'" value="'+$(this).val()+'">'+$(this).text()+'</a>');
a.val($(this).val());
@ -590,7 +607,7 @@ function initListButtons(){
prev_action_button.removeClass("confirm_with_select_button");
prev_action_button.removeClass("confirm_button");
prev_action_button.removeClass("action_button");
prev_action_button.addClass($(this).attr("class"));
prev_action_button.addClass($(this).attr('class'));
prev_action_button.button("option","label",$(this).text());
prev_action_button.button("enable");
$(this).parents('ul').hide("blind",100);
@ -612,19 +629,19 @@ function initListButtons(){
//Prepares the standard confirm dialogs
function setupConfirmDialogs(){
dialogs_context.append('<div id="confirm_dialog" title="Confirmation of action"></div>');
dialogs_context.append('<div id="confirm_dialog" title=\"'+tr("Confirmation of action")+'\"></div>');
var dialog = $('div#confirm_dialog',dialogs_context);
//add the HTML with the standard question and buttons.
dialog.html(
'<form action="javascript:alert(\'js error!\');">\
<div id="confirm_tip">You have to confirm this action.</div>\
<div id="confirm_tip">'+tr("You have to confirm this action.")+'</div>\
<br />\
<div id="question">Do you want to proceed?</div>\
<div id="question">'+tr("Do you want to proceed?")+'</div>\
<br />\
<div class="form_buttons">\
<button id="confirm_proceed" class="action_button" value="">OK</button>\
<button class="confirm_cancel" value="">Cancel</button>\
<button id="confirm_proceed" class="action_button" value="">'+tr("OK")+'</button>\
<button class="confirm_cancel" value="">'+tr("Cancel")+'</button>\
</div>\
</form>');
@ -646,17 +663,17 @@ function setupConfirmDialogs(){
return false;
});
dialogs_context.append('<div id="confirm_with_select_dialog" title="Confirmation of action"></div>');
dialogs_context.append('<div id="confirm_with_select_dialog" title=\"'+tr("Confirmation of action")+'\"></div>');
dialog = $('div#confirm_with_select_dialog',dialogs_context);
dialog.html(
'<form action="javascript:alert(\'js error!\');">\
<div id="confirm_with_select_tip">You need to select something.</div>\
<div id="confirm_with_select_tip">'+tr("You need to select something.")+'</div>\
<select style="margin: 10px 0;" id="confirm_select">\
</select>\
<div class="form_buttons">\
<button id="confirm_with_select_proceed" class="" value="">OK</button>\
<button class="confirm_cancel" value="">Cancel</button>\
<button id="confirm_with_select_proceed" class="" value="">'+tr("OK")+'</button>\
<button class="confirm_cancel" value="">'+tr("Cancel")+'</button>\
</div>\
</form>');

View File

@ -0,0 +1,482 @@
//Translated by
lang="en_US"
datatable_lang=""
locale={
"Accept (default)":"",
"Acl":"",
"ACL Rules":"",
"ACLs":"",
"ACL String preview":"",
"ACPI":"",
"Add":"",
"Add context variables":"",
"Add custom variables":"",
"Add disk/image":"",
"Add disks/images":"",
"Add Graphics":"",
"Add Hypervisor raw options":"",
"Add inputs":"",
"Add lease":"",
"Add network":"",
"Add placement options":"",
"Advanced mode":"",
"Affected resources":"",
"All":"",
"Allowed operations":"",
"Amount of RAM required for the VM, in Megabytes.":"",
"Applies to":"",
"Architecture":"",
"are mandatory":"",
"Arguments for the booting kernel":"",
"Authentication":"",
"Authentication driver":"",
"Block":"",
"Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"",
"Boot":"",
"Boot device type":"",
"Bootloader":"",
"Boot method":"",
"Boot/OS options":"",
"Bridge":"",
"Bus":"",
"Cancel":"",
"Cannot contact server: is it running and reachable?":"",
"Canvas not supported.":"",
"Capacity":"",
"Capacity options":"",
"cdrom":"",
"CD-ROM":"",
"Change":"",
"Change authentication":"",
"Change group":"",
"Change owner":"",
"Change password":"",
"Changing language":"",
"Clone":"",
"Clone this image":"",
"Community":"",
"Configuration":"",
"Confirmation of action":"",
"Context":"",
"Context variable name and value must be filled in":"",
"Core":"",
"CPU":"",
"CPU architecture to virtualization":"",
"CPU Monitoring information":"",
"CPU Use":"",
"Create":"",
"Create ACL":"",
"Create an empty datablock":"",
"Create group":"",
"Create host":"",
"Create Image":"",
"Create user":"",
"Create Virtual Machine":"",
"Create Virtual Network":"",
"Create VM Template":"",
"Current disks":"",
"Current inputs":"",
"Current leases":"",
"Current NICs":"",
"Current variables":"",
"Custom attribute name and value must be filled in":"",
"Custom attributes":"",
"Custom variable name and value must be filled in":"",
"Custom variables":"",
"Dashboard":"",
"Data":"",
"Datablock":"",
"Default":"",
"Default (current image type)":"",
"Define a subnet by IP range":"",
"Delete":"",
"Delete host":"",
"Deploy":"",
"Deploy ID":"",
"Deploy # VMs":"",
"Description":"",
"Device prefix":"",
"Device to be mounted as root":"",
"Device to map image disk. If set, it will overwrite the default device mapping":"",
"Disable":"",
"disabled":"",
"Disallow access to the VM through the specified ports in the TCP protocol":"",
"Disallow access to the VM through the specified ports in the UDP protocol":"",
"Disk":"",
"Disk file location path or URL":"",
"disk id":"",
"Disks":"",
"Disk type":"",
"Documentation":"",
"Do you want to proceed?":"",
"Driver":"",
"Driver default":"",
"Drivers":"",
"Drop":"",
"Dummy":"",
"EC2":"",
"Enable":"",
"English":"",
"Error":"",
"failed":"",
"fd":"",
"Features":"",
"Fields marked with":"",
"File":"",
"Filesystem type":"",
"Filesystem type for the fs images":"",
"Fill in a new password":"",
"Fixed network":"",
"Floppy":"",
"Fold / Unfold all sections":"",
"Format":"",
"FS":"",
"FS type":"",
"Get Information":"",
"Get Pool of my/group\'s resources":"",
"Get Pool of resources":"",
"Graphics":"",
"Graphics type":"",
"Group":"",
"Group ":"",
"Group name":"",
"Groups":"",
"Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"",
"hd":"",
"Historical monitoring information":"",
"hold":"",
"Hold":"",
"Hold lease":"",
"Host":"",
"Host information":"",
"Hostname":"",
"Host name missing!":"",
"Host parameters":"",
"Hosts":"",
"Hosts CPU":"",
"Host shares":"",
"Hosts memory":"",
"Hosts (total/active)":"",
"Host template":"",
"Human readable description of the image for other users.":"",
"HW address associated with the network interface":"",
"Icmp":"",
"ICMP policy":"",
"id":"",
"ID":"",
"IDE":"",
"Image":"",
"Image cannot be public and persistent":"",
"Image information":"",
"Image name":"",
"Images":"",
"Images (total/public)":"",
"Image template":"",
"IM MAD":"",
"Info":"",
"information":"",
"Information":"",
"Information Manager":"",
"Initrd":"",
"Inputs":"",
"Instantiate":"",
"IP":"",
"IP End":"",
"IP Start":"",
"IP to listen on":"",
"Kernel":"",
"Kernel commands":"",
"Keyboard configuration locale to use in the VNC display":"",
"Keymap":"",
"KVM":"",
"Language":"",
"LCM State":"",
"Lease IP":"",
"Lease MAC (opt):":"",
"Lease management":"",
"Leases information":"",
"Listen IP":"",
"Live migrate":"",
"Loading":"",
"MAC":"",
"Make non persistent":"",
"Make persistent":"",
"Manage":"",
"Manual":"",
"Max Mem":"",
"Memory":"",
"Memory monitoring information":"",
"Memory use":"",
"Migrate":"",
"Model":"",
"Monitoring information":"",
"Mount image as read-only":"",
"Mouse":"",
"Name":"",
"Name for the context variable":"",
"Name for the custom variable":"",
"Name for the tun device created for the VM":"",
"Name of a shell script to be executed after creating the tun device for the VM":"",
"Name of the bridge the network device is going to be attached to":"",
"Name of the image to use":"",
"Name of the network to attach this device":"",
"Name that the Image will get. Every image must have a unique name.":"",
"Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-&lt;VID&gt;.":"",
"Net_RX":"",
"Net_TX":"",
"network":"",
"Network":"",
"Network Address":"",
"Network is unreachable: is OpenNebula running?":"",
"Network mask":"",
"Network Mask":"",
"Network reception":"",
"Network transmission":"",
"Network type":"",
"New":"",
"+ New":"",
"+ New Group":"",
"New password":"",
"No":"",
"No disk id or image name specified":"",
"No disks defined":"",
"No leases to show":"",
"None":"",
"Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"",
"OK":"",
"Open VNC Session":"",
"Optional, please select":"",
"OS":"",
"OS and Boot options":"",
"Owned by group":"",
"Owner":"",
"PAE":"",
"Password":"",
"Password for the VNC server":"",
"Path":"",
"Path to the bootloader executable":"",
"Path to the initrd image":"",
"Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"",
"Path to the OS kernel to boot the image":"",
"Path vs. source":"",
"Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"",
"Permits access to the VM only through the specified ports in the TCP protocol":"",
"Permits access to the VM only through the specified ports in the UDP protocol":"",
"Persistence of the image":"",
"Persistent":"",
"Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"",
"Physical device":"",
"Placement":"",
"Please choose":"",
"Please, choose and modify the image you want to update":"",
"Please, choose and modify the template you want to update":"",
"Please, choose and modify the virtual network you want to update":"",
"Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"",
"Please choose the new type of authentication for the selected users":"",
"Please provide a lease IP":"",
"Please provide a network address":"",
"Please provide a resource ID for the resource(s) in this rule":"",
"Please select":"",
"Please select at least one resource":"",
"Please specify to who this ACL applies":"",
"Port":"",
"Port blacklist":"",
"Port for the VNC server":"",
"Port whitelist":"",
"Predefined":"",
"Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"",
"Previous action":"",
"Provide a path":"",
"Provide a source":"",
"PS2":"",
"Public":"",
"Public scope of the image":"",
"Publish":"",
"Quickstart":"",
"Ranged network":"",
"Rank":"",
"Raw":"",
"Raw data to be passed directly to the hypervisor":"",
"Read only":"",
"Refresh list":"",
"Register time":"",
"Registration time":"",
"release":"",
"Release":"",
"Remove selected":"",
"Request an specific IP from the Network":"",
"Requirements":"",
"Reset":"",
"Resource ID":"",
"Resource ID / Owned by":"",
"Resource subset":"",
"Restart":"",
"Resubmit":"",
"Resume":"",
"Retrieving":"",
"Root":"",
"running":"",
"Running VMs":"",
"Running #VMS":"",
"Russian":"",
"Save":"",
"Save as":"",
"Saveas for VM with ID":"",
"Save this image after shutting down the VM":"",
"Script":"",
"SCSI":"",
"SDL":"",
"Select a network":"",
"Select an image":"",
"Select a template":"",
"Select boot method":"",
"Select disk":"",
"Select template":"",
"Select the new group":"",
"Select the new owner":"",
"Server (Cipher)":"",
"Server (x509)":"",
"Setup Networks":"",
"Shared":"",
"Shutdown":"",
"Sign out":"",
"Size":"",
"Size in MB":"",
"Size (Mb)":"",
"Size of the datablock in MB.":"",
"Skipping VM ":"",
"Source":"",
"Source to be used in the DISK attribute. Useful for not file-based images.":"",
"Specific ID":"",
"Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:":"",
"Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"",
"SSH":"",
"Start time":"",
"Start Time":"",
"State":"",
"Status":"",
"Stop":"",
"Submitted":"",
"Summary of resources":"",
"Sunstone UI Configuration":"",
"Support":"",
"Suspend":"",
"Swap":"",
"Tablet":"",
"Target":"",
"Tcp black ports":"",
"Tcp firewall mode":"",
"Tcp white ports":"",
"Template":"",
"Template information":"",
"Templates":"",
"Template updated correctly":"",
"There are mandatory fields missing in the capacity section":"",
"There are mandatory fields missing in the OS Boot options section":"",
"There are mandatory parameters missing":"",
"There are mandatory parameters missing in this section":"",
"This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"",
"This rule applies to":"",
"This will cancel selected VMs":"",
"This will change the main group of the selected users. Select the new group":"",
"This will change the password for the selected users":"",
"This will delete the selected VMs from the database":"",
"This will deploy the selected VMs on the chosen host":"",
"This will hold selected pending VMs from being deployed":"",
"This will initiate the shutdown process in the selected VMs":"",
"This will live-migrate the selected VMs to the chosen host":"",
"This will migrate the selected VMs to the chosen host":"",
"This will redeploy selected VMs (in UNKNOWN or BOOT state)":"",
"This will release held machines":"",
"This will resubmits VMs to PENDING state":"",
"This will resume selected stopped or suspended VMs":"",
"This will suspend selected machines":"",
"TM MAD":"",
"total":"",
"Total Leases":"",
"Total VM count":"",
"Total VM CPU":"",
"Total VM Memory":"",
"Transfer Manager":"",
"Type":"",
"Type of disk device to emulate.":"",
"Type of disk device to emulate: ide, scsi":"",
"Type of file system to be built. This can be any value understood by mkfs unix command.":"",
"Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"",
"Udp black ports":"",
"Udp firewall mode":"",
"Udp white ports":"",
"Unauthorized":"",
"Unpublish":"",
"Update":"",
"Update a template":"",
"Update image template":"",
"Update network template":"",
"Update template":"",
"USB":"",
"Use":"",
"Used by VM":"",
"Used CPU":"",
"Used CPU (allocated)":"",
"Used CPU (real)":"",
"Used Mem (allocated)":"",
"Used Memory":"",
"Used Mem (real)":"",
"Useful for power management, for example, normally required for graceful shutdown to work":"",
"User":"",
"Username":"",
"User name and password must be filled in":"",
"Users":"",
"Value":"",
"Value of the context variable":"",
"Value of the custom variable":"",
"VCPU":"",
"Virtio":"",
"Virtio (KVM)":"",
"Virtualization Manager":"",
"Virtual Machine information":"",
"Virtual Machines":"",
"Virtual Network":"",
"Virtual network information":"",
"Virtual Network information":"",
"Virtual Network name missing!":"",
"Virtual Networks":"",
"Virtual Networks (total/public)":"",
"Virtual Network template (attributes)":"",
"VM information":"",
"VM Instance":"",
"VM Instances":"",
"VM log":"",
"VM MAD":"",
"VM Name":"",
"VM Network stats":"",
"#VMS":"",
"VM Save As":"",
"VM template":"",
"VM Template":"",
"VM Templates":"",
"VM Templates (total/public)":"",
"VNC":"",
"VNC Access":"",
"VNC connection":"",
"VNC Disabled":"",
"VNC Session":"",
"VNET ID":"",
"VN MAD":"",
"Welcome":"",
"Wizard":"",
"Wizard KVM":"",
"Wizard VMware":"",
"Wizard XEN":"",
"Write the image template here":"",
"Write the Virtual Machine template here":"",
"Write the Virtual Network template here":"",
"x509":"",
"XEN":"",
"Xen templates must specify a boot method":"",
"yes":"",
"Yes":"",
"You have not selected a template":"",
"You have to confirm this action.":"",
"You need to select something.":"",
};

View File

@ -0,0 +1,31 @@
#!/usr/bin/env ruby
# -*- coding: utf-8 -*-
# -------------------------------------------------------------------------- #
# Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) #
# #
# Licensed under the Apache License, Version 2.0 (the "License"); you may #
# not use this file except in compliance with the License. You may obtain #
# a copy of the License at #
# #
# http://www.apache.org/licenses/LICENSE-2.0 #
# #
# Unless required by applicable law or agreed to in writing, software #
# distributed under the License is distributed on an "AS IS" BASIS, #
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. #
# See the License for the specific language governing permissions and #
# limitations under the License. #
#--------------------------------------------------------------------------- #
tr_strings = `grep -h -o -R -e 'tr("[[:print:]]*")' ../js/* | cut -d'"' -f 2 | sort -u`
puts "//Translated by"
puts 'lang="en_US"'
puts 'datatable_lang=""'
puts "locale={"
tr_strings.each_line do | line |
puts " \"#{line.chomp}\":\"\","
end
puts "};"

View File

@ -0,0 +1,482 @@
//Translated by
lang="en_US"
datatable_lang=""
locale={
"Accept (default)":"",
"Acl":"",
"ACL Rules":"",
"ACLs":"",
"ACL String preview":"",
"ACPI":"",
"Add":"",
"Add context variables":"",
"Add custom variables":"",
"Add disk/image":"",
"Add disks/images":"",
"Add Graphics":"",
"Add Hypervisor raw options":"",
"Add inputs":"",
"Add lease":"",
"Add network":"",
"Add placement options":"",
"Advanced mode":"",
"Affected resources":"",
"All":"",
"Allowed operations":"",
"Amount of RAM required for the VM, in Megabytes.":"",
"Applies to":"",
"Architecture":"",
"are mandatory":"",
"Arguments for the booting kernel":"",
"Authentication":"",
"Authentication driver":"",
"Block":"",
"Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM":"",
"Boot":"",
"Boot device type":"",
"Bootloader":"",
"Boot method":"",
"Boot/OS options":"",
"Bridge":"",
"Bus":"",
"Cancel":"",
"Cannot contact server: is it running and reachable?":"",
"Canvas not supported.":"",
"Capacity":"",
"Capacity options":"",
"cdrom":"",
"CD-ROM":"",
"Change":"",
"Change authentication":"",
"Change group":"",
"Change owner":"",
"Change password":"",
"Changing language":"",
"Clone":"",
"Clone this image":"",
"Community":"",
"Configuration":"",
"Confirmation of action":"",
"Context":"",
"Context variable name and value must be filled in":"",
"Core":"",
"CPU":"",
"CPU architecture to virtualization":"",
"CPU Monitoring information":"",
"CPU Use":"",
"Create":"",
"Create ACL":"",
"Create an empty datablock":"",
"Create group":"",
"Create host":"",
"Create Image":"",
"Create user":"",
"Create Virtual Machine":"",
"Create Virtual Network":"",
"Create VM Template":"",
"Current disks":"",
"Current inputs":"",
"Current leases":"",
"Current NICs":"",
"Current variables":"",
"Custom attribute name and value must be filled in":"",
"Custom attributes":"",
"Custom variable name and value must be filled in":"",
"Custom variables":"",
"Dashboard":"",
"Data":"",
"Datablock":"",
"Default":"",
"Default (current image type)":"",
"Define a subnet by IP range":"",
"Delete":"",
"Delete host":"",
"Deploy":"",
"Deploy ID":"",
"Deploy # VMs":"",
"Description":"",
"Device prefix":"",
"Device to be mounted as root":"",
"Device to map image disk. If set, it will overwrite the default device mapping":"",
"Disable":"",
"disabled":"",
"Disallow access to the VM through the specified ports in the TCP protocol":"",
"Disallow access to the VM through the specified ports in the UDP protocol":"",
"Disk":"",
"Disk file location path or URL":"",
"disk id":"",
"Disks":"",
"Disk type":"",
"Documentation":"",
"Do you want to proceed?":"",
"Driver":"",
"Driver default":"",
"Drivers":"",
"Drop":"",
"Dummy":"",
"EC2":"",
"Enable":"",
"English":"",
"Error":"",
"failed":"",
"fd":"",
"Features":"",
"Fields marked with":"",
"File":"",
"Filesystem type":"",
"Filesystem type for the fs images":"",
"Fill in a new password":"",
"Fixed network":"",
"Floppy":"",
"Fold / Unfold all sections":"",
"Format":"",
"FS":"",
"FS type":"",
"Get Information":"",
"Get Pool of my/group\'s resources":"",
"Get Pool of resources":"",
"Graphics":"",
"Graphics type":"",
"Group":"",
"Group ":"",
"Group name":"",
"Groups":"",
"Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.":"",
"hd":"",
"Historical monitoring information":"",
"hold":"",
"Hold":"",
"Hold lease":"",
"Host":"",
"Host information":"",
"Hostname":"",
"Host name missing!":"",
"Host parameters":"",
"Hosts":"",
"Hosts CPU":"",
"Host shares":"",
"Hosts memory":"",
"Hosts (total/active)":"",
"Host template":"",
"Human readable description of the image for other users.":"",
"HW address associated with the network interface":"",
"Icmp":"",
"ICMP policy":"",
"id":"",
"ID":"",
"IDE":"",
"Image":"",
"Image cannot be public and persistent":"",
"Image information":"",
"Image name":"",
"Images":"",
"Images (total/public)":"",
"Image template":"",
"IM MAD":"",
"Info":"",
"information":"",
"Information":"",
"Information Manager":"",
"Initrd":"",
"Inputs":"",
"Instantiate":"",
"IP":"",
"IP End":"",
"IP Start":"",
"IP to listen on":"",
"Kernel":"",
"Kernel commands":"",
"Keyboard configuration locale to use in the VNC display":"",
"Keymap":"",
"KVM":"",
"Language":"",
"LCM State":"",
"Lease IP":"",
"Lease MAC (opt):":"",
"Lease management":"",
"Leases information":"",
"Listen IP":"",
"Live migrate":"",
"Loading":"",
"MAC":"",
"Make non persistent":"",
"Make persistent":"",
"Manage":"",
"Manual":"",
"Max Mem":"",
"Memory":"",
"Memory monitoring information":"",
"Memory use":"",
"Migrate":"",
"Model":"",
"Monitoring information":"",
"Mount image as read-only":"",
"Mouse":"",
"Name":"",
"Name for the context variable":"",
"Name for the custom variable":"",
"Name for the tun device created for the VM":"",
"Name of a shell script to be executed after creating the tun device for the VM":"",
"Name of the bridge the network device is going to be attached to":"",
"Name of the image to use":"",
"Name of the network to attach this device":"",
"Name that the Image will get. Every image must have a unique name.":"",
"Name that the VM will get for description purposes. If NAME is not supplied a name generated by one will be in the form of one-&lt;VID&gt;.":"",
"Net_RX":"",
"Net_TX":"",
"network":"",
"Network":"",
"Network Address":"",
"Network is unreachable: is OpenNebula running?":"",
"Network mask":"",
"Network Mask":"",
"Network reception":"",
"Network transmission":"",
"Network type":"",
"New":"",
"+ New":"",
"+ New Group":"",
"New password":"",
"No":"",
"No disk id or image name specified":"",
"No disks defined":"",
"No leases to show":"",
"None":"",
"Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.":"",
"OK":"",
"Open VNC Session":"",
"Optional, please select":"",
"OS":"",
"OS and Boot options":"",
"Owned by group":"",
"Owner":"",
"PAE":"",
"Password":"",
"Password for the VNC server":"",
"Path":"",
"Path to the bootloader executable":"",
"Path to the initrd image":"",
"Path to the original file that will be copied to the image repository. If not specified for a DATABLOCK type image, an empty image will be created.":"",
"Path to the OS kernel to boot the image":"",
"Path vs. source":"",
"Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.":"",
"Permits access to the VM only through the specified ports in the TCP protocol":"",
"Permits access to the VM only through the specified ports in the UDP protocol":"",
"Persistence of the image":"",
"Persistent":"",
"Physical address extension mode allows 32-bit guests to address more than 4 GB of memory":"",
"Physical device":"",
"Placement":"",
"Please choose":"",
"Please, choose and modify the image you want to update":"",
"Please, choose and modify the template you want to update":"",
"Please, choose and modify the virtual network you want to update":"",
"Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.":"",
"Please choose the new type of authentication for the selected users":"",
"Please provide a lease IP":"",
"Please provide a network address":"",
"Please provide a resource ID for the resource(s) in this rule":"",
"Please select":"",
"Please select at least one resource":"",
"Please specify to who this ACL applies":"",
"Port":"",
"Port blacklist":"",
"Port for the VNC server":"",
"Port whitelist":"",
"Predefined":"",
"Prefix for the emulated device this image will be mounted at. For instance, “hd”, “sd”. If omitted, the default value is the one defined in oned.conf (installation default is “hd”).":"",
"Previous action":"",
"Provide a path":"",
"Provide a source":"",
"PS2":"",
"Public":"",
"Public scope of the image":"",
"Publish":"",
"Quickstart":"",
"Ranged network":"",
"Rank":"",
"Raw":"",
"Raw data to be passed directly to the hypervisor":"",
"Read only":"",
"Refresh list":"",
"Register time":"",
"Registration time":"",
"release":"",
"Release":"",
"Remove selected":"",
"Request an specific IP from the Network":"",
"Requirements":"",
"Reset":"",
"Resource ID":"",
"Resource ID / Owned by":"",
"Resource subset":"",
"Restart":"",
"Resubmit":"",
"Resume":"",
"Retrieving":"",
"Root":"",
"running":"",
"Running VMs":"",
"Running #VMS":"",
"Russian":"",
"Save":"",
"Save as":"",
"Saveas for VM with ID":"",
"Save this image after shutting down the VM":"",
"Script":"",
"SCSI":"",
"SDL":"",
"Select a network":"",
"Select an image":"",
"Select a template":"",
"Select boot method":"",
"Select disk":"",
"Select template":"",
"Select the new group":"",
"Select the new owner":"",
"Server (Cipher)":"",
"Server (x509)":"",
"Setup Networks":"",
"Shared":"",
"Shutdown":"",
"Sign out":"",
"Size":"",
"Size in MB":"",
"Size (Mb)":"",
"Size of the datablock in MB.":"",
"Skipping VM ":"",
"Source":"",
"Source to be used in the DISK attribute. Useful for not file-based images.":"",
"Specific ID":"",
"Specific image mapping driver. KVM: raw, qcow2. XEN: tap:aio, file:":"",
"Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported":"",
"SSH":"",
"Start time":"",
"Start Time":"",
"State":"",
"Status":"",
"Stop":"",
"Submitted":"",
"Summary of resources":"",
"Sunstone UI Configuration":"",
"Support":"",
"Suspend":"",
"Swap":"",
"Tablet":"",
"Target":"",
"Tcp black ports":"",
"Tcp firewall mode":"",
"Tcp white ports":"",
"Template":"",
"Template information":"",
"Templates":"",
"Template updated correctly":"",
"There are mandatory fields missing in the capacity section":"",
"There are mandatory fields missing in the OS Boot options section":"",
"There are mandatory parameters missing":"",
"There are mandatory parameters missing in this section":"",
"This field sets which attribute will be used to sort the suitable hosts for this VM. Basically, it defines which hosts are more suitable than others":"",
"This rule applies to":"",
"This will cancel selected VMs":"",
"This will change the main group of the selected users. Select the new group":"",
"This will change the password for the selected users":"",
"This will delete the selected VMs from the database":"",
"This will deploy the selected VMs on the chosen host":"",
"This will hold selected pending VMs from being deployed":"",
"This will initiate the shutdown process in the selected VMs":"",
"This will live-migrate the selected VMs to the chosen host":"",
"This will migrate the selected VMs to the chosen host":"",
"This will redeploy selected VMs (in UNKNOWN or BOOT state)":"",
"This will release held machines":"",
"This will resubmits VMs to PENDING state":"",
"This will resume selected stopped or suspended VMs":"",
"This will suspend selected machines":"",
"TM MAD":"",
"total":"",
"Total Leases":"",
"Total VM count":"",
"Total VM CPU":"",
"Total VM Memory":"",
"Transfer Manager":"",
"Type":"",
"Type of disk device to emulate.":"",
"Type of disk device to emulate: ide, scsi":"",
"Type of file system to be built. This can be any value understood by mkfs unix command.":"",
"Type of the image, explained in detail in the following section. If omitted, the default value is the one defined in oned.conf (install default is OS).":"",
"Udp black ports":"",
"Udp firewall mode":"",
"Udp white ports":"",
"Unauthorized":"",
"Unpublish":"",
"Update":"",
"Update a template":"",
"Update image template":"",
"Update network template":"",
"Update template":"",
"USB":"",
"Use":"",
"Used by VM":"",
"Used CPU":"",
"Used CPU (allocated)":"",
"Used CPU (real)":"",
"Used Mem (allocated)":"",
"Used Memory":"",
"Used Mem (real)":"",
"Useful for power management, for example, normally required for graceful shutdown to work":"",
"User":"",
"Username":"",
"User name and password must be filled in":"",
"Users":"",
"Value":"",
"Value of the context variable":"",
"Value of the custom variable":"",
"VCPU":"",
"Virtio":"",
"Virtio (KVM)":"",
"Virtualization Manager":"",
"Virtual Machine information":"",
"Virtual Machines":"",
"Virtual Network":"",
"Virtual network information":"",
"Virtual Network information":"",
"Virtual Network name missing!":"",
"Virtual Networks":"",
"Virtual Networks (total/public)":"",
"Virtual Network template (attributes)":"",
"VM information":"",
"VM Instance":"",
"VM Instances":"",
"VM log":"",
"VM MAD":"",
"VM Name":"",
"VM Network stats":"",
"#VMS":"",
"VM Save As":"",
"VM template":"",
"VM Template":"",
"VM Templates":"",
"VM Templates (total/public)":"",
"VNC":"",
"VNC Access":"",
"VNC connection":"",
"VNC Disabled":"",
"VNC Session":"",
"VNET ID":"",
"VN MAD":"",
"Welcome":"",
"Wizard":"",
"Wizard KVM":"",
"Wizard VMware":"",
"Wizard XEN":"",
"Write the image template here":"",
"Write the Virtual Machine template here":"",
"Write the Virtual Network template here":"",
"x509":"",
"XEN":"",
"Xen templates must specify a boot method":"",
"yes":"",
"Yes":"",
"You have not selected a template":"",
"You have to confirm this action.":"",
"You need to select something.":"",
};

Some files were not shown because too many files have changed in this diff Show More