From ff8e45daf339cfe1029e0ba50797a9c16af86170 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 10 Feb 2011 11:43:04 +0100 Subject: [PATCH 01/21] New probes and ganglia readers (from branch feature-446) Feature #244: Network interface statistics for KVM Feature #446: Probe to get monitoring info from ganglia Feature #472: Get cpu consumption from KVM VMs poll_xen_kvm.rb - This new probe gets information from XEN and KVM vms. If it is called with the name of a VM then its monitoring information is written in standard poll probe way. If called without parameters a base64-encoded yaml-representation of a hash containing the information about all the VMs running in the host is returned. poll_ganglia.rb - This probe gets information from ganglia pushed by gmetric. Consumes the information generated by poll_xen_kvm.rb ganglia_probe - Gets host monitoring information from ganglia. It pushes all metrics that start by OPENNEBULA_ Ganglia.rb - library that holds ganglia reading code --- share/etc/oned.conf | 9 + src/mad/ruby/Ganglia.rb | 151 +++++++++++++ src/vmm_mad/remotes/kvm/poll | 110 ++++++--- src/vmm_mad/remotes/poll_ganglia.rb | 61 +++++ src/vmm_mad/remotes/poll_xen_kvm.rb | 337 ++++++++++++++++++++++++++++ 5 files changed, 635 insertions(+), 33 deletions(-) create mode 100644 src/mad/ruby/Ganglia.rb create mode 100755 src/vmm_mad/remotes/poll_ganglia.rb create mode 100644 src/vmm_mad/remotes/poll_xen_kvm.rb diff --git a/share/etc/oned.conf b/share/etc/oned.conf index b8c88492bb..521791f9f5 100644 --- a/share/etc/oned.conf +++ b/share/etc/oned.conf @@ -149,6 +149,15 @@ IM_MAD = [ # arguments = "im_ec2/im_ec2.conf" ] #------------------------------------------------------------------------------- +#----------------------------------------------------------------------------- +# Ganglia Information Driver Manager Configuration +#----------------------------------------------------------------------------- +#IM_MAD = [ +# name = "im_ganglia", +# executable = "one_im_sh", +# arguments = "ganglia" ] +#----------------------------------------------------------------------------- + #------------------------------------------------------------------------------- # Dummy Information Driver Manager Configuration #------------------------------------------------------------------------------- diff --git a/src/mad/ruby/Ganglia.rb b/src/mad/ruby/Ganglia.rb new file mode 100644 index 0000000000..36448630cf --- /dev/null +++ b/src/mad/ruby/Ganglia.rb @@ -0,0 +1,151 @@ + +require 'socket' +require 'pp' +require 'rexml/document' + +begin + require 'rubygems' + require 'nokogiri' + $nokogiri_enabled=true +rescue LoadError + $nokogiri_enabled=false +end + + +# This class holds the parsing code of ganglia xml monitoring data +class GangliaHost + + # Gets monitoring data from ganglia or file + def self.new_with_options(host, options) + begin + if options[:file] + xml=File.read(options[:file]) + else + socket=TCPSocket.new(options[:host], options[:port]) + xml=socket.read + socket.close + end + rescue + STDERR.puts "Error reading ganglia data" + nil + end + + self.new(xml, host) + end + + def self.new_fom_file(host, file) + new_with_options(host, :file => file) + end + + def self.new_from_ganglia(host, server, port) + new_with_options(host, :host => server, :port => port) + end + + # Initializes the object with raw xml data and the host we + # want to monitor + def initialize(xml, host) + + # Checks if the host was specified as an IP address to + # choose the correct xpath string + if host.match(/(\d{1,3}\.){3}\d{1,3}/) + xpath="/GANGLIA_XML/CLUSTER/HOST[@IP='#{host}']" + else + xpath="/GANGLIA_XML/CLUSTER/HOST[@NAME='#{host}']" + end + + if $nokogiri_enabled + @doc=Nokogiri::XML.parse(xml) + @host=@doc.xpath(xpath) + else + @doc=REXML::Document.new(xml) + @host=@doc.root.elements[xpath] + end + end + + # Gets a metric value from the host + def get_value(name) + xpath="METRIC[@NAME='#{name}']" + + if $nokogiri_enabled + metric=@host.xpath(xpath).first + else + metric=@host.elements[xpath] + end + + if metric + if $nokogiri_enabled + metric.attr 'VAL' + else + metric.attributes['VAL'] + end + else + nil + end + end + + # The same as get_value + def [](name) + get_value(name) + end + + # Returns a hash with the hosts metrics + def to_hash + xpath='METRIC' + + if $nokogiri_enabled + values=Hash.new + + @host.xpath(xpath).each do |node| + values[node.attr('NAME')]=node.attr('VAL') + end + + values + else + values=Hash.new + + @host.elements.each(xpath) do |node| + values[node.attributes['NAME']]=node.attributes['VAL'] + end + + values + end + end + + # extract opennebula related metrics (start with OPENNEBULA_) and + # return a hash + def get_opennebula_metrics + all_info=self.to_hash + one_info=Hash.new + + keys=all_info.keys.select {|key| key.match(/^OPENNEBULA_.*/) } + + keys.each do |key| + m=key.match(/^OPENNEBULA_(.*)$/) + name=m[1] + + one_info[name]=all_info[key] + end + + one_info + end + + # extract base64 encoded yaml hash from OPENNEBULA_VMS_INFORMATION + # metric and return the hash with the VMs information + def get_vms_information + require 'base64' + require 'yaml' + + base64_info=self['OPENNEBULA_VMS_INFORMATION'] + + return nil if !base64_info + + info_yaml=Base64::decode64(base64_info) + info=YAML.load(info_yaml) + end + + # Helper class method to print monitoring values + def self.print_info(name, value) + return if value.nil? or value.to_s.strip.empty? + puts "#{name}=\"#{value}\"" + end +end diff --git a/src/vmm_mad/remotes/kvm/poll b/src/vmm_mad/remotes/kvm/poll index 54d9ff3e7d..56b3ba7fce 100755 --- a/src/vmm_mad/remotes/kvm/poll +++ b/src/vmm_mad/remotes/kvm/poll @@ -1,7 +1,7 @@ -#!/bin/bash +#!/usr/bin/env ruby # -------------------------------------------------------------------------- # -# Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) # +# 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 # @@ -16,43 +16,87 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -source $(dirname $0)/kvmrc +require 'pp' -AWK_SCRIPT=' -BEGIN { FS=":" }; +def dom_info(vmid) + text=`virsh dominfo #{vmid}` -$1=="Used memory" { - split($2, data, " "); - print "USEDMEMORY=" data[1] -}; + return nil if $?.exitstatus != 0 -$1=="State" { - vstat=$2; - gsub(" ", "", vstat); + lines=text.split(/\n/) - if(vstat=="running" || - vstat=="blocked" || - vstat=="shutdown" || - vstat=="dying") - state="a"; - else if(vstat=="paused") state="p"; - else if(vstat=="crashed") state="c"; - else state="u"; + data=lines.map do |line| + parts=line.split(/:\s+/) + end - print "STATE=" state -} -' + Hash[data] +end -deploy_id=$1 +def process_info(uuid) + ps=`ps auxwww | grep -- '-uuid #{uuid}' | grep -v grep` + ps.split(/\s+/) +end -virsh_cmd="virsh --connect $LIBVIRT_URI --readonly dominfo $deploy_id" -awk_cmd="awk \'$AWK_SCRIPT\'" +def get_state(state) + case state + when *%w{running blocked shutdown dying} + 'a' + when 'paused' + 'p' + when 'crashed' + 'c' + else + 'u' + end +end -info=`$virsh_cmd 2>/dev/null | awk "$AWK_SCRIPT"` +def print_data(name, value) + if value + "#{name}=\"#{value}\"" + else + nil + end +end -if [ -n "$info" ]; then - echo $info -else - echo STATE=d -fi -exit 0 +vm_id=ARGV[0] + +if !vm_id or vm_id.empty? + STDERR.puts "VM id not specified" + exit(-1) +end + +data=dom_info(vm_id) + +if !data + #STDERR.puts "Error getting info for '#{vm_id}'" + #exit(-1) + puts "STATUS=d" + exit +end + + +ps_data=process_info(data['UUID']) + + +monitor=Hash.new + +monitor[:cpu]=ps_data[2] +monitor[:resident_memory]=ps_data[5].to_i +monitor[:max_memory]=data['Max memory'].split(/\s+/).first.to_i + +monitor[:memory]=[monitor[:resident_memory], monitor[:max_memory]].max + + +state=data['State'] + + +monitor[:state]=get_state(data['State']) +monitor[:cpus]=data['CPU(s)'] + +values=Array.new + +values << print_data('STATUS', monitor[:state]) +values << print_data('USEDCPU', monitor[:cpu]) +values << print_data('USEDMEMORY', monitor[:memory]) + +puts values.zip.join(',') diff --git a/src/vmm_mad/remotes/poll_ganglia.rb b/src/vmm_mad/remotes/poll_ganglia.rb new file mode 100755 index 0000000000..81f20a9faa --- /dev/null +++ b/src/vmm_mad/remotes/poll_ganglia.rb @@ -0,0 +1,61 @@ +#!/usr/bin/env ruby + +# Adds current directory to the library search path (make the script +# compatible with ruby 1.9.2) +$: << '.' + +ONE_LOCATION=ENV["ONE_LOCATION"] + +if !ONE_LOCATION + RUBY_LIB_LOCATION="/usr/lib/one/ruby" +else + RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" +end + +$: << RUBY_LIB_LOCATION + +require 'socket' +require 'pp' +require 'rexml/document' +require 'Ganglia' + +############################# +## CONFIGURATION GOES HERE ## +############################# + +# host and port where to get monitoring information +GANGLIA_HOST='localhost' +GANGLIA_PORT=8649 + +# If this variable is set the the information will be read from that file +# otherwise it will get information from the ganglia endpoint +# defined previously +#GANGLIA_FILE='data.xml' + + +host=ARGV[0] +domain=ARGV[1] + +# Gets monitoring data from ganglia or file +begin + if defined?(GANGLIA_FILE) + ganglia=GangliaHost.new_from_file(host, GANGLIA_FILE) + else + ganglia=GangliaHost.new_from_ganglia(host, GANGLIA_HOST, GANGLIA_PORT) + end +rescue + STDERR.puts "Error reading ganglia data" + exit -1 +end + +dom_info=ganglia.get_vms_information + +if dom_info[domain] + info=dom_info[domain].map do |key, value| + "#{key.to_s.upcase}=\"#{value}\"" + end.join(' ') + + puts info +end + + diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb new file mode 100644 index 0000000000..eaf253a5a8 --- /dev/null +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -0,0 +1,337 @@ +#!/usr/bin/env ruby + +# -------------------------------------------------------------------------- # +# Copyright 2002-2010, 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. # +#--------------------------------------------------------------------------- # + +require 'pp' +require 'rexml/document' + +module KVM + CONF={ + :dominfo => 'virsh --connect LIBVIRT_URI --readonly dominfo', + :list => 'virsh --connect LIBVIRT_URI --readonly list', + :dumpxml => 'virsh --connect LIBVIRT_URI --readonly dumpxml', + :domifstat => 'virsh --connect LIBVIRT_URI --readonly domifstat', + 'LIBVIRT_URI' => 'qemu:///system' + } + + def self.get_vm_info(vm_id) + if !vm_id or vm_id.empty? + STDERR.puts "VM id not specified" + return nil + end + + data=dom_info(vm_id) + + if !data + return {:STATUS => 'd'} + end + + + ps_data=process_info(data['UUID']) + + + monitor=Hash.new + + monitor[:cpu]=ps_data[2] + monitor[:resident_memory]=ps_data[5].to_i + monitor[:max_memory]=data['Max memory'].split(/\s+/).first.to_i + + monitor[:memory]=[monitor[:resident_memory], monitor[:max_memory]].max + + + state=data['State'] + + + monitor[:state]=get_state(data['State']) + monitor[:cpus]=data['CPU(s)'] + + values=Hash.new + + values[:status]=monitor[:state] + values[:usedcpu]=monitor[:cpu] + values[:usedmemory]=monitor[:memory] + + values.merge!(get_interface_statistics(vm_id)) + + values + end + + def self.get_all_vm_info + names=get_vm_names + + vms=Hash.new + + names.each do |vm| + info=get_vm_info(vm) + info[:name]=vm + + vms[vm]=info + end + + vms + end + +private + + def self.virsh(command) + CONF[command].gsub('LIBVIRT_URI', CONF['LIBVIRT_URI']) + end + + def self.dom_info(vmid) + text=`#{virsh(:dominfo)} #{vmid}` + + return nil if $?.exitstatus != 0 + + lines=text.split(/\n/) + + data=lines.map do |line| + parts=line.split(/:\s+/) + end + + Hash[data] + end + + def self.get_vm_names + text=`#{virsh(:list)}` + + return [] if $?.exitstatus != 0 + + lines=text.split(/\n/)[2..-1] + + lines.map do |line| + line.split(/\s+/)[1] + end + end + + def self.get_interface_names(vmid) + text=`#{virsh(:dumpxml)} #{vmid}` + + doc=REXML::Document.new(text) + interfaces = [] + doc.elements.each('domain/devices/interface/target') do |ele| + interfaces << ele.attributes["dev"] + end + + interfaces + end + + def self.get_interface_statistics(vmid) + interfaces=get_interface_names(vmid) + + if interfaces && !interfaces.empty? + text=`#{virsh(:domifstat)} #{vmid} #{interfaces.join(' ')}` + + values={} + + text.each_line do |line| + columns=line.split(/\s+/) + case columns[1] + when 'rx_bytes' + values[:netrx]=columns[2] + when 'tx_bytes' + values[:nettx]=columns[2] + end + end + + values + else + {} + end + end + + def self.process_info(uuid) + ps=`ps auxwww | grep -- '-uuid #{uuid}' | grep -v grep` + ps.split(/\s+/) + end + + def self.get_state(state) + case state.gsub('-', '') + when *%w{running blocked shutdown dying} + 'a' + when 'paused' + 'p' + when 'crashed' + 'c' + else + 'u' + end + end +end + +module XEN + CONF={ + 'XM_POLL' => 'sudo /usr/sbin/xentop -bi2' + } + + def self.get_vm_info(vm_id) + get_all_vm_info[vm_id] + end + + def self.get_all_vm_info + begin + text=`#{CONF['XM_POLL']}` + lines=text.strip.split("\n") + block_size=lines.length/2 + valid_lines=lines.last(block_size) + + domain_lines=valid_lines[4..-1] + + domains=Hash.new + + domain_lines.each do |dom| + dom_data=dom.gsub('no limit', 'no-limit').strip.split + + dom_hash=Hash.new + + dom_hash[:name]=dom_data[0] + dom_hash[:state]=get_state(dom_data[1]) + dom_hash[:usedcpu]=dom_data[3] + dom_hash[:usedmem]=dom_data[4] + dom_hash[:nettx]=dom_data[10] + dom_hash[:netrx]=dom_data[11] + + domains[dom_hash[:name]]=dom_hash + end + + domains + rescue + STDERR.puts "Error executing #{CONF['XM_POLL']}" + nil + end + end + + def self.get_state(state) + case state + when *%w{r b s d} + 'a' + when 'p' + 'p' + when 'c' + 'c' + else + 'u' + end + end +end + + +def select_hypervisor + hypervisor=nil + params=ARGV.clone + + params.each_with_index do |param, index| + case param + when '--kvm' + hypervisor=KVM + ARGV.delete_at(index) + when '--xen' + hypervisor=XEN + ARGV.delete_at(index) + end + end + + if !hypervisor + case $0 + when %r{/kvm\.d/} + hypervisor=KVM + when %r{/xen\.d/} + hypervisor=XEN + end + end + + hypervisor +end + +def load_vars(hypervisor) + case hypervisor.name + when 'XEN' + file='xenrc' + vars=%w{XM_POLL} + when 'KVM' + file='kvmrc' + vars=%w{LIBVIRT_URI} + else + return + end + +begin + env=`. #{File.dirname($0)+"/#{file}"};env` + + lines=env.split("\n") + vars.each do |var| + lines.each do |line| + if a=line.match(/^(#{var})=(.*)$/) + hypervisor::CONF[var]=a[2] + break + end + end + end +rescue +end +end + + +def print_data(name, value) + if value + "#{name.to_s.upcase}=\"#{value}\"" + else + nil + end +end + + + +def print_one_vm_info(hypervisor, vm_id) + info=hypervisor.get_vm_info(vm_id) + + exit(-1) if !info + + #info.merge!(get_interface_statistics(vm_id)) + + values=info.map do |key, value| + print_data(key, value) + end + + puts values.zip.join(' ') +end + +def print_all_vm_info(hypervisor) + require 'yaml' + require 'base64' + + vms=hypervisor.get_all_vm_info + + puts Base64.encode64(vms.to_yaml).delete("\n") +end + +hypervisor=select_hypervisor + +if !hypervisor + STDERR.puts "Could not detect hypervisor" + exit(-1) +end + +load_vars(hypervisor) + +vm_id=ARGV[0] + +if vm_id + print_one_vm_info(hypervisor, vm_id) +else + print_all_vm_info(hypervisor) +end + From 7adf54e2f12e165015b97cf4cb097209947e4ee3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Feb 2011 15:57:11 +0100 Subject: [PATCH 02/21] Feature #482: install.sh -c now installs CLI, occi and ec2 client utilities. --- install.sh | 66 +++++++++++++++++++++++++++++++----------------------- 1 file changed, 38 insertions(+), 28 deletions(-) diff --git a/install.sh b/install.sh index 2c971bac5b..2d37ab91ff 100755 --- a/install.sh +++ b/install.sh @@ -39,7 +39,7 @@ usage() { echo " OpenNebula for the first time" echo "-d: target installation directory, if not defined it'd be root. Must be" echo " an absolute path." - echo "-c: install only 'occi' or 'ec2' client files" + echo "-c: install client utilities: OpenNebula cli, occi and ec2 client files" echo "-r: remove Opennebula, only useful if -d was not specified, otherwise" echo " rm -rf \$ONE_LOCATION would do the job" echo "-l: creates symlinks instead of copying files, useful for development" @@ -47,7 +47,7 @@ usage() { } #------------------------------------------------------------------------------- -TEMP_OPT=`getopt -o hkrlc:u:g:d: -n 'install.sh' -- "$@"` +TEMP_OPT=`getopt -o hkrlcu:g:d: -n 'install.sh' -- "$@"` if [ $? != 0 ] ; then usage @@ -70,7 +70,7 @@ while true ; do -k) INSTALL_ETC="no" ; shift ;; -r) UNINSTALL="yes" ; shift ;; -l) LINK="yes" ; shift ;; - -c) CLIENT="$2" ; shift 2;; + -c) CLIENT="yes" ; shift ;; -u) ONEADMIN_USER="$2" ; shift 2;; -g) ONEADMIN_GROUP="$2"; shift 2;; -d) ROOT="$2" ; shift 2 ;; @@ -79,14 +79,6 @@ while true ; do esac done -if echo "$CLIENT" | egrep -ivq '^(no|occi|ec2)$'; then - echo "ERROR: client '$CLIENT' not valid. Use either 'occi' or 'ec2'." - usage - exit 1 -else - CLIENT=`echo $CLIENT | tr [:upper:] [:lower:]` -fi - #------------------------------------------------------------------------------- # Definition of locations #------------------------------------------------------------------------------- @@ -195,20 +187,22 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/vmm/kvm" LIB_ECO_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula + $LIB_LOCATION/ruby/OpenNebula \ $LIB_LOCATION/ruby/cloud/ \ $LIB_LOCATION/ruby/cloud/econe" LIB_OCCI_CLIENT_DIRS="$LIB_LOCATION/ruby \ - $LIB_LOCATION/ruby/OpenNebula + $LIB_LOCATION/ruby/OpenNebula \ $LIB_LOCATION/ruby/cloud/occi" +LIB_CLI_DIRS="$LIB_LOCATION/ruby \ + $LIB_LOCATION/ruby/OpenNebula" + if [ "$CLIENT" = "no" ]; then MAKE_DIRS="$MAKE_DIRS $SHARE_DIRS $ETC_DIRS $LIB_DIRS $VAR_DIRS" -elif [ "$CLIENT" = "ec2" ]; then - MAKE_DIRS="$MAKE_DIRS $LIB_ECO_CLIENT_DIRS" -elif [ "$CLIENT" = "occi" ]; then - MAKE_DIRS="$MAKE_DIRS $LIB_OCCI_CLIENT_DIRS" +else + MAKE_DIRS="$MAKE_DIRS $LIB_ECO_CLIENT_DIRS $LIB_OCCI_CLIENT_DIRS \ + $LIB_CLI_DIRS" fi #------------------------------------------------------------------------------- @@ -248,13 +242,15 @@ INSTALL_FILES[27]="OCCI_LIB_FILES:$LIB_LOCATION/ruby/cloud/occi" INSTALL_FILES[28]="OCCI_BIN_FILES:$BIN_LOCATION" INSTALL_FILES[29]="MAN_FILES:$MAN_LOCATION" -INSTALL_ECO_CLIENT_FILES[0]="COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud" -INSTALL_ECO_CLIENT_FILES[1]="ECO_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/econe" -INSTALL_ECO_CLIENT_FILES[2]="ECO_BIN_CLIENT_FILES:$BIN_LOCATION" - -INSTALL_OCCI_CLIENT_FILES[0]="COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud" -INSTALL_OCCI_CLIENT_FILES[1]="OCCI_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/occi" -INSTALL_OCCI_CLIENT_FILES[2]="OCCI_BIN_CLIENT_FILES:$BIN_LOCATION" +INSTALL_CLIENT_FILES[0]="COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud" +INSTALL_CLIENT_FILES[1]="ECO_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/econe" +INSTALL_CLIENT_FILES[2]="ECO_BIN_CLIENT_FILES:$BIN_LOCATION" +INSTALL_CLIENT_FILES[3]="COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud" +INSTALL_CLIENT_FILES[4]="OCCI_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/occi" +INSTALL_CLIENT_FILES[5]="OCCI_BIN_CLIENT_FILES:$BIN_LOCATION" +INSTALL_CLIENT_FILES[6]="CLI_BIN_FILES:$BIN_LOCATION" +INSTALL_CLIENT_FILES[7]="CLI_LIB_FILES:$LIB_LOCATION/ruby" +INSTALL_CLIENT_FILES[8]="RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula" INSTALL_ETC_FILES[0]="ETC_FILES:$ETC_LOCATION" INSTALL_ETC_FILES[1]="VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2" @@ -609,6 +605,22 @@ OCCI_ETC_TEMPLATE_FILES="src/cloud/occi/etc/templates/common.erb \ src/cloud/occi/etc/templates/medium.erb \ src/cloud/occi/etc/templates/large.erb" +#----------------------------------------------------------------------------- +# CLI files +#----------------------------------------------------------------------------- + +CLI_LIB_FILES="src/mad/ruby/CommandManager.rb \ + src/cli/client_utilities.rb \ + src/cli/command_parse.rb \ + src/oca/ruby/OpenNebula.rb" + +CLI_BIN_FILES="src/cli/onevm \ + src/cli/onehost \ + src/cli/onevnet \ + src/cli/oneuser \ + src/cli/oneimage \ + src/cli/onecluster" + #----------------------------------------------------------------------------- # MAN files #----------------------------------------------------------------------------- @@ -661,10 +673,8 @@ do_file() { if [ "$CLIENT" = "no" ]; then INSTALL_SET=${INSTALL_FILES[@]} -elif [ "$CLIENT" = "occi" ]; then - INSTALL_SET=${INSTALL_OCCI_CLIENT_FILES[@]} -elif [ "$CLIENT" = "ec2" ]; then - INSTALL_SET=${INSTALL_ECO_CLIENT_FILES[@]} +else + INSTALL_SET=${INSTALL_CLIENT_FILES[@]} fi for i in ${INSTALL_SET[@]}; do From baa1d63ef3fe2648eb4401a184d50b1df60b0aed Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 10 Feb 2011 18:16:18 +0100 Subject: [PATCH 03/21] Changed install.sh to use another way of creating arrays Now we don't need to specify the array index so renumbering is not needed when adding new directories --- install.sh | 115 ++++++++++++++++++++++++++++------------------------- 1 file changed, 60 insertions(+), 55 deletions(-) diff --git a/install.sh b/install.sh index 2d37ab91ff..e11d90171a 100755 --- a/install.sh +++ b/install.sh @@ -210,63 +210,68 @@ fi # FILE DEFINITION, WHAT IS GOING TO BE INSTALLED AND WHERE #------------------------------------------------------------------------------- #------------------------------------------------------------------------------- +INSTALL_FILES=( + BIN_FILES:$BIN_LOCATION + INCLUDE_FILES:$INCLUDE_LOCATION + LIB_FILES:$LIB_LOCATION + RUBY_LIB_FILES:$LIB_LOCATION/ruby + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula + MADS_LIB_FILES:$LIB_LOCATION/mads + IM_PROBES_FILES:$VAR_LOCATION/remotes/im + IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d + IM_PROBES_XEN_FILES:$VAR_LOCATION/remotes/im/xen.d + VMM_SSH_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm + VMM_SSH_XEN_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen + IM_PROBES_FILES:$LIB_LOCATION/remotes/im + IM_PROBES_KVM_FILES:$LIB_LOCATION/remotes/im/kvm.d + IM_PROBES_XEN_FILES:$LIB_LOCATION/remotes/im/xen.d + VMM_SSH_KVM_SCRIPTS:$LIB_LOCATION/remotes/vmm/kvm + VMM_SSH_XEN_SCRIPTS:$LIB_LOCATION/remotes/vmm/xen + NFS_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/nfs + SSH_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/ssh + DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy + LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm + EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples + TM_EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples/tm + HOOK_SHARE_FILES:$SHARE_LOCATION/hooks + COMMON_CLOUD_LIB_FILES:$LIB_LOCATION/ruby/cloud + ECO_LIB_FILES:$LIB_LOCATION/ruby/cloud/econe + ECO_LIB_VIEW_FILES:$LIB_LOCATION/ruby/cloud/econe/views + ECO_BIN_FILES:$BIN_LOCATION + OCCI_LIB_FILES:$LIB_LOCATION/ruby/cloud/occi + OCCI_BIN_FILES:$BIN_LOCATION + MAN_FILES:$MAN_LOCATION +) -INSTALL_FILES[0]="BIN_FILES:$BIN_LOCATION" -INSTALL_FILES[1]="INCLUDE_FILES:$INCLUDE_LOCATION" -INSTALL_FILES[2]="LIB_FILES:$LIB_LOCATION" -INSTALL_FILES[3]="RUBY_LIB_FILES:$LIB_LOCATION/ruby" -INSTALL_FILES[4]="RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula" -INSTALL_FILES[5]="MADS_LIB_FILES:$LIB_LOCATION/mads" -INSTALL_FILES[6]="IM_PROBES_FILES:$VAR_LOCATION/remotes/im" -INSTALL_FILES[7]="IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d" -INSTALL_FILES[8]="IM_PROBES_XEN_FILES:$VAR_LOCATION/remotes/im/xen.d" -INSTALL_FILES[9]="VMM_SSH_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm" -INSTALL_FILES[10]="VMM_SSH_XEN_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen" -INSTALL_FILES[11]="IM_PROBES_FILES:$LIB_LOCATION/remotes/im" -INSTALL_FILES[12]="IM_PROBES_KVM_FILES:$LIB_LOCATION/remotes/im/kvm.d" -INSTALL_FILES[13]="IM_PROBES_XEN_FILES:$LIB_LOCATION/remotes/im/xen.d" -INSTALL_FILES[14]="VMM_SSH_KVM_SCRIPTS:$LIB_LOCATION/remotes/vmm/kvm" -INSTALL_FILES[15]="VMM_SSH_XEN_SCRIPTS:$LIB_LOCATION/remotes/vmm/xen" -INSTALL_FILES[16]="NFS_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/nfs" -INSTALL_FILES[17]="SSH_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/ssh" -INSTALL_FILES[18]="DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy" -INSTALL_FILES[19]="LVM_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/lvm" -INSTALL_FILES[20]="EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples" -INSTALL_FILES[21]="TM_EXAMPLE_SHARE_FILES:$SHARE_LOCATION/examples/tm" -INSTALL_FILES[22]="HOOK_SHARE_FILES:$SHARE_LOCATION/hooks" -INSTALL_FILES[23]="COMMON_CLOUD_LIB_FILES:$LIB_LOCATION/ruby/cloud" -INSTALL_FILES[24]="ECO_LIB_FILES:$LIB_LOCATION/ruby/cloud/econe" -INSTALL_FILES[25]="ECO_LIB_VIEW_FILES:$LIB_LOCATION/ruby/cloud/econe/views" -INSTALL_FILES[26]="ECO_BIN_FILES:$BIN_LOCATION" -INSTALL_FILES[27]="OCCI_LIB_FILES:$LIB_LOCATION/ruby/cloud/occi" -INSTALL_FILES[28]="OCCI_BIN_FILES:$BIN_LOCATION" -INSTALL_FILES[29]="MAN_FILES:$MAN_LOCATION" +INSTALL_CLIENT_FILES=( + COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud + ECO_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/econe + ECO_BIN_CLIENT_FILES:$BIN_LOCATION + COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud + OCCI_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/occi + OCCI_BIN_CLIENT_FILES:$BIN_LOCATION + CLI_BIN_FILES:$BIN_LOCATION + CLI_LIB_FILES:$LIB_LOCATION/ruby + RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula +) -INSTALL_CLIENT_FILES[0]="COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud" -INSTALL_CLIENT_FILES[1]="ECO_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/econe" -INSTALL_CLIENT_FILES[2]="ECO_BIN_CLIENT_FILES:$BIN_LOCATION" -INSTALL_CLIENT_FILES[3]="COMMON_CLOUD_CLIENT_LIB_FILES:$LIB_LOCATION/ruby/cloud" -INSTALL_CLIENT_FILES[4]="OCCI_LIB_CLIENT_FILES:$LIB_LOCATION/ruby/cloud/occi" -INSTALL_CLIENT_FILES[5]="OCCI_BIN_CLIENT_FILES:$BIN_LOCATION" -INSTALL_CLIENT_FILES[6]="CLI_BIN_FILES:$BIN_LOCATION" -INSTALL_CLIENT_FILES[7]="CLI_LIB_FILES:$LIB_LOCATION/ruby" -INSTALL_CLIENT_FILES[8]="RUBY_OPENNEBULA_LIB_FILES:$LIB_LOCATION/ruby/OpenNebula" - -INSTALL_ETC_FILES[0]="ETC_FILES:$ETC_LOCATION" -INSTALL_ETC_FILES[1]="VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2" -INSTALL_ETC_FILES[2]="VMM_SSH_ETC_FILES:$ETC_LOCATION/vmm_ssh" -INSTALL_ETC_FILES[3]="VMM_SH_ETC_FILES:$ETC_LOCATION/vmm_sh" -INSTALL_ETC_FILES[4]="IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2" -INSTALL_ETC_FILES[5]="TM_NFS_ETC_FILES:$ETC_LOCATION/tm_nfs" -INSTALL_ETC_FILES[6]="TM_SSH_ETC_FILES:$ETC_LOCATION/tm_ssh" -INSTALL_ETC_FILES[7]="TM_DUMMY_ETC_FILES:$ETC_LOCATION/tm_dummy" -INSTALL_ETC_FILES[8]="TM_LVM_ETC_FILES:$ETC_LOCATION/tm_lvm" -INSTALL_ETC_FILES[9]="HM_ETC_FILES:$ETC_LOCATION/hm" -INSTALL_ETC_FILES[10]="AUTH_ETC_FILES:$ETC_LOCATION/auth" -INSTALL_ETC_FILES[11]="ECO_ETC_FILES:$ETC_LOCATION" -INSTALL_ETC_FILES[12]="ECO_ETC_TEMPLATE_FILES:$ETC_LOCATION/ec2query_templates" -INSTALL_ETC_FILES[13]="OCCI_ETC_FILES:$ETC_LOCATION" -INSTALL_ETC_FILES[14]="OCCI_ETC_TEMPLATE_FILES:$ETC_LOCATION/occi_templates" +INSTALL_ETC_FILES=( + ETC_FILES:$ETC_LOCATION + VMM_EC2_ETC_FILES:$ETC_LOCATION/vmm_ec2 + VMM_SSH_ETC_FILES:$ETC_LOCATION/vmm_ssh + VMM_SH_ETC_FILES:$ETC_LOCATION/vmm_sh + IM_EC2_ETC_FILES:$ETC_LOCATION/im_ec2 + TM_NFS_ETC_FILES:$ETC_LOCATION/tm_nfs + TM_SSH_ETC_FILES:$ETC_LOCATION/tm_ssh + TM_DUMMY_ETC_FILES:$ETC_LOCATION/tm_dummy + TM_LVM_ETC_FILES:$ETC_LOCATION/tm_lvm + HM_ETC_FILES:$ETC_LOCATION/hm + AUTH_ETC_FILES:$ETC_LOCATION/auth + ECO_ETC_FILES:$ETC_LOCATION + ECO_ETC_TEMPLATE_FILES:$ETC_LOCATION/ec2query_templates + OCCI_ETC_FILES:$ETC_LOCATION + OCCI_ETC_TEMPLATE_FILES:$ETC_LOCATION/occi_templates +) #------------------------------------------------------------------------------- # Binary files, to be installed under $BIN_LOCATION From daa7fab3e193a95481a2adac49ed90ba7b7bd6b5 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Feb 2011 18:56:32 +0100 Subject: [PATCH 04/21] bug: Added paths to network utils in ebtables hooks --- share/hooks/ebtables-flush | 58 +++++++++++++++++++++++-------- share/hooks/ebtables-kvm | 71 ++++++++++++++++++++++---------------- share/hooks/ebtables-xen | 70 ++++++++++++++++++++++--------------- 3 files changed, 127 insertions(+), 72 deletions(-) diff --git a/share/hooks/ebtables-flush b/share/hooks/ebtables-flush index 1881b5aa34..049149c8bf 100755 --- a/share/hooks/ebtables-flush +++ b/share/hooks/ebtables-flush @@ -16,27 +16,50 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -def deactivate(rule) - system "sudo ebtables -D #{rule}" -end - -def get_interfaces - brctl_exit=`brctl show` - brctl_exit.split("\n")[1..-1].collect{|l| l.split.last } -end +#------------------------------------------------------------------------------ +# Configuration Options for the script. Change it to fit your installation +#------------------------------------------------------------------------------ +CONF = { + :ebtables => "sudo /sbin/ebtables", + :brctl => "/usr/sbin/brctl" +} +#------------------------------------------------------------------------------ RULE_TYPES=[ /-i ([\w\.\-]+) /, /-o ([\w\.\-]+) / ] +#------------------------------------------------------------------------------ +# Applies a given rule to the ebtables +#------------------------------------------------------------------------------ +def deactivate(rule) + system "#{CONF[:ebtables]} -D #{rule}" +end +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# Gets the interfaces attached to a given bridge +#------------------------------------------------------------------------------ +def get_interfaces + brctl_exit =`#{CONF[:brctl]} show` + brctl_exit.split("\n")[1..-1].collect{|l| l.split.last } +end +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# Gets the interfaces attached to a given bridge +#------------------------------------------------------------------------------ def get_rules - rules=Array.new + rules = Array.new + RULE_TYPES.each do |reg| - ebtables_exit=`sudo ebtables -L FORWARD` + ebtables_exit = `#{CONF[:ebtables]} -L FORWARD` + rules << ebtables_exit.split("\n")[3..-1].collect do |l| - line=l.strip - m=line.match(reg) + line = l.strip + m = line.match(reg) + if m interface=m[1] { @@ -48,14 +71,19 @@ def get_rules end end.compact end + rules.flatten end -# if executed on "done", we must wait a bit until the tap is detached from the bridge +############################################################################### +# Main +############################################################################### + +# on "done", it waits a bit until the tap is detached from the bridge sleep 1 -interfaces=get_interfaces -all_rules=get_rules +interfaces = get_interfaces +all_rules = get_rules all_rules.each do |rule| if !interfaces.include?(rule[:interface]) diff --git a/share/hooks/ebtables-kvm b/share/hooks/ebtables-kvm index b31ae342d7..2974090f59 100755 --- a/share/hooks/ebtables-kvm +++ b/share/hooks/ebtables-kvm @@ -16,60 +16,74 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -require 'pp' require 'rexml/document' -VM_NAME=ARGV[0] - -# Uncomment to act only on the listed bridges. -#FILTERED_BRIDGES = ['beth0'] +#------------------------------------------------------------------------------ +# Configuration Options for the script. Change it to fit your installation +#------------------------------------------------------------------------------ +CONF = { + :ebtables => "sudo /sbin/ebtables", + :brctl => "/usr/sbin/brctl", + :virsh => "virsh -c qemu:///system" +} +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# Applies a given rule to the ebtables +#------------------------------------------------------------------------------ def activate(rule) - system "sudo ebtables -A #{rule}" + system "#{CONF[:ebtables]} -A #{rule}" end - -def get_bridges - bridges = Hash.new - brctl_exit=`brctl show` +#------------------------------------------------------------------------------ + +#------------------------------------------------------------------------------ +# Gets the interfaces attached to a given bridge +#------------------------------------------------------------------------------ +def get_interfaces + bridges = Hash.new + brctl_exit =`#{CONF[:brctl]} show` cur_bridge = "" + brctl_exit.split("\n")[1..-1].each do |l| l = l.split + if l.length > 1 cur_bridge = l[0] + bridges[cur_bridge] = Array.new bridges[cur_bridge] << l[3] else bridges[cur_bridge] << l[0] end end + bridges end +#------------------------------------------------------------------------------ -def get_interfaces - bridges = get_bridges - if defined? FILTERED_BRIDGES - FILTERED_BRIDGES.collect {|k,v| bridges[k]}.flatten - else - bridges.values.flatten - end -end +############################################################################### +# Main +############################################################################### -nets=`virsh -c qemu:///system dumpxml #{VM_NAME}` +VM_NAME = ARGV[0] -doc=REXML::Document.new(nets).root +nets = `#{CONF[:virsh]} dumpxml #{VM_NAME}` +doc = REXML::Document.new(nets).root interfaces = get_interfaces() doc.elements.each('/domain/devices/interface') {|net| - tap=net.elements['target'].attributes['dev'] - if interfaces.include? tap - iface_mac=net.elements['mac'].attributes['address'] - - mac=iface_mac.split(':') - mac[-1]='00' - net_mac=mac.join(':') - + + tap = net.elements['target'].attributes['dev'] + if interfaces.include? tap + iface_mac = net.elements['mac'].attributes['address'] + + mac = iface_mac.split(':') + mac[-1] = '00' + + net_mac = mac.join(':') + in_rule="FORWARD -s ! #{net_mac}/ff:ff:ff:ff:ff:00 -o #{tap} -j DROP" out_rule="FORWARD -s ! #{iface_mac} -i #{tap} -j DROP" @@ -77,4 +91,3 @@ doc.elements.each('/domain/devices/interface') {|net| activate(out_rule) end } - diff --git a/share/hooks/ebtables-xen b/share/hooks/ebtables-xen index bff2864f29..2babd8de13 100755 --- a/share/hooks/ebtables-xen +++ b/share/hooks/ebtables-xen @@ -16,64 +16,78 @@ # limitations under the License. # #--------------------------------------------------------------------------- # -VM_NAME=ARGV[0] - -# Uncomment to act only on the listed bridges. -#FILTERED_BRIDGES = ['beth0'] +#------------------------------------------------------------------------------ +# Configuration Options for the script. Change it to fit your installation +#------------------------------------------------------------------------------ +CONF = { + :ebtables => "sudo /sbin/ebtables", + :brctl => "/usr/sbin/brctl", + :xm => "sudo /usr/sbin/xm" +} +#------------------------------------------------------------------------------ +#------------------------------------------------------------------------------ +# Applies a given rule to the ebtables +#------------------------------------------------------------------------------ def activate(rule) - system "sudo ebtables -A #{rule}" + system "#{CONF[:ebtables]} -A #{rule}" end +#------------------------------------------------------------------------------ -def get_bridges - bridges = Hash.new - brctl_exit=`brctl show` +#------------------------------------------------------------------------------ +# Gets the interfaces attached to a given bridge +#------------------------------------------------------------------------------ +def get_interfaces + bridges = Hash.new + brctl_exit =`#{CONF[:brctl]} show` cur_bridge = "" + brctl_exit.split("\n")[1..-1].each do |l| l = l.split + if l.length > 1 cur_bridge = l[0] + bridges[cur_bridge] = Array.new bridges[cur_bridge] << l[3] else bridges[cur_bridge] << l[0] end end + bridges end +#------------------------------------------------------------------------------ -def get_interfaces - bridges = get_bridges - if defined? FILTERED_BRIDGES - FILTERED_BRIDGES.collect {|k,v| bridges[k]}.flatten - else - bridges.values.flatten - end -end +############################################################################### +# Main +############################################################################### -vm_id=`sudo xm domid #{VM_NAME}`.strip -networks=`sudo xm network-list #{vm_id}`.split("\n")[1..-1] +VM_NAME = ARGV[0] + +vm_id =`#{CONF[:xm]} domid #{VM_NAME}`.strip +networks =`#{CONF[:xm]} network-list #{vm_id}`.split("\n")[1..-1] interfaces = get_interfaces networks.each {|net| - n=net.split - iface_id=n[0] - iface_mac=n[2] + n = net.split - tap="vif#{vm_id}.#{iface_id}" + iface_id = n[0] + iface_mac = n[2] + + tap = "vif#{vm_id}.#{iface_id}" if interfaces.include? tap - mac=iface_mac.split(':') - mac[-1]='00' - net_mac=mac.join(':') + mac = iface_mac.split(':') + mac[-1] = '00' + net_mac = mac.join(':') - in_rule="FORWARD -s ! #{net_mac}/ff:ff:ff:ff:ff:00 -o #{tap} -j DROP" - out_rule="FORWARD -s ! #{iface_mac} -i #{tap} -j DROP" + in_rule = "FORWARD -s ! #{net_mac}/ff:ff:ff:ff:ff:00 -o #{tap} -j DROP" + out_rule = "FORWARD -s ! #{iface_mac} -i #{tap} -j DROP" activate(in_rule) activate(out_rule) end } - From 6a3f565593ac023623df47f5b10d90701ddfd91e Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Thu, 10 Feb 2011 19:29:35 +0100 Subject: [PATCH 05/21] Feature #446: Added new probes for ganglia in install.sh --- install.sh | 26 ++++++++++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/install.sh b/install.sh index e11d90171a..cd789bf823 100755 --- a/install.sh +++ b/install.sh @@ -35,7 +35,7 @@ usage() { echo "-g: group of the user that will run opennebula, defults to user" echo " executing install.sh" echo "-k: keep configuration files of existing OpenNebula installation, useful" - echo " when upgrading. This flag should not be set when installing" + echo " when upgrading. This flag should not be set when installing" echo " OpenNebula for the first time" echo "-d: target installation directory, if not defined it'd be root. Must be" echo " an absolute path." @@ -176,6 +176,7 @@ LIB_DIRS="$LIB_LOCATION/ruby \ $LIB_LOCATION/remotes/im \ $LIB_LOCATION/remotes/im/kvm.d \ $LIB_LOCATION/remotes/im/xen.d \ + $LIB_LOCATION/remotes/im/ganglia.d \ $LIB_LOCATION/remotes/vmm/xen \ $LIB_LOCATION/remotes/vmm/kvm" @@ -183,6 +184,7 @@ VAR_DIRS="$VAR_LOCATION/remotes \ $VAR_LOCATION/remotes/im \ $VAR_LOCATION/remotes/im/kvm.d \ $VAR_LOCATION/remotes/im/xen.d \ + $VAR_LOCATION/remotes/im/ganglia.d \ $VAR_LOCATION/remotes/vmm/xen \ $VAR_LOCATION/remotes/vmm/kvm" @@ -220,13 +222,23 @@ INSTALL_FILES=( IM_PROBES_FILES:$VAR_LOCATION/remotes/im IM_PROBES_KVM_FILES:$VAR_LOCATION/remotes/im/kvm.d IM_PROBES_XEN_FILES:$VAR_LOCATION/remotes/im/xen.d + IM_PROBES_GANGLIA_FILES:$VAR_LOCATION/remotes/im/ganglia.d VMM_SSH_KVM_SCRIPTS:$VAR_LOCATION/remotes/vmm/kvm VMM_SSH_XEN_SCRIPTS:$VAR_LOCATION/remotes/vmm/xen + VMM_SSH_XEN_KVM_POLL:$VAR_LOCATION/remotes/vmm/kvm/poll + VMM_SSH_XEN_KVM_POLL:$VAR_LOCATION/remotes/vmm/xen/poll + VMM_SSH_GANGLIA_POLL:$VAR_LOCATION/remotes/vmm/kvm/poll_local + VMM_SSH_GANGLIA_POLL:$VAR_LOCATION/remotes/vmm/xen/poll_local IM_PROBES_FILES:$LIB_LOCATION/remotes/im IM_PROBES_KVM_FILES:$LIB_LOCATION/remotes/im/kvm.d IM_PROBES_XEN_FILES:$LIB_LOCATION/remotes/im/xen.d + IM_PROBES_GANGLIA_FILES:$LIB_LOCATION/remotes/im/ganglia.d VMM_SSH_KVM_SCRIPTS:$LIB_LOCATION/remotes/vmm/kvm VMM_SSH_XEN_SCRIPTS:$LIB_LOCATION/remotes/vmm/xen + VMM_SSH_XEN_KVM_POLL:$LIB_LOCATION/remotes/vmm/kvm/poll + VMM_SSH_XEN_KVM_POLL:$LIB_LOCATION/remotes/vmm/xen/poll + VMM_SSH_GANGLIA_POLL:$LIB_LOCATION/remotes/vmm/kvm/poll_local + VMM_SSH_GANGLIA_POLL:$LIB_LOCATION/remotes/vmm/xen/poll_local NFS_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/nfs SSH_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/ssh DUMMY_TM_COMMANDS_LIB_FILES:$LIB_LOCATION/tm_commands/dummy @@ -305,6 +317,7 @@ RUBY_LIB_FILES="src/mad/ruby/ActionManager.rb \ src/mad/ruby/CommandManager.rb \ src/mad/ruby/OpenNebulaDriver.rb \ src/mad/ruby/VirtualMachineDriver.rb \ + src/mad/ruby/Ganglia.rb \ src/cli/client_utilities.rb \ src/cli/command_parse.rb \ src/oca/ruby/OpenNebula.rb \ @@ -386,6 +399,13 @@ VMM_SSH_XEN_SCRIPTS="src/vmm_mad/remotes/xen/cancel \ src/vmm_mad/remotes/xen/save \ src/vmm_mad/remotes/xen/shutdown" +#----------------------------------------------------------------------------- +# VMM SH Driver xen/kvm scripts, to be installed under $REMOTES_LOCATION/vmm/* +#----------------------------------------------------------------------------- + +VMM_SSH_XEN_KVM_POLL="src/vmm_mad/remotes/poll_xen_kvm.rb" +VMM_SSH_GANGLIA_POLL="src/vmm_mad/remotes/poll_ganglia.rb" + #------------------------------------------------------------------------------- # Information Manager Probes, to be installed under $LIB_LOCATION/remotes #------------------------------------------------------------------------------- @@ -402,6 +422,8 @@ IM_PROBES_KVM_FILES="src/im_mad/remotes/kvm.d/kvm.rb \ src/im_mad/remotes/kvm.d/cpu.sh \ src/im_mad/remotes/kvm.d/name.sh" +IM_PROBES_GANGLIA_FILES="src/im_mad/remotes/ganglia.d/ganglia_probe" + #------------------------------------------------------------------------------- # Transfer Manager commands, to be installed under $LIB_LOCATION/tm_commands @@ -457,7 +479,7 @@ VMM_EC2_ETC_FILES="src/vmm_mad/ec2/vmm_ec2rc \ VMM_SSH_ETC_FILES="src/vmm_mad/ssh/vmm_sshrc \ src/vmm_mad/ssh/vmm_ssh_kvm.conf \ src/vmm_mad/ssh/vmm_ssh_xen.conf" - + VMM_SH_ETC_FILES="src/vmm_mad/sh/vmm_shrc" #------------------------------------------------------------------------------- From e69e8328e29c5351a63cfc3d04874bb014d6eaa1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Thu, 10 Feb 2011 19:46:58 +0100 Subject: [PATCH 06/21] Core Unit testing: bigger timeout for LCM tests, sometimes fails in overloaded infraestructure. --- src/lcm/test/LifeCycleManagerTest.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/lcm/test/LifeCycleManagerTest.cc b/src/lcm/test/LifeCycleManagerTest.cc index 3565bbf492..1fabeb6045 100644 --- a/src/lcm/test/LifeCycleManagerTest.cc +++ b/src/lcm/test/LifeCycleManagerTest.cc @@ -133,13 +133,13 @@ private: /** * Wait until the VM changes to the specified state. - * There is a time-out of 3 seconds. + * There is a time-out of 30 seconds. */ void wait_assert(VirtualMachine* vm, VirtualMachine::VmState state, VirtualMachine::LcmState lcm_state = VirtualMachine::RUNNING) { - int n_steps = 100; + int n_steps = 1000; int step = 30000; int i = 0; From 2acd334aeccc25e2a16f763a48c6e86d929ded44 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Thu, 10 Feb 2011 23:36:58 +0100 Subject: [PATCH 07/21] added license header to files --- src/mad/ruby/Ganglia.rb | 18 +++++++++++++++++- src/vmm_mad/remotes/poll_ganglia.rb | 16 ++++++++++++++++ 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/src/mad/ruby/Ganglia.rb b/src/mad/ruby/Ganglia.rb index 36448630cf..5929846e24 100644 --- a/src/mad/ruby/Ganglia.rb +++ b/src/mad/ruby/Ganglia.rb @@ -1,3 +1,18 @@ +# ----------------------------------------------------------------------------- +# Copyright 2002-2010, 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. +# ----------------------------------------------------------------------------- require 'socket' require 'pp' @@ -11,8 +26,9 @@ rescue LoadError $nokogiri_enabled=false end - +# ----------------------------------------------------------------------------- # This class holds the parsing code of ganglia xml monitoring data +# ----------------------------------------------------------------------------- class GangliaHost # Gets monitoring data from ganglia or file diff --git a/src/vmm_mad/remotes/poll_ganglia.rb b/src/vmm_mad/remotes/poll_ganglia.rb index 81f20a9faa..b285517fb5 100755 --- a/src/vmm_mad/remotes/poll_ganglia.rb +++ b/src/vmm_mad/remotes/poll_ganglia.rb @@ -1,5 +1,21 @@ #!/usr/bin/env ruby +# ----------------------------------------------------------------------------- +# Copyright 2002-2010, 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. +# ----------------------------------------------------------------------------- + # Adds current directory to the library search path (make the script # compatible with ruby 1.9.2) $: << '.' From 0d26966a5effbf3337c88be19e5a84c07a11e22e Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 11 Feb 2011 15:18:51 +0100 Subject: [PATCH 08/21] Make poll_xen_kvm.rb compatible with ruby 1.8.5 --- src/vmm_mad/remotes/poll_xen_kvm.rb | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb index eaf253a5a8..011d7964c4 100644 --- a/src/vmm_mad/remotes/poll_xen_kvm.rb +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -97,12 +97,15 @@ private return nil if $?.exitstatus != 0 lines=text.split(/\n/) + + hash=Hash.new data=lines.map do |line| parts=line.split(/:\s+/) + hash[parts[0]]=parts[1] end - Hash[data] + hash end def self.get_vm_names From 2129ca0d71a11c5b014326042c57945592d36c23 Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Fri, 11 Feb 2011 16:02:26 +0100 Subject: [PATCH 09/21] Added missing ganglia_probe --- src/im_mad/remotes/ganglia.d/ganglia_probe | 89 ++++++++++++++++++++++ 1 file changed, 89 insertions(+) create mode 100755 src/im_mad/remotes/ganglia.d/ganglia_probe diff --git a/src/im_mad/remotes/ganglia.d/ganglia_probe b/src/im_mad/remotes/ganglia.d/ganglia_probe new file mode 100755 index 0000000000..51bab34db8 --- /dev/null +++ b/src/im_mad/remotes/ganglia.d/ganglia_probe @@ -0,0 +1,89 @@ +#!/usr/bin/env ruby + +# Adds current directory to the library search path (make the script +# compatible with ruby 1.9.2) +$: << '.' + +ONE_LOCATION=ENV["ONE_LOCATION"] + +if !ONE_LOCATION + RUBY_LIB_LOCATION="/usr/lib/one/ruby" +else + RUBY_LIB_LOCATION=ONE_LOCATION+"/lib/ruby" +end + +$: << RUBY_LIB_LOCATION + +require 'socket' +require 'pp' +require 'rexml/document' +require 'Ganglia' + +############################# +## CONFIGURATION GOES HERE ## +############################# + +# host and port where to get monitoring information +GANGLIA_HOST='localhost' +GANGLIA_PORT=8649 + +# If this variable is set the the information will be read from that file +# otherwise it will get information from the ganglia endpoint +# defined previously +#GANGLIA_FILE='data.xml' + + +host=ARGV[1] + +# Gets monitoring data from ganglia or file +begin + if defined?(GANGLIA_FILE) + ganglia=GangliaHost.new_from_file(host, GANGLIA_FILE) + else + ganglia=GangliaHost.new_from_ganglia(host, GANGLIA_HOST, GANGLIA_PORT) + end +rescue + STDERR.puts "Error reading ganglia data" + exit -1 +end + +data=ganglia.to_hash + + +# Monitoring info extraction + +info=Hash.new + +total_cpu=data['cpu_num'].to_i*100 + +info["TOTALCPU"]=total_cpu +info["CPUSPEED"]=data['cpu_speed'] + +info["TOTALMEMORY"]=data['mem_total'] +info["USEDMEMORY"]=data['mem_total'].to_i-data['mem_free'].to_i +info["FREEMEMORY"]=data['mem_free'].to_i + +free_cpu=(data['cpu_idle'].to_f/100.0) * total_cpu + +info["FREECPU"]=free_cpu +info["USEDCPU"]=total_cpu - free_cpu + +info["NETRX"]=data['bytes_out'] +info["NETTX"]=data['bytes_in'] + +info["KVM_VERSION"]=data['KVM_VERSION'] +info["XEN_VERSION"]=data['XEN_VERSION'] + +# Get opennebula metrics from ganglia + +info.merge!(ganglia.get_opennebula_metrics) + + +# Print information + +info.each do |key, value| + GangliaHost.print_info(key, value) +end + + + From b98c4d8cee1d8d7679a21dc3f46c5abc4e5b15d5 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Mon, 14 Feb 2011 18:45:54 +0100 Subject: [PATCH 10/21] Various bug-fixes for MAD subsystem: * install.sh: 2 unneeded files were copied and then replaced by the generic poll_xen_kvm.rb file. * CommandManager.rb: Fix for retry condition. * poll_xen_kvm.rb: STATUS changed to STATE. The core couldn't identify the current state before. Deletion of quotes for values. This prevented the core from parsing correctly the monitoring values. Fix for hypervisor auto-detection. --- install.sh | 2 - src/mad/ruby/CommandManager.rb | 2 +- src/vmm_mad/remotes/kvm/poll | 102 ---------------------------- src/vmm_mad/remotes/poll_xen_kvm.rb | 10 +-- src/vmm_mad/remotes/xen/poll | 64 ----------------- 5 files changed, 6 insertions(+), 174 deletions(-) delete mode 100755 src/vmm_mad/remotes/kvm/poll delete mode 100755 src/vmm_mad/remotes/xen/poll diff --git a/install.sh b/install.sh index cd789bf823..b5c507ac43 100755 --- a/install.sh +++ b/install.sh @@ -381,7 +381,6 @@ VMM_SSH_KVM_SCRIPTS="src/vmm_mad/remotes/kvm/cancel \ src/vmm_mad/remotes/kvm/deploy \ src/vmm_mad/remotes/kvm/kvmrc \ src/vmm_mad/remotes/kvm/migrate \ - src/vmm_mad/remotes/kvm/poll \ src/vmm_mad/remotes/kvm/restore \ src/vmm_mad/remotes/kvm/save \ src/vmm_mad/remotes/kvm/shutdown" @@ -394,7 +393,6 @@ VMM_SSH_XEN_SCRIPTS="src/vmm_mad/remotes/xen/cancel \ src/vmm_mad/remotes/xen/deploy \ src/vmm_mad/remotes/xen/xenrc \ src/vmm_mad/remotes/xen/migrate \ - src/vmm_mad/remotes/xen/poll \ src/vmm_mad/remotes/xen/restore \ src/vmm_mad/remotes/xen/save \ src/vmm_mad/remotes/xen/shutdown" diff --git a/src/mad/ruby/CommandManager.rb b/src/mad/ruby/CommandManager.rb index f198981988..98a40703d8 100644 --- a/src/mad/ruby/CommandManager.rb +++ b/src/mad/ruby/CommandManager.rb @@ -166,7 +166,7 @@ class RemotesCommand < SSHCommand cmd.run end - while cmd.code != 0 or retries != 0 + while cmd.code != 0 and retries != 0 sleep 1 cmd.run retries = retries - 1 diff --git a/src/vmm_mad/remotes/kvm/poll b/src/vmm_mad/remotes/kvm/poll deleted file mode 100755 index 56b3ba7fce..0000000000 --- a/src/vmm_mad/remotes/kvm/poll +++ /dev/null @@ -1,102 +0,0 @@ -#!/usr/bin/env ruby - -# -------------------------------------------------------------------------- # -# 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. # -#--------------------------------------------------------------------------- # - -require 'pp' - -def dom_info(vmid) - text=`virsh dominfo #{vmid}` - - return nil if $?.exitstatus != 0 - - lines=text.split(/\n/) - - data=lines.map do |line| - parts=line.split(/:\s+/) - end - - Hash[data] -end - -def process_info(uuid) - ps=`ps auxwww | grep -- '-uuid #{uuid}' | grep -v grep` - ps.split(/\s+/) -end - -def get_state(state) - case state - when *%w{running blocked shutdown dying} - 'a' - when 'paused' - 'p' - when 'crashed' - 'c' - else - 'u' - end -end - -def print_data(name, value) - if value - "#{name}=\"#{value}\"" - else - nil - end -end - -vm_id=ARGV[0] - -if !vm_id or vm_id.empty? - STDERR.puts "VM id not specified" - exit(-1) -end - -data=dom_info(vm_id) - -if !data - #STDERR.puts "Error getting info for '#{vm_id}'" - #exit(-1) - puts "STATUS=d" - exit -end - - -ps_data=process_info(data['UUID']) - - -monitor=Hash.new - -monitor[:cpu]=ps_data[2] -monitor[:resident_memory]=ps_data[5].to_i -monitor[:max_memory]=data['Max memory'].split(/\s+/).first.to_i - -monitor[:memory]=[monitor[:resident_memory], monitor[:max_memory]].max - - -state=data['State'] - - -monitor[:state]=get_state(data['State']) -monitor[:cpus]=data['CPU(s)'] - -values=Array.new - -values << print_data('STATUS', monitor[:state]) -values << print_data('USEDCPU', monitor[:cpu]) -values << print_data('USEDMEMORY', monitor[:memory]) - -puts values.zip.join(',') diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb index 011d7964c4..ee2c7af62c 100644 --- a/src/vmm_mad/remotes/poll_xen_kvm.rb +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -37,7 +37,7 @@ module KVM data=dom_info(vm_id) if !data - return {:STATUS => 'd'} + return {:STATE => 'd'} end @@ -61,7 +61,7 @@ module KVM values=Hash.new - values[:status]=monitor[:state] + values[:state]=monitor[:state] values[:usedcpu]=monitor[:cpu] values[:usedmemory]=monitor[:memory] @@ -249,9 +249,9 @@ def select_hypervisor if !hypervisor case $0 - when %r{/kvm\.d/} + when %r{/vmm\/kvm/} hypervisor=KVM - when %r{/xen\.d/} + when %r{/vmm\/xen/} hypervisor=XEN end end @@ -290,7 +290,7 @@ end def print_data(name, value) if value - "#{name.to_s.upcase}=\"#{value}\"" + "#{name.to_s.upcase}=#{value}" else nil end diff --git a/src/vmm_mad/remotes/xen/poll b/src/vmm_mad/remotes/xen/poll deleted file mode 100755 index 7c45ddaae3..0000000000 --- a/src/vmm_mad/remotes/xen/poll +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash - -# -------------------------------------------------------------------------- # -# Copyright 2002-2010, 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. # -#--------------------------------------------------------------------------- # - -source $(dirname $0)/xenrc - -INFO_MEM=4 -INFO_CPU=3 -INFO_NETTX=10 -INFO_NETRX=11 -INFO_STATE=1 - - -AWK_SCRIPT=' -{ - mem=$5; - cpu=$4; - nettx=$11; - netrx=$12; - stat=$2 - gsub("-", "", stat); - - if(stat=="r" || - stat=="b" || - stat=="s" || - stat=="d") - state="a"; - else if(stat=="p") state="a"; - else if(stat=="c") state="c"; - else state="u"; - - print "USEDMEMORY=" mem " USEDCPU=" cpu " NETTX=" nettx " NETRX=" netrx " STATE=" state -} -' - -function get_info() { - $XM_POLL | egrep "^ *(migrating-)?$1 " | tail -1 | sed 's/^ *//' | sed 's/no limit/no_limit/' -} - - - -info=`get_info $1 2>/dev/null | awk "$AWK_SCRIPT"` - - -if [ -n "$info" ]; then - echo $info -else - echo STATE=d -fi -exit 0 From 2e8fd8e83adfcbe6a36bea46cb75142bb20cc835 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Mon, 14 Feb 2011 17:17:38 +0100 Subject: [PATCH 11/21] Capture XML parser exceptions in XMLUtils(cherry picked from commit f2d04f680e8ee8591782ff9e4fef3a3a6c5b76da) --- src/oca/ruby/OpenNebula/XMLUtils.rb | 32 ++++++++++++++++++----------- 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/src/oca/ruby/OpenNebula/XMLUtils.rb b/src/oca/ruby/OpenNebula/XMLUtils.rb index f9acffbee1..33a216d207 100644 --- a/src/oca/ruby/OpenNebula/XMLUtils.rb +++ b/src/oca/ruby/OpenNebula/XMLUtils.rb @@ -46,15 +46,19 @@ module OpenNebula # xml:: _String_ the XML document of the object # root_element:: _String_ Base xml element def initialize_xml(xml, root_element) - if NOKOGIRI - @xml = Nokogiri::XML(xml).xpath("/#{root_element}") - if @xml.size == 0 - @xml = nil - end + @xml = XMLElement.build_xml(xml, root_element) + + if OpenNebula.is_error?(@xml) + @xml = nil else - @xml = REXML::Document.new(xml).root - if @xml.name != root_element - @xml = nil + if NOKOGIRI + if @xml.size == 0 + @xml = nil + end + else + if @xml.name != root_element + @xml = nil + end end end end @@ -64,10 +68,14 @@ module OpenNebula # root_element:: _String_ Base xml element # [return] _XML_ object for the underlying XML engine def self.build_xml(xml, root_element) - if NOKOGIRI - doc = Nokogiri::XML(xml).xpath("/#{root_element}") - else - doc = REXML::Document.new(xml).root + begin + if NOKOGIRI + doc = Nokogiri::XML(xml).xpath("/#{root_element}") + else + doc = REXML::Document.new(xml).root + end + rescue Exception => e + return OpenNebula::Error.new(e.message) end return doc From 6f563ae73ff1ac6cfd641e0c93148d0fe8123aa3 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 15 Feb 2011 11:20:49 +0100 Subject: [PATCH 12/21] Add to_hash test for REXML(cherry picked from commit 258090afeadb61575290d30b5999c9ea9ffed891) --- src/oca/ruby/test/VirtualMachine_spec.rb | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/oca/ruby/test/VirtualMachine_spec.rb b/src/oca/ruby/test/VirtualMachine_spec.rb index f9e894532b..4fc6c90996 100644 --- a/src/oca/ruby/test/VirtualMachine_spec.rb +++ b/src/oca/ruby/test/VirtualMachine_spec.rb @@ -260,6 +260,23 @@ module OpenNebula @vm['HISTORY/HOSTNAME'].should eql('dummyhost') @vm['HISTORY/PSTIME'].should eql('1277375186') end + + it "should access an attribute using to_hash" do + vm_hash = @vm.to_hash + + vm_hash['VM']['NAME'].should eql('vm-example') + vm_hash['VM']['DEPLOY_ID'].should eql('dummy') + vm_hash['VM']['TEMPLATE']['MEMORY'].should eql('512') + vm_hash['VM']['ID'].should eql('6') + vm_hash['VM']['NAME'].should eql('vm-example') + vm_hash['VM']['LCM_STATE'].should eql('3') + vm_hash['VM']['DEPLOY_ID'].should eql('dummy') + vm_hash['VM']['TEMPLATE']['MEMORY'].should eql('512') + vm_hash['VM']['TEMPLATE']['CONTEXT']['DNS'].should eql('192.169.1.4') + vm_hash['VM']['TEMPLATE']['DISK'][1]['SIZE'].should eql('1024') + vm_hash['VM']['HISTORY']['HOSTNAME'].should eql('dummyhost') + vm_hash['VM']['HISTORY']['PSTIME'].should eql('1277375186') + end end From 9ece054d488a506bd70654c9a9bb520a3882be47 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Tue, 15 Feb 2011 15:17:25 +0100 Subject: [PATCH 13/21] Bugs in poll_xen_kvm.rb * Had wrong states for some unusual cases. * It also had to be made executable. Otherwise the remote monitoring fails. --- src/vmm_mad/remotes/poll_xen_kvm.rb | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) mode change 100644 => 100755 src/vmm_mad/remotes/poll_xen_kvm.rb diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb old mode 100644 new mode 100755 index ee2c7af62c..959a746936 --- a/src/vmm_mad/remotes/poll_xen_kvm.rb +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -163,14 +163,14 @@ private def self.get_state(state) case state.gsub('-', '') - when *%w{running blocked shutdown dying} + when *%w{running blocked shutdown dying idle} 'a' when 'paused' 'p' when 'crashed' - 'c' + 'e' else - 'u' + '-' end end end @@ -224,9 +224,9 @@ module XEN when 'p' 'p' when 'c' - 'c' + 'e' else - 'u' + '-' end end end From 41423417c038ac3aa70cffeebecbb812b43a792b Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 15 Feb 2011 22:22:19 +0100 Subject: [PATCH 14/21] Ganglia probes more reliable and bug fixes --- src/mad/ruby/Ganglia.rb | 2 +- src/vmm_mad/remotes/poll_ganglia.rb | 13 +++++++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/src/mad/ruby/Ganglia.rb b/src/mad/ruby/Ganglia.rb index 5929846e24..f9b3acb7e3 100644 --- a/src/mad/ruby/Ganglia.rb +++ b/src/mad/ruby/Ganglia.rb @@ -49,7 +49,7 @@ class GangliaHost self.new(xml, host) end - def self.new_fom_file(host, file) + def self.new_from_file(host, file) new_with_options(host, :file => file) end diff --git a/src/vmm_mad/remotes/poll_ganglia.rb b/src/vmm_mad/remotes/poll_ganglia.rb index b285517fb5..15981f22a0 100755 --- a/src/vmm_mad/remotes/poll_ganglia.rb +++ b/src/vmm_mad/remotes/poll_ganglia.rb @@ -64,11 +64,16 @@ rescue exit -1 end -dom_info=ganglia.get_vms_information +doms_info=ganglia.get_vms_information +dom_id=domain.split('-').last -if dom_info[domain] - info=dom_info[domain].map do |key, value| - "#{key.to_s.upcase}=\"#{value}\"" +# Get key one- or key from the hash +dom_info=doms_info[domain] +dom_info=doms_info[dom_id] if !dom_info + +if dom_info + info=dom_info.map do |key, value| + "#{key.to_s.upcase}=#{value}" end.join(' ') puts info From 1bb3a971b782c98deea96e19092ef0d4f946e6ef Mon Sep 17 00:00:00 2001 From: Javi Fontan Date: Tue, 15 Feb 2011 22:41:52 +0100 Subject: [PATCH 15/21] bug #462: set locales before executing commands in mads --- src/im_mad/remotes/run_probes | 2 ++ src/tm_mad/tm_common.sh | 2 ++ src/vmm_mad/remotes/kvm/kvmrc | 2 ++ src/vmm_mad/remotes/poll_xen_kvm.rb | 2 ++ src/vmm_mad/remotes/xen/xenrc | 2 ++ 5 files changed, 10 insertions(+) diff --git a/src/im_mad/remotes/run_probes b/src/im_mad/remotes/run_probes index 3209b285bc..d77b75714f 100755 --- a/src/im_mad/remotes/run_probes +++ b/src/im_mad/remotes/run_probes @@ -16,6 +16,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +export LANG=C + HYPERVISOR_DIR=$1.d ARGUMENTS=$* diff --git a/src/tm_mad/tm_common.sh b/src/tm_mad/tm_common.sh index cb087cc23e..6634c8afca 100644 --- a/src/tm_mad/tm_common.sh +++ b/src/tm_mad/tm_common.sh @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +export LANG=C + if [ -z "$ONE_LOCATION" ]; then ONE_LOCAL_VAR=/var/lib/one else diff --git a/src/vmm_mad/remotes/kvm/kvmrc b/src/vmm_mad/remotes/kvm/kvmrc index 0fc5d39ddd..abe2945774 100644 --- a/src/vmm_mad/remotes/kvm/kvmrc +++ b/src/vmm_mad/remotes/kvm/kvmrc @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +export LANG=C + export LIBVIRT_URI=qemu:///system export QEMU_PROTOCOL=qemu diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb index 959a746936..4b05d121d1 100755 --- a/src/vmm_mad/remotes/poll_xen_kvm.rb +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -19,6 +19,8 @@ require 'pp' require 'rexml/document' +ENV['LANG']='C' + module KVM CONF={ :dominfo => 'virsh --connect LIBVIRT_URI --readonly dominfo', diff --git a/src/vmm_mad/remotes/xen/xenrc b/src/vmm_mad/remotes/xen/xenrc index 0715fac7e3..6ce17b0c7a 100644 --- a/src/vmm_mad/remotes/xen/xenrc +++ b/src/vmm_mad/remotes/xen/xenrc @@ -14,6 +14,8 @@ # limitations under the License. # #--------------------------------------------------------------------------- # +export LANG=C + export XM_PATH="/usr/sbin/xm" export XM_CANCEL="sudo $XM_PATH destroy" export XM_CREATE="sudo $XM_PATH create" From ad44f1015791261e912dc6d7b17aab945eefb8a0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn?= Date: Wed, 16 Feb 2011 18:36:46 +0100 Subject: [PATCH 16/21] Bugs in poll_xen_kvm.rb for Xen monitoring: * usedmem changed to usedmemory * State detection fixed for Xen --- src/vmm_mad/remotes/poll_xen_kvm.rb | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/src/vmm_mad/remotes/poll_xen_kvm.rb b/src/vmm_mad/remotes/poll_xen_kvm.rb index 959a746936..5b02bbfb10 100755 --- a/src/vmm_mad/remotes/poll_xen_kvm.rb +++ b/src/vmm_mad/remotes/poll_xen_kvm.rb @@ -181,7 +181,13 @@ module XEN } def self.get_vm_info(vm_id) - get_all_vm_info[vm_id] + data = get_all_vm_info[vm_id] + + if !data + return {:STATE => 'd'} + else + return data + end end def self.get_all_vm_info @@ -203,7 +209,7 @@ module XEN dom_hash[:name]=dom_data[0] dom_hash[:state]=get_state(dom_data[1]) dom_hash[:usedcpu]=dom_data[3] - dom_hash[:usedmem]=dom_data[4] + dom_hash[:usedmemory]=dom_data[4] dom_hash[:nettx]=dom_data[10] dom_hash[:netrx]=dom_data[11] @@ -218,7 +224,7 @@ module XEN end def self.get_state(state) - case state + case state.gsub('-', '')[-1..-1] when *%w{r b s d} 'a' when 'p' From 5e4cf53a15815003bd973b49c9c1e56a1aabc764 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Fri, 18 Feb 2011 11:13:51 +0100 Subject: [PATCH 17/21] Fix REXML and Nokogiri to_hash output --- src/oca/ruby/OpenNebula/XMLUtils.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/oca/ruby/OpenNebula/XMLUtils.rb b/src/oca/ruby/OpenNebula/XMLUtils.rb index 33a216d207..c532efd812 100644 --- a/src/oca/ruby/OpenNebula/XMLUtils.rb +++ b/src/oca/ruby/OpenNebula/XMLUtils.rb @@ -246,7 +246,7 @@ module OpenNebula if NOKOGIRI array = element.children - if array.length == 1 and array.first.text? + if array.length==1 and (array.first.text? or array.first.cdata?) r = array.first.text else r = {} @@ -257,8 +257,8 @@ module OpenNebula } end else + r = {} if element.has_elements? - r = {} element.each_element { |c| to_hash(r, c) } elsif element.has_text? r = element.text From ef738d5d51cefff55f7ee2aec4f7721473ebeb0e Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Mon, 21 Feb 2011 17:25:29 +0100 Subject: [PATCH 18/21] Bug #496: Fixed bug in sed script in the LVM driver --- src/tm_mad/lvm/tm_lvmrc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tm_mad/lvm/tm_lvmrc b/src/tm_mad/lvm/tm_lvmrc index f90f9b133e..cd005003d1 100644 --- a/src/tm_mad/lvm/tm_lvmrc +++ b/src/tm_mad/lvm/tm_lvmrc @@ -28,7 +28,7 @@ DEFAULT_LV_SIZE="1G" # -------------------------------------------------------------------------- # function get_vid { - echo $1 |$SED -e 's%^.*/\([^/]*\)/images.*$%\1%' + echo $1 |$SED -e 's%^.*/([^/]*)/images.*$%\1%' } function get_lv_name { From b8f2b6e1fe35fc1522919e7c97fb945952a9df7d Mon Sep 17 00:00:00 2001 From: "Daniel Molina, Hector Sanjuan and Jaime Melis" Date: Mon, 21 Feb 2011 18:16:06 +0100 Subject: [PATCH 19/21] Feature #495: OpenNebula Sunstone Squashed commit of the following: commit 968e8868d9d02762423df6b7abe76d91c2fd9484 Author: Jaime Melis Date: Mon Feb 21 18:13:29 2011 +0100 Feature #495: Updated copyright banners commit 5ebd184e9d771e0bc9865bae219019b56e35ba5b Author: Hector Sanjuan Date: Mon Feb 21 13:54:50 2011 +0100 Feature #495: Cleaned up some css and added rules for add/remove from select buttons commit 1dbca245d57584d9c4fb225476ca32252fc3c834 Author: Hector Sanjuan Date: Mon Feb 21 13:22:51 2011 +0100 Feature #495: Fixed Chrome selects listeners commit a6721b729d0e609b012b6491988aeb5e8b634b07 Author: Hector Sanjuan Date: Mon Feb 21 12:42:35 2011 +0100 Feature #495: Removed pipe at the end of last action block commit ec42344c3bbe56a12b064f9e13676518dffabf15 Merge: 15045ac 926e102 Author: Hector Sanjuan Date: Mon Feb 21 11:47:42 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 926e102006b7ad428155232edd7a968401adfe50 Merge: 41e8ba2 80145ad Author: Jaime Melis Date: Fri Feb 18 18:12:12 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 41e8ba2435c53c26801f607300f30b49029430a3 Author: Jaime Melis Date: Fri Feb 18 18:12:03 2011 +0100 Feature #495: Fixed tooltips in Chrome commit 80145ada3c85daa2a8ab2357fc561c12ddb9c5a5 Merge: a93339a 9074b8c Author: Daniel Molina Date: Fri Feb 18 16:11:50 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit a93339a61794eae1d11110a0d6bafcf5f7490dc1 Author: Daniel Molina Date: Fri Feb 18 16:11:16 2011 +0100 Feature #495: Add delete host with running vms test commit f1da04a87bc1c35593104eb7a55f6569955db2b4 Author: Jaime Melis Date: Fri Feb 18 16:02:45 2011 +0100 Feature #495: Fixed syntax errors for the Safari browser commit 15045acf0658b908a7c7677e502daf0348972f5a Merge: e8f1e81 9074b8c Author: Hector Sanjuan Date: Fri Feb 18 15:30:01 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 9074b8c76916ded6045c14935090e38ecebc0690 Author: Jaime Melis Date: Fri Feb 18 15:27:58 2011 +0100 Feature #495: Fixed bug in opennebula.js, when sending the timout, it's not encoded to JSON anymore commit e8f1e818d47b33c1257eae24d836fe129df38c7b Merge: 3d06c22 44d244e Author: Hector Sanjuan Date: Fri Feb 18 15:23:08 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 3d06c2263cd9123ec7338d2dc15cf05b39e2e8ef Author: Hector Sanjuan Date: Fri Feb 18 15:22:57 2011 +0100 Feature #495: Fixed some margins commit 44d244e009c84e789276a424f76051497f53581d Merge: 9cb5aed b5a8544 Author: Jaime Melis Date: Fri Feb 18 15:21:11 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 9cb5aed3e820883fdcf479ac14ad5761bc0f410e Author: Jaime Melis Date: Fri Feb 18 15:20:51 2011 +0100 Feature #495: Fixed bug hiding unauthorized divs for users other than oneadmin commit b5a85445b5d764adbee4011831d308b37b903a06 Merge: 76524ba 3af2d3a Author: Hector Sanjuan Date: Fri Feb 18 15:14:20 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 76524baefb5bf8d24ced0aab0fe84af416d7c0bc Author: Hector Sanjuan Date: Fri Feb 18 15:14:03 2011 +0100 Feature #495: Changed add lease buttons commit 3a6a131483baacc5b594b86ab31d45d8aa6939d5 Author: Jaime Melis Date: Fri Feb 18 14:51:42 2011 +0100 Feature #495: Registered a new type of error: auth_error commit 04001db75d6baa6661e4876018c64db7fab46387 Author: Hector Sanjuan Date: Fri Feb 18 14:51:35 2011 +0100 Feature #495: Reduce border radious for select lists commit 7e39a5e789e3e48668ddc7f793a8026cc2d352a5 Author: Hector Sanjuan Date: Fri Feb 18 14:45:51 2011 +0100 Feature #495: List select width reduced 5 pixels commit a533b577167c8cddb93d2df67c63115d4ae4cf28 Author: Hector Sanjuan Date: Fri Feb 18 14:40:49 2011 +0100 Feature #495: Removed * on mandatory items commit b0f18e9d7f30eae0318a56e7fb1fa367942276ea Author: Jaime Melis Date: Fri Feb 18 14:37:40 2011 +0100 Feature #495: Implemented image_type and resource_state for images in opennebula.rg commit 3af2d3ad2c3dcc1893b588f8c6bc139ecd1914f1 Merge: 1553443 c601772 Author: Jaime Melis Date: Fri Feb 18 14:31:34 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui Conflicts: public/js/one-ui_views.js commit 1553443dd62357f5f52daa8bff25b192b86e63a5 Author: Jaime Melis Date: Fri Feb 18 14:29:28 2011 +0100 Feature #495: Fix bugs when user is not oneadmin. commit c601772ba81254951c006ce09065b987921c7d85 Author: Hector Sanjuan Date: Fri Feb 18 13:52:38 2011 +0100 Feature #495: Add new host button label changed to "+ New Host" as there is "+ New Cluster" as well. commit 4e68def72852e9cf9e2b5c4bb0bfb0a585302c82 Author: Hector Sanjuan Date: Fri Feb 18 13:52:06 2011 +0100 Feature #495: Added seconds to start times commit 3fa154b569b9180f3d828f83dd9c7791d0057729 Author: Hector Sanjuan Date: Fri Feb 18 13:46:12 2011 +0100 Feature #495: Close select lists when clicked anywhere commit 1575219b9521bbfe4f0ab5fc1271adcf68822aa6 Author: Hector Sanjuan Date: Fri Feb 18 13:39:52 2011 +0100 Feature #495: Changed select list color on hover commit 0f9bf69bf4486e596a744a57ff85498c80b7583e Merge: 3493e72 506c6e8 Author: Hector Sanjuan Date: Fri Feb 18 13:38:43 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 3493e72b4ab03a0c2952113480f83f3aa443d608 Author: Hector Sanjuan Date: Fri Feb 18 13:38:26 2011 +0100 Feature #495: Replaced spinner commit b1637c28743f0f2a54df668154c01d95182e035c Author: Hector Sanjuan Date: Fri Feb 18 13:30:37 2011 +0100 Feature #495: Removed enabled column for users commit 296e906d5d96122dbaceddc4fafa891f3a26c85e Author: Hector Sanjuan Date: Fri Feb 18 13:30:12 2011 +0100 Feature #495: Fixed inputs margins commit a9630974db92d80ece0b6bf218673d0eba360526 Author: Hector Sanjuan Date: Fri Feb 18 13:22:34 2011 +0100 Feature #495: Darked overlay commit b193f37e235161d3603895a5e933b532356c2388 Merge: 2a137c1 506c6e8 Author: Jaime Melis Date: Fri Feb 18 13:13:00 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit cf0cddf496f49df9a404f24917d67739f5c23706 Author: Hector Sanjuan Date: Fri Feb 18 13:12:25 2011 +0100 Feature #495: Added titles to the advanced create dialogs commit 506c6e8d7ac8766a3f2791d4c5c2b1626f0990b2 Author: Daniel Molina Date: Fri Feb 18 13:12:23 2011 +0100 Feature #495: Fix cookie parameters error commit 2a137c1d02d9692be33ec43b6cf16bf79139e7af Merge: 023a436 5d89ff3 Author: Jaime Melis Date: Fri Feb 18 13:12:13 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 5d89ff320a2f0ed37ade65b141a98d319b8e050f Author: Daniel Molina Date: Fri Feb 18 13:08:46 2011 +0100 Feature #495: Add user_id cookie commit 0a08fa32afe9ac0c8f42e31ac6eeea3a46c46cba Author: Hector Sanjuan Date: Fri Feb 18 13:00:42 2011 +0100 Feature #495: Hack to use the grey icon set Renamed the grey icon file as the black icon file commit 023a43678cf4b72e428c4e28f2e6723be95ebd2b Merge: 6f53880 0b392f9 Author: Jaime Melis Date: Fri Feb 18 12:58:37 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 0b392f9daa58f198f6d34190ad3f6a99d13a6896 Merge: 2ced9e4 6416601 Author: Daniel Molina Date: Fri Feb 18 12:58:03 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 6f5388022344486c10bd3e890c7f55e43ac71758 Merge: c4822a3 6416601 Author: Jaime Melis Date: Fri Feb 18 12:52:58 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit c4822a3340580b477c60a63e4f92439383adeac3 Author: Jaime Melis Date: Fri Feb 18 12:52:53 2011 +0100 Feature #495: Do not show the 'users' tab if user is not oneadmin commit 64166011ece347794a53600fbe5e9ed3a7fd0dee Merge: 202de2d 9a96d91 Author: Hector Sanjuan Date: Fri Feb 18 12:50:14 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 202de2db31ccb438b113670f5429c40110436970 Author: Hector Sanjuan Date: Fri Feb 18 12:49:26 2011 +0100 Feature #495: Multiple style changes assigned to me commit 2ced9e471f7f22a61795387a98d0f568bb632451 Author: Daniel Molina Date: Fri Feb 18 12:48:35 2011 +0100 Feature #495: Add user_id in the cookie string commit 401e6f7d3c9b29ec4eff94c10fffc8d484199275 Author: Jaime Melis Date: Fri Feb 18 12:33:05 2011 +0100 Feature #495: AutoRefresh request don't extend the cookies lifetime. commit 9a96d911da49816a4af2dc78d772d28f1d493e54 Author: Daniel Molina Date: Fri Feb 18 12:21:27 2011 +0100 Feature #495: Add user_flag for pools commit 8ec0892c468e494374e5cd80858bc7437f88cbaf Author: Jaime Melis Date: Fri Feb 18 12:12:45 2011 +0100 Feature #495: Display a loading message when clicking on a datatables row. commit 220876ece63a58733cdbad2f3466a2db47b0bb71 Author: Hector Sanjuan Date: Fri Feb 18 10:54:38 2011 +0100 Feature #495: Added missing return false in clicks in the NEw VM dialog commit e46b0b6e1bda16cabd943011fc154ecfdc4f853c Author: Daniel Molina Date: Fri Feb 18 01:17:54 2011 +0100 Feature #495: Add vm0 example commit 2439e510f933c991eba07db3de032bce2fa96734 Merge: c10a324 7ff7fe5 Author: Daniel Molina Date: Fri Feb 18 01:17:02 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit c10a32460fe78f97a1e86ce1e74ab1b17f18e6e8 Author: Daniel Molina Date: Fri Feb 18 01:16:25 2011 +0100 Feature #495: Add test examples commit 74eea7fb908525ff25ffbfbc4b52c30da9f99553 Author: Daniel Molina Date: Fri Feb 18 01:16:05 2011 +0100 Feature #495: Fix bugs in server commit 16673388905d757dfdc37c4c979efff91a3309a7 Author: Daniel Molina Date: Fri Feb 18 01:15:23 2011 +0100 Feature #495: Fix tests commit 7ff7fe5b22e331101b695bf4cf97afd293f3d9c7 Merge: 72eb52c 9a8c548 Author: Jaime Melis Date: Thu Feb 17 23:00:19 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 9a8c548aa870ca987af46b45be51544bce11dfb1 Author: Hector Sanjuan Date: Thu Feb 17 16:59:11 2011 +0100 Feature #495: Changed "more actions" text into "previous action" commit 8887c48476c7f9e977083b78b3ebb9cf1ee744ee Author: Hector Sanjuan Date: Thu Feb 17 16:52:39 2011 +0100 Feature #495: Changed "more actions" text into "previous action" commit 7e30a15c2082e62f7c4fc02f7ff3eea8b0d1f349 Merge: 2016ab4 d0851c6 Author: Hector Sanjuan Date: Thu Feb 17 16:47:37 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 2016ab4f9406d77a1e3dea7d13e9d5991122b51b Author: Hector Sanjuan Date: Thu Feb 17 16:46:47 2011 +0100 Feature #495: Added bars for cpu use and memory use in the hosts view Revert if not good looking.... commit 72eb52c74921748b2d9a0cd851b7f27cc5279d69 Author: Jaime Melis Date: Thu Feb 17 16:39:29 2011 +0100 Feature #495: Removed autofilter of created VM commit 74831e35bfeca4033edda50113e4c27037135cb8 Author: Jaime Melis Date: Thu Feb 17 15:59:09 2011 +0100 Feature #495: focus on the login username input by default commit d1baf66c1d24f9bd03c06c0f59608b784cdb90be Author: Jaime Melis Date: Thu Feb 17 15:27:21 2011 +0100 Feature #495: Fixed selects in Chrome commit d0851c67cda267a2129cd644dd9dbb74dfad3139 Author: Jaime Melis Date: Thu Feb 17 14:21:15 2011 +0100 Feature #495: Layout tweaks: - background colors - menu gradient - centered sunstone logo image in login screen - better login screen commit 92a71420a3aaca49d3a02c9776f6c2be238cd5ba Author: Hector Sanjuan Date: Thu Feb 17 13:53:38 2011 +0100 Feature #495: Add network with network name and not ID in the new VM dialog commit 7582cfd2f0593b41043dc55944b68540b25cd957 Author: Jaime Melis Date: Thu Feb 17 11:52:00 2011 +0100 Feature #495: Reverted: 9d7ccc7. REXML and NOKOGIRI used to return different objects when the request pool is empty. OpenNebula has been modified to return when using REXML the same as NOKOGIRI commit 524201a2d8c09d2db6957cedbdc3cde581dd41a9 Author: Jaime Melis Date: Thu Feb 17 08:52:02 2011 +0100 Feature #495: Reformat error messages commit 3d818f305005b6ac02ae59274abbabc38c73e447 Author: Jaime Melis Date: Wed Feb 16 19:51:17 2011 +0100 Feature #495: removed debugging info commit d7b005309fdb90fd8d1b4b4a3c0083db0ef39e92 Author: Jaime Melis Date: Wed Feb 16 19:50:32 2011 +0100 Feature #495: Do not update if filter is set commit f440d9f3d0066923837f87b8cdda93f5e7ec0a3d Author: Jaime Melis Date: Wed Feb 16 19:25:50 2011 +0100 Feature #495: Human readable memory sizes commit a12b0ff75b124b9b41e02ce3de33ebe36d180aa2 Author: Jaime Melis Date: Wed Feb 16 18:43:53 2011 +0100 Feature #495: Implemented the authentication information in the javascript side commit bee8516256e80bdd3b0485a63f194f86e0e40125 Author: Jaime Melis Date: Wed Feb 16 18:42:53 2011 +0100 Feature #495: Changed logo colors commit 50cbf71b2754299fc75de15231a46a7eecb04e53 Merge: c889b11 598c34b Author: Jaime Melis Date: Wed Feb 16 17:54:49 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 598c34b52d8050f3ac8cf3a2e6c3f7c59e2db27c Author: Daniel Molina Date: Wed Feb 16 17:49:34 2011 +0100 Feature #495: Add username cookie commit c889b1192ecd47bb5ea42c40c15212eac4c904c6 Author: Jaime Melis Date: Wed Feb 16 17:38:21 2011 +0100 Feature #495: Revert "Modified width of datatables columns." This reverts commit 89f686f53b5e8ebe5d77af2627af21e6bfa01f7c. commit 6e725e9eed8aa74f908d8e066a5dc420389de920 Author: Jaime Melis Date: Wed Feb 16 17:33:35 2011 +0100 Feature #495: Changed running time to start time commit e53bbac29c4bf40478b073d7a8d000697fd1fd0c Author: Jaime Melis Date: Wed Feb 16 17:01:51 2011 +0100 Feature #495: Modified width of datatables columns. commit 31ea3d9280cd3a17e78012ff9bee96996d216db2 Author: Jaime Melis Date: Wed Feb 16 16:50:01 2011 +0100 Feature #495: Use the same font in all cases commit dbf9be6397415cadbf0cc5afab33254b51de4f5b Author: Jaime Melis Date: Wed Feb 16 16:31:28 2011 +0100 Feature #495: Changed the logo image commit c31be1d5c1d5b4e47d1c25c50bf7ac22ae33ccd6 Author: Jaime Melis Date: Tue Feb 15 19:58:11 2011 +0100 Feature #495: Completed the migration to the new prototype methods in opennebula.js commit d3a975ecdec256ff5deab3e696e2d6b25411dfca Author: Jaime Melis Date: Tue Feb 15 17:47:50 2011 +0100 Feature #495: Changed all of the methods of OpenNebula.js to accept always only a single hash as an argument. Modified many library calls in one-ui_view.js to the new methods prototype -- missing the multi-option ones. Modified login.js to the new methods prototype commit 44b65718cb8d2abe65847e344c31a67e456a8271 Author: Jaime Melis Date: Mon Feb 14 17:12:17 2011 +0100 Feature #495: changed callback for success and callback_error for error commit ecc06b3a6f539a1d8f12b97094deed9ab2f354d4 Author: Jaime Melis Date: Mon Feb 14 17:07:30 2011 +0100 Feature #495: Changed all functions in opennebula.js to accept a Hash instead of a variable number of arguments commit 3848db7d1a618bc8b292897586235dce1c5afcf1 Merge: 4ba4a5f 54a8262 Author: Hector Sanjuan Date: Wed Feb 16 14:01:43 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 4ba4a5fb60952550b5271358da411cf50eb2b428 Author: Hector Sanjuan Date: Wed Feb 16 13:59:56 2011 +0100 Feature #495: Turned the add predifined/manual network button set into normal radio button commit 1377cf4aa732deed8df4eb82f9189b498bea34f0 Author: Hector Sanjuan Date: Wed Feb 16 13:56:28 2011 +0100 Feature #495: Bus,target,driver parameters where not showing up when adding disks/images. commit c1a4a0ee52a2d0d5d056818ceb0544e18eecbb2f Author: Hector Sanjuan Date: Wed Feb 16 13:46:25 2011 +0100 Feature #495: Disable previous action button in all cases if nothing is selected commit b542a4b7b84662538c717d25f4e29437ca35e316 Author: Hector Sanjuan Date: Wed Feb 16 13:43:19 2011 +0100 Feature #495: Dark border multi_action lists commit 2b1e0af090f926681c08c077f8764b59ce9b69e3 Author: Hector Sanjuan Date: Wed Feb 16 13:40:12 2011 +0100 Feature #495: Underline fold/unfold button commit 54a82622cf6fa12eca685a047ac4d71e7885ca40 Author: Daniel Molina Date: Wed Feb 16 13:15:21 2011 +0100 Feature #495: Change login layout commit c606bf393475717758610433c922d53bec0cacf4 Author: Daniel Molina Date: Wed Feb 16 13:13:28 2011 +0100 Feature #495: Check malformed template commit b550f17cf15224e2acf026ffb9f6cc8b2490c65b Author: Hector Sanjuan Date: Wed Feb 16 13:09:01 2011 +0100 Feature #495: improved select list css commit ca5de06c26e87f360c7c6ecdc89f54406481bba9 Merge: ddee858 b550f17 Author: Daniel Molina Date: Wed Feb 16 13:08:51 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit ddee85871767f0b784c0ac5e66e5e3a0d9dd78cb Author: Daniel Molina Date: Wed Feb 16 13:08:37 2011 +0100 Feature #495: Fix create_resource error commit 1a70eca6225ebeb3bb479005505d23fdbdbbfc2d Author: Hector Sanjuan Date: Wed Feb 16 12:58:57 2011 +0100 Feature #495: Improved create VM dialog Tabs to select which wizard etc... commit 91f31f2c6977f13d277ef29e3be574f2dbfbc0b6 Author: Hector Sanjuan Date: Tue Feb 15 16:57:03 2011 +0100 Feature #495: Make confirmation and confirmation with select dialogs have the buttons on the right commit 6e7c5e13f72547897e21a95c338b03771675258e Author: Hector Sanjuan Date: Tue Feb 15 16:55:19 2011 +0100 Feature #495: Confirm deletion of VMs commit 1650e725cc3a06ed2e05a940c286db1e9780bd52 Author: Hector Sanjuan Date: Tue Feb 15 16:49:23 2011 +0100 Feature #495: Replaced all "alert" with "notifyError" messages commit 1a737a33d142654752c09fb7c35f1c0084fd7b96 Author: Hector Sanjuan Date: Tue Feb 15 16:46:41 2011 +0100 Feature #495: force host and network names when creating them commit f6200bc3f539ca05132c0bdbd9ae278e23ae23b1 Author: Hector Sanjuan Date: Tue Feb 15 16:42:23 2011 +0100 Feature #495: Reverted the add disk/image buttons into radio buttons again commit 1e6086bdf0531197be2b7a195514a87b9a31c496 Author: Hector Sanjuan Date: Tue Feb 15 16:37:48 2011 +0100 Feature #495: Fixed bug when deleting an VM element commit 1357caa3cf0ae74696177f8e8e2a7c04fcc8bb25 Author: Hector Sanjuan Date: Tue Feb 15 16:35:25 2011 +0100 Feature #495: Bug fixes to selects and buttons commit 341c369e7ea70e9fc18aa7e19426c6d6b4cbdab7 Author: Hector Sanjuan Date: Tue Feb 15 16:21:00 2011 +0100 Feature #495: Disable action buttons when no element is checked commit 94e034dad1e17a4791b9d62f0735eb3ad22b65c7 Author: Hector Sanjuan Date: Tue Feb 15 15:07:59 2011 +0100 Feature #495: Changed option to select listener in the new Image dialog commit 3fb4f3b9b79222032a798114252fa090f5e9240a Author: Hector Sanjuan Date: Tue Feb 15 15:03:57 2011 +0100 Feature #495: Changed option listeners in the new VM dialog to select listeners commit 26a3f3a0a3c45bc4c64ec330a5687ab75d7e828e Author: Hector Sanjuan Date: Tue Feb 15 14:48:58 2011 +0100 Feature #495: Enhaced multiple action selects for the list views. commit a79e5ef07e4a075f4f9478819a36f1005a8640f3 Author: Jaime Melis Date: Mon Feb 14 16:03:24 2011 +0100 Feature #495: Created OpenNebula.Auth (login & logout). Login.js uses these methods. Using jQuery 1.4.4 commit 36c9ffd9fe55ced0dddac1c5045a87ca51a85c6f Merge: 2570613 5c96465 Author: Jaime Melis Date: Mon Feb 14 15:15:03 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 25706132706b8d6c029d13d05840b88970f5a42d Author: Jaime Melis Date: Mon Feb 14 15:14:56 2011 +0100 Feature #495: Made checkbox and radio buttons a bit wider commit 5c964655af5d3779225606c1bfb679d604d09bca Author: Daniel Molina Date: Mon Feb 14 12:54:17 2011 +0100 Feature #495: Add Authentication and Refactor UI Server commit b2db3b96f12b73751e526cf5edcf8ca46221da81 Author: Jaime Melis Date: Mon Feb 14 11:35:41 2011 +0100 Feature #495: removed left and right resizer bar borders commit 1ce73178c2f45425a2a5ec81a8003c5e481aba98 Author: Jaime Melis Date: Mon Feb 14 11:30:24 2011 +0100 Feature #495: Revert "Bumped up jquery version from 1.4.4 to 1.5" With jQuery 1.5 resizer bars in jQuery layouit plugin don't work. This will break the login JS, but it needs to be rewritten. This reverts commit d92d040526997dd662b453e7676c40ade4a0cd3e. commit c2c8d885bb64288c8151391105d7cf74bb618a9d Merge: c50d8ae 1706931 Author: Jaime Melis Date: Sat Feb 12 11:08:31 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit c50d8aec4f9a2ac0b00419294993c195879ec334 Merge: 00a25ef 71f546d Author: Jaime Melis Date: Fri Feb 11 20:26:00 2011 +0100 Feature #495: Merge remote branch 'origin/master' commit 00a25ef661d1379326cf96e83af732022f0c58aa Author: Jaime Melis Date: Fri Feb 11 20:12:44 2011 +0100 Feature #495: Bumped up jquery version from 1.4.4 to 1.5 commit 1e5d314e00baeab8809d8fa6386ed6e48f67a6be Author: Jaime Melis Date: Fri Feb 11 20:04:54 2011 +0100 Feature #495: Added failed vms to the dasboard commit 5cebd10febe156aca9e1e70229ec97a629f17d36 Author: Jaime Melis Date: Fri Feb 11 20:04:19 2011 +0100 Feature #495: New layout for dashboard (tables) commit 0afad77938882e1c3015125ada19b38e715453c7 Author: Jaime Melis Date: Fri Feb 11 18:31:03 2011 +0100 Feature #495: css tweaks: * dashboard boxes drop shadows * resizer bars have borders * padding for main content tabs commit 1706931602f4935a4c590edaa45de069cef69647 Author: Hector Sanjuan Date: Fri Feb 11 17:13:17 2011 +0100 Feature #495: Updated datatables to 1.7.5 commit 7792185776074daa71226f244515a4755f4ec011 Author: Hector Sanjuan Date: Fri Feb 11 17:11:08 2011 +0100 Feature #495: Fix columns width commit e58f5287ff5bbdd95631760552cd63b4cc04a0a4 Author: Hector Sanjuan Date: Fri Feb 11 16:40:28 2011 +0100 Feature #495: Fixed VM buttons commit fd1e45c08692b16edeb8faf6b03c204340b7ee32 Author: Hector Sanjuan Date: Fri Feb 11 16:33:37 2011 +0100 Feature #495: Removed cluster tab and included cluster related actions in the hosts & clusters tab. commit 30ceab3e4ac5942261dd517e45138baef050bdd4 Author: Jaime Melis Date: Fri Feb 11 16:13:53 2011 +0100 Feature #495: changed refresh icon commit 71f546d87ea3b16166931df94a29ebb327376ed6 Merge: 670c580 1db3e0e Author: Hector Sanjuan Date: Fri Feb 11 15:48:30 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui Conflicts: public/js/one-ui_views.templates.js commit 670c580e68bbc2713748a55064c14823ce70371b Author: Hector Sanjuan Date: Fri Feb 11 15:45:35 2011 +0100 Feature #495: Reorganized, renamed some buttons commit 1db3e0eba966ea9381da2893c9b53162cf3eecd7 Merge: ba8f655 079666e Author: Jaime Melis Date: Fri Feb 11 14:53:25 2011 +0100 Feature #495: Merge branch 'new-layout' Conflicts: public/css/application.css commit 079666e908ebfd86903d3d768f55361087fd63d2 Author: Jaime Melis Date: Fri Feb 11 14:51:21 2011 +0100 Feature #495: footer padding commit 2f41a4d7013a358534fb2add3143187f650c51d5 Author: Jaime Melis Date: Fri Feb 11 12:52:59 2011 +0100 Feature #495: new refresh icon commit 59f0c7b2567457309e06b2dbd12658c65c8381ee Author: Jaime Melis Date: Fri Feb 11 12:52:48 2011 +0100 Feature #495: new layout for dashboard commit df43a31c0120acdbac71bd1212dff7060c4aa806 Author: Jaime Melis Date: Fri Feb 11 12:51:57 2011 +0100 Feature #495: reimagined the layout commit ba8f655c276d6c5788b985572d34cdef58125f18 Author: Hector Sanjuan Date: Fri Feb 11 12:50:05 2011 +0100 Feature #495: Handle deploy_id == null case in the VM information commit d6afe70ec86ba2c795e0800ac77bc6b1e849e7bb Author: Hector Sanjuan Date: Fri Feb 11 12:44:51 2011 +0100 Feature #495: Renaming and reordering of some buttons commit f68fa714b77aba9591fae3a32f32c72c0d9fc09c Author: Hector Sanjuan Date: Fri Feb 11 12:25:47 2011 +0100 Feature #495: Change "easy mode" into "wizard" and "manual" into "advanced" commit dfdc32ec223c209f91c9f73c8b5811a1833d9d70 Author: Hector Sanjuan Date: Thu Feb 10 16:26:42 2011 +0100 Feature #495: Css fixes in the create dialogs. commit a0770b141814d85777e3d3e2130e12703dae2a25 Author: Hector Sanjuan Date: Thu Feb 10 14:59:02 2011 +0100 Feature #495: Fixed boot option select. Changing to xen and back to kvm caused some text be left behind. commit 19da8a049aa5f16eba2887ac6294e2e756674976 Author: Hector Sanjuan Date: Thu Feb 10 14:36:33 2011 +0100 Feature #495: Fix css width for radio and checkboxes inputs (Not showing nice in chrome) commit b648e6c68d1d14962267b955e8b6e6b7d958705f Author: Jaime Melis Date: Thu Feb 10 11:40:10 2011 +0100 Feature #495: css tweaks: - wider navigation menu - prettier input button borders - a more compact layout (top action buttons) commit 7f78c5d2e76a52af860b68b7dc3d8dbb00626db2 Author: Jaime Melis Date: Thu Feb 10 10:29:37 2011 +0100 Feature #495: changed ticks and crosses for OK and Cancel commit 3dd367973d84a6ccf102b00a6ef37ea6d13d601b Author: Jaime Melis Date: Thu Feb 10 10:19:02 2011 +0100 Feature #495: removed gradient from menu commit 1436ab7744d1e1d57a7fc1cd5b84162855c6ee2e Author: Jaime Melis Date: Thu Feb 10 10:13:34 2011 +0100 Feature #495: Made buttons smaller and with variable width commit c17d8f354e57104063c75fa02ca2912fea9584f0 Author: Jaime Melis Date: Thu Feb 10 10:13:16 2011 +0100 Feature #495: Changed refresh buttons for refresh icons commit a3146f0bebd2bcdc9eae016c5e06febf4767bc29 Merge: c60e267 82e986f Author: Jaime Melis Date: Wed Feb 9 20:28:24 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui Conflicts: public/js/one-ui_views.js public/js/one-ui_views.templates.js commit c60e267f06c8b19b74468a92a9710a42fd93bb46 Author: Jaime Melis Date: Wed Feb 9 20:24:49 2011 +0100 Feature #495: * enabled manual VM submit * fixed wizard mode VM submit * new feature: when image is created datatables is filtered and the popDialog is displayed with the new VM info commit 6b8fa70a152abed8960fd3d11a13878da1659e5c Author: Jaime Melis Date: Wed Feb 9 20:23:00 2011 +0100 Feature #495: Fix error in Helper pool commit f7fc033de153d4bdb83c9b5ceec50a7f0f13d559 Author: Jaime Melis Date: Wed Feb 9 20:20:14 2011 +0100 Feature #495: Textareas don't contain any text commit b289d23b337b44992345d06a8b501a742c0f30a9 Author: Jaime Melis Date: Wed Feb 9 20:19:58 2011 +0100 Feature #495: Graphics by default is empty commit 82e986f2ce8c9f5b50e982c54987fc4528a62c4b Merge: a7efe81 cac206e Author: Hector Sanjuan Date: Wed Feb 9 16:29:30 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit a7efe8101a89abbc3698f2d60625692cef4db21a Author: Hector Sanjuan Date: Wed Feb 9 16:28:20 2011 +0100 Feature #495: Added : to labels and * to mandatory fields in the Register image dialog commit 6e35edc03d78e7391186710ed7c467495638c0a4 Author: Hector Sanjuan Date: Wed Feb 9 16:23:19 2011 +0100 Feature #495: Added register image dialog (usable and looking nice). commit cac206e24fb9e59627c562439c336ce39d94ea69 Merge: 3f62d5c 5b04568 Author: Daniel Molina Date: Wed Feb 9 12:42:11 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 3f62d5cf68c68cea8bd3b9dbaa1c2faa6065e110 Author: Daniel Molina Date: Wed Feb 9 12:41:41 2011 +0100 Feature #495: Add logout to server commit ffad6a05b8fb857b2c5a22461176974eaa843962 Author: Jaime Melis Date: Wed Feb 9 12:32:22 2011 +0100 Feature #495: Set +New VM window to be 80% of the window commit 5b04568385a5b03777fa04bbde6bef5f5ee081f7 Merge: 8e50e98 3cf8837 Author: Jaime Melis Date: Wed Feb 9 12:15:40 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 8e50e98429d6a67b8c77e1f15233b41ac8587ffb Author: Jaime Melis Date: Wed Feb 9 12:09:57 2011 +0100 Feature #495: Removed the font-family specification for the VM log commit 3cf883720d9dbfc5033178e1f8141489335ce038 Merge: 1f1a7fc ac18499 Author: Daniel Molina Date: Wed Feb 9 11:42:59 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 1f1a7fcdb7ecd82b878975b663313bbed38fc625 Author: Daniel Molina Date: Wed Feb 9 11:42:24 2011 +0100 Feature #495: Add Authentication and Login page commit ac18499ed26996f4105563fc85f168c31a8b2ffb Author: Jaime Melis Date: Tue Feb 8 19:48:30 2011 +0100 Feature #495: Squashed commit of the following: commit 8a2c4f03eda1e84332c95eed346e23eb9aea4437 Author: Jaime Melis Date: Tue Feb 8 19:46:36 2011 +0100 Moved the show VM log functionality to a listener. It's only fetched when the VM log tab is clicked. commit e4a833a53e5f283afc4a1d3ee5acc919dae6000b Author: Jaime Melis Date: Tue Feb 8 19:21:14 2011 +0100 Created the VM log tab. The log is always loaded. commit 91f2bfef239f0b653c7a0bbf0403331ba3e46d1b Author: Jaime Melis Date: Tue Feb 8 17:33:25 2011 +0100 implemented sinatra server part of the vm log feature commit 9f9e2751b3fb542c7014eeb6d73a52138c1bb615 Author: Jaime Melis Date: Tue Feb 8 16:40:15 2011 +0100 Feature #495: Added jGrowl error notification commit e97ede88a6ac99bf2c6463ba659a58a90193fcb3 Author: Hector Sanjuan Date: Tue Feb 8 16:07:35 2011 +0100 Feature #495: Fixed new VNET dialog to look better commit 9c00d4a035e114064add62e2eab44f5a9c86be9e Author: Hector Sanjuan Date: Tue Feb 8 16:06:58 2011 +0100 Feature #495: Fixed total leases count commit 6d57dc818a90213d3555f384c52623a4b89afaf2 Merge: 9c3f142 9fcba53 Author: Hector Sanjuan Date: Tue Feb 8 15:56:24 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 9c3f14278bff92e11be4dcef5834469ea3624d59 Author: Hector Sanjuan Date: Tue Feb 8 15:56:10 2011 +0100 Feature #495: small fixes commit 9fcba53bb126acf78eb49579a08a25ceda149ae4 Merge: 6139c8e d039f53 Author: Jaime Melis Date: Tue Feb 8 15:39:30 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 6139c8ec1df24cc35ce75c33720af390edd5935c Author: Jaime Melis Date: Tue Feb 8 15:39:18 2011 +0100 Feature #495: * Added jGrowl notification plugin. * Added notifications for actionButtonListener and confirmWithSelectListener commit d039f53c8afc315a98115a1bb885de3c9c974d9c Author: Hector Sanjuan Date: Tue Feb 8 15:11:42 2011 +0100 Feature #495: Made top buttons look better commit 15eee40f0a7d277ba012f9db63eb1be74c56ceee Author: Hector Sanjuan Date: Tue Feb 8 14:12:48 2011 +0100 Feature #495: Added and tested dialogs to add/remove/update attributes from images. *Fix in opennebula.js included. commit 610085ce96ef5958d80af59691e9f2fd7cb306e1 Author: Hector Sanjuan Date: Tue Feb 8 12:09:32 2011 +0100 Feature #495: Enabled and tested basic action buttons for images commit 838e8d9d866b16b94f4dc17e2e2a1863aff728ec Author: Jaime Melis Date: Mon Feb 7 17:57:17 2011 +0100 Feature #495: Typo in spinner declaration commit c543d80b36a83d66dd15ebf5118cbe7da1a46e10 Author: Jaime Melis Date: Mon Feb 7 17:30:07 2011 +0100 Feature #495: fixed typo in dashboard commit f80a8e118f4fbb3544764ddc791935eb93702589 Author: Jaime Melis Date: Mon Feb 7 17:29:49 2011 +0100 Feature #495: Wrapped opennebula.js methods in an OpenNebula class commit 619b49f719c640c49ef0138c874a1b4a9471d7a5 Author: Hector Sanjuan Date: Mon Feb 7 15:35:36 2011 +0100 Feature #495: Merge with image resource type commit ef319ceb0dda5698b2e139932b2c8352bd08cca3 Author: Jaime Melis Date: Mon Feb 7 15:18:43 2011 +0100 Feature #495: added resource type for image commit 65695efebd31a4d9209b425c2942176fd5d1db69 Author: Hector Sanjuan Date: Mon Feb 7 14:29:06 2011 +0100 Feature #495: Added some TBDs in the Helper commit 362aec2a8273758d373fa6bc364b9666a2dc7246 Author: Hector Sanjuan Date: Mon Feb 7 13:30:48 2011 +0100 Feature #495: resized north panel it took too much space commit 3587b34936e13e28e31cffc9fe9d9899eb3cdea9 Author: Hector Sanjuan Date: Mon Feb 7 13:24:46 2011 +0100 Feature #495: Create vnet fix Fixed showing correct fields when clicking the fixed/ranged buttons twice (it toggled when clicking twice on the same button) commit 1f077f789afcddde498d840576372d329dc7a94f Author: Hector Sanjuan Date: Mon Feb 7 13:21:26 2011 +0100 Feature #495: Retrieve username from users table when only UID is provided. commit 0edac90c9d8a659e887cd535afa71f59b427acad Author: Hector Sanjuan Date: Fri Feb 4 19:23:37 2011 +0100 Feature #495: Improved add VM dialog Tooltips etc... commit 9c2379b19f772e6b0f95390857e6be954b67224e Author: Hector Sanjuan Date: Thu Feb 3 16:02:09 2011 +0100 Feature #495: Removed tabs from VNET creation dialog. Added a radio select. commit d9db8fb284ea1346df71f538994bce02e4a3459b Author: Hector Sanjuan Date: Thu Feb 3 15:50:17 2011 +0100 Feature #495: Added fixed height for rows Prevents ugly resizing when changing the checkbox into a loading wheel commit 0052b5d2d924c3139aa8f365ac5816d2ea6f689d Author: Hector Sanjuan Date: Thu Feb 3 15:34:41 2011 +0100 Feature #495: Added loading icon when refreshing tables. (better option should be found) commit bb61b763b426af0634f7474037836bdd9dcab576 Author: Hector Sanjuan Date: Thu Feb 3 14:57:32 2011 +0100 Feature #495: Added loading icon to tables commit f6c2c90f9f0cf85f8ef61dd48ab8a8fc69728fac Author: Hector Sanjuan Date: Thu Feb 3 14:36:46 2011 +0100 Feature #495: Commented tabSelect No longer needed with the new layout commit 7eb5099fa74b15fd949aa5fb193706cd63821bbe Author: Hector Sanjuan Date: Thu Feb 3 14:35:22 2011 +0100 Feature #495: added loading icon to the dashboard commit 3f352510f4abb9e78f6f9e6d293a6e8955d00e34 Author: Jaime Melis Date: Wed Feb 2 18:33:27 2011 +0100 Feature #495: CSS & html tweaks: * background color of the panes * added footer * dashboard typo * font colors * datatables with cells commit 05ac36916848d5bd26ca22a32faf6662f0db772a Author: Jaime Melis Date: Wed Feb 2 16:52:05 2011 +0100 Feature #495: Removed inner divs of dialog borders commit 0adb114a34616f8caeb3d0e3a2feb07a15dd670d Merge: da44b97 92f9ba6 Author: Jaime Melis Date: Wed Feb 2 16:33:37 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit da44b971a2876dbff71b7e447a34236d803c81c6 Author: Jaime Melis Date: Wed Feb 2 16:33:15 2011 +0100 Feature #495: Display different styles for selected menu commit 92f9ba6d0b1ceb969508cafea900a6c8b327567d Author: Hector Sanjuan Date: Wed Feb 2 15:49:45 2011 +0100 Feature #495: Added tables to VNET information dialogs commit 1663a7e307750714901ea9c34abdc3b72e49dbd3 Author: Hector Sanjuan Date: Wed Feb 2 15:40:55 2011 +0100 Feature #495: Added nice tables for the VM info dialog commit d07dcbe6aa0bf651179ce5a9cf45a78fce13fa39 Author: Hector Sanjuan Date: Wed Feb 2 15:40:07 2011 +0100 Feature #495: vertical align top for info tables commit 53e1a32b2bfb91fe638932af6ee85887366e7eec Author: Hector Sanjuan Date: Wed Feb 2 15:09:37 2011 +0100 Feature #495: Recreated tables for host information commit 02b52253b7404495f93e6c033a6c926706ebed60 Author: Jaime Melis Date: Wed Feb 2 13:11:21 2011 +0100 Feature #495: Removed the href="javascript:..." links and changed enabled listeners to substitute them commit 3a8ff94b82efc2a5df712202bf0e5ffab50e5dc1 Author: Jaime Melis Date: Wed Feb 2 12:15:59 2011 +0100 Feature #495: don't change url when clicking on dashboard commit 8695d6b511cdea40e3a954d00f42a8ff99db5497 Author: Jaime Melis Date: Wed Feb 2 00:17:21 2011 +0100 Feature #495: Open the dialog automatically when clicking on an item commit 5e6228af9154b95023dca7ab4c88703d828cb29c Author: Jaime Melis Date: Tue Feb 1 18:54:31 2011 +0100 Feature #495: Tab urls don't change the url commit 6a1049a8d6fb6f7e256969363892fd49de8335e5 Author: Jaime Melis Date: Tue Feb 1 18:51:37 2011 +0100 Feature #495: Open info dialogs in the #dialog box commit 9450469829efadcd5043c36c942dc7b7df4f8e53 Author: Jaime Melis Date: Tue Feb 1 17:44:38 2011 +0100 Feature #495: * Show the Dashboard by default * Create links from the dashboard to the other sections commit 37840737726c11e2ce1dfe67f10685b1f576e9ce Merge: d51e03d 86bfdd4 Author: Jaime Melis Date: Tue Feb 1 17:34:33 2011 +0100 Feature #495: Merged with last commit commit d51e03dff0054eeadd9120205d04c80c975b56f9 Author: Jaime Melis Date: Tue Feb 1 17:32:45 2011 +0100 Feature #495: Adopted the jQuery layout plugin commit 86bfdd4ec012b1803d1a95cf51645dca0e3e54ec Author: Hector Sanjuan Date: Tue Feb 1 15:38:11 2011 +0100 Feature #495: Added dashboard. TODOs: Improve the look. Improve the figures update. commit de068b8b3d594e091092287d3456926810498f77 Author: Hector Sanjuan Date: Tue Feb 1 14:04:05 2011 +0100 Feature #495: Moved action icons to top of table It shouldn't affect behaviour commit 437db8519a33d5030d99ef5eeddc65968e503792 Author: Hector Sanjuan Date: Mon Jan 31 16:26:47 2011 +0100 Feature #495: Updated new VM dialog to look as the proposal commit f812a12a36988158a6bce142d7898ce5e72bdb69 Author: Hector Sanjuan Date: Mon Jan 31 15:22:01 2011 +0100 Feature #495: Fix: username not provided with vm.show commit c2e9156b12d9a50d19b1ada378eb326d97147864 Author: Hector Sanjuan Date: Mon Jan 31 14:01:07 2011 +0100 Feature #495: Some css tests for the host information commit 47d27fc7e49959c1483a3d8f61e62af601cfa36f Author: Hector Sanjuan Date: Mon Jan 31 13:35:48 2011 +0100 Feature #495: Bug fixes. Clicking on new single elements added to tables did not show the extended information. The history of a new VM can be null. A VNet.show does not bring the username (showing uid now) not the total_leases (calculated from the leases array in that case). commit ffa35087f68cb44a9f8ddee0d8ca08bf1b753d0c Author: Hector Sanjuan Date: Fri Jan 28 17:10:15 2011 +0100 Feature #495: Update single elements methods added. Callbacks do not fetch the whole list now, but affect only the element that has changed. Implemented for all elements and all create/modify/delete actions. commit 698b79f422e890aa489beb088023c4497052fbf8 Author: Jaime Melis Date: Thu Jan 27 17:53:36 2011 +0100 Feature #495: Fixed width for dialog forms commit 86fbd5dd8da98b92fb944fae352198a4ab126d4e Author: Jaime Melis Date: Thu Jan 27 12:32:41 2011 +0100 Feature #495: fixed typo in css commit ad6afb324a8a2966af824c5947de5fce65c46be2 Author: Jaime Melis Date: Thu Jan 27 12:31:55 2011 +0100 Feature #495: added a clear class commit f53acb15bdc63a2a39ea597187e5891fdc69198b Author: Jaime Melis Date: Thu Jan 27 12:31:09 2011 +0100 Feature #495: Changed header image commit 44315281026d14f9b7a7727f95dafb3cc4c469e8 Author: Jaime Melis Date: Thu Jan 27 12:30:33 2011 +0100 Feature #495: Change style for tabs commit d20d43b27aafcdd39dbc03aaccd3ae972aeee77d Author: Jaime Melis Date: Wed Jan 26 18:40:44 2011 +0100 Feature #495: tr:hover is now not highlighted commit 9e818647dd402d5367ba0811c8ad1b2ccf4fcf12 Merge: f674696 fc4b0c3 Author: Jaime Melis Date: Wed Jan 26 16:20:56 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit f6746967e4da2c54bb601495d5d711dd720ed2c2 Author: Jaime Melis Date: Wed Jan 26 16:20:43 2011 +0100 Feature #495: Reorganized css files in index.html commit fc4b0c3436a48ac25fb9f3f3504fe54b2107de8a Author: Hector Sanjuan Date: Wed Jan 26 16:16:09 2011 +0100 Feature #495: Cliking on the overlay now dismisses the current dialog. commit 3f938009ac3279577f67ddc36e8cecac7842d833 Author: Hector Sanjuan Date: Wed Jan 26 16:08:04 2011 +0100 Feature #495: Fixed remove from cluster button. The parameter indicating which cluster to remove the hosts from is now set to "0". commit d50fb22be4661acf1eaf03c657375f529973234e Author: Hector Sanjuan Date: Wed Jan 26 15:54:11 2011 +0100 Feature #495: Removed cluster select in the host views. Add to cluster action is now done through a confirm dialog with a select option for the clusters. commit 6d6026179594ec4a21ca918c3d6e65598aab0b10 Author: Hector Sanjuan Date: Wed Jan 26 15:43:02 2011 +0100 Feature #495: Improved buttons in the add VM dialog. commit 14420bd18159379bc6f454cca803757da89f8864 Author: Hector Sanjuan Date: Wed Jan 26 13:59:29 2011 +0100 Feature #495: Improved sections of the New VM Machine dialog. Now all sections can be hidden/shown. There is one ".show_hide" button for each one so the look is much more regular. commit 9ebc69faa844247de91ea4e9133a581872100ce1 Author: Jaime Melis Date: Wed Jan 26 13:05:55 2011 +0100 Feature #495: Minor css improvements + logo commit c9d16d248eefa120b59c3ddb71681f86b4f0a0d2 Merge: a07e5d6 ba06b70 Author: Jaime Melis Date: Tue Jan 25 17:34:52 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit a07e5d6d317d8bc7f12fa6d672fb24854aedb88d Author: Jaime Melis Date: Tue Jan 25 17:34:34 2011 +0100 Feature #495: Get running time for the VMs commit ba06b706500c561f8c79e499b4913cf2913e95a9 Author: Hector Sanjuan Date: Tue Jan 25 17:02:06 2011 +0100 Feature #495: Added refresh buttons to tables commit d932f1fd953330e78e3bc51cd7b263baeb9c293b Author: Hector Sanjuan Date: Tue Jan 25 16:37:38 2011 +0100 Feature #495: Added simple actions to the VM info dialog. commit 7cacc60da6fb0c2f0cf79b593106a40a8ee19025 Author: Hector Sanjuan Date: Tue Jan 25 15:53:31 2011 +0100 Feature #495: Added action buttons to the host info dialog commit b11d965ad19cc3d5369d0c0b60c204862798f6ef Author: Hector Sanjuan Date: Tue Jan 25 15:15:55 2011 +0100 Feature #495: Added refresh intervals for the datatables. commit 732e9fd28511e789558d2a3c6eb651bc20cbf279 Author: Hector Sanjuan Date: Tue Jan 25 14:57:48 2011 +0100 Feature #495: Enabled modal dialogs commit e25f91c2897a77d5d107edb61bb7e2ac48ffa53c Author: Hector Sanjuan Date: Tue Jan 25 14:49:33 2011 +0100 Feature #495: Bug fixes in the new VM form commit 9b149f8e3682695cb88c0b00addccd0622f45fa5 Author: Hector Sanjuan Date: Tue Jan 25 14:36:19 2011 +0100 Feature #495: Finished processing new VM form parameters commit 48b43150930eba3e129bf6de357e810fe391dadf Author: Jaime Melis Date: Tue Jan 25 12:32:44 2011 +0100 Feature #495: Added a '/config' handler commit 7a8daba9eb6d5a6cd5f1a529e42103fc63e33d19 Author: Hector Sanjuan Date: Mon Jan 24 20:57:13 2011 +0100 Feature #495: Started processing the New VM form parameters. Quite many fixes and some auxiliary functions. commit c38aa0bd97460dd77b66e82a1c46e29296dc5e65 Author: Hector Sanjuan Date: Fri Jan 21 14:49:17 2011 +0100 Feature #495: enabled preloading (fetches all lists). commit 0418807552f00bea2c57535fff50483133eb29b9 Author: Hector Sanjuan Date: Fri Jan 21 14:41:36 2011 +0100 Feature #495: Added dialog where the destination host can be selected for VM deploy/migrate actions. The dialog is reusable for add host to cluster... commit 3c2b57a0cfd4690451f5cda673e956ba0155bfec Author: Hector Sanjuan Date: Fri Jan 21 13:20:39 2011 +0100 Feature #495: Added confirmation dialog with explanation for VM actions. commit 44b374b053e020df202a20d939fa567378686141 Author: Hector Sanjuan Date: Fri Jan 21 12:16:15 2011 +0100 Feature #495: Added test CSS to mark table rows when the mouse hovers on them. commit 514bc6fc335d009fadfbf509fec2bf6d9110cc76 Merge: 02d6b12 2b203d5 Author: Hector Sanjuan Date: Fri Jan 21 11:58:54 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 02d6b12c28dc064f0be40c2983dcb0fb8ea629c2 Author: Hector Sanjuan Date: Fri Jan 21 11:58:08 2011 +0100 Feature #495: Added select for Mads in the +New Host dialog. commit 2b203d5fe2e421d8afde2e541399f62fd34def92 Author: Jaime Melis Date: Fri Jan 21 11:13:48 2011 +0100 Feature #495: Fixed bug in Helper.pool method commit 15716ff0b68c82f74fe69a936c866fd297f2595c Author: Hector Sanjuan Date: Fri Jan 21 11:07:45 2011 +0100 Feature #495: Added "check-all" checkbox commit f4fa94ec896541cebae4fb6576db13ca0ad491f2 Author: Hector Sanjuan Date: Thu Jan 20 18:20:44 2011 +0100 Feature #495: Added some css commit 6676a3dc2e29ecfd78b0f4fc56d0c0857d16341b Author: Hector Sanjuan Date: Thu Jan 20 15:50:07 2011 +0100 Feature #495: Added the create VM dialog. commit 9ff39b11cb40661b1cea13863e37f34d923a4a95 Author: Hector Sanjuan Date: Wed Jan 19 17:29:42 2011 +0100 Feature #495: Fix: clicking on checkbox showed element information. commit 397f120a3be2001d23f07a239526656d8a4ffec6 Author: Hector Sanjuan Date: Wed Jan 19 15:22:29 2011 +0100 Feature #495: Extended information now shown when clicking on rows. commit db072e236613f221fec3eaf47039c77af1fa7a7d Author: Hector Sanjuan Date: Wed Jan 19 15:15:38 2011 +0100 Feature #495: Added extended information of VM commit 0495c2f96ced576b5a76c408e3d6f559d4648392 Author: Hector Sanjuan Date: Wed Jan 19 14:36:32 2011 +0100 Feature #495: Code refactoring Ordered, commented and added auxiliary functions. commit 0580c7c93b7228ddc2e6c95f8667ad533b1ba38c Merge: a64174a 84fa7ab Author: Daniel Molina Date: Tue Jan 18 19:54:18 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit a64174ae5e64c00434df29a932d449c092121e0b Author: Daniel Molina Date: Tue Jan 18 19:54:01 2011 +0100 Feature #495: Modify test script commit 554a51794feaf9e84645f4348ddf3504a40159d5 Author: Daniel Molina Date: Tue Jan 18 19:53:28 2011 +0100 Feature #495: Add ImageJSON tests commit 3a2051592d0650d4610607dd3aeb0b71cc2dc37d Author: Daniel Molina Date: Tue Jan 18 19:53:09 2011 +0100 Feature #495: Remove crack dependency commit 84fa7ab5fb15e827b9ad525a06684e0b686fdb5e Author: Hector Sanjuan Date: Tue Jan 18 15:01:46 2011 +0100 Feature #495: Enabled buttons in the Virtual Machines view... commit 2e23e0718bfaa2d14df4c05dff994477696a2509 Author: Hector Sanjuan Date: Tue Jan 18 14:33:08 2011 +0100 Feature #495: Added add to cluster/remove from cluster features commit 964077cc8f1f17e8eac9b9a6b6229dafbedf3d66 Author: Hector Sanjuan Date: Tue Jan 18 14:21:10 2011 +0100 Feature #495: Improved onError() to handle several error messages one after the other commit 173831d079af6264a38ec212e230564554675716 Author: Hector Sanjuan Date: Tue Jan 18 12:01:01 2011 +0100 Feature #495: Plugged in users. Missing a change password method. commit b6cd771b96aa6fb29f946a09caeb57a58344823f Author: Hector Sanjuan Date: Mon Jan 17 22:30:43 2011 +0100 Feature #495: Plugged in clusters. Several fixes. commit d80063157ac9c535d6b8d88944be9cf63d15c3a4 Merge: 92bbb17 d3ff7aa Author: Jaime Melis Date: Mon Jan 17 22:12:47 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 92bbb17855ea4a7a7db657d0204085c0733bfdf2 Author: Jaime Melis Date: Mon Jan 17 22:12:31 2011 +0100 Feature #495: Undo refactor of opennebula.js since it raises some problems with the client library commit d3ff7aa8595f2592317ed589988a2e699664b2e2 Merge: 3eb44f7 49b6e6f Author: Daniel Molina Date: Mon Jan 17 18:36:18 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 3eb44f76385f5ea13cc0668a132ff7ffb784ba42 Author: Daniel Molina Date: Mon Jan 17 18:35:53 2011 +0100 Feature #495: Add UserJSON tests commit 49b6e6f6e9f8d8c3cd03b5913c15df87091f3931 Merge: 1347fb4 647800c Author: Jaime Melis Date: Mon Jan 17 18:05:06 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 1347fb454332d524045431b62067f73b867620cc Author: Jaime Melis Date: Mon Jan 17 18:04:36 2011 +0100 Feature #495: Added User and Image methods to opennebula.js commit 647800c4d4cf3c0ff2247dcc169ea9f36f12035f Merge: b895d66 42059e4 Author: Daniel Molina Date: Mon Jan 17 17:52:49 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit b895d66df11bcb9cdfd582e744111a39eeef1a83 Author: Daniel Molina Date: Mon Jan 17 17:52:32 2011 +0100 Feature #495: Add ClusterJSON tests commit 42059e4744432829011256fe3ea1567297bcc1ca Author: Jaime Melis Date: Mon Jan 17 17:43:21 2011 +0100 Feature #495: Fixed typos in opennebula.js commit 559166ceb3e87066f7bc8632d2b82b3045778ed5 Merge: 7f35a95 5ad204f Author: Jaime Melis Date: Mon Jan 17 12:28:15 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 5ad204f52d14e37ec61c0117964260f0ecf9b2bf Author: Daniel Molina Date: Mon Jan 17 12:19:16 2011 +0100 Feature #495: Fix UserJSON method name commit 7f35a956e1e142236f91d418b2e6e59e6ce49e92 Author: Jaime Melis Date: Mon Jan 17 12:13:56 2011 +0100 Feature #495: Completed the cluster section in opennebula.js commit 04eb1d0f7493175348ba244fc17bf98b042eed5c Merge: 5d3caa0 adab841 Author: Jaime Melis Date: Mon Jan 17 11:39:54 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit adab841f03d1456c90e0a2a51f125f050e2168ff Author: Daniel Molina Date: Mon Jan 17 11:39:06 2011 +0100 Feature #495: Add resources require commit 5d3caa07483f83409d8a17824163fde07323f024 Author: Jaime Melis Date: Sat Jan 15 21:13:49 2011 +0100 Feature #495: missing some arguments for callback_error functions commit c45f59dd0125be6c02a1ca21dc42dde87677e735 Author: Jaime Melis Date: Sat Jan 15 21:06:38 2011 +0100 Feature #495: Refactor opennebula.js commit 4a543f447f2d2a4a2dd2ce7d3ecdcb22c72d017a Merge: 993a3e8 2cc0d67 Author: Hector Sanjuan Date: Fri Jan 14 14:14:56 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 993a3e85186063197d81ce71f9e15a2d399d33a0 Author: Hector Sanjuan Date: Fri Jan 14 14:13:34 2011 +0100 Feature #495: "Plugged in" the virtual networks list, actions. Still missing the manual create. Fixed Network.create in opennebula.js as it didn't post the data, but an empty action. commit 2cc0d67c4fffddf2fa4b6ff69cea853b476407f5 Author: Daniel Molina Date: Fri Jan 14 13:16:04 2011 +0100 Feature #495: Add VirtualMachine examples commit 92322f92a27ba48dff6836f05a3cb696b5a4bb0a Author: Daniel Molina Date: Fri Jan 14 13:15:16 2011 +0100 Feature #495: Add save_as tests commit a64be133f6911481b1e0acfe9a35d91a17fae81a Author: Daniel Molina Date: Fri Jan 14 13:15:06 2011 +0100 Feature #495: Add save_as functionality commit 1b0cb7a88af9b132fa67e26f8b5540762a0613c1 Merge: 1dce9cc 23b72f7 Author: Jaime Melis Date: Thu Jan 13 19:19:51 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 1dce9cc6ae9f497fddbee8b8ac99dedf00116586 Author: Jaime Melis Date: Thu Jan 13 19:19:31 2011 +0100 Feature #495: Fixed a couple of bugs in opennebula.js. Added VM methods commit 23b72f7e6be2159fba05e10d38bd0d6469061526 Merge: 9ba4c01 446a0a0 Author: Daniel Molina Date: Thu Jan 13 10:09:04 2011 -0800 Feature #495: Merge branch 'master' of git@opennebula.org:one-ui commit 9ba4c01b360fd1668fe2c06cc6c990fe4f8a98bf Author: Daniel Molina Date: Thu Jan 13 19:08:24 2011 +0100 Feature #495: Add VirtualMachineJSON file commit 527a5903f006b1f0183a095ad0870a35f912c960 Author: Daniel Molina Date: Thu Jan 13 19:07:54 2011 +0100 Feature #495: Add UserJSON commit a5ebb9ae671105580c9cc67d19c0a004e43a661e Author: Daniel Molina Date: Thu Jan 13 19:07:34 2011 +0100 Feature #495: Add ImageJSON commit 5c98088bd9e590fad385fb392fdc4975f3d0b08c Author: Daniel Molina Date: Thu Jan 13 19:07:06 2011 +0100 Feature #495: Add ClusterJSON commit 9847c78d5ca3b32b563e4f680c6cdef45ac8b4e1 Author: Daniel Molina Date: Thu Jan 13 19:06:34 2011 +0100 Feature #495: Add VirtualMachineJSON commit 8ffff10c6e1098aaa7234d412c5ea16c95d8792f Author: Daniel Molina Date: Thu Jan 13 19:05:37 2011 +0100 Feature #495: Add DELETE tests commit 446a0a0c0b2fb01bbcbdd0f3fe446e7f4f5d70b0 Merge: 746caf5 5c9e99c Author: Jaime Melis Date: Thu Jan 13 17:23:17 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 746caf52b2c561c4bbb08d1f97019f88c31a82d1 Author: Jaime Melis Date: Thu Jan 13 17:22:36 2011 +0100 Feature #495: Fixed bugs in opennebula.js commit 5c9e99c5d6bf8aa0be7325b63f6437e936fb93f1 Merge: 08fc9ee 4b4cdb0 Author: Hector Sanjuan Date: Thu Jan 13 17:18:50 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 08fc9ee361a9ee868bce105beb1447aad3379f97 Author: Hector Sanjuan Date: Thu Jan 13 17:16:19 2011 +0100 Feature #495: Plugged in hosts to opennebula.js. Basic actions (create, enable, disable, delete, show) are working. commit 4b4cdb031d8db27110976d9a291bc85c12cb83cb Author: Jaime Melis Date: Thu Jan 13 17:12:12 2011 +0100 Feature #495: Helper.pool detects type of pool. Helper method to get human friendly values for resource states commit 53914923fb9c25aa32650a5eeb38fafea0114565 Merge: 905c9ba 3ec09c0 Author: Jaime Melis Date: Thu Jan 13 15:46:18 2011 +0100 Feature #495: Merge branch 'master' of opennebula.org:one-ui commit 905c9ba1245defd9fe6bb62d28bcdd9d6bca95f4 Author: Jaime Melis Date: Thu Jan 13 15:45:27 2011 +0100 Feature #495: Collect errors from the sinatra server. Added a pool helper commit 3ec09c0939d0fb660f30e0dfe780aeeb78b9eb85 Author: Daniel Molina Date: Thu Jan 13 10:29:10 2011 +0100 Feature #495: Refactor POST action methods commit 6e706d4ed654f56fbc487bc13f1ebd43f07ac4bc Author: Jaime Melis Date: Wed Jan 12 11:46:30 2011 +0100 Feature #495: Added css and js files from the old app commit 5538a85e4921201de6050c266d4a90cdbc0ffa17 Author: Jaime Melis Date: Wed Jan 12 11:05:36 2011 +0100 Feature #495: Merged files from the old branch commit 492a11e5a50e0212764fc0a96c5157b0e520f5ec Author: Daniel Molina Date: Wed Jan 12 10:53:55 2011 +0100 Feature #495: Add Host and VirtualNetwork JSON examples commit 68d9289f28cdcb59be49af430afcbff1b9df1cfb Author: Daniel Molina Date: Wed Jan 12 10:12:01 2011 +0100 Feature #495: Add more HostJSON tests commit 59fccd8c4b459931884d2352e13f99e0913b54a2 Author: Daniel Molina Date: Wed Jan 12 10:11:05 2011 +0100 Feature #495: Add VirtualNetworkJSON tests commit ef98fd44163aa4f9e301b12acf93fb2871dcd5c0 Author: Daniel Molina Date: Wed Jan 12 10:10:49 2011 +0100 Feature #495: Add VirtualNetworkJSON functionality commit 2cce9440527b521f4bea60c740b96c0011062be6 Author: Daniel Molina Date: Tue Jan 11 16:57:24 2011 +0100 Feature #495: Add enable/disable Host tests commit f5053c8a51168a0e1d4a5ea9d49ff9190e718c84 Author: Daniel Molina Date: Tue Jan 11 16:56:31 2011 +0100 Feature #495: Fix typo in HostJSON commit a3609d83a43e080e485391d2a60b613578f911f9 Author: Daniel Molina Date: Tue Jan 11 16:55:52 2011 +0100 Feature #495: Add JSON Error format commit 9a537c9ac9dcfa5dbf57da7c30b0dce96522bc2d Author: Jaime Melis Date: Tue Jan 11 16:58:40 2011 +0100 Feature #495: Typo: vmm_mad => vm_mad commit d43e5b6d88e4233fce805b80e062b304e8c2a6f5 Author: Jaime Melis Date: Tue Jan 11 16:33:11 2011 +0100 Feature #495: Prototype complete implementation of host methods in opennebula.js commit 999a9de23da1ecfada92e876dca922cae43c2992 Author: Jaime Melis Date: Tue Jan 11 16:31:57 2011 +0100 Feature #495: Message body is request.body.read commit c8d89d48dff7d0ee2996bc2dfe3a46282696a439 Author: Jaime Melis Date: Tue Jan 11 14:33:57 2011 +0100 Feature #495: Prototype version of opennebula.js (temporarily embedded in index.html) commit f80864e0f0fcf710d48ec96df0b041dcae37c262 Author: Jaime Melis Date: Tue Jan 11 14:32:32 2011 +0100 Feature #495: Temporary fetch of user and password from the ONE_AUTH env variable commit 0fc2eac8b352f2ffd4294dda64f169f6de089b27 Author: Daniel Molina Date: Tue Jan 11 14:23:49 2011 +0100 Feature #495: Add Pool GET methods commit e80890396fbcf2210280326036279fc4fab6d769 Author: Daniel Molina Date: Tue Jan 11 14:22:11 2011 +0100 Feature #495: Add create Host commit 02ce042bd1604229e52b94cfe5b25148abcd0ee5 Author: Daniel Molina Date: Tue Jan 11 14:21:38 2011 +0100 Feature #495: Add Host tests commit f95113d944d13efe36a9c903a0129de8340ce1a7 Author: Daniel Molina Date: Thu Dec 23 13:07:41 2010 +0100 Feature #495: Add OpenNebula JSON Server commit 8887f3db9c74ee69160832bf89cc7763fddc6ec3 Author: Daniel Molina Date: Thu Dec 23 13:05:33 2010 +0100 Feature #495: Clean old files commit 6ca3cd91a71723dc032c5e8e12e0a55226cf1f64 Author: Hector Sanjuan Date: Wed Dec 22 16:13:32 2010 +0100 Feature #495: Added capture to list buttons being clicked. commit b5e72041716022ef9881926ecfe5a0ddb16d16e3 Author: Hector Sanjuan Date: Mon Dec 20 15:36:08 2010 +0100 Feature #495: Update the table views does not append html code anymore, only changes the datatable object data. commit 3dde3732a8d9a337738ed513f315feb9c5fbd9ae Author: Hector Sanjuan Date: Mon Dec 20 15:25:52 2010 +0100 Feature #495: Templates are now hardcoded in one-ui_views.js commit cd37a3beec51d67e4eb78a76ff4a295de660ad2f Author: Hector Sanjuan Date: Mon Dec 20 12:47:47 2010 +0100 Feature #495: Added application css. Make dashboard look nicer. commit 3b85137dc6dd8e8618370daee6798dabaaf39ca1 Author: Hector Sanjuan Date: Fri Dec 17 15:33:32 2010 +0100 Feature #495: Datatables are correctly showing now. JS code is well divided in two files. commit 5ffe2490e28d72eebd7bb61d37436ff9b93382b4 Author: Hector Sanjuan Date: Thu Dec 16 17:18:32 2010 +0100 Feature #495: Trying datatables but not working... commit 6cce95b5b5649e8805da73b3b3de71d19a06f49a Author: Hector Sanjuan Date: Thu Dec 16 16:58:42 2010 +0100 Feature #495: Moved all js to a single file, for the moment. Fixed some names. Hosts table is now loaded, but not showing nicely. commit ca3ee40afec8e9c35effc23005155c5b3136f647 Author: Hector Sanjuan Date: Thu Dec 16 16:40:54 2010 +0100 Feature #495: As far as today goes: *Set up the new project *Set up some templates *Set up the sinatra application and the models *Wrote some js. Tabs are showing at least. commit b9d71dacfde63be54dd2bb26a86b8c0dc85cda0e Author: Hector Sanjuan Date: Thu Dec 16 12:48:02 2010 +0100 Feature #495: Initial commit --- src/sunstone/config.ru | 24 + src/sunstone/models/OneUI.rb | 216 ++ src/sunstone/models/OpenNebulaJSON.rb | 54 + .../models/OpenNebulaJSON/ClusterJSON.rb | 56 + .../models/OpenNebulaJSON/HostJSON.rb | 57 + .../models/OpenNebulaJSON/ImageJSON.rb | 67 + .../models/OpenNebulaJSON/JSONUtils.rb | 89 + .../models/OpenNebulaJSON/PoolJSON.rb | 26 + .../models/OpenNebulaJSON/UserJSON.rb | 53 + .../OpenNebulaJSON/VirtualMachineJSON.rb | 120 + .../OpenNebulaJSON/VirtualNetworkJSON.rb | 53 + src/sunstone/one-ui.rb | 175 + src/sunstone/public/css/application.css | 534 +++ src/sunstone/public/css/demo_table_jui.css | 513 +++ src/sunstone/public/css/jquery.jgrowl.css | 131 + .../public/css/layout-default-latest.css | 126 + src/sunstone/public/css/layout.css | 173 + src/sunstone/public/css/login.css | 166 + .../images/ui-bg_flat_0_575c5b_40x100.png | Bin 0 -> 224 bytes .../images/ui-bg_flat_0_8f9392_40x100.png | Bin 0 -> 224 bytes .../images/ui-bg_flat_0_aaaaaa_40x100.png | Bin 0 -> 180 bytes .../images/ui-bg_flat_75_ffffff_40x100.png | Bin 0 -> 178 bytes .../images/ui-bg_glass_55_fbf9ee_1x400.png | Bin 0 -> 120 bytes .../images/ui-bg_glass_65_ffffff_1x400.png | Bin 0 -> 105 bytes .../images/ui-bg_glass_75_dadada_1x400.png | Bin 0 -> 111 bytes .../images/ui-bg_glass_75_e6e6e6_1x400.png | Bin 0 -> 110 bytes .../images/ui-bg_glass_95_fef1ec_1x400.png | Bin 0 -> 119 bytes .../ui-bg_highlight-soft_75_cccccc_1x100.png | Bin 0 -> 101 bytes .../images/ui-icons_222222_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_222222_256x240.png.old | Bin 0 -> 4369 bytes .../images/ui-icons_2e83ff_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_454545_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_888888_256x240.png | Bin 0 -> 4369 bytes .../images/ui-icons_cd0a0a_256x240.png | Bin 0 -> 4369 bytes .../css/smoothness/jquery-ui-1.8.7.custom.css | 572 +++ src/sunstone/public/images/Refresh-icon.png | Bin 0 -> 447 bytes src/sunstone/public/images/ajax-loader.gif | Bin 0 -> 673 bytes src/sunstone/public/images/box_gradient.png | Bin 0 -> 540 bytes src/sunstone/public/images/login.png | Bin 0 -> 4097 bytes src/sunstone/public/images/login_over.png | Bin 0 -> 4351 bytes .../public/images/opennebula-sunstone-big.png | Bin 0 -> 8084 bytes .../images/opennebula-sunstone-small.png | Bin 0 -> 2434 bytes src/sunstone/public/images/panel.png | Bin 0 -> 5227 bytes src/sunstone/public/images/pbar.gif | Bin 0 -> 3951 bytes src/sunstone/public/js/base64.js | 113 + src/sunstone/public/js/jquery-1.4.4.min.js | 167 + .../public/js/jquery-ui-1.8.7.custom.min.js | 781 ++++ .../public/js/jquery.dataTables.min.js | 142 + .../public/js/jquery.jgrowl_minimized.js | 11 + .../public/js/jquery.layout.min-1.2.0.js | 80 + src/sunstone/public/js/layout.js | 102 + src/sunstone/public/js/login.js | 71 + src/sunstone/public/js/one-ui_views.js | 3215 +++++++++++++++++ .../public/js/one-ui_views.templates.js | 1096 ++++++ src/sunstone/public/js/opennebula.js | 1832 ++++++++++ src/sunstone/templates/index.html | 98 + src/sunstone/templates/login.html | 48 + .../test/examples/cluster/addhost.json | 8 + .../test/examples/cluster/cluster1.json | 5 + .../test/examples/cluster/cluster2.json | 5 + .../test/examples/cluster/rmhost.json | 8 + .../test/examples/error/wrong_action.json | 5 + src/sunstone/test/examples/host/disable.json | 5 + src/sunstone/test/examples/host/enable.json | 5 + src/sunstone/test/examples/host/host0.json | 8 + src/sunstone/test/examples/host/host1.json | 8 + src/sunstone/test/examples/image/disable.json | 5 + src/sunstone/test/examples/image/enable.json | 5 + src/sunstone/test/examples/image/image0.json | 7 + src/sunstone/test/examples/image/image1.json | 7 + .../test/examples/image/nonpersistent.json | 5 + .../test/examples/image/persistent.json | 5 + src/sunstone/test/examples/image/publish.json | 5 + .../test/examples/image/removeattr.json | 8 + .../test/examples/image/unpublish.json | 5 + src/sunstone/test/examples/image/update.json | 9 + src/sunstone/test/examples/user/passwd.json | 8 + src/sunstone/test/examples/user/user1.json | 6 + src/sunstone/test/examples/user/user2.json | 6 + src/sunstone/test/examples/vm/deploy.json | 8 + src/sunstone/test/examples/vm/hold.json | 5 + src/sunstone/test/examples/vm/save_as.json | 9 + src/sunstone/test/examples/vm/vm0.json | 12 + src/sunstone/test/examples/vm/vm1.json | 7 + .../test/examples/vnet/fixed_vnet.json | 16 + src/sunstone/test/examples/vnet/publish.json | 5 + .../test/examples/vnet/ranged_vnet.json | 9 + .../test/examples/vnet/unpublish.json | 5 + src/sunstone/test/spec/cluster_spec.rb | 176 + src/sunstone/test/spec/host_spec.rb | 203 ++ src/sunstone/test/spec/image_spec.rb | 327 ++ src/sunstone/test/spec/spec_helper.rb | 41 + src/sunstone/test/spec/user_spec.rb | 161 + src/sunstone/test/spec/vm_spec.rb | 251 ++ src/sunstone/test/spec/vnet_spec.rb | 207 ++ src/sunstone/test/test.sh | 49 + 96 files changed, 12590 insertions(+) create mode 100644 src/sunstone/config.ru create mode 100644 src/sunstone/models/OneUI.rb create mode 100644 src/sunstone/models/OpenNebulaJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/HostJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/ImageJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/JSONUtils.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/PoolJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/UserJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb create mode 100644 src/sunstone/models/OpenNebulaJSON/VirtualNetworkJSON.rb create mode 100755 src/sunstone/one-ui.rb create mode 100644 src/sunstone/public/css/application.css create mode 100644 src/sunstone/public/css/demo_table_jui.css create mode 100755 src/sunstone/public/css/jquery.jgrowl.css create mode 100644 src/sunstone/public/css/layout-default-latest.css create mode 100755 src/sunstone/public/css/layout.css create mode 100644 src/sunstone/public/css/login.css create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_flat_0_575c5b_40x100.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_flat_0_8f9392_40x100.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_flat_0_aaaaaa_40x100.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_glass_75_e6e6e6_1x400.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_glass_95_fef1ec_1x400.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png.old create mode 100644 src/sunstone/public/css/smoothness/images/ui-icons_2e83ff_256x240.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-icons_454545_256x240.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-icons_888888_256x240.png create mode 100644 src/sunstone/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png create mode 100644 src/sunstone/public/css/smoothness/jquery-ui-1.8.7.custom.css create mode 100644 src/sunstone/public/images/Refresh-icon.png create mode 100644 src/sunstone/public/images/ajax-loader.gif create mode 100644 src/sunstone/public/images/box_gradient.png create mode 100644 src/sunstone/public/images/login.png create mode 100644 src/sunstone/public/images/login_over.png create mode 100644 src/sunstone/public/images/opennebula-sunstone-big.png create mode 100644 src/sunstone/public/images/opennebula-sunstone-small.png create mode 100644 src/sunstone/public/images/panel.png create mode 100644 src/sunstone/public/images/pbar.gif create mode 100644 src/sunstone/public/js/base64.js create mode 100644 src/sunstone/public/js/jquery-1.4.4.min.js create mode 100644 src/sunstone/public/js/jquery-ui-1.8.7.custom.min.js create mode 100644 src/sunstone/public/js/jquery.dataTables.min.js create mode 100644 src/sunstone/public/js/jquery.jgrowl_minimized.js create mode 100644 src/sunstone/public/js/jquery.layout.min-1.2.0.js create mode 100755 src/sunstone/public/js/layout.js create mode 100644 src/sunstone/public/js/login.js create mode 100644 src/sunstone/public/js/one-ui_views.js create mode 100644 src/sunstone/public/js/one-ui_views.templates.js create mode 100644 src/sunstone/public/js/opennebula.js create mode 100644 src/sunstone/templates/index.html create mode 100644 src/sunstone/templates/login.html create mode 100644 src/sunstone/test/examples/cluster/addhost.json create mode 100644 src/sunstone/test/examples/cluster/cluster1.json create mode 100644 src/sunstone/test/examples/cluster/cluster2.json create mode 100644 src/sunstone/test/examples/cluster/rmhost.json create mode 100644 src/sunstone/test/examples/error/wrong_action.json create mode 100644 src/sunstone/test/examples/host/disable.json create mode 100644 src/sunstone/test/examples/host/enable.json create mode 100644 src/sunstone/test/examples/host/host0.json create mode 100644 src/sunstone/test/examples/host/host1.json create mode 100644 src/sunstone/test/examples/image/disable.json create mode 100644 src/sunstone/test/examples/image/enable.json create mode 100644 src/sunstone/test/examples/image/image0.json create mode 100644 src/sunstone/test/examples/image/image1.json create mode 100644 src/sunstone/test/examples/image/nonpersistent.json create mode 100644 src/sunstone/test/examples/image/persistent.json create mode 100644 src/sunstone/test/examples/image/publish.json create mode 100644 src/sunstone/test/examples/image/removeattr.json create mode 100644 src/sunstone/test/examples/image/unpublish.json create mode 100644 src/sunstone/test/examples/image/update.json create mode 100644 src/sunstone/test/examples/user/passwd.json create mode 100644 src/sunstone/test/examples/user/user1.json create mode 100644 src/sunstone/test/examples/user/user2.json create mode 100644 src/sunstone/test/examples/vm/deploy.json create mode 100644 src/sunstone/test/examples/vm/hold.json create mode 100644 src/sunstone/test/examples/vm/save_as.json create mode 100644 src/sunstone/test/examples/vm/vm0.json create mode 100644 src/sunstone/test/examples/vm/vm1.json create mode 100644 src/sunstone/test/examples/vnet/fixed_vnet.json create mode 100644 src/sunstone/test/examples/vnet/publish.json create mode 100644 src/sunstone/test/examples/vnet/ranged_vnet.json create mode 100644 src/sunstone/test/examples/vnet/unpublish.json create mode 100644 src/sunstone/test/spec/cluster_spec.rb create mode 100644 src/sunstone/test/spec/host_spec.rb create mode 100644 src/sunstone/test/spec/image_spec.rb create mode 100644 src/sunstone/test/spec/spec_helper.rb create mode 100644 src/sunstone/test/spec/user_spec.rb create mode 100644 src/sunstone/test/spec/vm_spec.rb create mode 100644 src/sunstone/test/spec/vnet_spec.rb create mode 100644 src/sunstone/test/test.sh diff --git a/src/sunstone/config.ru b/src/sunstone/config.ru new file mode 100644 index 0000000000..a7034811d0 --- /dev/null +++ b/src/sunstone/config.ru @@ -0,0 +1,24 @@ +#!/usr/bin/ruby + +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +# TBD Change path for intallation tree +$: << File.dirname(__FILE__) + +require 'one-ui.rb' + +run Sinatra::Application diff --git a/src/sunstone/models/OneUI.rb b/src/sunstone/models/OneUI.rb new file mode 100644 index 0000000000..f41200adbf --- /dev/null +++ b/src/sunstone/models/OneUI.rb @@ -0,0 +1,216 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +# TBD Change path for intallation tree + +#require 'OpenNebulaJSON' +require 'models/OpenNebulaJSON' +include OpenNebulaJSON + +class OneUI + def initialize(username, password) + # TBD one_client_user(name) from CloudServer + @client = Client.new("dummy:dummy") + @client.one_auth = "#{username}:#{password}" + end + + ############################################################################ + # + ############################################################################ + def self.authorize(user="", sha1_pass="") + if user.empty? || sha1_pass.empty? + return [401, false] + end + + # TBD get_user_password(name) from CloudServer + user_pool = UserPool.new(Client.new) + rc = user_pool.info + if OpenNebula.is_error?(rc) + return [500, false] + end + + user_pass = user_pool["USER[NAME=\"#{user}\"]/PASSWORD"] + if user_pass == sha1_pass + return [204, user_pool["USER[NAME=\"#{user}\"]/ID"]] + else + return [401, nil] + end + end + + ############################################################################ + # + ############################################################################ + def get_pool(kind, user_id) + user_flag = user_id=="0" ? -2 : -1 + + pool = case kind + when "cluster" then ClusterPoolJSON.new(@client) + when "host" then HostPoolJSON.new(@client) + when "image" then ImagePoolJSON.new(@client, user_flag) + when "vm" then VirtualMachinePoolJSON.new(@client, user_flag) + when "vnet" then VirtualNetworkPoolJSON.new(@client, user_flag) + when "user" then UserPoolJSON.new(@client) + else + error = Error.new("Error: #{kind} resource not supported") + return [404, error.to_json] + end + + rc = pool.info + if OpenNebula.is_error?(rc) + return [500, rc.to_json] + else + return [200, pool.to_json] + end + end + + ############################################################################ + # + ############################################################################ + def get_resource(kind, id) + resource = retrieve_resource(kind, id) + if OpenNebula.is_error?(resource) + return [404, resource.to_json] + else + return [200, resource.to_json] + end + end + + ############################################################################ + # + ############################################################################ + def create_resource(kind, template) + resource = case kind + when "cluster" then ClusterJSON.new(Cluster.build_xml, @client) + when "host" then HostJSON.new(Host.build_xml, @client) + when "image" then ImageJSON.new(Image.build_xml, @client) + when "vm" then VirtualMachineJSON.new(VirtualMachine.build_xml,@client) + when "vnet" then VirtualNetworkJSON.new(VirtualNetwork.build_xml, @client) + when "user" then UserJSON.new(User.build_xml, @client) + else + error = Error.new("Error: #{kind} resource not supported") + return [404, error.to_json] + end + + rc = resource.allocate(template) + if OpenNebula.is_error?(rc) + return [500, rc.to_json] + else + resource.info + return [201, resource.to_json] + end + end + + ############################################################################ + # + ############################################################################ + def delete_resource(kind, id) + resource = retrieve_resource(kind, id) + if OpenNebula.is_error?(resource) + return [404, resource.to_json] + end + + rc = resource.delete + if OpenNebula.is_error?(rc) + return [500, rc.to_json] + else + return [204, resource.to_json] + end + end + + ############################################################################ + # + ############################################################################ + def perform_action(kind, id, action_json) + resource = retrieve_resource(kind, id) + if OpenNebula.is_error?(resource) + return [404, resource.to_json] + end + + rc = resource.perform_action(action_json) + if OpenNebula.is_error?(rc) + return [500, rc.to_json] + else + return [204, resource.to_json] + end + end + + ############################################################################ + # + ############################################################################ + def get_configuration + one_config = VAR_LOCATION + "/config" + config = Hash.new + + begin + cfg = File.read(one_config) + rescue Exception => e + error = Error.new("Error reading config: #{e.inspect}") + return [500, error.to_json] + end + + cfg.lines do |line| + m=line.match(/^([^=]+)=(.*)$/) + + if m + name=m[1].strip.upcase + value=m[2].strip + config[name]=value + end + end + + return [200, config.to_json] + end + + ############################################################################ + # + ############################################################################ + def get_vm_log(id) + id = id.to_s + vm_log_file = VAR_LOCATION + "/#{id}/vm.log" + + begin + log = File.read(vm_log_file) + rescue Exception => e + error = Error.new("Error: log for VM #{id} not available") + return [500, error.to_s] + end + + return [200, log] + end + + private + + def retrieve_resource(kind, id) + resource = case kind + when "cluster" then ClusterJSON.new_with_id(id, @client) + when "host" then HostJSON.new_with_id(id, @client) + when "image" then ImageJSON.new_with_id(id, @client) + when "vm" then VirtualMachineJSON.new_with_id(id, @client) + when "vnet" then VirtualNetworkJSON.new_with_id(id, @client) + when "user" then UserJSON.new_with_id(id, @client) + else + error = Error.new("Error: #{kind} resource not supported") + return error + end + + rc = resource.info + if OpenNebula.is_error?(rc) + return rc + else + return resource + end + end +end diff --git a/src/sunstone/models/OpenNebulaJSON.rb b/src/sunstone/models/OpenNebulaJSON.rb new file mode 100644 index 0000000000..28821ef8e1 --- /dev/null +++ b/src/sunstone/models/OpenNebulaJSON.rb @@ -0,0 +1,54 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +ONE_LOCATION = ENV["ONE_LOCATION"] + +if !ONE_LOCATION + RUBY_LIB_LOCATION = "/usr/lib/one/ruby" + VAR_LOCATION = "/var/lib/one" +else + RUBY_LIB_LOCATION = ONE_LOCATION+"/lib/ruby" + VAR_LOCATION = ONE_LOCATION+"/var" +end + +$: << RUBY_LIB_LOCATION + +require 'OpenNebula' +include OpenNebula + +# TBD Change path for intallation tree +#require 'OpenNebulaJSON/PoolJSON' +#require 'OpenNebulaJSON/HostJSON' +#require 'OpenNebulaJSON/JSONUtils' +require 'models/OpenNebulaJSON/ClusterJSON' +require 'models/OpenNebulaJSON/HostJSON' +require 'models/OpenNebulaJSON/ImageJSON' +require 'models/OpenNebulaJSON/JSONUtils' +require 'models/OpenNebulaJSON/PoolJSON' +require 'models/OpenNebulaJSON/UserJSON' +require 'models/OpenNebulaJSON/VirtualMachineJSON' +require 'models/OpenNebulaJSON/VirtualNetworkJSON' + +module OpenNebula + class Error + def to_json + message = { :message => @message } + error_hash = { :error => message } + + return JSON.pretty_generate error_hash + end + end +end diff --git a/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb new file mode 100644 index 0000000000..9c015d0187 --- /dev/null +++ b/src/sunstone/models/OpenNebulaJSON/ClusterJSON.rb @@ -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. # +#--------------------------------------------------------------------------- # + +require 'models/OpenNebulaJSON/JSONUtils' + +module OpenNebulaJSON + class ClusterJSON < OpenNebula::Cluster + include JSONUtils + + def allocate(template_json) + cluster_hash = parse_json(template_json,'cluster') + if OpenNebula.is_error?(cluster_hash) + return cluster_hash + end + + super(cluster_hash['name']) + end + + def perform_action(template_json) + action_hash = parse_json(template_json, 'action') + if OpenNebula.is_error?(action_hash) + return action_hash + end + + rc = case action_hash['perform'] + when "add_host" then self.add_host(action_hash['params']) + when "remove_host" then self.remove_host(action_hash['params']) + else + error_msg = "#{action_hash['perform']} action not " << + " available for this resource" + OpenNebula::Error.new(error_msg) + end + end + + def add_host(params=Hash.new) + super(params['host_id']) + end + + def remove_host(params=Hash.new) + super(params['host_id']) + end + end +end diff --git a/src/sunstone/models/OpenNebulaJSON/HostJSON.rb b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb new file mode 100644 index 0000000000..42490d405a --- /dev/null +++ b/src/sunstone/models/OpenNebulaJSON/HostJSON.rb @@ -0,0 +1,57 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require 'models/OpenNebulaJSON/JSONUtils' + +module OpenNebulaJSON + class HostJSON < OpenNebula::Host + include JSONUtils + + def allocate(template_json) + host_hash = parse_json(template_json, 'host') + if OpenNebula.is_error?(host_hash) + return host_hash + end + + super(host_hash['name'], host_hash['im_mad'], host_hash['vm_mad'], + host_hash['tm_mad']) + end + + def delete + if self['HOST_SHARE/RUNNING_VMS'].to_i != 0 + OpenNebula::Error.new("Host still has associated VMs, aborting delete.") + else + super + end + end + + def perform_action(template_json) + action_hash = parse_json(template_json, 'action') + if OpenNebula.is_error?(action_hash) + return action_hash + end + + rc = case action_hash['perform'] + when "enable" then self.enable + when "disable" then self.disable + else + error_msg = "#{action_hash['perform']} action not " << + " available for this resource" + OpenNebula::Error.new(error_msg) + end + end + end +end diff --git a/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb b/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb new file mode 100644 index 0000000000..05cb041d21 --- /dev/null +++ b/src/sunstone/models/OpenNebulaJSON/ImageJSON.rb @@ -0,0 +1,67 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require 'models/OpenNebulaJSON/JSONUtils' + +module OpenNebulaJSON + class ImageJSON < OpenNebula::Image + include JSONUtils + + def allocate(template_json) + image_hash = parse_json(template_json, 'image') + if OpenNebula.is_error?(image_hash) + return image_hash + end + + if image_hash['image_raw'] + super(image_hash['image_raw']) + else + template = template_to_str(image_hash) + super(template) + end + end + + def perform_action(template_json) + action_hash = parse_json(template_json, 'action') + if OpenNebula.is_error?(action_hash) + return action_hash + end + + rc = case action_hash['perform'] + when "disable" then self.disable + when "enable" then self.enable + when "nonpersistent" then self.nonpersistent + when "persistent" then self.persistent + when "publish" then self.publish + when "rm_attr" then self.remove_attr(action_hash['params']) + when "unpublish" then self.unpublish + when "update" then self.update(action_hash['params']) + else + error_msg = "#{action_hash['perform']} action not " << + " available for this resource" + OpenNebula::Error.new(error_msg) + end + end + + def update(params=Hash.new) + super(params['name'], params['value']) + end + + def remove_attr(params=Hash.new) + super(params['name']) + end + end +end diff --git a/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb b/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb new file mode 100644 index 0000000000..ccd9c17ce5 --- /dev/null +++ b/src/sunstone/models/OpenNebulaJSON/JSONUtils.rb @@ -0,0 +1,89 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +module OpenNebulaJSON + require 'json' + + module JSONUtils + def to_json + begin + JSON.pretty_generate self.to_hash + rescue Exception => e + OpenNebula::Error.new(e.message) + end + end + + def parse_json(json_str, root_element) + begin + hash = JSON.parse(json_str) + rescue Exception => e + return OpenNebula::Error.new(e.message) + end + + if hash.has_key?(root_element) + return hash[root_element] + else + return OpenNebula::Error.new("Error parsing JSON: Wrong resource type") + end + end + + def template_to_str(attributes, indent=true) + if indent + ind_enter="\n" + ind_tab=' ' + else + ind_enter='' + ind_tab=' ' + end + + str=attributes.collect do |key, value| + if value + str_line="" + if value.class==Array && !value.empty? + value.each do |value2| + str_line << key.to_s.upcase << "=[" << ind_enter + if value2 && value2.class==Hash + str_line << value2.collect do |key3, value3| + str = ind_tab + key3.to_s.upcase + "=" + str += "\"#{value3.to_s}\"" if value3 + str + end.compact.join(",\n") + end + str_line << "\n]\n" + end + + elsif value.class==Hash && !value.empty? + str_line << key.to_s.upcase << "=[" << ind_enter + + str_line << value.collect do |key3, value3| + str = ind_tab + key3.to_s.upcase + "=" + str += "\"#{value3.to_s}\"" if value3 + str + end.compact.join(",\n") + + str_line << "\n]\n" + + else + str_line<"#{session['user']}", :expires=>time) + response.set_cookie("one-user_id", :value=>"#{session['user_id']}", :expires=>time) + File.read(File.dirname(__FILE__)+'/templates/index.html') +end + +get '/login' do + File.read(File.dirname(__FILE__)+'/templates/login.html') +end + +############################################################################## +# Login +############################################################################## +post '/login' do + build_session +end + +post '/logout' do + destroy_session +end + +############################################################################## +# GET Pool information +############################################################################## +get '/:pool' do + @OneUI.get_pool(params[:pool], session["user_id"]) +end + +############################################################################## +# GET Resource information +############################################################################## +get '/:resource/:id' do + @OneUI.get_resource(params[:resource], params[:id]) +end + +############################################################################## +# Delete Resource +############################################################################## +delete '/:resource/:id' do + @OneUI.delete_resource(params[:resource], params[:id]) +end + +############################################################################## +# Create a new Resource +############################################################################## +post '/:pool' do + @OneUI.create_resource(params[:pool], request.body.read) +end + +############################################################################## +# Perform an action on a Resource +############################################################################## +post '/:resource/:id/action' do + @OneUI.perform_action(params[:resource], params[:id], request.body.read) +end + +############################################################################## +# Config and Logs +############################################################################## +get '/config' do + @OneUI.get_configuration +end + +get '/vm/:id/log' do + @OneUI.get_vm_log(params[:id].to_i) +end diff --git a/src/sunstone/public/css/application.css b/src/sunstone/public/css/application.css new file mode 100644 index 0000000000..886e469918 --- /dev/null +++ b/src/sunstone/public/css/application.css @@ -0,0 +1,534 @@ +/* -------------------------------------------------------------------------- */ +/* 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 td{ + width:50%; +} + +div.panel { + background-color: #ffffff; + padding:0; + width:80%; + margin: 10px; + border: 1px #ddd solid; + min-height: 110px; + -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; + 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 td { + border: 0; + width: 100%!important; +} + +div.panel_info table.info_table td.value_td { + text-align: right; +} + +.key_td_green { + color: green!important; +} + +.key_td_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:150px; + /*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:154px; + /*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:150px; + padding:0 1em; + text-align:left; + } + + +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; +} +.kvm .man_icon,.xen .man_icon,.img_man .man_icon { + display:inline-block!important; +} + +span.tipspan { + 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:25px; + text-align:right; +} + +.add_remove_button { + font-size:0.8em; + height:25px; + margin-bottom:4px; +} + +.add_button { + margin-left:177px; +} + +.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: #E69138 !important; +} + +tr.even:hover{ + background-color: #E69138 !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:45%; + vertical-align:top; + } + +.info_table th,h3 { + border-bottom: 2px solid #353735; + color: #353735; + font-size: 14px; + font-weight: normal; + padding: 10px 8px; +} + + +.info_table td{ + border-bottom: 1px solid #CCCCCC; + color: #353735; + padding: 6px 8px; + } + + +.info_table td.key_td{ + width: 100%; + text-align:left; + font-weight:bold; +} + +.info_table td.key_td:after{ + content:":"; +} + +.info_table td.value_td{ + text-align:left; +} + +#dialog > div > div { + margin: 0; + padding: 0; +} + +.loading_img { + vertical-align:middle; + display:inline; + overflow:hide; + +} + +.top_button { + font-size: 0.8em; + height: 25px; + margin: 3px 0; + vertical-align: middle; + /*width: 89px;*/ +} +.top_button button { + font-size: 0.9em; + height: 25px; + vertical-align: middle; +} + +/* +.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-closer, .jGrowl-notify-submit { + border: 2px #444444 solid; + background-color: #F3F3F3; + color: #666666; +} + +.jGrowl-notify-error { + border: 2px #660000 solid; + background-color: #F39999; + 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-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:#E69138; + +} + +.progress_bar{ + height:10px; + background: #8F9392; +} + diff --git a/src/sunstone/public/css/demo_table_jui.css b/src/sunstone/public/css/demo_table_jui.css new file mode 100644 index 0000000000..b81a1cf99d --- /dev/null +++ b/src/sunstone/public/css/demo_table_jui.css @@ -0,0 +1,513 @@ +/* + * File: demo_table_jui.css + * CVS: $Id$ + * Description: CSS descriptions for DataTables demo pages + * Author: Allan Jardine + * Created: Tue May 12 06:47:22 BST 2009 + * Modified: $Date$ by $Author$ + * Language: CSS + * Project: DataTables + * + * Copyright 2009 Allan Jardine. All Rights Reserved. + * + * *************************************************************************** + * DESCRIPTION + * + * The styles given here are suitable for the demos that are used with the standard DataTables + * distribution (see www.datatables.net). You will most likely wish to modify these styles to + * meet the layout requirements of your site. + * + * Common issues: + * 'full_numbers' pagination - I use an extra selector on the body tag to ensure that there is + * no conflict between the two pagination types. If you want to use full_numbers pagination + * ensure that you either have "example_alt_pagination" as a body class name, or better yet, + * modify that selector. + * Note that the path used for Images is relative. All images are by default located in + * ../images/ - relative to this CSS file. + */ + + +/* + * jQuery UI specific styling + */ + +.paging_two_button .ui-button { + float: left; + cursor: pointer; + * cursor: hand; +} + +.paging_full_numbers .ui-button { + padding: 2px 6px; + margin: 0; + cursor: pointer; + * cursor: hand; +} + +.ui-buttonset .ui-button { + margin-right: -0.1em !important; +} + +.paging_full_numbers { + width: 350px !important; +} + +.ui-toolbar { + padding: 5px; +} + +.dataTables_paginate { + width: auto; +} + +.dataTables_info { + padding-top: 3px; +} + +table.display thead th { + padding: 3px 0px 3px 10px; + cursor: pointer; + * cursor: hand; +} + +div.dataTables_wrapper .ui-widget-header { + font-weight: normal; +} + + +/* + * Sort arrow icon positioning + */ +table.display thead th div.DataTables_sort_wrapper { + position: relative; + padding-right: 20px; + padding-right: 20px; +} + +table.display thead th div.DataTables_sort_wrapper span { + position: absolute; + top: 50%; + margin-top: -8px; + right: 0; +} + + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * + * Everything below this line is the same as demo_table.css. This file is + * required for 'cleanliness' of the markup + * + * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * */ + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * DataTables features + */ + +.dataTables_wrapper { + position: relative; + min-height: 302px; + _height: 302px; + clear: both; +} + +.dataTables_processing { + position: absolute; + top: 0px; + left: 50%; + width: 250px; + margin-left: -125px; + border: 1px solid #ddd; + text-align: center; + color: #999; + font-size: 11px; + padding: 2px 0; +} + +.dataTables_length { + width: 40%; + float: left; +} + +.dataTables_filter { + width: 50%; + float: right; + text-align: right; +} + +.dataTables_info { + width: 50%; + float: left; +} + +.dataTables_paginate { + float: right; + text-align: right; +} + +/* Pagination nested */ +.paginate_disabled_previous, .paginate_enabled_previous, .paginate_disabled_next, .paginate_enabled_next { + height: 19px; + width: 19px; + margin-left: 3px; + float: left; +} + +.paginate_disabled_previous { + background-image: url('../images/back_disabled.jpg'); +} + +.paginate_enabled_previous { + background-image: url('../images/back_enabled.jpg'); +} + +.paginate_disabled_next { + background-image: url('../images/forward_disabled.jpg'); +} + +.paginate_enabled_next { + background-image: url('../images/forward_enabled.jpg'); +} + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * DataTables display + */ +table.display { + margin: 0 auto; + width: 100%; + clear: both; + border-collapse: collapse; +} + +table.display tfoot th { + padding: 3px 0px 3px 10px; + font-weight: bold; + font-weight: normal; +} + +table.display tr.heading2 td { + border-bottom: 1px solid #aaa; +} + +table.display td { + padding: 3px 10px; +} + +table.display td.center { + text-align: center; +} + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * DataTables sorting + */ + +.sorting_asc { + background: url('../images/sort_asc.jpg') no-repeat center right; +} + +.sorting_desc { + background: url('../images/sort_desc.jpg') no-repeat center right; +} + +.sorting { + background: url('../images/sort_both.jpg') no-repeat center right; +} + + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * DataTables row classes + */ +table.display tr.odd.gradeA { + background-color: #ddffdd; +} + +table.display tr.even.gradeA { + background-color: #eeffee; +} + + + + +table.display tr.odd.gradeA { + background-color: #ddffdd; +} + +table.display tr.even.gradeA { + background-color: #eeffee; +} + +table.display tr.odd.gradeC { + background-color: #ddddff; +} + +table.display tr.even.gradeC { + background-color: #eeeeff; +} + +table.display tr.odd.gradeX { + background-color: #ffdddd; +} + +table.display tr.even.gradeX { + background-color: #ffeeee; +} + +table.display tr.odd.gradeU { + background-color: #ddd; +} + +table.display tr.even.gradeU { + background-color: #eee; +} + + +tr.odd { + background-color: #E2E4FF; +} + +tr.even { + background-color: white; +} + + + + + +/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * + * Misc + */ +.dataTables_scroll { + clear: both; +} + +.top, .bottom { + padding: 15px; + background-color: #F5F5F5; + border: 1px solid #CCCCCC; +} + +.top .dataTables_info { + float: none; +} + +.clear { + clear: both; +} + +.dataTables_empty { + text-align: center; +} + +tfoot input { + margin: 0.5em 0; + width: 100%; + color: #444; +} + +tfoot input.search_init { + color: #999; +} + +td.group { + background-color: #d1cfd0; + border-bottom: 2px solid #A19B9E; + border-top: 2px solid #A19B9E; +} + +td.details { + background-color: #d1cfd0; + border: 2px solid #A19B9E; +} + + +.example_alt_pagination div.dataTables_info { + width: 40%; +} + +.paging_full_numbers span.paginate_button, + .paging_full_numbers span.paginate_active { + border: 1px solid #aaa; + -webkit-border-radius: 5px; + -moz-border-radius: 5px; + padding: 2px 5px; + margin: 0 3px; + cursor: pointer; + *cursor: hand; +} + +.paging_full_numbers span.paginate_button { + background-color: #ddd; +} + +.paging_full_numbers span.paginate_button:hover { + background-color: #ccc; +} + +.paging_full_numbers span.paginate_active { + background-color: #99B3FF; +} + +table.display tr.even.row_selected td { + background-color: #B0BED9; +} + +table.display tr.odd.row_selected td { + background-color: #9FAFD1; +} + + +/* + * Sorting classes for columns + */ +/* For the standard odd/even */ +tr.odd td.sorting_1 { + background-color: #D3D6FF; +} + +tr.odd td.sorting_2 { + background-color: #DADCFF; +} + +tr.odd td.sorting_3 { + background-color: #E0E2FF; +} + +tr.even td.sorting_1 { + background-color: #EAEBFF; +} + +tr.even td.sorting_2 { + background-color: #F2F3FF; +} + +tr.even td.sorting_3 { + background-color: #F9F9FF; +} + + +/* For the Conditional-CSS grading rows */ +/* + Colour calculations (based off the main row colours) + Level 1: + dd > c4 + ee > d5 + Level 2: + dd > d1 + ee > e2 + */ +tr.odd.gradeA td.sorting_1 { + background-color: #c4ffc4; +} + +tr.odd.gradeA td.sorting_2 { + background-color: #d1ffd1; +} + +tr.odd.gradeA td.sorting_3 { + background-color: #d1ffd1; +} + +tr.even.gradeA td.sorting_1 { + background-color: #d5ffd5; +} + +tr.even.gradeA td.sorting_2 { + background-color: #e2ffe2; +} + +tr.even.gradeA td.sorting_3 { + background-color: #e2ffe2; +} + +tr.odd.gradeC td.sorting_1 { + background-color: #c4c4ff; +} + +tr.odd.gradeC td.sorting_2 { + background-color: #d1d1ff; +} + +tr.odd.gradeC td.sorting_3 { + background-color: #d1d1ff; +} + +tr.even.gradeC td.sorting_1 { + background-color: #d5d5ff; +} + +tr.even.gradeC td.sorting_2 { + background-color: #e2e2ff; +} + +tr.even.gradeC td.sorting_3 { + background-color: #e2e2ff; +} + +tr.odd.gradeX td.sorting_1 { + background-color: #ffc4c4; +} + +tr.odd.gradeX td.sorting_2 { + background-color: #ffd1d1; +} + +tr.odd.gradeX td.sorting_3 { + background-color: #ffd1d1; +} + +tr.even.gradeX td.sorting_1 { + background-color: #ffd5d5; +} + +tr.even.gradeX td.sorting_2 { + background-color: #ffe2e2; +} + +tr.even.gradeX td.sorting_3 { + background-color: #ffe2e2; +} + +tr.odd.gradeU td.sorting_1 { + background-color: #c4c4c4; +} + +tr.odd.gradeU td.sorting_2 { + background-color: #d1d1d1; +} + +tr.odd.gradeU td.sorting_3 { + background-color: #d1d1d1; +} + +tr.even.gradeU td.sorting_1 { + background-color: #d5d5d5; +} + +tr.even.gradeU td.sorting_2 { + background-color: #e2e2e2; +} + +tr.even.gradeU td.sorting_3 { + background-color: #e2e2e2; +} + + +/* + * Row highlighting example + */ +.ex_highlight #example tbody tr.even:hover, #example tbody tr.even td.highlighted { + background-color: #ECFFB3; +} + +.ex_highlight #example tbody tr.odd:hover, #example tbody tr.odd td.highlighted { + background-color: #E6FF99; +} \ No newline at end of file diff --git a/src/sunstone/public/css/jquery.jgrowl.css b/src/sunstone/public/css/jquery.jgrowl.css new file mode 100755 index 0000000000..a735d2fbd8 --- /dev/null +++ b/src/sunstone/public/css/jquery.jgrowl.css @@ -0,0 +1,131 @@ + +div.jGrowl { + padding: 10px; + z-index: 9999; + color: #fff; + font-size: 12px; +} + +/** Special IE6 Style Positioning **/ +div.ie6 { + position: absolute; +} + +div.ie6.top-right { + right: auto; + bottom: auto; + left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.top-left { + left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.bottom-right { + left: expression( ( 0 - jGrowl.offsetWidth + ( document.documentElement.clientWidth ? document.documentElement.clientWidth : document.body.clientWidth ) + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.bottom-left { + left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 - jGrowl.offsetHeight + ( document.documentElement.clientHeight ? document.documentElement.clientHeight : document.body.clientHeight ) + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); +} + +div.ie6.center { + left: expression( ( 0 + ( ignoreMe2 = document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft ) ) + 'px' ); + top: expression( ( 0 + ( ignoreMe = document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop ) ) + 'px' ); + width: 100%; +} + +/** Normal Style Positions **/ +div.jGrowl { + position: absolute; +} + +body > div.jGrowl { + position: fixed; +} + +div.jGrowl.top-left { + left: 0px; + top: 0px; +} + +div.jGrowl.top-right { + right: 0px; + top: 0px; +} + +div.jGrowl.bottom-left { + left: 0px; + bottom: 0px; +} + +div.jGrowl.bottom-right { + right: 0px; + bottom: 0px; +} + +div.jGrowl.center { + top: 0px; + width: 50%; + left: 25%; +} + +/** Cross Browser Styling **/ +div.center div.jGrowl-notification, div.center div.jGrowl-closer { + margin-left: auto; + margin-right: auto; +} + +div.jGrowl div.jGrowl-notification, div.jGrowl div.jGrowl-closer { + opacity: 0.90; + -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=90)"; + filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=90); + zoom: 1; + width: 235px; + padding: 10px; + margin-top: 5px; + margin-bottom: 5px; + font-family: Tahoma, Arial, Helvetica, sans-serif; + font-size: 1em; + text-align: left; + display: none; + -moz-border-radius: 5px; + -webkit-border-radius: 5px; +} + +div.jGrowl div.jGrowl-notification { + min-height: 20px; +} + +div.jGrowl div.jGrowl-notification div.jGrowl-header { + font-weight: bold; + font-size: .85em; +} + +div.jGrowl div.jGrowl-notification div.jGrowl-close { + z-index: 99; + float: right; + font-weight: bold; + font-size: 1em; + cursor: pointer; +} + +div.jGrowl div.jGrowl-closer { + padding-top: 4px; + padding-bottom: 4px; + cursor: pointer; + font-size: .9em; + font-weight: bold; + text-align: center; +} + +/** Hide jGrowl when printing **/ +@media print { + div.jGrowl { + display: none; + } +} diff --git a/src/sunstone/public/css/layout-default-latest.css b/src/sunstone/public/css/layout-default-latest.css new file mode 100644 index 0000000000..8575005874 --- /dev/null +++ b/src/sunstone/public/css/layout-default-latest.css @@ -0,0 +1,126 @@ +/* + * Default Layout Theme + * + * Created for jquery.layout + * + * Copyright (c) 2010 + * Fabrizio Balliano (http://www.fabrizioballiano.net) + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * Last Updated: 2010-02-10 + * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars + */ + +/* + * PANES & CONTENT-DIVs + */ +.ui-layout-pane { /* all 'panes' */ + background: #f5f5f5; + /* DO NOT add scrolling (or padding) to 'panes' that have a content-div, + otherwise you may get double-scrollbars - on the pane AND on the content-div + */ + padding: 10px; + overflow: auto; + } + /* (scrolling) content-div inside pane allows for fixed header(s) and/or footer(s) */ + .ui-layout-content { + padding: 10px; + position: relative; /* contain floated or positioned elements */ + overflow: auto; /* add scrolling to content-div */ + } + +/* + * RESIZER-BARS + */ +.ui-layout-resizer { /* all 'resizer-bars' */ + background: #DDD; + /*border: 1px solid #BBB; + border-width: 0;*/ + border: 1px #BBB solid; + } + .ui-layout-resizer-drag { /* REAL resizer while resize in progress */ + } + .ui-layout-resizer-hover { /* affects both open and closed states */ + } + /* NOTE: It looks best when 'hover' and 'dragging' are set to the same color, + otherwise color shifts while dragging when bar can't keep up with mouse */ + .ui-layout-resizer-open-hover , /* hover-color to 'resize' */ + .ui-layout-resizer-dragging { /* resizer beging 'dragging' */ + border-top: 1px solid #BBB; + border-bottom: 1px solid #BBB; + background: #DDD; + } + .ui-layout-resizer-dragging { /* CLONED resizer being dragged */ + border-left: 1px solid #BBB; + border-right: 1px solid #BBB; + } + /* NOTE: Add a 'dragging-limit' color to provide visual feedback when resizer hits min/max size limits */ + .ui-layout-resizer-dragging-limit { /* CLONED resizer at min or max size-limit */ + background: #E1A4A4; /* red */ + } + + .ui-layout-resizer-closed-hover { /* hover-color to 'slide open' */ + background: #EBD5AA; + } + .ui-layout-resizer-sliding { /* resizer when pane is 'slid open' */ + opacity: .10; /* show only a slight shadow */ + filter: alpha(opacity=10); + } + .ui-layout-resizer-sliding-hover { /* sliding resizer - hover */ + opacity: 1.00; /* on-hover, show the resizer-bar normally */ + filter: alpha(opacity=100); + } + /* sliding resizer - add 'outside-border' to resizer on-hover + * this sample illustrates how to target specific panes and states */ + .ui-layout-resizer-north-sliding-hover { border-bottom-width: 1px; } + .ui-layout-resizer-south-sliding-hover { border-top-width: 1px; } + .ui-layout-resizer-west-sliding-hover { border-right-width: 1px; } + .ui-layout-resizer-east-sliding-hover { border-left-width: 1px; } + +/* + * TOGGLER-BUTTONS + */ +.ui-layout-toggler { + border: 1px solid #BBB; /* match pane-border */ + background-color: #BBB; + } + .ui-layout-resizer-hover .ui-layout-toggler { + opacity: .60; + filter: alpha(opacity=60); + } + .ui-layout-toggler-hover , /* need when NOT resizable */ + .ui-layout-resizer-hover .ui-layout-toggler-hover { /* need specificity when IS resizable */ + background-color: #FC6; + opacity: 1.00; + filter: alpha(opacity=100); + } + .ui-layout-toggler-north , + .ui-layout-toggler-south { + border-width: 0 1px; /* left/right borders */ + } + .ui-layout-toggler-west , + .ui-layout-toggler-east { + border-width: 1px 0; /* top/bottom borders */ + } + /* hide the toggler-button when the pane is 'slid open' */ + .ui-layout-resizer-sliding ui-layout-toggler { + display: none; + } + /* + * style the text we put INSIDE the togglers + */ + .ui-layout-toggler .content { + color: #666; + font-size: 12px; + font-weight: bold; + width: 100%; + padding-bottom: 0.35ex; /* to 'vertically center' text inside text-span */ + } + +.ui-layout-resizer-south{ + border-left: 0; + border-right: 0; +} diff --git a/src/sunstone/public/css/layout.css b/src/sunstone/public/css/layout.css new file mode 100755 index 0000000000..d713822e56 --- /dev/null +++ b/src/sunstone/public/css/layout.css @@ -0,0 +1,173 @@ +/* -------------------------------------------------------------------------- */ +/* 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; + background-color: #353735; +} + +#footer { + padding:0; + background-color: #353735; +} + +#header { + padding: 0 10px 0 10px; + background-color: #353735; +} +#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: #E69138; +} + +#footer { + padding-top: 9px; + font-size: 0.8em; + color: white; + text-align: center; +} + +#footer a { + color: white; + text-decoration: underline; +} + +#logo-wrapper { + float: right; + margin-top: 0px; + margin-right: 20px; +} + +#menu { + padding-right: 0; + padding-left: 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, #E69138), + color-stop(1, rgb(53,55,53)) +); +background-image: -moz-linear-gradient( + left center, + #E69138 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; +} diff --git a/src/sunstone/public/css/login.css b/src/sunstone/public/css/login.css new file mode 100644 index 0000000000..baee3d985e --- /dev/null +++ b/src/sunstone/public/css/login.css @@ -0,0 +1,166 @@ +/* -------------------------------------------------------------------------- */ +/* 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-sunstone-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: 150px; + 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; +} + + + diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_575c5b_40x100.png b/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_575c5b_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..f6faa0f3d8980d9bc7e3f63d0cb999d86d8d4810 GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FDaPU;cPEB*=VV?2Ic!PZ?k+$Y z2!1;6t_M<_1s;*b3=G`DAk4@xYmNj^kiEpy*OmP?lMs(6)03DlDL|nFPZ!6KjC*g- z88R{`a4;AwSmdKI;Vst E0KIN6asU7T literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_8f9392_40x100.png b/src/sunstone/public/css/smoothness/images/ui-bg_flat_0_8f9392_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..1e8453f2559e902b6e047225328c1de62c5c6dbd GIT binary patch literal 224 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FDaPU;cPEB*=VV?2Ic!PZ?k+$Y z2!1;6t_M<_1s;*b3=G`DAk4@xYmNj^kiEpy*OmP?lMs)9)ke)7`+-6Uo-U3d8Ta0v z+sMnHz`N1x91EQ4=4yQ7#`R^ z$vje}bP0l+XkK DSH>_4 literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png b/src/sunstone/public/css/smoothness/images/ui-bg_flat_75_ffffff_40x100.png new file mode 100644 index 0000000000000000000000000000000000000000..ac8b229af950c29356abf64a6c4aa894575445f0 GIT binary patch literal 178 zcmeAS@N?(olHy`uVBq!ia0vp^8bF-F!3HG1q!d*FsY*{5$B>N1x91EQ4=4yQYz+E8 zPo9&<{J;c_6SHRil>2s{Zw^OT)6@jj2u|u!(plXsM>LJD`vD!n;OXk;vd$@?2>^GI BH@yG= literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png b/src/sunstone/public/css/smoothness/images/ui-bg_glass_55_fbf9ee_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..ad3d6346e00f246102f72f2e026ed0491988b394 GIT binary patch literal 120 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnour0hLi978O6-<~(*I$*%ybaDOn z{W;e!B}_MSUQoPXhYd^Y6RUoS1yepnPx`2Kz)7OXQG!!=-jY=F+d2OOy?#DnJ32>z UEim$g7SJdLPgg&ebxsLQ09~*s;{X5v literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png b/src/sunstone/public/css/smoothness/images/ui-bg_glass_65_ffffff_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..42ccba269b6e91bef12ad0fa18be651b5ef0ee68 GIT binary patch literal 105 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnouqzpV=978O6-=0?FV^9z|eBtf= z|7WztIJ;WT>{+tN>ySr~=F{k$>;_x^_y?afmf9pRKH0)6?eSP?3s5hEr>mdKI;Vst E0O;M1& literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png b/src/sunstone/public/css/smoothness/images/ui-bg_glass_75_dadada_1x400.png new file mode 100644 index 0000000000000000000000000000000000000000..5a46b47cb16631068aee9e0bd61269fc4e95e5cd GIT binary patch literal 111 zcmeAS@N?(olHy`uVBq!ia0vp^j6gJjgAK^akKnouq|7{B978O6lPf+wIa#m9#>Unb zm^4K~wN3Zq+uP{vDV26o)#~38k_!`W=^oo1w6ixmPC4R1b Tyd6G3lNdZ*{an^LB{Ts5`idse literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png b/src/sunstone/public/css/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png new file mode 100644 index 0000000000000000000000000000000000000000..7c9fa6c6edcfcdd3e5b77e6f547b719e6fc66e30 GIT binary patch literal 101 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 oBo%DI*Kv;w;*%(i9W@f3_WCF#rGn literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png.old b/src/sunstone/public/css/smoothness/images/ui-icons_222222_256x240.png.old new file mode 100644 index 0000000000000000000000000000000000000000..b273ff111d219c9b9a8b96d57683d0075fb7871a GIT binary patch literal 4369 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 literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_2e83ff_256x240.png b/src/sunstone/public/css/smoothness/images/ui-icons_2e83ff_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..09d1cdc856c292c4ab6dd818c7543ac0828bd616 GIT binary patch literal 4369 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 literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_454545_256x240.png b/src/sunstone/public/css/smoothness/images/ui-icons_454545_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..59bd45b907c4fd965697774ce8c5fc6b2fd9c105 GIT binary patch literal 4369 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 oBo%DI*Kv;w;*%(i9W@f3_WCF#rGn literal 0 HcmV?d00001 diff --git a/src/sunstone/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png b/src/sunstone/public/css/smoothness/images/ui-icons_cd0a0a_256x240.png new file mode 100644 index 0000000000000000000000000000000000000000..2ab019b73ec11a485fa09378f3a0e155194f6a5d GIT binary patch literal 4369 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 Tcz5e3Kn)C@u6{1-oD!M<+;OK; literal 0 HcmV?d00001 diff --git a/src/sunstone/public/images/ajax-loader.gif b/src/sunstone/public/images/ajax-loader.gif new file mode 100644 index 0000000000000000000000000000000000000000..6f0e2ddb683a314c0f4b12b55c582d09fa131c88 GIT binary patch literal 673 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 literal 0 HcmV?d00001 diff --git a/src/sunstone/public/images/login_over.png b/src/sunstone/public/images/login_over.png new file mode 100644 index 0000000000000000000000000000000000000000..dc5f102c7af836fe25e520149371c3459a3b7d30 GIT binary patch literal 4351 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 A761SM literal 0 HcmV?d00001 diff --git a/src/sunstone/public/images/panel.png b/src/sunstone/public/images/panel.png new file mode 100644 index 0000000000000000000000000000000000000000..815baddff9acd518cd4a900c5c17e2ec9d8a7b28 GIT binary patch literal 5227 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 literal 0 HcmV?d00001 diff --git a/src/sunstone/public/images/pbar.gif b/src/sunstone/public/images/pbar.gif new file mode 100644 index 0000000000000000000000000000000000000000..b9d8856a730fd66cba9bf6cfbba4da6fe107d368 GIT binary patch literal 3951 zcmc(iXH*l|w#TC}7GM&_C^Co&I;dm2&M*#gMX#u+IM_x-utcc}s33zhkrqOS5Sr8g zp(hYZLMkD>(mNp}5K02l1*w*Yv)27E>)kS6-g^7fS!bPd);hnn|9kKMCCiH^P3?jK z5Wsr?KrWZ7P$w1j6a^nURA9fh2K*6*Uo@{-+`e_*{D#F($BqNnt!)~9);sU%Was7N zXyD`G_0+)5)z0^syPe}Pmlw|N0K?@CTQt^A9r=3w>*D~RdULhr=d#l~_yx1r0NlbZ zlaTz)>AD0I&epPYHFd%*`$KF!RX%sN^P28HQtU7Hw7nfyyetk7{bH<3uMGcen*14k z7k^^>VK{lz-BuGuZ+4}mA9>PDKSSHi+%xwjFvP~!9v+H_bn%IZ_SOO>pn%XsRB}oZ zBrP4B`8FjdF)uYEEkB_+3y_H}%*A6W3$lx-`2p9C`MMaZ`>yvlGWY8T&6P@CHBD2{Mf}`# z&o3rlTXxuptSg36vu=ZUf)g&!y$c^<7x!;W%6Gb-$~vu?H~oYEZb^Dw~N{Jg@Vl6)+ttQb;M0j?^j ztisn2s?gb#I#MYM$0_Gk1Bgr-yPn&Ksm+pz$O39dLr+sLzgZ~mYA3elC{>E?fziRv zadlrmy>&wRZf0z9abC9Y>3!`gZS1wW0#+CL5v*7rX(%&>fT`wv3zdczQ92-NN07m~ zb^n%1+35qW*&P~M^Mc(wLNjaME3a;jR`wcb?m-qdG zu*$rpA>Ur!jDwVVS-iaEu|2ZTm3w;LqfB)!)oC{UYL1NHOAt;D;FvD2{5;_yKK^=v zfuWIMap4HJhg zrvOXxi+LOoiy*0KAUD+l>ck9o3s(r?6?J#Cb#>M&8;6=lTHEE_GC_%AOwF8~9_Sxj z7+zAX;3j&da~&Xk(RG-)|Kh;*d3CVTJOr}kP?inSp7VI>xFeCTgutlr%V+FoN+82$ zQ2Nj{P5p1x{E<0psu6qbRcp@Ip;?IhyRK>zRIaUM$0{tTn^?M^l_BYPj`f%L2z5;fHQnHe&-*lqDmX2f*8FYKxY z+%xc5ko%h$*EpBU2$WZZe`IP(T5^U>cs4v18Il(ek15gvm103q9JU-^1_2UlfKXBm zg-RyW(y1&GhgQcHkgBS|l1e;}*untUwgWobq#}L?Q$}orC>yGJ#)mW?Ge`VV>{7S{~1@o?0PnJN&(W?W8?kgWZVz7mNq9CI`jB_%fmG8 zP}xK9)2$odnD$OMC!H`B?0rx9?&8h6cT!gBHIlCj+P;HdE4=Tu80+NLJ?5PSJQl+} z4r-TYE-Hhq11@-)z4CXAbdL6c!@}G{0~3N0!(YexMMQ)=NX50k4VO!m6c^ItkrmaigqR-rCPsGTVlS z>H(4tI#pUV#Te^rP|Oc346dcrsAL2N^+)7q@0+DMYLzyD#dWdi2sZ+6To8%pNRU5h&vWAxwn zVFM70y_>x4Z4z_RF^`SxI*0Ei9F`#|e_s(TCZP>BH*620Nsn4Pa86#|c+=#xVL8C= z)!WnFNt98yq3_Q({TqrGGxWIqy}-nfNsd^o`_Ag}%wvmaV5hm4Zq?C!mk`hq!)<;jM?tvOhr(fU z+oNBD_4fUyKjwxGPd9Q~XwUUjBhW|vs{7LaJ3*X|!4iU_n=xpSdWh~nwgai zbbB{n_Q-wx_uxHerB=eUgV{fgPDYt&+`ahh&g)mtEpHcHsO6n-p&xIisYncY``z7} zN~dqmryr4TSD$hB3JnQ*wchuZUx2@Zb9{K1d7`aHa&Tk}(kaR%!xfeH4D-S=r#QM4 zZBme04zDl(5r`mY4UtSCLFl#MIvNEEV4e%IDvp>3p48* zinH(?N39FGZy4JPy`cH0^}qAf6T~gtIApdoo-az&T10s*BlrIl^Wo=#2Fm;FYw?CB ze6{@TN`B32-uf3fF1$5}?!6rDoQ@gVXkSs!CNx;3T`2qt{{hyY07TcYTwS^U)$0=JgtJd#%`+ zg}w}Oe;5~nJmVexBs?lTCh5hSEYF|IQ(b-SGSOuTvB7^<@|tK_gg# z@0x#D_{|9G5Rd0ZFMoLBiHJ;&hNpPDJwPSI1YUTXnuLi;PkS0%nu#_7;VVGU%8F`2 z6@)|vQ)>u}N+uBk<5*Uf}q&avT_`xvIKZ#GpuM4Yf6OO(pd9HX=X_ z<_jP)u3RSVX>F+=X;e24sm4bq-wi5+oH_R3;_!6m*y>96(!}6%obc*>N&rA^6c$lw z#|n7Q+P?4PW4nLEe9=GDAxhZ!@B$oa)aLN^8c^)BU!GFyQC)ZiU^woQmiAZV`gOWr z+I$dO=xSs)tV7osPMv$Mt`!$0?THRI{?_N>t|L;1ZP}Mg&L7;Yf&8^JR@`Y%h8ZoL zz+Xjl_4^!kHW5!9dth~yFsLL`KW2@uzJB!Tz}@HJK{o?ELn30l&xX0i`Nc=YM%qRv z--AE-2PiiW1jXbP6y`%pO2N3|!U{}P5w?Vo3kA~XKx!=wUsK7c<`K(D0*a&zz!q^^ z_+Tcjj@jHKZWH#lD%uC+(qY+PeMe_^?MVNma(YNLJF0H%WI&eY8$Xgi&8??Fb;13# zho93v-7l#$B>Qh^|Md5#lRHhm(c#-^`OIpa6Cm|Zz|u}8?g;*i3AJW_;&ZV(r5Pz< z)T&o)FQcYCK9{jF@InWzI1|iP)B6&b6~M#D>LRWY_qSEvIl8PO?o{eEkiyI6;RbU3 zvnR{3Fj@a4vKfRq9rWboJzr~oc#va2bnvavaO9h?CjwRR3~B8P)I^RYdfcb*Cps|>+KNB z6wNJtLkf9)zgpG!u6wjmNgW=0KR!P>AstyD&MXnW@B#MF(J4jUmYF`68No9pHGGHe rq1Yu4`@<29`ewj{f0;DuueRtN$Qp89Ho|A_wqyAm2K literal 0 HcmV?d00001 diff --git a/src/sunstone/public/js/base64.js b/src/sunstone/public/js/base64.js new file mode 100644 index 0000000000..54c86951c6 --- /dev/null +++ b/src/sunstone/public/js/base64.js @@ -0,0 +1,113 @@ +// adapted from here: http://ostermiller.org/calc/encode.html +var base64 = {}; + +(function () { + var END_OF_INPUT = -1, + base64Chars = new Array( + 'A','B','C','D','E','F','G','H', + 'I','J','K','L','M','N','O','P', + 'Q','R','S','T','U','V','W','X', + 'Y','Z','a','b','c','d','e','f', + 'g','h','i','j','k','l','m','n', + 'o','p','q','r','s','t','u','v', + 'w','x','y','z','0','1','2','3', + '4','5','6','7','8','9','+','/'), + reverseBase64Chars = new Array(), + base64Str, + base64Count; + + for (var i=0; i < base64Chars.length; i++){ + reverseBase64Chars[base64Chars[i]] = i; + } + + function setBase64Str(str){ + base64Str = str; + base64Count = 0; + } + function readBase64(){ + if (!base64Str) return END_OF_INPUT; + if (base64Count >= base64Str.length) return END_OF_INPUT; + var c = base64Str.charCodeAt(base64Count) & 0xff; + base64Count++; + return c; + } + function readReverseBase64(){ + if (!base64Str) return END_OF_INPUT; + while (true){ + if (base64Count >= base64Str.length) return END_OF_INPUT; + var nextCharacter = base64Str.charAt(base64Count); + base64Count++; + if (reverseBase64Chars[nextCharacter]){ + return reverseBase64Chars[nextCharacter]; + } + if (nextCharacter == 'A') return 0; + } + return END_OF_INPUT; + } + + function ntos(n){ + n=n.toString(16); + if (n.length == 1) n="0"+n; + n="%"+n; + return unescape(n); + } + + base64.encode = function(str){ + setBase64Str(str); + var result = ''; + var inBuffer = new Array(3); + var lineCount = 0; + var done = false; + while (!done && (inBuffer[0] = readBase64()) != END_OF_INPUT){ + inBuffer[1] = readBase64(); + inBuffer[2] = readBase64(); + result += (base64Chars[ inBuffer[0] >> 2 ]); + if (inBuffer[1] != END_OF_INPUT){ + result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30) | (inBuffer[1] >> 4) ]); + if (inBuffer[2] != END_OF_INPUT){ + result += (base64Chars [((inBuffer[1] << 2) & 0x3c) | (inBuffer[2] >> 6) ]); + result += (base64Chars [inBuffer[2] & 0x3F]); + } else { + result += (base64Chars [((inBuffer[1] << 2) & 0x3c)]); + result += ('='); + done = true; + } + } else { + result += (base64Chars [(( inBuffer[0] << 4 ) & 0x30)]); + result += ('='); + result += ('='); + done = true; + } + lineCount += 4; + if (lineCount >= 76){ + result += ('\n'); + lineCount = 0; + } + } + return result; + } + + base64.decode = function(str){ + setBase64Str(str); + var result = ""; + var inBuffer = new Array(4); + var done = false; + while (!done && (inBuffer[0] = readReverseBase64()) != END_OF_INPUT + && (inBuffer[1] = readReverseBase64()) != END_OF_INPUT){ + inBuffer[2] = readReverseBase64(); + inBuffer[3] = readReverseBase64(); + result += ntos((((inBuffer[0] << 2) & 0xff)| inBuffer[1] >> 4)); + if (inBuffer[2] != END_OF_INPUT){ + result += ntos((((inBuffer[1] << 4) & 0xff)| inBuffer[2] >> 2)); + if (inBuffer[3] != END_OF_INPUT){ + result += ntos((((inBuffer[2] << 6) & 0xff) | inBuffer[3])); + } else { + done = true; + } + } else { + done = true; + } + } + return result; + } +})() \ No newline at end of file diff --git a/src/sunstone/public/js/jquery-1.4.4.min.js b/src/sunstone/public/js/jquery-1.4.4.min.js new file mode 100644 index 0000000000..8f3ca2e2da --- /dev/null +++ b/src/sunstone/public/js/jquery-1.4.4.min.js @@ -0,0 +1,167 @@ +/*! + * jQuery JavaScript Library v1.4.4 + * http://jquery.com/ + * + * Copyright 2010, John Resig + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * Includes Sizzle.js + * http://sizzlejs.com/ + * Copyright 2010, The Dojo Foundation + * Released under the MIT, BSD, and GPL Licenses. + * + * Date: Thu Nov 11 19:04:53 2010 -0500 + */ +(function(E,B){function ka(a,b,d){if(d===B&&a.nodeType===1){d=a.getAttribute("data-"+b);if(typeof d==="string"){try{d=d==="true"?true:d==="false"?false:d==="null"?null:!c.isNaN(d)?parseFloat(d):Ja.test(d)?c.parseJSON(d):d}catch(e){}c.data(a,b,d)}else d=B}return d}function U(){return false}function ca(){return true}function la(a,b,d){d[0].type=a;return c.event.handle.apply(b,d)}function Ka(a){var b,d,e,f,h,l,k,o,x,r,A,C=[];f=[];h=c.data(this,this.nodeType?"events":"__events__");if(typeof h==="function")h= +h.events;if(!(a.liveFired===this||!h||!h.live||a.button&&a.type==="click")){if(a.namespace)A=RegExp("(^|\\.)"+a.namespace.split(".").join("\\.(?:.*\\.)?")+"(\\.|$)");a.liveFired=this;var J=h.live.slice(0);for(k=0;kd)break;a.currentTarget=f.elem;a.data=f.handleObj.data;a.handleObj=f.handleObj;A=f.handleObj.origHandler.apply(f.elem,arguments);if(A===false||a.isPropagationStopped()){d=f.level;if(A===false)b=false;if(a.isImmediatePropagationStopped())break}}return b}}function Y(a,b){return(a&&a!=="*"?a+".":"")+b.replace(La, +"`").replace(Ma,"&")}function ma(a,b,d){if(c.isFunction(b))return c.grep(a,function(f,h){return!!b.call(f,h,f)===d});else if(b.nodeType)return c.grep(a,function(f){return f===b===d});else if(typeof b==="string"){var e=c.grep(a,function(f){return f.nodeType===1});if(Na.test(b))return c.filter(b,e,!d);else b=c.filter(b,e)}return c.grep(a,function(f){return c.inArray(f,b)>=0===d})}function na(a,b){var d=0;b.each(function(){if(this.nodeName===(a[d]&&a[d].nodeName)){var e=c.data(a[d++]),f=c.data(this, +e);if(e=e&&e.events){delete f.handle;f.events={};for(var h in e)for(var l in e[h])c.event.add(this,h,e[h][l],e[h][l].data)}}})}function Oa(a,b){b.src?c.ajax({url:b.src,async:false,dataType:"script"}):c.globalEval(b.text||b.textContent||b.innerHTML||"");b.parentNode&&b.parentNode.removeChild(b)}function oa(a,b,d){var e=b==="width"?a.offsetWidth:a.offsetHeight;if(d==="border")return e;c.each(b==="width"?Pa:Qa,function(){d||(e-=parseFloat(c.css(a,"padding"+this))||0);if(d==="margin")e+=parseFloat(c.css(a, +"margin"+this))||0;else e-=parseFloat(c.css(a,"border"+this+"Width"))||0});return e}function da(a,b,d,e){if(c.isArray(b)&&b.length)c.each(b,function(f,h){d||Ra.test(a)?e(a,h):da(a+"["+(typeof h==="object"||c.isArray(h)?f:"")+"]",h,d,e)});else if(!d&&b!=null&&typeof b==="object")c.isEmptyObject(b)?e(a,""):c.each(b,function(f,h){da(a+"["+f+"]",h,d,e)});else e(a,b)}function S(a,b){var d={};c.each(pa.concat.apply([],pa.slice(0,b)),function(){d[this]=a});return d}function qa(a){if(!ea[a]){var b=c("<"+ +a+">").appendTo("body"),d=b.css("display");b.remove();if(d==="none"||d==="")d="block";ea[a]=d}return ea[a]}function fa(a){return c.isWindow(a)?a:a.nodeType===9?a.defaultView||a.parentWindow:false}var t=E.document,c=function(){function a(){if(!b.isReady){try{t.documentElement.doScroll("left")}catch(j){setTimeout(a,1);return}b.ready()}}var b=function(j,s){return new b.fn.init(j,s)},d=E.jQuery,e=E.$,f,h=/^(?:[^<]*(<[\w\W]+>)[^>]*$|#([\w\-]+)$)/,l=/\S/,k=/^\s+/,o=/\s+$/,x=/\W/,r=/\d/,A=/^<(\w+)\s*\/?>(?:<\/\1>)?$/, +C=/^[\],:{}\s]*$/,J=/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,w=/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,I=/(?:^|:|,)(?:\s*\[)+/g,L=/(webkit)[ \/]([\w.]+)/,g=/(opera)(?:.*version)?[ \/]([\w.]+)/,i=/(msie) ([\w.]+)/,n=/(mozilla)(?:.*? rv:([\w.]+))?/,m=navigator.userAgent,p=false,q=[],u,y=Object.prototype.toString,F=Object.prototype.hasOwnProperty,M=Array.prototype.push,N=Array.prototype.slice,O=String.prototype.trim,D=Array.prototype.indexOf,R={};b.fn=b.prototype={init:function(j, +s){var v,z,H;if(!j)return this;if(j.nodeType){this.context=this[0]=j;this.length=1;return this}if(j==="body"&&!s&&t.body){this.context=t;this[0]=t.body;this.selector="body";this.length=1;return this}if(typeof j==="string")if((v=h.exec(j))&&(v[1]||!s))if(v[1]){H=s?s.ownerDocument||s:t;if(z=A.exec(j))if(b.isPlainObject(s)){j=[t.createElement(z[1])];b.fn.attr.call(j,s,true)}else j=[H.createElement(z[1])];else{z=b.buildFragment([v[1]],[H]);j=(z.cacheable?z.fragment.cloneNode(true):z.fragment).childNodes}return b.merge(this, +j)}else{if((z=t.getElementById(v[2]))&&z.parentNode){if(z.id!==v[2])return f.find(j);this.length=1;this[0]=z}this.context=t;this.selector=j;return this}else if(!s&&!x.test(j)){this.selector=j;this.context=t;j=t.getElementsByTagName(j);return b.merge(this,j)}else return!s||s.jquery?(s||f).find(j):b(s).find(j);else if(b.isFunction(j))return f.ready(j);if(j.selector!==B){this.selector=j.selector;this.context=j.context}return b.makeArray(j,this)},selector:"",jquery:"1.4.4",length:0,size:function(){return this.length}, +toArray:function(){return N.call(this,0)},get:function(j){return j==null?this.toArray():j<0?this.slice(j)[0]:this[j]},pushStack:function(j,s,v){var z=b();b.isArray(j)?M.apply(z,j):b.merge(z,j);z.prevObject=this;z.context=this.context;if(s==="find")z.selector=this.selector+(this.selector?" ":"")+v;else if(s)z.selector=this.selector+"."+s+"("+v+")";return z},each:function(j,s){return b.each(this,j,s)},ready:function(j){b.bindReady();if(b.isReady)j.call(t,b);else q&&q.push(j);return this},eq:function(j){return j=== +-1?this.slice(j):this.slice(j,+j+1)},first:function(){return this.eq(0)},last:function(){return this.eq(-1)},slice:function(){return this.pushStack(N.apply(this,arguments),"slice",N.call(arguments).join(","))},map:function(j){return this.pushStack(b.map(this,function(s,v){return j.call(s,v,s)}))},end:function(){return this.prevObject||b(null)},push:M,sort:[].sort,splice:[].splice};b.fn.init.prototype=b.fn;b.extend=b.fn.extend=function(){var j,s,v,z,H,G=arguments[0]||{},K=1,Q=arguments.length,ga=false; +if(typeof G==="boolean"){ga=G;G=arguments[1]||{};K=2}if(typeof G!=="object"&&!b.isFunction(G))G={};if(Q===K){G=this;--K}for(;K0))if(q){var s=0,v=q;for(q=null;j=v[s++];)j.call(t,b);b.fn.trigger&&b(t).trigger("ready").unbind("ready")}}},bindReady:function(){if(!p){p=true;if(t.readyState==="complete")return setTimeout(b.ready,1);if(t.addEventListener){t.addEventListener("DOMContentLoaded",u,false);E.addEventListener("load",b.ready,false)}else if(t.attachEvent){t.attachEvent("onreadystatechange",u);E.attachEvent("onload", +b.ready);var j=false;try{j=E.frameElement==null}catch(s){}t.documentElement.doScroll&&j&&a()}}},isFunction:function(j){return b.type(j)==="function"},isArray:Array.isArray||function(j){return b.type(j)==="array"},isWindow:function(j){return j&&typeof j==="object"&&"setInterval"in j},isNaN:function(j){return j==null||!r.test(j)||isNaN(j)},type:function(j){return j==null?String(j):R[y.call(j)]||"object"},isPlainObject:function(j){if(!j||b.type(j)!=="object"||j.nodeType||b.isWindow(j))return false;if(j.constructor&& +!F.call(j,"constructor")&&!F.call(j.constructor.prototype,"isPrototypeOf"))return false;for(var s in j);return s===B||F.call(j,s)},isEmptyObject:function(j){for(var s in j)return false;return true},error:function(j){throw j;},parseJSON:function(j){if(typeof j!=="string"||!j)return null;j=b.trim(j);if(C.test(j.replace(J,"@").replace(w,"]").replace(I,"")))return E.JSON&&E.JSON.parse?E.JSON.parse(j):(new Function("return "+j))();else b.error("Invalid JSON: "+j)},noop:function(){},globalEval:function(j){if(j&& +l.test(j)){var s=t.getElementsByTagName("head")[0]||t.documentElement,v=t.createElement("script");v.type="text/javascript";if(b.support.scriptEval)v.appendChild(t.createTextNode(j));else v.text=j;s.insertBefore(v,s.firstChild);s.removeChild(v)}},nodeName:function(j,s){return j.nodeName&&j.nodeName.toUpperCase()===s.toUpperCase()},each:function(j,s,v){var z,H=0,G=j.length,K=G===B||b.isFunction(j);if(v)if(K)for(z in j){if(s.apply(j[z],v)===false)break}else for(;H
a";var f=d.getElementsByTagName("*"),h=d.getElementsByTagName("a")[0],l=t.createElement("select"), +k=l.appendChild(t.createElement("option"));if(!(!f||!f.length||!h)){c.support={leadingWhitespace:d.firstChild.nodeType===3,tbody:!d.getElementsByTagName("tbody").length,htmlSerialize:!!d.getElementsByTagName("link").length,style:/red/.test(h.getAttribute("style")),hrefNormalized:h.getAttribute("href")==="/a",opacity:/^0.55$/.test(h.style.opacity),cssFloat:!!h.style.cssFloat,checkOn:d.getElementsByTagName("input")[0].value==="on",optSelected:k.selected,deleteExpando:true,optDisabled:false,checkClone:false, +scriptEval:false,noCloneEvent:true,boxModel:null,inlineBlockNeedsLayout:false,shrinkWrapBlocks:false,reliableHiddenOffsets:true};l.disabled=true;c.support.optDisabled=!k.disabled;b.type="text/javascript";try{b.appendChild(t.createTextNode("window."+e+"=1;"))}catch(o){}a.insertBefore(b,a.firstChild);if(E[e]){c.support.scriptEval=true;delete E[e]}try{delete b.test}catch(x){c.support.deleteExpando=false}a.removeChild(b);if(d.attachEvent&&d.fireEvent){d.attachEvent("onclick",function r(){c.support.noCloneEvent= +false;d.detachEvent("onclick",r)});d.cloneNode(true).fireEvent("onclick")}d=t.createElement("div");d.innerHTML="";a=t.createDocumentFragment();a.appendChild(d.firstChild);c.support.checkClone=a.cloneNode(true).cloneNode(true).lastChild.checked;c(function(){var r=t.createElement("div");r.style.width=r.style.paddingLeft="1px";t.body.appendChild(r);c.boxModel=c.support.boxModel=r.offsetWidth===2;if("zoom"in r.style){r.style.display="inline";r.style.zoom= +1;c.support.inlineBlockNeedsLayout=r.offsetWidth===2;r.style.display="";r.innerHTML="

";c.support.shrinkWrapBlocks=r.offsetWidth!==2}r.innerHTML="
t
";var A=r.getElementsByTagName("td");c.support.reliableHiddenOffsets=A[0].offsetHeight===0;A[0].style.display="";A[1].style.display="none";c.support.reliableHiddenOffsets=c.support.reliableHiddenOffsets&&A[0].offsetHeight===0;r.innerHTML="";t.body.removeChild(r).style.display= +"none"});a=function(r){var A=t.createElement("div");r="on"+r;var C=r in A;if(!C){A.setAttribute(r,"return;");C=typeof A[r]==="function"}return C};c.support.submitBubbles=a("submit");c.support.changeBubbles=a("change");a=b=d=f=h=null}})();var ra={},Ja=/^(?:\{.*\}|\[.*\])$/;c.extend({cache:{},uuid:0,expando:"jQuery"+c.now(),noData:{embed:true,object:"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000",applet:true},data:function(a,b,d){if(c.acceptData(a)){a=a==E?ra:a;var e=a.nodeType,f=e?a[c.expando]:null,h= +c.cache;if(!(e&&!f&&typeof b==="string"&&d===B)){if(e)f||(a[c.expando]=f=++c.uuid);else h=a;if(typeof b==="object")if(e)h[f]=c.extend(h[f],b);else c.extend(h,b);else if(e&&!h[f])h[f]={};a=e?h[f]:h;if(d!==B)a[b]=d;return typeof b==="string"?a[b]:a}}},removeData:function(a,b){if(c.acceptData(a)){a=a==E?ra:a;var d=a.nodeType,e=d?a[c.expando]:a,f=c.cache,h=d?f[e]:e;if(b){if(h){delete h[b];d&&c.isEmptyObject(h)&&c.removeData(a)}}else if(d&&c.support.deleteExpando)delete a[c.expando];else if(a.removeAttribute)a.removeAttribute(c.expando); +else if(d)delete f[e];else for(var l in a)delete a[l]}},acceptData:function(a){if(a.nodeName){var b=c.noData[a.nodeName.toLowerCase()];if(b)return!(b===true||a.getAttribute("classid")!==b)}return true}});c.fn.extend({data:function(a,b){var d=null;if(typeof a==="undefined"){if(this.length){var e=this[0].attributes,f;d=c.data(this[0]);for(var h=0,l=e.length;h-1)return true;return false},val:function(a){if(!arguments.length){var b=this[0];if(b){if(c.nodeName(b,"option")){var d=b.attributes.value;return!d||d.specified?b.value:b.text}if(c.nodeName(b,"select")){var e=b.selectedIndex;d=[];var f=b.options;b=b.type==="select-one"; +if(e<0)return null;var h=b?e:0;for(e=b?e+1:f.length;h=0;else if(c.nodeName(this,"select")){var A=c.makeArray(r);c("option",this).each(function(){this.selected=c.inArray(c(this).val(),A)>=0});if(!A.length)this.selectedIndex=-1}else this.value=r}})}});c.extend({attrFn:{val:true,css:true,html:true,text:true,data:true,width:true,height:true,offset:true}, +attr:function(a,b,d,e){if(!a||a.nodeType===3||a.nodeType===8)return B;if(e&&b in c.attrFn)return c(a)[b](d);e=a.nodeType!==1||!c.isXMLDoc(a);var f=d!==B;b=e&&c.props[b]||b;var h=Ta.test(b);if((b in a||a[b]!==B)&&e&&!h){if(f){b==="type"&&Ua.test(a.nodeName)&&a.parentNode&&c.error("type property can't be changed");if(d===null)a.nodeType===1&&a.removeAttribute(b);else a[b]=d}if(c.nodeName(a,"form")&&a.getAttributeNode(b))return a.getAttributeNode(b).nodeValue;if(b==="tabIndex")return(b=a.getAttributeNode("tabIndex"))&& +b.specified?b.value:Va.test(a.nodeName)||Wa.test(a.nodeName)&&a.href?0:B;return a[b]}if(!c.support.style&&e&&b==="style"){if(f)a.style.cssText=""+d;return a.style.cssText}f&&a.setAttribute(b,""+d);if(!a.attributes[b]&&a.hasAttribute&&!a.hasAttribute(b))return B;a=!c.support.hrefNormalized&&e&&h?a.getAttribute(b,2):a.getAttribute(b);return a===null?B:a}});var X=/\.(.*)$/,ia=/^(?:textarea|input|select)$/i,La=/\./g,Ma=/ /g,Xa=/[^\w\s.|`]/g,Ya=function(a){return a.replace(Xa,"\\$&")},ua={focusin:0,focusout:0}; +c.event={add:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(c.isWindow(a)&&a!==E&&!a.frameElement)a=E;if(d===false)d=U;else if(!d)return;var f,h;if(d.handler){f=d;d=f.handler}if(!d.guid)d.guid=c.guid++;if(h=c.data(a)){var l=a.nodeType?"events":"__events__",k=h[l],o=h.handle;if(typeof k==="function"){o=k.handle;k=k.events}else if(!k){a.nodeType||(h[l]=h=function(){});h.events=k={}}if(!o)h.handle=o=function(){return typeof c!=="undefined"&&!c.event.triggered?c.event.handle.apply(o.elem, +arguments):B};o.elem=a;b=b.split(" ");for(var x=0,r;l=b[x++];){h=f?c.extend({},f):{handler:d,data:e};if(l.indexOf(".")>-1){r=l.split(".");l=r.shift();h.namespace=r.slice(0).sort().join(".")}else{r=[];h.namespace=""}h.type=l;if(!h.guid)h.guid=d.guid;var A=k[l],C=c.event.special[l]||{};if(!A){A=k[l]=[];if(!C.setup||C.setup.call(a,e,r,o)===false)if(a.addEventListener)a.addEventListener(l,o,false);else a.attachEvent&&a.attachEvent("on"+l,o)}if(C.add){C.add.call(a,h);if(!h.handler.guid)h.handler.guid= +d.guid}A.push(h);c.event.global[l]=true}a=null}}},global:{},remove:function(a,b,d,e){if(!(a.nodeType===3||a.nodeType===8)){if(d===false)d=U;var f,h,l=0,k,o,x,r,A,C,J=a.nodeType?"events":"__events__",w=c.data(a),I=w&&w[J];if(w&&I){if(typeof I==="function"){w=I;I=I.events}if(b&&b.type){d=b.handler;b=b.type}if(!b||typeof b==="string"&&b.charAt(0)==="."){b=b||"";for(f in I)c.event.remove(a,f+b)}else{for(b=b.split(" ");f=b[l++];){r=f;k=f.indexOf(".")<0;o=[];if(!k){o=f.split(".");f=o.shift();x=RegExp("(^|\\.)"+ +c.map(o.slice(0).sort(),Ya).join("\\.(?:.*\\.)?")+"(\\.|$)")}if(A=I[f])if(d){r=c.event.special[f]||{};for(h=e||0;h=0){a.type=f=f.slice(0,-1);a.exclusive=true}if(!d){a.stopPropagation();c.event.global[f]&&c.each(c.cache,function(){this.events&&this.events[f]&&c.event.trigger(a,b,this.handle.elem)})}if(!d||d.nodeType===3||d.nodeType=== +8)return B;a.result=B;a.target=d;b=c.makeArray(b);b.unshift(a)}a.currentTarget=d;(e=d.nodeType?c.data(d,"handle"):(c.data(d,"__events__")||{}).handle)&&e.apply(d,b);e=d.parentNode||d.ownerDocument;try{if(!(d&&d.nodeName&&c.noData[d.nodeName.toLowerCase()]))if(d["on"+f]&&d["on"+f].apply(d,b)===false){a.result=false;a.preventDefault()}}catch(h){}if(!a.isPropagationStopped()&&e)c.event.trigger(a,b,e,true);else if(!a.isDefaultPrevented()){var l;e=a.target;var k=f.replace(X,""),o=c.nodeName(e,"a")&&k=== +"click",x=c.event.special[k]||{};if((!x._default||x._default.call(d,a)===false)&&!o&&!(e&&e.nodeName&&c.noData[e.nodeName.toLowerCase()])){try{if(e[k]){if(l=e["on"+k])e["on"+k]=null;c.event.triggered=true;e[k]()}}catch(r){}if(l)e["on"+k]=l;c.event.triggered=false}}},handle:function(a){var b,d,e,f;d=[];var h=c.makeArray(arguments);a=h[0]=c.event.fix(a||E.event);a.currentTarget=this;b=a.type.indexOf(".")<0&&!a.exclusive;if(!b){e=a.type.split(".");a.type=e.shift();d=e.slice(0).sort();e=RegExp("(^|\\.)"+ +d.join("\\.(?:.*\\.)?")+"(\\.|$)")}a.namespace=a.namespace||d.join(".");f=c.data(this,this.nodeType?"events":"__events__");if(typeof f==="function")f=f.events;d=(f||{})[a.type];if(f&&d){d=d.slice(0);f=0;for(var l=d.length;f-1?c.map(a.options,function(e){return e.selected}).join("-"):"";else if(a.nodeName.toLowerCase()==="select")d=a.selectedIndex;return d},Z=function(a,b){var d=a.target,e,f;if(!(!ia.test(d.nodeName)||d.readOnly)){e=c.data(d,"_change_data");f=xa(d);if(a.type!=="focusout"||d.type!=="radio")c.data(d,"_change_data",f);if(!(e===B||f===e))if(e!=null||f){a.type="change";a.liveFired= +B;return c.event.trigger(a,b,d)}}};c.event.special.change={filters:{focusout:Z,beforedeactivate:Z,click:function(a){var b=a.target,d=b.type;if(d==="radio"||d==="checkbox"||b.nodeName.toLowerCase()==="select")return Z.call(this,a)},keydown:function(a){var b=a.target,d=b.type;if(a.keyCode===13&&b.nodeName.toLowerCase()!=="textarea"||a.keyCode===32&&(d==="checkbox"||d==="radio")||d==="select-multiple")return Z.call(this,a)},beforeactivate:function(a){a=a.target;c.data(a,"_change_data",xa(a))}},setup:function(){if(this.type=== +"file")return false;for(var a in V)c.event.add(this,a+".specialChange",V[a]);return ia.test(this.nodeName)},teardown:function(){c.event.remove(this,".specialChange");return ia.test(this.nodeName)}};V=c.event.special.change.filters;V.focus=V.beforeactivate}t.addEventListener&&c.each({focus:"focusin",blur:"focusout"},function(a,b){function d(e){e=c.event.fix(e);e.type=b;return c.event.trigger(e,null,e.target)}c.event.special[b]={setup:function(){ua[b]++===0&&t.addEventListener(a,d,true)},teardown:function(){--ua[b]=== +0&&t.removeEventListener(a,d,true)}}});c.each(["bind","one"],function(a,b){c.fn[b]=function(d,e,f){if(typeof d==="object"){for(var h in d)this[b](h,e,d[h],f);return this}if(c.isFunction(e)||e===false){f=e;e=B}var l=b==="one"?c.proxy(f,function(o){c(this).unbind(o,l);return f.apply(this,arguments)}):f;if(d==="unload"&&b!=="one")this.one(d,e,f);else{h=0;for(var k=this.length;h0?this.bind(b,d,e):this.trigger(b)};if(c.attrFn)c.attrFn[b]=true});E.attachEvent&&!E.addEventListener&&c(E).bind("unload",function(){for(var a in c.cache)if(c.cache[a].handle)try{c.event.remove(c.cache[a].handle.elem)}catch(b){}}); +(function(){function a(g,i,n,m,p,q){p=0;for(var u=m.length;p0){F=y;break}}y=y[g]}m[p]=F}}}var d=/((?:\((?:\([^()]+\)|[^()]+)+\)|\[(?:\[[^\[\]]*\]|['"][^'"]*['"]|[^\[\]'"]+)+\]|\\.|[^ >+~,(\[\\]+)+|[>+~])(\s*,\s*)?((?:.|\r|\n)*)/g,e=0,f=Object.prototype.toString,h=false,l=true;[0,0].sort(function(){l=false;return 0});var k=function(g,i,n,m){n=n||[];var p=i=i||t;if(i.nodeType!==1&&i.nodeType!==9)return[];if(!g||typeof g!=="string")return n;var q,u,y,F,M,N=true,O=k.isXML(i),D=[],R=g;do{d.exec("");if(q=d.exec(R)){R=q[3];D.push(q[1]);if(q[2]){F=q[3]; +break}}}while(q);if(D.length>1&&x.exec(g))if(D.length===2&&o.relative[D[0]])u=L(D[0]+D[1],i);else for(u=o.relative[D[0]]?[i]:k(D.shift(),i);D.length;){g=D.shift();if(o.relative[g])g+=D.shift();u=L(g,u)}else{if(!m&&D.length>1&&i.nodeType===9&&!O&&o.match.ID.test(D[0])&&!o.match.ID.test(D[D.length-1])){q=k.find(D.shift(),i,O);i=q.expr?k.filter(q.expr,q.set)[0]:q.set[0]}if(i){q=m?{expr:D.pop(),set:C(m)}:k.find(D.pop(),D.length===1&&(D[0]==="~"||D[0]==="+")&&i.parentNode?i.parentNode:i,O);u=q.expr?k.filter(q.expr, +q.set):q.set;if(D.length>0)y=C(u);else N=false;for(;D.length;){q=M=D.pop();if(o.relative[M])q=D.pop();else M="";if(q==null)q=i;o.relative[M](y,q,O)}}else y=[]}y||(y=u);y||k.error(M||g);if(f.call(y)==="[object Array]")if(N)if(i&&i.nodeType===1)for(g=0;y[g]!=null;g++){if(y[g]&&(y[g]===true||y[g].nodeType===1&&k.contains(i,y[g])))n.push(u[g])}else for(g=0;y[g]!=null;g++)y[g]&&y[g].nodeType===1&&n.push(u[g]);else n.push.apply(n,y);else C(y,n);if(F){k(F,p,n,m);k.uniqueSort(n)}return n};k.uniqueSort=function(g){if(w){h= +l;g.sort(w);if(h)for(var i=1;i0};k.find=function(g,i,n){var m;if(!g)return[];for(var p=0,q=o.order.length;p":function(g,i){var n,m=typeof i==="string",p=0,q=g.length;if(m&&!/\W/.test(i))for(i=i.toLowerCase();p=0))n||m.push(u);else if(n)i[q]=false;return false},ID:function(g){return g[1].replace(/\\/g,"")},TAG:function(g){return g[1].toLowerCase()},CHILD:function(g){if(g[1]==="nth"){var i=/(-?)(\d*)n((?:\+|-)?\d*)/.exec(g[2]==="even"&&"2n"||g[2]==="odd"&&"2n+1"||!/\D/.test(g[2])&&"0n+"+g[2]||g[2]);g[2]=i[1]+(i[2]||1)-0;g[3]=i[3]-0}g[0]=e++;return g},ATTR:function(g,i,n, +m,p,q){i=g[1].replace(/\\/g,"");if(!q&&o.attrMap[i])g[1]=o.attrMap[i];if(g[2]==="~=")g[4]=" "+g[4]+" ";return g},PSEUDO:function(g,i,n,m,p){if(g[1]==="not")if((d.exec(g[3])||"").length>1||/^\w/.test(g[3]))g[3]=k(g[3],null,null,i);else{g=k.filter(g[3],i,n,true^p);n||m.push.apply(m,g);return false}else if(o.match.POS.test(g[0])||o.match.CHILD.test(g[0]))return true;return g},POS:function(g){g.unshift(true);return g}},filters:{enabled:function(g){return g.disabled===false&&g.type!=="hidden"},disabled:function(g){return g.disabled=== +true},checked:function(g){return g.checked===true},selected:function(g){return g.selected===true},parent:function(g){return!!g.firstChild},empty:function(g){return!g.firstChild},has:function(g,i,n){return!!k(n[3],g).length},header:function(g){return/h\d/i.test(g.nodeName)},text:function(g){return"text"===g.type},radio:function(g){return"radio"===g.type},checkbox:function(g){return"checkbox"===g.type},file:function(g){return"file"===g.type},password:function(g){return"password"===g.type},submit:function(g){return"submit"=== +g.type},image:function(g){return"image"===g.type},reset:function(g){return"reset"===g.type},button:function(g){return"button"===g.type||g.nodeName.toLowerCase()==="button"},input:function(g){return/input|select|textarea|button/i.test(g.nodeName)}},setFilters:{first:function(g,i){return i===0},last:function(g,i,n,m){return i===m.length-1},even:function(g,i){return i%2===0},odd:function(g,i){return i%2===1},lt:function(g,i,n){return in[3]-0},nth:function(g,i,n){return n[3]- +0===i},eq:function(g,i,n){return n[3]-0===i}},filter:{PSEUDO:function(g,i,n,m){var p=i[1],q=o.filters[p];if(q)return q(g,n,i,m);else if(p==="contains")return(g.textContent||g.innerText||k.getText([g])||"").indexOf(i[3])>=0;else if(p==="not"){i=i[3];n=0;for(m=i.length;n=0}},ID:function(g,i){return g.nodeType===1&&g.getAttribute("id")===i},TAG:function(g,i){return i==="*"&&g.nodeType===1||g.nodeName.toLowerCase()=== +i},CLASS:function(g,i){return(" "+(g.className||g.getAttribute("class"))+" ").indexOf(i)>-1},ATTR:function(g,i){var n=i[1];n=o.attrHandle[n]?o.attrHandle[n](g):g[n]!=null?g[n]:g.getAttribute(n);var m=n+"",p=i[2],q=i[4];return n==null?p==="!=":p==="="?m===q:p==="*="?m.indexOf(q)>=0:p==="~="?(" "+m+" ").indexOf(q)>=0:!q?m&&n!==false:p==="!="?m!==q:p==="^="?m.indexOf(q)===0:p==="$="?m.substr(m.length-q.length)===q:p==="|="?m===q||m.substr(0,q.length+1)===q+"-":false},POS:function(g,i,n,m){var p=o.setFilters[i[2]]; +if(p)return p(g,n,i,m)}}},x=o.match.POS,r=function(g,i){return"\\"+(i-0+1)},A;for(A in o.match){o.match[A]=RegExp(o.match[A].source+/(?![^\[]*\])(?![^\(]*\))/.source);o.leftMatch[A]=RegExp(/(^(?:.|\r|\n)*?)/.source+o.match[A].source.replace(/\\(\d+)/g,r))}var C=function(g,i){g=Array.prototype.slice.call(g,0);if(i){i.push.apply(i,g);return i}return g};try{Array.prototype.slice.call(t.documentElement.childNodes,0)}catch(J){C=function(g,i){var n=0,m=i||[];if(f.call(g)==="[object Array]")Array.prototype.push.apply(m, +g);else if(typeof g.length==="number")for(var p=g.length;n";n.insertBefore(g,n.firstChild);if(t.getElementById(i)){o.find.ID=function(m,p,q){if(typeof p.getElementById!=="undefined"&&!q)return(p=p.getElementById(m[1]))?p.id===m[1]||typeof p.getAttributeNode!=="undefined"&&p.getAttributeNode("id").nodeValue===m[1]?[p]:B:[]};o.filter.ID=function(m,p){var q=typeof m.getAttributeNode!=="undefined"&&m.getAttributeNode("id");return m.nodeType===1&&q&&q.nodeValue===p}}n.removeChild(g); +n=g=null})();(function(){var g=t.createElement("div");g.appendChild(t.createComment(""));if(g.getElementsByTagName("*").length>0)o.find.TAG=function(i,n){var m=n.getElementsByTagName(i[1]);if(i[1]==="*"){for(var p=[],q=0;m[q];q++)m[q].nodeType===1&&p.push(m[q]);m=p}return m};g.innerHTML="";if(g.firstChild&&typeof g.firstChild.getAttribute!=="undefined"&&g.firstChild.getAttribute("href")!=="#")o.attrHandle.href=function(i){return i.getAttribute("href",2)};g=null})();t.querySelectorAll&& +function(){var g=k,i=t.createElement("div");i.innerHTML="

";if(!(i.querySelectorAll&&i.querySelectorAll(".TEST").length===0)){k=function(m,p,q,u){p=p||t;m=m.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!u&&!k.isXML(p))if(p.nodeType===9)try{return C(p.querySelectorAll(m),q)}catch(y){}else if(p.nodeType===1&&p.nodeName.toLowerCase()!=="object"){var F=p.getAttribute("id"),M=F||"__sizzle__";F||p.setAttribute("id",M);try{return C(p.querySelectorAll("#"+M+" "+m),q)}catch(N){}finally{F|| +p.removeAttribute("id")}}return g(m,p,q,u)};for(var n in g)k[n]=g[n];i=null}}();(function(){var g=t.documentElement,i=g.matchesSelector||g.mozMatchesSelector||g.webkitMatchesSelector||g.msMatchesSelector,n=false;try{i.call(t.documentElement,"[test!='']:sizzle")}catch(m){n=true}if(i)k.matchesSelector=function(p,q){q=q.replace(/\=\s*([^'"\]]*)\s*\]/g,"='$1']");if(!k.isXML(p))try{if(n||!o.match.PSEUDO.test(q)&&!/!=/.test(q))return i.call(p,q)}catch(u){}return k(q,null,null,[p]).length>0}})();(function(){var g= +t.createElement("div");g.innerHTML="
";if(!(!g.getElementsByClassName||g.getElementsByClassName("e").length===0)){g.lastChild.className="e";if(g.getElementsByClassName("e").length!==1){o.order.splice(1,0,"CLASS");o.find.CLASS=function(i,n,m){if(typeof n.getElementsByClassName!=="undefined"&&!m)return n.getElementsByClassName(i[1])};g=null}}})();k.contains=t.documentElement.contains?function(g,i){return g!==i&&(g.contains?g.contains(i):true)}:t.documentElement.compareDocumentPosition? +function(g,i){return!!(g.compareDocumentPosition(i)&16)}:function(){return false};k.isXML=function(g){return(g=(g?g.ownerDocument||g:0).documentElement)?g.nodeName!=="HTML":false};var L=function(g,i){for(var n,m=[],p="",q=i.nodeType?[i]:i;n=o.match.PSEUDO.exec(g);){p+=n[0];g=g.replace(o.match.PSEUDO,"")}g=o.relative[g]?g+"*":g;n=0;for(var u=q.length;n0)for(var h=d;h0},closest:function(a,b){var d=[],e,f,h=this[0];if(c.isArray(a)){var l,k={},o=1;if(h&&a.length){e=0;for(f=a.length;e-1:c(h).is(e))d.push({selector:l,elem:h,level:o})}h= +h.parentNode;o++}}return d}l=cb.test(a)?c(a,b||this.context):null;e=0;for(f=this.length;e-1:c.find.matchesSelector(h,a)){d.push(h);break}else{h=h.parentNode;if(!h||!h.ownerDocument||h===b)break}d=d.length>1?c.unique(d):d;return this.pushStack(d,"closest",a)},index:function(a){if(!a||typeof a==="string")return c.inArray(this[0],a?c(a):this.parent().children());return c.inArray(a.jquery?a[0]:a,this)},add:function(a,b){var d=typeof a==="string"?c(a,b||this.context): +c.makeArray(a),e=c.merge(this.get(),d);return this.pushStack(!d[0]||!d[0].parentNode||d[0].parentNode.nodeType===11||!e[0]||!e[0].parentNode||e[0].parentNode.nodeType===11?e:c.unique(e))},andSelf:function(){return this.add(this.prevObject)}});c.each({parent:function(a){return(a=a.parentNode)&&a.nodeType!==11?a:null},parents:function(a){return c.dir(a,"parentNode")},parentsUntil:function(a,b,d){return c.dir(a,"parentNode",d)},next:function(a){return c.nth(a,2,"nextSibling")},prev:function(a){return c.nth(a, +2,"previousSibling")},nextAll:function(a){return c.dir(a,"nextSibling")},prevAll:function(a){return c.dir(a,"previousSibling")},nextUntil:function(a,b,d){return c.dir(a,"nextSibling",d)},prevUntil:function(a,b,d){return c.dir(a,"previousSibling",d)},siblings:function(a){return c.sibling(a.parentNode.firstChild,a)},children:function(a){return c.sibling(a.firstChild)},contents:function(a){return c.nodeName(a,"iframe")?a.contentDocument||a.contentWindow.document:c.makeArray(a.childNodes)}},function(a, +b){c.fn[a]=function(d,e){var f=c.map(this,b,d);Za.test(a)||(e=d);if(e&&typeof e==="string")f=c.filter(e,f);f=this.length>1?c.unique(f):f;if((this.length>1||ab.test(e))&&$a.test(a))f=f.reverse();return this.pushStack(f,a,bb.call(arguments).join(","))}});c.extend({filter:function(a,b,d){if(d)a=":not("+a+")";return b.length===1?c.find.matchesSelector(b[0],a)?[b[0]]:[]:c.find.matches(a,b)},dir:function(a,b,d){var e=[];for(a=a[b];a&&a.nodeType!==9&&(d===B||a.nodeType!==1||!c(a).is(d));){a.nodeType===1&& +e.push(a);a=a[b]}return e},nth:function(a,b,d){b=b||1;for(var e=0;a;a=a[d])if(a.nodeType===1&&++e===b)break;return a},sibling:function(a,b){for(var d=[];a;a=a.nextSibling)a.nodeType===1&&a!==b&&d.push(a);return d}});var za=/ jQuery\d+="(?:\d+|null)"/g,$=/^\s+/,Aa=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,Ba=/<([\w:]+)/,db=/\s]+\/)>/g,P={option:[1, +""],legend:[1,"
","
"],thead:[1,"","
"],tr:[2,"","
"],td:[3,"","
"],col:[2,"","
"],area:[1,"",""],_default:[0,"",""]};P.optgroup=P.option;P.tbody=P.tfoot=P.colgroup=P.caption=P.thead;P.th=P.td;if(!c.support.htmlSerialize)P._default=[1,"div
","
"];c.fn.extend({text:function(a){if(c.isFunction(a))return this.each(function(b){var d= +c(this);d.text(a.call(this,b,d.text()))});if(typeof a!=="object"&&a!==B)return this.empty().append((this[0]&&this[0].ownerDocument||t).createTextNode(a));return c.text(this)},wrapAll:function(a){if(c.isFunction(a))return this.each(function(d){c(this).wrapAll(a.call(this,d))});if(this[0]){var b=c(a,this[0].ownerDocument).eq(0).clone(true);this[0].parentNode&&b.insertBefore(this[0]);b.map(function(){for(var d=this;d.firstChild&&d.firstChild.nodeType===1;)d=d.firstChild;return d}).append(this)}return this}, +wrapInner:function(a){if(c.isFunction(a))return this.each(function(b){c(this).wrapInner(a.call(this,b))});return this.each(function(){var b=c(this),d=b.contents();d.length?d.wrapAll(a):b.append(a)})},wrap:function(a){return this.each(function(){c(this).wrapAll(a)})},unwrap:function(){return this.parent().each(function(){c.nodeName(this,"body")||c(this).replaceWith(this.childNodes)}).end()},append:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.appendChild(a)})}, +prepend:function(){return this.domManip(arguments,true,function(a){this.nodeType===1&&this.insertBefore(a,this.firstChild)})},before:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b,this)});else if(arguments.length){var a=c(arguments[0]);a.push.apply(a,this.toArray());return this.pushStack(a,"before",arguments)}},after:function(){if(this[0]&&this[0].parentNode)return this.domManip(arguments,false,function(b){this.parentNode.insertBefore(b, +this.nextSibling)});else if(arguments.length){var a=this.pushStack(this,"after",arguments);a.push.apply(a,c(arguments[0]).toArray());return a}},remove:function(a,b){for(var d=0,e;(e=this[d])!=null;d++)if(!a||c.filter(a,[e]).length){if(!b&&e.nodeType===1){c.cleanData(e.getElementsByTagName("*"));c.cleanData([e])}e.parentNode&&e.parentNode.removeChild(e)}return this},empty:function(){for(var a=0,b;(b=this[a])!=null;a++)for(b.nodeType===1&&c.cleanData(b.getElementsByTagName("*"));b.firstChild;)b.removeChild(b.firstChild); +return this},clone:function(a){var b=this.map(function(){if(!c.support.noCloneEvent&&!c.isXMLDoc(this)){var d=this.outerHTML,e=this.ownerDocument;if(!d){d=e.createElement("div");d.appendChild(this.cloneNode(true));d=d.innerHTML}return c.clean([d.replace(za,"").replace(fb,'="$1">').replace($,"")],e)[0]}else return this.cloneNode(true)});if(a===true){na(this,b);na(this.find("*"),b.find("*"))}return b},html:function(a){if(a===B)return this[0]&&this[0].nodeType===1?this[0].innerHTML.replace(za,""):null; +else if(typeof a==="string"&&!Ca.test(a)&&(c.support.leadingWhitespace||!$.test(a))&&!P[(Ba.exec(a)||["",""])[1].toLowerCase()]){a=a.replace(Aa,"<$1>");try{for(var b=0,d=this.length;b0||e.cacheable||this.length>1?h.cloneNode(true):h)}k.length&&c.each(k,Oa)}return this}});c.buildFragment=function(a,b,d){var e,f,h;b=b&&b[0]?b[0].ownerDocument||b[0]:t;if(a.length===1&&typeof a[0]==="string"&&a[0].length<512&&b===t&&!Ca.test(a[0])&&(c.support.checkClone||!Da.test(a[0]))){f=true;if(h=c.fragments[a[0]])if(h!==1)e=h}if(!e){e=b.createDocumentFragment();c.clean(a,b,e,d)}if(f)c.fragments[a[0]]=h?e:1;return{fragment:e,cacheable:f}};c.fragments={};c.each({appendTo:"append", +prependTo:"prepend",insertBefore:"before",insertAfter:"after",replaceAll:"replaceWith"},function(a,b){c.fn[a]=function(d){var e=[];d=c(d);var f=this.length===1&&this[0].parentNode;if(f&&f.nodeType===11&&f.childNodes.length===1&&d.length===1){d[b](this[0]);return this}else{f=0;for(var h=d.length;f0?this.clone(true):this).get();c(d[f])[b](l);e=e.concat(l)}return this.pushStack(e,a,d.selector)}}});c.extend({clean:function(a,b,d,e){b=b||t;if(typeof b.createElement==="undefined")b=b.ownerDocument|| +b[0]&&b[0].ownerDocument||t;for(var f=[],h=0,l;(l=a[h])!=null;h++){if(typeof l==="number")l+="";if(l){if(typeof l==="string"&&!eb.test(l))l=b.createTextNode(l);else if(typeof l==="string"){l=l.replace(Aa,"<$1>");var k=(Ba.exec(l)||["",""])[1].toLowerCase(),o=P[k]||P._default,x=o[0],r=b.createElement("div");for(r.innerHTML=o[1]+l+o[2];x--;)r=r.lastChild;if(!c.support.tbody){x=db.test(l);k=k==="table"&&!x?r.firstChild&&r.firstChild.childNodes:o[1]===""&&!x?r.childNodes:[];for(o=k.length- +1;o>=0;--o)c.nodeName(k[o],"tbody")&&!k[o].childNodes.length&&k[o].parentNode.removeChild(k[o])}!c.support.leadingWhitespace&&$.test(l)&&r.insertBefore(b.createTextNode($.exec(l)[0]),r.firstChild);l=r.childNodes}if(l.nodeType)f.push(l);else f=c.merge(f,l)}}if(d)for(h=0;f[h];h++)if(e&&c.nodeName(f[h],"script")&&(!f[h].type||f[h].type.toLowerCase()==="text/javascript"))e.push(f[h].parentNode?f[h].parentNode.removeChild(f[h]):f[h]);else{f[h].nodeType===1&&f.splice.apply(f,[h+1,0].concat(c.makeArray(f[h].getElementsByTagName("script")))); +d.appendChild(f[h])}return f},cleanData:function(a){for(var b,d,e=c.cache,f=c.event.special,h=c.support.deleteExpando,l=0,k;(k=a[l])!=null;l++)if(!(k.nodeName&&c.noData[k.nodeName.toLowerCase()]))if(d=k[c.expando]){if((b=e[d])&&b.events)for(var o in b.events)f[o]?c.event.remove(k,o):c.removeEvent(k,o,b.handle);if(h)delete k[c.expando];else k.removeAttribute&&k.removeAttribute(c.expando);delete e[d]}}});var Ea=/alpha\([^)]*\)/i,gb=/opacity=([^)]*)/,hb=/-([a-z])/ig,ib=/([A-Z])/g,Fa=/^-?\d+(?:px)?$/i, +jb=/^-?\d/,kb={position:"absolute",visibility:"hidden",display:"block"},Pa=["Left","Right"],Qa=["Top","Bottom"],W,Ga,aa,lb=function(a,b){return b.toUpperCase()};c.fn.css=function(a,b){if(arguments.length===2&&b===B)return this;return c.access(this,a,b,true,function(d,e,f){return f!==B?c.style(d,e,f):c.css(d,e)})};c.extend({cssHooks:{opacity:{get:function(a,b){if(b){var d=W(a,"opacity","opacity");return d===""?"1":d}else return a.style.opacity}}},cssNumber:{zIndex:true,fontWeight:true,opacity:true, +zoom:true,lineHeight:true},cssProps:{"float":c.support.cssFloat?"cssFloat":"styleFloat"},style:function(a,b,d,e){if(!(!a||a.nodeType===3||a.nodeType===8||!a.style)){var f,h=c.camelCase(b),l=a.style,k=c.cssHooks[h];b=c.cssProps[h]||h;if(d!==B){if(!(typeof d==="number"&&isNaN(d)||d==null)){if(typeof d==="number"&&!c.cssNumber[h])d+="px";if(!k||!("set"in k)||(d=k.set(a,d))!==B)try{l[b]=d}catch(o){}}}else{if(k&&"get"in k&&(f=k.get(a,false,e))!==B)return f;return l[b]}}},css:function(a,b,d){var e,f=c.camelCase(b), +h=c.cssHooks[f];b=c.cssProps[f]||f;if(h&&"get"in h&&(e=h.get(a,true,d))!==B)return e;else if(W)return W(a,b,f)},swap:function(a,b,d){var e={},f;for(f in b){e[f]=a.style[f];a.style[f]=b[f]}d.call(a);for(f in b)a.style[f]=e[f]},camelCase:function(a){return a.replace(hb,lb)}});c.curCSS=c.css;c.each(["height","width"],function(a,b){c.cssHooks[b]={get:function(d,e,f){var h;if(e){if(d.offsetWidth!==0)h=oa(d,b,f);else c.swap(d,kb,function(){h=oa(d,b,f)});if(h<=0){h=W(d,b,b);if(h==="0px"&&aa)h=aa(d,b,b); +if(h!=null)return h===""||h==="auto"?"0px":h}if(h<0||h==null){h=d.style[b];return h===""||h==="auto"?"0px":h}return typeof h==="string"?h:h+"px"}},set:function(d,e){if(Fa.test(e)){e=parseFloat(e);if(e>=0)return e+"px"}else return e}}});if(!c.support.opacity)c.cssHooks.opacity={get:function(a,b){return gb.test((b&&a.currentStyle?a.currentStyle.filter:a.style.filter)||"")?parseFloat(RegExp.$1)/100+"":b?"1":""},set:function(a,b){var d=a.style;d.zoom=1;var e=c.isNaN(b)?"":"alpha(opacity="+b*100+")",f= +d.filter||"";d.filter=Ea.test(f)?f.replace(Ea,e):d.filter+" "+e}};if(t.defaultView&&t.defaultView.getComputedStyle)Ga=function(a,b,d){var e;d=d.replace(ib,"-$1").toLowerCase();if(!(b=a.ownerDocument.defaultView))return B;if(b=b.getComputedStyle(a,null)){e=b.getPropertyValue(d);if(e===""&&!c.contains(a.ownerDocument.documentElement,a))e=c.style(a,d)}return e};if(t.documentElement.currentStyle)aa=function(a,b){var d,e,f=a.currentStyle&&a.currentStyle[b],h=a.style;if(!Fa.test(f)&&jb.test(f)){d=h.left; +e=a.runtimeStyle.left;a.runtimeStyle.left=a.currentStyle.left;h.left=b==="fontSize"?"1em":f||0;f=h.pixelLeft+"px";h.left=d;a.runtimeStyle.left=e}return f===""?"auto":f};W=Ga||aa;if(c.expr&&c.expr.filters){c.expr.filters.hidden=function(a){var b=a.offsetHeight;return a.offsetWidth===0&&b===0||!c.support.reliableHiddenOffsets&&(a.style.display||c.css(a,"display"))==="none"};c.expr.filters.visible=function(a){return!c.expr.filters.hidden(a)}}var mb=c.now(),nb=/)<[^<]*)*<\/script>/gi, +ob=/^(?:select|textarea)/i,pb=/^(?:color|date|datetime|email|hidden|month|number|password|range|search|tel|text|time|url|week)$/i,qb=/^(?:GET|HEAD)$/,Ra=/\[\]$/,T=/\=\?(&|$)/,ja=/\?/,rb=/([?&])_=[^&]*/,sb=/^(\w+:)?\/\/([^\/?#]+)/,tb=/%20/g,ub=/#.*$/,Ha=c.fn.load;c.fn.extend({load:function(a,b,d){if(typeof a!=="string"&&Ha)return Ha.apply(this,arguments);else if(!this.length)return this;var e=a.indexOf(" ");if(e>=0){var f=a.slice(e,a.length);a=a.slice(0,e)}e="GET";if(b)if(c.isFunction(b)){d=b;b=null}else if(typeof b=== +"object"){b=c.param(b,c.ajaxSettings.traditional);e="POST"}var h=this;c.ajax({url:a,type:e,dataType:"html",data:b,complete:function(l,k){if(k==="success"||k==="notmodified")h.html(f?c("
").append(l.responseText.replace(nb,"")).find(f):l.responseText);d&&h.each(d,[l.responseText,k,l])}});return this},serialize:function(){return c.param(this.serializeArray())},serializeArray:function(){return this.map(function(){return this.elements?c.makeArray(this.elements):this}).filter(function(){return this.name&& +!this.disabled&&(this.checked||ob.test(this.nodeName)||pb.test(this.type))}).map(function(a,b){var d=c(this).val();return d==null?null:c.isArray(d)?c.map(d,function(e){return{name:b.name,value:e}}):{name:b.name,value:d}}).get()}});c.each("ajaxStart ajaxStop ajaxComplete ajaxError ajaxSuccess ajaxSend".split(" "),function(a,b){c.fn[b]=function(d){return this.bind(b,d)}});c.extend({get:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b=null}return c.ajax({type:"GET",url:a,data:b,success:d,dataType:e})}, +getScript:function(a,b){return c.get(a,null,b,"script")},getJSON:function(a,b,d){return c.get(a,b,d,"json")},post:function(a,b,d,e){if(c.isFunction(b)){e=e||d;d=b;b={}}return c.ajax({type:"POST",url:a,data:b,success:d,dataType:e})},ajaxSetup:function(a){c.extend(c.ajaxSettings,a)},ajaxSettings:{url:location.href,global:true,type:"GET",contentType:"application/x-www-form-urlencoded",processData:true,async:true,xhr:function(){return new E.XMLHttpRequest},accepts:{xml:"application/xml, text/xml",html:"text/html", +script:"text/javascript, application/javascript",json:"application/json, text/javascript",text:"text/plain",_default:"*/*"}},ajax:function(a){var b=c.extend(true,{},c.ajaxSettings,a),d,e,f,h=b.type.toUpperCase(),l=qb.test(h);b.url=b.url.replace(ub,"");b.context=a&&a.context!=null?a.context:b;if(b.data&&b.processData&&typeof b.data!=="string")b.data=c.param(b.data,b.traditional);if(b.dataType==="jsonp"){if(h==="GET")T.test(b.url)||(b.url+=(ja.test(b.url)?"&":"?")+(b.jsonp||"callback")+"=?");else if(!b.data|| +!T.test(b.data))b.data=(b.data?b.data+"&":"")+(b.jsonp||"callback")+"=?";b.dataType="json"}if(b.dataType==="json"&&(b.data&&T.test(b.data)||T.test(b.url))){d=b.jsonpCallback||"jsonp"+mb++;if(b.data)b.data=(b.data+"").replace(T,"="+d+"$1");b.url=b.url.replace(T,"="+d+"$1");b.dataType="script";var k=E[d];E[d]=function(m){if(c.isFunction(k))k(m);else{E[d]=B;try{delete E[d]}catch(p){}}f=m;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);r&&r.removeChild(A)}}if(b.dataType==="script"&&b.cache===null)b.cache= +false;if(b.cache===false&&l){var o=c.now(),x=b.url.replace(rb,"$1_="+o);b.url=x+(x===b.url?(ja.test(b.url)?"&":"?")+"_="+o:"")}if(b.data&&l)b.url+=(ja.test(b.url)?"&":"?")+b.data;b.global&&c.active++===0&&c.event.trigger("ajaxStart");o=(o=sb.exec(b.url))&&(o[1]&&o[1].toLowerCase()!==location.protocol||o[2].toLowerCase()!==location.host);if(b.dataType==="script"&&h==="GET"&&o){var r=t.getElementsByTagName("head")[0]||t.documentElement,A=t.createElement("script");if(b.scriptCharset)A.charset=b.scriptCharset; +A.src=b.url;if(!d){var C=false;A.onload=A.onreadystatechange=function(){if(!C&&(!this.readyState||this.readyState==="loaded"||this.readyState==="complete")){C=true;c.handleSuccess(b,w,e,f);c.handleComplete(b,w,e,f);A.onload=A.onreadystatechange=null;r&&A.parentNode&&r.removeChild(A)}}}r.insertBefore(A,r.firstChild);return B}var J=false,w=b.xhr();if(w){b.username?w.open(h,b.url,b.async,b.username,b.password):w.open(h,b.url,b.async);try{if(b.data!=null&&!l||a&&a.contentType)w.setRequestHeader("Content-Type", +b.contentType);if(b.ifModified){c.lastModified[b.url]&&w.setRequestHeader("If-Modified-Since",c.lastModified[b.url]);c.etag[b.url]&&w.setRequestHeader("If-None-Match",c.etag[b.url])}o||w.setRequestHeader("X-Requested-With","XMLHttpRequest");w.setRequestHeader("Accept",b.dataType&&b.accepts[b.dataType]?b.accepts[b.dataType]+", */*; q=0.01":b.accepts._default)}catch(I){}if(b.beforeSend&&b.beforeSend.call(b.context,w,b)===false){b.global&&c.active--===1&&c.event.trigger("ajaxStop");w.abort();return false}b.global&& +c.triggerGlobal(b,"ajaxSend",[w,b]);var L=w.onreadystatechange=function(m){if(!w||w.readyState===0||m==="abort"){J||c.handleComplete(b,w,e,f);J=true;if(w)w.onreadystatechange=c.noop}else if(!J&&w&&(w.readyState===4||m==="timeout")){J=true;w.onreadystatechange=c.noop;e=m==="timeout"?"timeout":!c.httpSuccess(w)?"error":b.ifModified&&c.httpNotModified(w,b.url)?"notmodified":"success";var p;if(e==="success")try{f=c.httpData(w,b.dataType,b)}catch(q){e="parsererror";p=q}if(e==="success"||e==="notmodified")d|| +c.handleSuccess(b,w,e,f);else c.handleError(b,w,e,p);d||c.handleComplete(b,w,e,f);m==="timeout"&&w.abort();if(b.async)w=null}};try{var g=w.abort;w.abort=function(){w&&Function.prototype.call.call(g,w);L("abort")}}catch(i){}b.async&&b.timeout>0&&setTimeout(function(){w&&!J&&L("timeout")},b.timeout);try{w.send(l||b.data==null?null:b.data)}catch(n){c.handleError(b,w,null,n);c.handleComplete(b,w,e,f)}b.async||L();return w}},param:function(a,b){var d=[],e=function(h,l){l=c.isFunction(l)?l():l;d[d.length]= +encodeURIComponent(h)+"="+encodeURIComponent(l)};if(b===B)b=c.ajaxSettings.traditional;if(c.isArray(a)||a.jquery)c.each(a,function(){e(this.name,this.value)});else for(var f in a)da(f,a[f],b,e);return d.join("&").replace(tb,"+")}});c.extend({active:0,lastModified:{},etag:{},handleError:function(a,b,d,e){a.error&&a.error.call(a.context,b,d,e);a.global&&c.triggerGlobal(a,"ajaxError",[b,a,e])},handleSuccess:function(a,b,d,e){a.success&&a.success.call(a.context,e,d,b);a.global&&c.triggerGlobal(a,"ajaxSuccess", +[b,a])},handleComplete:function(a,b,d){a.complete&&a.complete.call(a.context,b,d);a.global&&c.triggerGlobal(a,"ajaxComplete",[b,a]);a.global&&c.active--===1&&c.event.trigger("ajaxStop")},triggerGlobal:function(a,b,d){(a.context&&a.context.url==null?c(a.context):c.event).trigger(b,d)},httpSuccess:function(a){try{return!a.status&&location.protocol==="file:"||a.status>=200&&a.status<300||a.status===304||a.status===1223}catch(b){}return false},httpNotModified:function(a,b){var d=a.getResponseHeader("Last-Modified"), +e=a.getResponseHeader("Etag");if(d)c.lastModified[b]=d;if(e)c.etag[b]=e;return a.status===304},httpData:function(a,b,d){var e=a.getResponseHeader("content-type")||"",f=b==="xml"||!b&&e.indexOf("xml")>=0;a=f?a.responseXML:a.responseText;f&&a.documentElement.nodeName==="parsererror"&&c.error("parsererror");if(d&&d.dataFilter)a=d.dataFilter(a,b);if(typeof a==="string")if(b==="json"||!b&&e.indexOf("json")>=0)a=c.parseJSON(a);else if(b==="script"||!b&&e.indexOf("javascript")>=0)c.globalEval(a);return a}}); +if(E.ActiveXObject)c.ajaxSettings.xhr=function(){if(E.location.protocol!=="file:")try{return new E.XMLHttpRequest}catch(a){}try{return new E.ActiveXObject("Microsoft.XMLHTTP")}catch(b){}};c.support.ajax=!!c.ajaxSettings.xhr();var ea={},vb=/^(?:toggle|show|hide)$/,wb=/^([+\-]=)?([\d+.\-]+)(.*)$/,ba,pa=[["height","marginTop","marginBottom","paddingTop","paddingBottom"],["width","marginLeft","marginRight","paddingLeft","paddingRight"],["opacity"]];c.fn.extend({show:function(a,b,d){if(a||a===0)return this.animate(S("show", +3),a,b,d);else{d=0;for(var e=this.length;d=0;e--)if(d[e].elem===this){b&&d[e](true);d.splice(e,1)}});b||this.dequeue();return this}});c.each({slideDown:S("show",1),slideUp:S("hide",1),slideToggle:S("toggle",1),fadeIn:{opacity:"show"},fadeOut:{opacity:"hide"},fadeToggle:{opacity:"toggle"}},function(a,b){c.fn[a]=function(d,e,f){return this.animate(b, +d,e,f)}});c.extend({speed:function(a,b,d){var e=a&&typeof a==="object"?c.extend({},a):{complete:d||!d&&b||c.isFunction(a)&&a,duration:a,easing:d&&b||b&&!c.isFunction(b)&&b};e.duration=c.fx.off?0:typeof e.duration==="number"?e.duration:e.duration in c.fx.speeds?c.fx.speeds[e.duration]:c.fx.speeds._default;e.old=e.complete;e.complete=function(){e.queue!==false&&c(this).dequeue();c.isFunction(e.old)&&e.old.call(this)};return e},easing:{linear:function(a,b,d,e){return d+e*a},swing:function(a,b,d,e){return(-Math.cos(a* +Math.PI)/2+0.5)*e+d}},timers:[],fx:function(a,b,d){this.options=b;this.elem=a;this.prop=d;if(!b.orig)b.orig={}}});c.fx.prototype={update:function(){this.options.step&&this.options.step.call(this.elem,this.now,this);(c.fx.step[this.prop]||c.fx.step._default)(this)},cur:function(){if(this.elem[this.prop]!=null&&(!this.elem.style||this.elem.style[this.prop]==null))return this.elem[this.prop];var a=parseFloat(c.css(this.elem,this.prop));return a&&a>-1E4?a:0},custom:function(a,b,d){function e(l){return f.step(l)} +var f=this,h=c.fx;this.startTime=c.now();this.start=a;this.end=b;this.unit=d||this.unit||"px";this.now=this.start;this.pos=this.state=0;e.elem=this.elem;if(e()&&c.timers.push(e)&&!ba)ba=setInterval(h.tick,h.interval)},show:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.show=true;this.custom(this.prop==="width"||this.prop==="height"?1:0,this.cur());c(this.elem).show()},hide:function(){this.options.orig[this.prop]=c.style(this.elem,this.prop);this.options.hide=true; +this.custom(this.cur(),0)},step:function(a){var b=c.now(),d=true;if(a||b>=this.options.duration+this.startTime){this.now=this.end;this.pos=this.state=1;this.update();this.options.curAnim[this.prop]=true;for(var e in this.options.curAnim)if(this.options.curAnim[e]!==true)d=false;if(d){if(this.options.overflow!=null&&!c.support.shrinkWrapBlocks){var f=this.elem,h=this.options;c.each(["","X","Y"],function(k,o){f.style["overflow"+o]=h.overflow[k]})}this.options.hide&&c(this.elem).hide();if(this.options.hide|| +this.options.show)for(var l in this.options.curAnim)c.style(this.elem,l,this.options.orig[l]);this.options.complete.call(this.elem)}return false}else{a=b-this.startTime;this.state=a/this.options.duration;b=this.options.easing||(c.easing.swing?"swing":"linear");this.pos=c.easing[this.options.specialEasing&&this.options.specialEasing[this.prop]||b](this.state,a,0,1,this.options.duration);this.now=this.start+(this.end-this.start)*this.pos;this.update()}return true}};c.extend(c.fx,{tick:function(){for(var a= +c.timers,b=0;b-1;e={};var x={};if(o)x=f.position();l=o?x.top:parseInt(l,10)||0;k=o?x.left:parseInt(k,10)||0;if(c.isFunction(b))b=b.call(a,d,h);if(b.top!=null)e.top=b.top-h.top+l;if(b.left!=null)e.left=b.left-h.left+k;"using"in b?b.using.call(a, +e):f.css(e)}};c.fn.extend({position:function(){if(!this[0])return null;var a=this[0],b=this.offsetParent(),d=this.offset(),e=Ia.test(b[0].nodeName)?{top:0,left:0}:b.offset();d.top-=parseFloat(c.css(a,"marginTop"))||0;d.left-=parseFloat(c.css(a,"marginLeft"))||0;e.top+=parseFloat(c.css(b[0],"borderTopWidth"))||0;e.left+=parseFloat(c.css(b[0],"borderLeftWidth"))||0;return{top:d.top-e.top,left:d.left-e.left}},offsetParent:function(){return this.map(function(){for(var a=this.offsetParent||t.body;a&&!Ia.test(a.nodeName)&& +c.css(a,"position")==="static";)a=a.offsetParent;return a})}});c.each(["Left","Top"],function(a,b){var d="scroll"+b;c.fn[d]=function(e){var f=this[0],h;if(!f)return null;if(e!==B)return this.each(function(){if(h=fa(this))h.scrollTo(!a?e:c(h).scrollLeft(),a?e:c(h).scrollTop());else this[d]=e});else return(h=fa(f))?"pageXOffset"in h?h[a?"pageYOffset":"pageXOffset"]:c.support.boxModel&&h.document.documentElement[d]||h.document.body[d]:f[d]}});c.each(["Height","Width"],function(a,b){var d=b.toLowerCase(); +c.fn["inner"+b]=function(){return this[0]?parseFloat(c.css(this[0],d,"padding")):null};c.fn["outer"+b]=function(e){return this[0]?parseFloat(c.css(this[0],d,e?"margin":"border")):null};c.fn[d]=function(e){var f=this[0];if(!f)return e==null?null:this;if(c.isFunction(e))return this.each(function(l){var k=c(this);k[d](e.call(this,l,k[d]()))});if(c.isWindow(f))return f.document.compatMode==="CSS1Compat"&&f.document.documentElement["client"+b]||f.document.body["client"+b];else if(f.nodeType===9)return Math.max(f.documentElement["client"+ +b],f.body["scroll"+b],f.documentElement["scroll"+b],f.body["offset"+b],f.documentElement["offset"+b]);else if(e===B){f=c.css(f,d);var h=parseFloat(f);return c.isNaN(h)?f:h}else return this.css(d,typeof e==="string"?e:e+"px")}})})(window); diff --git a/src/sunstone/public/js/jquery-ui-1.8.7.custom.min.js b/src/sunstone/public/js/jquery-ui-1.8.7.custom.min.js new file mode 100644 index 0000000000..b03a87e844 --- /dev/null +++ b/src/sunstone/public/js/jquery-ui-1.8.7.custom.min.js @@ -0,0 +1,781 @@ +/*! + * jQuery UI 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI + */ +(function(c,j){function k(a){return!c(a).parents().andSelf().filter(function(){return c.curCSS(this,"visibility")==="hidden"||c.expr.filters.hidden(this)}).length}c.ui=c.ui||{};if(!c.ui.version){c.extend(c.ui,{version:"1.8.7",keyCode:{ALT:18,BACKSPACE:8,CAPS_LOCK:20,COMMA:188,COMMAND:91,COMMAND_LEFT:91,COMMAND_RIGHT:93,CONTROL:17,DELETE:46,DOWN:40,END:35,ENTER:13,ESCAPE:27,HOME:36,INSERT:45,LEFT:37,MENU:93,NUMPAD_ADD:107,NUMPAD_DECIMAL:110,NUMPAD_DIVIDE:111,NUMPAD_ENTER:108,NUMPAD_MULTIPLY:106, +NUMPAD_SUBTRACT:109,PAGE_DOWN:34,PAGE_UP:33,PERIOD:190,RIGHT:39,SHIFT:16,SPACE:32,TAB:9,UP:38,WINDOWS:91}});c.fn.extend({_focus:c.fn.focus,focus:function(a,b){return typeof a==="number"?this.each(function(){var d=this;setTimeout(function(){c(d).focus();b&&b.call(d)},a)}):this._focus.apply(this,arguments)},scrollParent:function(){var a;a=c.browser.msie&&/(static|relative)/.test(this.css("position"))||/absolute/.test(this.css("position"))?this.parents().filter(function(){return/(relative|absolute|fixed)/.test(c.curCSS(this, +"position",1))&&/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0):this.parents().filter(function(){return/(auto|scroll)/.test(c.curCSS(this,"overflow",1)+c.curCSS(this,"overflow-y",1)+c.curCSS(this,"overflow-x",1))}).eq(0);return/fixed/.test(this.css("position"))||!a.length?c(document):a},zIndex:function(a){if(a!==j)return this.css("zIndex",a);if(this.length){a=c(this[0]);for(var b;a.length&&a[0]!==document;){b=a.css("position"); +if(b==="absolute"||b==="relative"||b==="fixed"){b=parseInt(a.css("zIndex"),10);if(!isNaN(b)&&b!==0)return b}a=a.parent()}}return 0},disableSelection:function(){return this.bind((c.support.selectstart?"selectstart":"mousedown")+".ui-disableSelection",function(a){a.preventDefault()})},enableSelection:function(){return this.unbind(".ui-disableSelection")}});c.each(["Width","Height"],function(a,b){function d(f,g,l,m){c.each(e,function(){g-=parseFloat(c.curCSS(f,"padding"+this,true))||0;if(l)g-=parseFloat(c.curCSS(f, +"border"+this+"Width",true))||0;if(m)g-=parseFloat(c.curCSS(f,"margin"+this,true))||0});return g}var e=b==="Width"?["Left","Right"]:["Top","Bottom"],h=b.toLowerCase(),i={innerWidth:c.fn.innerWidth,innerHeight:c.fn.innerHeight,outerWidth:c.fn.outerWidth,outerHeight:c.fn.outerHeight};c.fn["inner"+b]=function(f){if(f===j)return i["inner"+b].call(this);return this.each(function(){c(this).css(h,d(this,f)+"px")})};c.fn["outer"+b]=function(f,g){if(typeof f!=="number")return i["outer"+b].call(this,f);return this.each(function(){c(this).css(h, +d(this,f,true,g)+"px")})}});c.extend(c.expr[":"],{data:function(a,b,d){return!!c.data(a,d[3])},focusable:function(a){var b=a.nodeName.toLowerCase(),d=c.attr(a,"tabindex");if("area"===b){b=a.parentNode;d=b.name;if(!a.href||!d||b.nodeName.toLowerCase()!=="map")return false;a=c("img[usemap=#"+d+"]")[0];return!!a&&k(a)}return(/input|select|textarea|button|object/.test(b)?!a.disabled:"a"==b?a.href||!isNaN(d):!isNaN(d))&&k(a)},tabbable:function(a){var b=c.attr(a,"tabindex");return(isNaN(b)||b>=0)&&c(a).is(":focusable")}}); +c(function(){var a=document.body,b=a.appendChild(b=document.createElement("div"));c.extend(b.style,{minHeight:"100px",height:"auto",padding:0,borderWidth:0});c.support.minHeight=b.offsetHeight===100;c.support.selectstart="onselectstart"in b;a.removeChild(b).style.display="none"});c.extend(c.ui,{plugin:{add:function(a,b,d){a=c.ui[a].prototype;for(var e in d){a.plugins[e]=a.plugins[e]||[];a.plugins[e].push([b,d[e]])}},call:function(a,b,d){if((b=a.plugins[b])&&a.element[0].parentNode)for(var e=0;e0)return true;a[b]=1;d=a[b]>0;a[b]=0;return d},isOverAxis:function(a,b,d){return a>b&&a=9)&&!a.button)return this._mouseUp(a);if(this._mouseStarted){this._mouseDrag(a); +return a.preventDefault()}if(this._mouseDistanceMet(a)&&this._mouseDelayMet(a))(this._mouseStarted=this._mouseStart(this._mouseDownEvent,a)!==false)?this._mouseDrag(a):this._mouseUp(a);return!this._mouseStarted},_mouseUp:function(a){c(document).unbind("mousemove."+this.widgetName,this._mouseMoveDelegate).unbind("mouseup."+this.widgetName,this._mouseUpDelegate);if(this._mouseStarted){this._mouseStarted=false;a.target==this._mouseDownEvent.target&&c.data(a.target,this.widgetName+".preventClickEvent", +true);this._mouseStop(a)}return false},_mouseDistanceMet:function(a){return Math.max(Math.abs(this._mouseDownEvent.pageX-a.pageX),Math.abs(this._mouseDownEvent.pageY-a.pageY))>=this.options.distance},_mouseDelayMet:function(){return this.mouseDelayMet},_mouseStart:function(){},_mouseDrag:function(){},_mouseStop:function(){},_mouseCapture:function(){return true}})})(jQuery); +;/* + * jQuery UI Position 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Position + */ +(function(c){c.ui=c.ui||{};var n=/left|center|right/,o=/top|center|bottom/,t=c.fn.position,u=c.fn.offset;c.fn.position=function(b){if(!b||!b.of)return t.apply(this,arguments);b=c.extend({},b);var a=c(b.of),d=a[0],g=(b.collision||"flip").split(" "),e=b.offset?b.offset.split(" "):[0,0],h,k,j;if(d.nodeType===9){h=a.width();k=a.height();j={top:0,left:0}}else if(d.setTimeout){h=a.width();k=a.height();j={top:a.scrollTop(),left:a.scrollLeft()}}else if(d.preventDefault){b.at="left top";h=k=0;j={top:b.of.pageY, +left:b.of.pageX}}else{h=a.outerWidth();k=a.outerHeight();j=a.offset()}c.each(["my","at"],function(){var f=(b[this]||"").split(" ");if(f.length===1)f=n.test(f[0])?f.concat(["center"]):o.test(f[0])?["center"].concat(f):["center","center"];f[0]=n.test(f[0])?f[0]:"center";f[1]=o.test(f[1])?f[1]:"center";b[this]=f});if(g.length===1)g[1]=g[0];e[0]=parseInt(e[0],10)||0;if(e.length===1)e[1]=e[0];e[1]=parseInt(e[1],10)||0;if(b.at[0]==="right")j.left+=h;else if(b.at[0]==="center")j.left+=h/2;if(b.at[1]==="bottom")j.top+= +k;else if(b.at[1]==="center")j.top+=k/2;j.left+=e[0];j.top+=e[1];return this.each(function(){var f=c(this),l=f.outerWidth(),m=f.outerHeight(),p=parseInt(c.curCSS(this,"marginLeft",true))||0,q=parseInt(c.curCSS(this,"marginTop",true))||0,v=l+p+parseInt(c.curCSS(this,"marginRight",true))||0,w=m+q+parseInt(c.curCSS(this,"marginBottom",true))||0,i=c.extend({},j),r;if(b.my[0]==="right")i.left-=l;else if(b.my[0]==="center")i.left-=l/2;if(b.my[1]==="bottom")i.top-=m;else if(b.my[1]==="center")i.top-=m/2; +i.left=Math.round(i.left);i.top=Math.round(i.top);r={left:i.left-p,top:i.top-q};c.each(["left","top"],function(s,x){c.ui.position[g[s]]&&c.ui.position[g[s]][x](i,{targetWidth:h,targetHeight:k,elemWidth:l,elemHeight:m,collisionPosition:r,collisionWidth:v,collisionHeight:w,offset:e,my:b.my,at:b.at})});c.fn.bgiframe&&f.bgiframe();f.offset(c.extend(i,{using:b.using}))})};c.ui.position={fit:{left:function(b,a){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();b.left= +d>0?b.left-d:Math.max(b.left-a.collisionPosition.left,b.left)},top:function(b,a){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();b.top=d>0?b.top-d:Math.max(b.top-a.collisionPosition.top,b.top)}},flip:{left:function(b,a){if(a.at[0]!=="center"){var d=c(window);d=a.collisionPosition.left+a.collisionWidth-d.width()-d.scrollLeft();var g=a.my[0]==="left"?-a.elemWidth:a.my[0]==="right"?a.elemWidth:0,e=a.at[0]==="left"?a.targetWidth:-a.targetWidth,h=-2*a.offset[0];b.left+= +a.collisionPosition.left<0?g+e+h:d>0?g+e+h:0}},top:function(b,a){if(a.at[1]!=="center"){var d=c(window);d=a.collisionPosition.top+a.collisionHeight-d.height()-d.scrollTop();var g=a.my[1]==="top"?-a.elemHeight:a.my[1]==="bottom"?a.elemHeight:0,e=a.at[1]==="top"?a.targetHeight:-a.targetHeight,h=-2*a.offset[1];b.top+=a.collisionPosition.top<0?g+e+h:d>0?g+e+h:0}}}};if(!c.offset.setOffset){c.offset.setOffset=function(b,a){if(/static/.test(c.curCSS(b,"position")))b.style.position="relative";var d=c(b), +g=d.offset(),e=parseInt(c.curCSS(b,"top",true),10)||0,h=parseInt(c.curCSS(b,"left",true),10)||0;g={top:a.top-g.top+e,left:a.left-g.left+h};"using"in a?a.using.call(b,g):d.css(g)};c.fn.offset=function(b){var a=this[0];if(!a||!a.ownerDocument)return null;if(b)return this.each(function(){c.offset.setOffset(this,b)});return u.call(this)}}})(jQuery); +;/* + * jQuery UI Draggable 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Draggables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(d){d.widget("ui.draggable",d.ui.mouse,{widgetEventPrefix:"drag",options:{addClasses:true,appendTo:"parent",axis:false,connectToSortable:false,containment:false,cursor:"auto",cursorAt:false,grid:false,handle:false,helper:"original",iframeFix:false,opacity:false,refreshPositions:false,revert:false,revertDuration:500,scope:"default",scroll:true,scrollSensitivity:20,scrollSpeed:20,snap:false,snapMode:"both",snapTolerance:20,stack:false,zIndex:false},_create:function(){if(this.options.helper== +"original"&&!/^(?:r|a|f)/.test(this.element.css("position")))this.element[0].style.position="relative";this.options.addClasses&&this.element.addClass("ui-draggable");this.options.disabled&&this.element.addClass("ui-draggable-disabled");this._mouseInit()},destroy:function(){if(this.element.data("draggable")){this.element.removeData("draggable").unbind(".draggable").removeClass("ui-draggable ui-draggable-dragging ui-draggable-disabled");this._mouseDestroy();return this}},_mouseCapture:function(a){var b= +this.options;if(this.helper||b.disabled||d(a.target).is(".ui-resizable-handle"))return false;this.handle=this._getHandle(a);if(!this.handle)return false;return true},_mouseStart:function(a){var b=this.options;this.helper=this._createHelper(a);this._cacheHelperProportions();if(d.ui.ddmanager)d.ui.ddmanager.current=this;this._cacheMargins();this.cssPosition=this.helper.css("position");this.scrollParent=this.helper.scrollParent();this.offset=this.positionAbs=this.element.offset();this.offset={top:this.offset.top- +this.margins.top,left:this.offset.left-this.margins.left};d.extend(this.offset,{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this.position=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);b.containment&&this._setContainment();if(this._trigger("start",a)===false){this._clear();return false}this._cacheHelperProportions(); +d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.helper.addClass("ui-draggable-dragging");this._mouseDrag(a,true);return true},_mouseDrag:function(a,b){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute");if(!b){b=this._uiHash();if(this._trigger("drag",a,b)===false){this._mouseUp({});return false}this.position=b.position}if(!this.options.axis||this.options.axis!="y")this.helper[0].style.left=this.position.left+"px";if(!this.options.axis|| +this.options.axis!="x")this.helper[0].style.top=this.position.top+"px";d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);return false},_mouseStop:function(a){var b=false;if(d.ui.ddmanager&&!this.options.dropBehaviour)b=d.ui.ddmanager.drop(this,a);if(this.dropped){b=this.dropped;this.dropped=false}if(!this.element[0]||!this.element[0].parentNode)return false;if(this.options.revert=="invalid"&&!b||this.options.revert=="valid"&&b||this.options.revert===true||d.isFunction(this.options.revert)&&this.options.revert.call(this.element, +b)){var c=this;d(this.helper).animate(this.originalPosition,parseInt(this.options.revertDuration,10),function(){c._trigger("stop",a)!==false&&c._clear()})}else this._trigger("stop",a)!==false&&this._clear();return false},cancel:function(){this.helper.is(".ui-draggable-dragging")?this._mouseUp({}):this._clear();return this},_getHandle:function(a){var b=!this.options.handle||!d(this.options.handle,this.element).length?true:false;d(this.options.handle,this.element).find("*").andSelf().each(function(){if(this== +a.target)b=true});return b},_createHelper:function(a){var b=this.options;a=d.isFunction(b.helper)?d(b.helper.apply(this.element[0],[a])):b.helper=="clone"?this.element.clone():this.element;a.parents("body").length||a.appendTo(b.appendTo=="parent"?this.element[0].parentNode:b.appendTo);a[0]!=this.element[0]&&!/(fixed|absolute)/.test(a.css("position"))&&a.css("position","absolute");return a},_adjustOffsetFromHelper:function(a){if(typeof a=="string")a=a.split(" ");if(d.isArray(a))a={left:+a[0],top:+a[1]|| +0};if("left"in a)this.offset.click.left=a.left+this.margins.left;if("right"in a)this.offset.click.left=this.helperProportions.width-a.right+this.margins.left;if("top"in a)this.offset.click.top=a.top+this.margins.top;if("bottom"in a)this.offset.click.top=this.helperProportions.height-a.bottom+this.margins.top},_getParentOffset:function(){this.offsetParent=this.helper.offsetParent();var a=this.offsetParent.offset();if(this.cssPosition=="absolute"&&this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0], +this.offsetParent[0])){a.left+=this.scrollParent.scrollLeft();a.top+=this.scrollParent.scrollTop()}if(this.offsetParent[0]==document.body||this.offsetParent[0].tagName&&this.offsetParent[0].tagName.toLowerCase()=="html"&&d.browser.msie)a={top:0,left:0};return{top:a.top+(parseInt(this.offsetParent.css("borderTopWidth"),10)||0),left:a.left+(parseInt(this.offsetParent.css("borderLeftWidth"),10)||0)}},_getRelativeOffset:function(){if(this.cssPosition=="relative"){var a=this.element.position();return{top:a.top- +(parseInt(this.helper.css("top"),10)||0)+this.scrollParent.scrollTop(),left:a.left-(parseInt(this.helper.css("left"),10)||0)+this.scrollParent.scrollLeft()}}else return{top:0,left:0}},_cacheMargins:function(){this.margins={left:parseInt(this.element.css("marginLeft"),10)||0,top:parseInt(this.element.css("marginTop"),10)||0}},_cacheHelperProportions:function(){this.helperProportions={width:this.helper.outerWidth(),height:this.helper.outerHeight()}},_setContainment:function(){var a=this.options;if(a.containment== +"parent")a.containment=this.helper[0].parentNode;if(a.containment=="document"||a.containment=="window")this.containment=[(a.containment=="document"?0:d(window).scrollLeft())-this.offset.relative.left-this.offset.parent.left,(a.containment=="document"?0:d(window).scrollTop())-this.offset.relative.top-this.offset.parent.top,(a.containment=="document"?0:d(window).scrollLeft())+d(a.containment=="document"?document:window).width()-this.helperProportions.width-this.margins.left,(a.containment=="document"? +0:d(window).scrollTop())+(d(a.containment=="document"?document:window).height()||document.body.parentNode.scrollHeight)-this.helperProportions.height-this.margins.top];if(!/^(document|window|parent)$/.test(a.containment)&&a.containment.constructor!=Array){var b=d(a.containment)[0];if(b){a=d(a.containment).offset();var c=d(b).css("overflow")!="hidden";this.containment=[a.left+(parseInt(d(b).css("borderLeftWidth"),10)||0)+(parseInt(d(b).css("paddingLeft"),10)||0)-this.margins.left,a.top+(parseInt(d(b).css("borderTopWidth"), +10)||0)+(parseInt(d(b).css("paddingTop"),10)||0)-this.margins.top,a.left+(c?Math.max(b.scrollWidth,b.offsetWidth):b.offsetWidth)-(parseInt(d(b).css("borderLeftWidth"),10)||0)-(parseInt(d(b).css("paddingRight"),10)||0)-this.helperProportions.width-this.margins.left,a.top+(c?Math.max(b.scrollHeight,b.offsetHeight):b.offsetHeight)-(parseInt(d(b).css("borderTopWidth"),10)||0)-(parseInt(d(b).css("paddingBottom"),10)||0)-this.helperProportions.height-this.margins.top]}}else if(a.containment.constructor== +Array)this.containment=a.containment},_convertPositionTo:function(a,b){if(!b)b=this.position;a=a=="absolute"?1:-1;var c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName);return{top:b.top+this.offset.relative.top*a+this.offset.parent.top*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollTop(): +f?0:c.scrollTop())*a),left:b.left+this.offset.relative.left*a+this.offset.parent.left*a-(d.browser.safari&&d.browser.version<526&&this.cssPosition=="fixed"?0:(this.cssPosition=="fixed"?-this.scrollParent.scrollLeft():f?0:c.scrollLeft())*a)}},_generatePosition:function(a){var b=this.options,c=this.cssPosition=="absolute"&&!(this.scrollParent[0]!=document&&d.ui.contains(this.scrollParent[0],this.offsetParent[0]))?this.offsetParent:this.scrollParent,f=/(html|body)/i.test(c[0].tagName),e=a.pageX,g=a.pageY; +if(this.originalPosition){if(this.containment){if(a.pageX-this.offset.click.leftthis.containment[2])e=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/ +b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])?g:!(g-this.offset.click.topthis.containment[2])?e:!(e-this.offset.click.left
').css({width:this.offsetWidth+"px",height:this.offsetHeight+"px",position:"absolute",opacity:"0.001",zIndex:1E3}).css(d(this).offset()).appendTo("body")})}, +stop:function(){d("div.ui-draggable-iframeFix").each(function(){this.parentNode.removeChild(this)})}});d.ui.plugin.add("draggable","opacity",{start:function(a,b){a=d(b.helper);b=d(this).data("draggable").options;if(a.css("opacity"))b._opacity=a.css("opacity");a.css("opacity",b.opacity)},stop:function(a,b){a=d(this).data("draggable").options;a._opacity&&d(b.helper).css("opacity",a._opacity)}});d.ui.plugin.add("draggable","scroll",{start:function(){var a=d(this).data("draggable");if(a.scrollParent[0]!= +document&&a.scrollParent[0].tagName!="HTML")a.overflowOffset=a.scrollParent.offset()},drag:function(a){var b=d(this).data("draggable"),c=b.options,f=false;if(b.scrollParent[0]!=document&&b.scrollParent[0].tagName!="HTML"){if(!c.axis||c.axis!="x")if(b.overflowOffset.top+b.scrollParent[0].offsetHeight-a.pageY=0;h--){var i=c.snapElements[h].left,k=i+c.snapElements[h].width,j=c.snapElements[h].top,l=j+c.snapElements[h].height;if(i-e=j&&f<=l||h>=j&&h<=l||fl)&&(e>= +i&&e<=k||g>=i&&g<=k||ek);default:return false}};d.ui.ddmanager={current:null,droppables:{"default":[]},prepareOffsets:function(a,b){var c=d.ui.ddmanager.droppables[a.options.scope]||[],e=b?b.type:null,g=(a.currentItem||a.element).find(":data(droppable)").andSelf(),f=0;a:for(;f').css({position:this.element.css("position"),width:this.element.outerWidth(),height:this.element.outerHeight(), +top:this.element.css("top"),left:this.element.css("left")}));this.element=this.element.parent().data("resizable",this.element.data("resizable"));this.elementIsWrapper=true;this.element.css({marginLeft:this.originalElement.css("marginLeft"),marginTop:this.originalElement.css("marginTop"),marginRight:this.originalElement.css("marginRight"),marginBottom:this.originalElement.css("marginBottom")});this.originalElement.css({marginLeft:0,marginTop:0,marginRight:0,marginBottom:0});this.originalResizeStyle= +this.originalElement.css("resize");this.originalElement.css("resize","none");this._proportionallyResizeElements.push(this.originalElement.css({position:"static",zoom:1,display:"block"}));this.originalElement.css({margin:this.originalElement.css("margin")});this._proportionallyResize()}this.handles=a.handles||(!e(".ui-resizable-handle",this.element).length?"e,s,se":{n:".ui-resizable-n",e:".ui-resizable-e",s:".ui-resizable-s",w:".ui-resizable-w",se:".ui-resizable-se",sw:".ui-resizable-sw",ne:".ui-resizable-ne", +nw:".ui-resizable-nw"});if(this.handles.constructor==String){if(this.handles=="all")this.handles="n,e,s,w,se,sw,ne,nw";var c=this.handles.split(",");this.handles={};for(var d=0;d');/sw|se|ne|nw/.test(f)&&g.css({zIndex:++a.zIndex});"se"==f&&g.addClass("ui-icon ui-icon-gripsmall-diagonal-se");this.handles[f]=".ui-resizable-"+f;this.element.append(g)}}this._renderAxis=function(h){h=h||this.element;for(var i in this.handles){if(this.handles[i].constructor== +String)this.handles[i]=e(this.handles[i],this.element).show();if(this.elementIsWrapper&&this.originalElement[0].nodeName.match(/textarea|input|select|button/i)){var j=e(this.handles[i],this.element),k=0;k=/sw|ne|nw|se|n|s/.test(i)?j.outerHeight():j.outerWidth();j=["padding",/ne|nw|n/.test(i)?"Top":/se|sw|s/.test(i)?"Bottom":/^e$/.test(i)?"Right":"Left"].join("");h.css(j,k);this._proportionallyResize()}e(this.handles[i])}};this._renderAxis(this.element);this._handles=e(".ui-resizable-handle",this.element).disableSelection(); +this._handles.mouseover(function(){if(!b.resizing){if(this.className)var h=this.className.match(/ui-resizable-(se|sw|ne|nw|n|e|s|w)/i);b.axis=h&&h[1]?h[1]:"se"}});if(a.autoHide){this._handles.hide();e(this.element).addClass("ui-resizable-autohide").hover(function(){e(this).removeClass("ui-resizable-autohide");b._handles.show()},function(){if(!b.resizing){e(this).addClass("ui-resizable-autohide");b._handles.hide()}})}this._mouseInit()},destroy:function(){this._mouseDestroy();var b=function(c){e(c).removeClass("ui-resizable ui-resizable-disabled ui-resizable-resizing").removeData("resizable").unbind(".resizable").find(".ui-resizable-handle").remove()}; +if(this.elementIsWrapper){b(this.element);var a=this.element;a.after(this.originalElement.css({position:a.css("position"),width:a.outerWidth(),height:a.outerHeight(),top:a.css("top"),left:a.css("left")})).remove()}this.originalElement.css("resize",this.originalResizeStyle);b(this.originalElement);return this},_mouseCapture:function(b){var a=false;for(var c in this.handles)if(e(this.handles[c])[0]==b.target)a=true;return!this.options.disabled&&a},_mouseStart:function(b){var a=this.options,c=this.element.position(), +d=this.element;this.resizing=true;this.documentScroll={top:e(document).scrollTop(),left:e(document).scrollLeft()};if(d.is(".ui-draggable")||/absolute/.test(d.css("position")))d.css({position:"absolute",top:c.top,left:c.left});e.browser.opera&&/relative/.test(d.css("position"))&&d.css({position:"relative",top:"auto",left:"auto"});this._renderProxy();c=m(this.helper.css("left"));var f=m(this.helper.css("top"));if(a.containment){c+=e(a.containment).scrollLeft()||0;f+=e(a.containment).scrollTop()||0}this.offset= +this.helper.offset();this.position={left:c,top:f};this.size=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalSize=this._helper?{width:d.outerWidth(),height:d.outerHeight()}:{width:d.width(),height:d.height()};this.originalPosition={left:c,top:f};this.sizeDiff={width:d.outerWidth()-d.width(),height:d.outerHeight()-d.height()};this.originalMousePosition={left:b.pageX,top:b.pageY};this.aspectRatio=typeof a.aspectRatio=="number"?a.aspectRatio: +this.originalSize.width/this.originalSize.height||1;a=e(".ui-resizable-"+this.axis).css("cursor");e("body").css("cursor",a=="auto"?this.axis+"-resize":a);d.addClass("ui-resizable-resizing");this._propagate("start",b);return true},_mouseDrag:function(b){var a=this.helper,c=this.originalMousePosition,d=this._change[this.axis];if(!d)return false;c=d.apply(this,[b,b.pageX-c.left||0,b.pageY-c.top||0]);if(this._aspectRatio||b.shiftKey)c=this._updateRatio(c,b);c=this._respectSize(c,b);this._propagate("resize", +b);a.css({top:this.position.top+"px",left:this.position.left+"px",width:this.size.width+"px",height:this.size.height+"px"});!this._helper&&this._proportionallyResizeElements.length&&this._proportionallyResize();this._updateCache(c);this._trigger("resize",b,this.ui());return false},_mouseStop:function(b){this.resizing=false;var a=this.options,c=this;if(this._helper){var d=this._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName);d=f&&e.ui.hasScroll(d[0],"left")?0:c.sizeDiff.height; +f={width:c.size.width-(f?0:c.sizeDiff.width),height:c.size.height-d};d=parseInt(c.element.css("left"),10)+(c.position.left-c.originalPosition.left)||null;var g=parseInt(c.element.css("top"),10)+(c.position.top-c.originalPosition.top)||null;a.animate||this.element.css(e.extend(f,{top:g,left:d}));c.helper.height(c.size.height);c.helper.width(c.size.width);this._helper&&!a.animate&&this._proportionallyResize()}e("body").css("cursor","auto");this.element.removeClass("ui-resizable-resizing");this._propagate("stop", +b);this._helper&&this.helper.remove();return false},_updateCache:function(b){this.offset=this.helper.offset();if(l(b.left))this.position.left=b.left;if(l(b.top))this.position.top=b.top;if(l(b.height))this.size.height=b.height;if(l(b.width))this.size.width=b.width},_updateRatio:function(b){var a=this.position,c=this.size,d=this.axis;if(b.height)b.width=c.height*this.aspectRatio;else if(b.width)b.height=c.width/this.aspectRatio;if(d=="sw"){b.left=a.left+(c.width-b.width);b.top=null}if(d=="nw"){b.top= +a.top+(c.height-b.height);b.left=a.left+(c.width-b.width)}return b},_respectSize:function(b){var a=this.options,c=this.axis,d=l(b.width)&&a.maxWidth&&a.maxWidthb.width,h=l(b.height)&&a.minHeight&&a.minHeight>b.height;if(g)b.width=a.minWidth;if(h)b.height=a.minHeight;if(d)b.width=a.maxWidth;if(f)b.height=a.maxHeight;var i=this.originalPosition.left+this.originalSize.width,j=this.position.top+this.size.height, +k=/sw|nw|w/.test(c);c=/nw|ne|n/.test(c);if(g&&k)b.left=i-a.minWidth;if(d&&k)b.left=i-a.maxWidth;if(h&&c)b.top=j-a.minHeight;if(f&&c)b.top=j-a.maxHeight;if((a=!b.width&&!b.height)&&!b.left&&b.top)b.top=null;else if(a&&!b.top&&b.left)b.left=null;return b},_proportionallyResize:function(){if(this._proportionallyResizeElements.length)for(var b=this.helper||this.element,a=0;a');var a=e.browser.msie&&e.browser.version<7,c=a?1:0;a=a?2:-1;this.helper.addClass(this._helper).css({width:this.element.outerWidth()+a,height:this.element.outerHeight()+a,position:"absolute",left:this.elementOffset.left-c+"px",top:this.elementOffset.top-c+"px",zIndex:++b.zIndex});this.helper.appendTo("body").disableSelection()}else this.helper=this.element},_change:{e:function(b,a){return{width:this.originalSize.width+ +a}},w:function(b,a){return{left:this.originalPosition.left+a,width:this.originalSize.width-a}},n:function(b,a,c){return{top:this.originalPosition.top+c,height:this.originalSize.height-c}},s:function(b,a,c){return{height:this.originalSize.height+c}},se:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.e.apply(this,[b,a,c]))},sw:function(b,a,c){return e.extend(this._change.s.apply(this,arguments),this._change.w.apply(this,[b,a,c]))},ne:function(b,a,c){return e.extend(this._change.n.apply(this, +arguments),this._change.e.apply(this,[b,a,c]))},nw:function(b,a,c){return e.extend(this._change.n.apply(this,arguments),this._change.w.apply(this,[b,a,c]))}},_propagate:function(b,a){e.ui.plugin.call(this,b,[a,this.ui()]);b!="resize"&&this._trigger(b,a,this.ui())},plugins:{},ui:function(){return{originalElement:this.originalElement,element:this.element,helper:this.helper,position:this.position,size:this.size,originalSize:this.originalSize,originalPosition:this.originalPosition}}});e.extend(e.ui.resizable, +{version:"1.8.7"});e.ui.plugin.add("resizable","alsoResize",{start:function(){var b=e(this).data("resizable").options,a=function(c){e(c).each(function(){var d=e(this);d.data("resizable-alsoresize",{width:parseInt(d.width(),10),height:parseInt(d.height(),10),left:parseInt(d.css("left"),10),top:parseInt(d.css("top"),10),position:d.css("position")})})};if(typeof b.alsoResize=="object"&&!b.alsoResize.parentNode)if(b.alsoResize.length){b.alsoResize=b.alsoResize[0];a(b.alsoResize)}else e.each(b.alsoResize, +function(c){a(c)});else a(b.alsoResize)},resize:function(b,a){var c=e(this).data("resizable");b=c.options;var d=c.originalSize,f=c.originalPosition,g={height:c.size.height-d.height||0,width:c.size.width-d.width||0,top:c.position.top-f.top||0,left:c.position.left-f.left||0},h=function(i,j){e(i).each(function(){var k=e(this),q=e(this).data("resizable-alsoresize"),p={},r=j&&j.length?j:k.parents(a.originalElement[0]).length?["width","height"]:["width","height","top","left"];e.each(r,function(n,o){if((n= +(q[o]||0)+(g[o]||0))&&n>=0)p[o]=n||null});if(e.browser.opera&&/relative/.test(k.css("position"))){c._revertToRelativePosition=true;k.css({position:"absolute",top:"auto",left:"auto"})}k.css(p)})};typeof b.alsoResize=="object"&&!b.alsoResize.nodeType?e.each(b.alsoResize,function(i,j){h(i,j)}):h(b.alsoResize)},stop:function(){var b=e(this).data("resizable"),a=b.options,c=function(d){e(d).each(function(){var f=e(this);f.css({position:f.data("resizable-alsoresize").position})})};if(b._revertToRelativePosition){b._revertToRelativePosition= +false;typeof a.alsoResize=="object"&&!a.alsoResize.nodeType?e.each(a.alsoResize,function(d){c(d)}):c(a.alsoResize)}e(this).removeData("resizable-alsoresize")}});e.ui.plugin.add("resizable","animate",{stop:function(b){var a=e(this).data("resizable"),c=a.options,d=a._proportionallyResizeElements,f=d.length&&/textarea/i.test(d[0].nodeName),g=f&&e.ui.hasScroll(d[0],"left")?0:a.sizeDiff.height;f={width:a.size.width-(f?0:a.sizeDiff.width),height:a.size.height-g};g=parseInt(a.element.css("left"),10)+(a.position.left- +a.originalPosition.left)||null;var h=parseInt(a.element.css("top"),10)+(a.position.top-a.originalPosition.top)||null;a.element.animate(e.extend(f,h&&g?{top:h,left:g}:{}),{duration:c.animateDuration,easing:c.animateEasing,step:function(){var i={width:parseInt(a.element.css("width"),10),height:parseInt(a.element.css("height"),10),top:parseInt(a.element.css("top"),10),left:parseInt(a.element.css("left"),10)};d&&d.length&&e(d[0]).css({width:i.width,height:i.height});a._updateCache(i);a._propagate("resize", +b)}})}});e.ui.plugin.add("resizable","containment",{start:function(){var b=e(this).data("resizable"),a=b.element,c=b.options.containment;if(a=c instanceof e?c.get(0):/parent/.test(c)?a.parent().get(0):c){b.containerElement=e(a);if(/document/.test(c)||c==document){b.containerOffset={left:0,top:0};b.containerPosition={left:0,top:0};b.parentData={element:e(document),left:0,top:0,width:e(document).width(),height:e(document).height()||document.body.parentNode.scrollHeight}}else{var d=e(a),f=[];e(["Top", +"Right","Left","Bottom"]).each(function(i,j){f[i]=m(d.css("padding"+j))});b.containerOffset=d.offset();b.containerPosition=d.position();b.containerSize={height:d.innerHeight()-f[3],width:d.innerWidth()-f[1]};c=b.containerOffset;var g=b.containerSize.height,h=b.containerSize.width;h=e.ui.hasScroll(a,"left")?a.scrollWidth:h;g=e.ui.hasScroll(a)?a.scrollHeight:g;b.parentData={element:a,left:c.left,top:c.top,width:h,height:g}}}},resize:function(b){var a=e(this).data("resizable"),c=a.options,d=a.containerOffset, +f=a.position;b=a._aspectRatio||b.shiftKey;var g={top:0,left:0},h=a.containerElement;if(h[0]!=document&&/static/.test(h.css("position")))g=d;if(f.left<(a._helper?d.left:0)){a.size.width+=a._helper?a.position.left-d.left:a.position.left-g.left;if(b)a.size.height=a.size.width/c.aspectRatio;a.position.left=c.helper?d.left:0}if(f.top<(a._helper?d.top:0)){a.size.height+=a._helper?a.position.top-d.top:a.position.top;if(b)a.size.width=a.size.height*c.aspectRatio;a.position.top=a._helper?d.top:0}a.offset.left= +a.parentData.left+a.position.left;a.offset.top=a.parentData.top+a.position.top;c=Math.abs((a._helper?a.offset.left-g.left:a.offset.left-g.left)+a.sizeDiff.width);d=Math.abs((a._helper?a.offset.top-g.top:a.offset.top-d.top)+a.sizeDiff.height);f=a.containerElement.get(0)==a.element.parent().get(0);g=/relative|absolute/.test(a.containerElement.css("position"));if(f&&g)c-=a.parentData.left;if(c+a.size.width>=a.parentData.width){a.size.width=a.parentData.width-c;if(b)a.size.height=a.size.width/a.aspectRatio}if(d+ +a.size.height>=a.parentData.height){a.size.height=a.parentData.height-d;if(b)a.size.width=a.size.height*a.aspectRatio}},stop:function(){var b=e(this).data("resizable"),a=b.options,c=b.containerOffset,d=b.containerPosition,f=b.containerElement,g=e(b.helper),h=g.offset(),i=g.outerWidth()-b.sizeDiff.width;g=g.outerHeight()-b.sizeDiff.height;b._helper&&!a.animate&&/relative/.test(f.css("position"))&&e(this).css({left:h.left-d.left-c.left,width:i,height:g});b._helper&&!a.animate&&/static/.test(f.css("position"))&& +e(this).css({left:h.left-d.left-c.left,width:i,height:g})}});e.ui.plugin.add("resizable","ghost",{start:function(){var b=e(this).data("resizable"),a=b.options,c=b.size;b.ghost=b.originalElement.clone();b.ghost.css({opacity:0.25,display:"block",position:"relative",height:c.height,width:c.width,margin:0,left:0,top:0}).addClass("ui-resizable-ghost").addClass(typeof a.ghost=="string"?a.ghost:"");b.ghost.appendTo(b.helper)},resize:function(){var b=e(this).data("resizable");b.ghost&&b.ghost.css({position:"relative", +height:b.size.height,width:b.size.width})},stop:function(){var b=e(this).data("resizable");b.ghost&&b.helper&&b.helper.get(0).removeChild(b.ghost.get(0))}});e.ui.plugin.add("resizable","grid",{resize:function(){var b=e(this).data("resizable"),a=b.options,c=b.size,d=b.originalSize,f=b.originalPosition,g=b.axis;a.grid=typeof a.grid=="number"?[a.grid,a.grid]:a.grid;var h=Math.round((c.width-d.width)/(a.grid[0]||1))*(a.grid[0]||1);a=Math.round((c.height-d.height)/(a.grid[1]||1))*(a.grid[1]||1);if(/^(se|s|e)$/.test(g)){b.size.width= +d.width+h;b.size.height=d.height+a}else if(/^(ne)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}else{if(/^(sw)$/.test(g)){b.size.width=d.width+h;b.size.height=d.height+a}else{b.size.width=d.width+h;b.size.height=d.height+a;b.position.top=f.top-a}b.position.left=f.left-h}}});var m=function(b){return parseInt(b,10)||0},l=function(b){return!isNaN(parseInt(b,10))}})(jQuery); +;/* + * jQuery UI Selectable 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Selectables + * + * Depends: + * jquery.ui.core.js + * jquery.ui.mouse.js + * jquery.ui.widget.js + */ +(function(e){e.widget("ui.selectable",e.ui.mouse,{options:{appendTo:"body",autoRefresh:true,distance:0,filter:"*",tolerance:"touch"},_create:function(){var c=this;this.element.addClass("ui-selectable");this.dragged=false;var f;this.refresh=function(){f=e(c.options.filter,c.element[0]);f.each(function(){var d=e(this),b=d.offset();e.data(this,"selectable-item",{element:this,$element:d,left:b.left,top:b.top,right:b.left+d.outerWidth(),bottom:b.top+d.outerHeight(),startselected:false,selected:d.hasClass("ui-selected"), +selecting:d.hasClass("ui-selecting"),unselecting:d.hasClass("ui-unselecting")})})};this.refresh();this.selectees=f.addClass("ui-selectee");this._mouseInit();this.helper=e("
")},destroy:function(){this.selectees.removeClass("ui-selectee").removeData("selectable-item");this.element.removeClass("ui-selectable ui-selectable-disabled").removeData("selectable").unbind(".selectable");this._mouseDestroy();return this},_mouseStart:function(c){var f=this;this.opos=[c.pageX, +c.pageY];if(!this.options.disabled){var d=this.options;this.selectees=e(d.filter,this.element[0]);this._trigger("start",c);e(d.appendTo).append(this.helper);this.helper.css({left:c.clientX,top:c.clientY,width:0,height:0});d.autoRefresh&&this.refresh();this.selectees.filter(".ui-selected").each(function(){var b=e.data(this,"selectable-item");b.startselected=true;if(!c.metaKey){b.$element.removeClass("ui-selected");b.selected=false;b.$element.addClass("ui-unselecting");b.unselecting=true;f._trigger("unselecting", +c,{unselecting:b.element})}});e(c.target).parents().andSelf().each(function(){var b=e.data(this,"selectable-item");if(b){var g=!c.metaKey||!b.$element.hasClass("ui-selected");b.$element.removeClass(g?"ui-unselecting":"ui-selected").addClass(g?"ui-selecting":"ui-unselecting");b.unselecting=!g;b.selecting=g;(b.selected=g)?f._trigger("selecting",c,{selecting:b.element}):f._trigger("unselecting",c,{unselecting:b.element});return false}})}},_mouseDrag:function(c){var f=this;this.dragged=true;if(!this.options.disabled){var d= +this.options,b=this.opos[0],g=this.opos[1],h=c.pageX,i=c.pageY;if(b>h){var j=h;h=b;b=j}if(g>i){j=i;i=g;g=j}this.helper.css({left:b,top:g,width:h-b,height:i-g});this.selectees.each(function(){var a=e.data(this,"selectable-item");if(!(!a||a.element==f.element[0])){var k=false;if(d.tolerance=="touch")k=!(a.left>h||a.righti||a.bottomb&&a.rightg&&a.bottom *",opacity:false,placeholder:false,revert:false,scroll:true,scrollSensitivity:20,scrollSpeed:20,scope:"default",tolerance:"intersect",zIndex:1E3},_create:function(){this.containerCache={};this.element.addClass("ui-sortable"); +this.refresh();this.floating=this.items.length?/left|right/.test(this.items[0].item.css("float")):false;this.offset=this.element.offset();this._mouseInit()},destroy:function(){this.element.removeClass("ui-sortable ui-sortable-disabled").removeData("sortable").unbind(".sortable");this._mouseDestroy();for(var a=this.items.length-1;a>=0;a--)this.items[a].item.removeData("sortable-item");return this},_setOption:function(a,b){if(a==="disabled"){this.options[a]=b;this.widget()[b?"addClass":"removeClass"]("ui-sortable-disabled")}else d.Widget.prototype._setOption.apply(this, +arguments)},_mouseCapture:function(a,b){if(this.reverting)return false;if(this.options.disabled||this.options.type=="static")return false;this._refreshItems(a);var c=null,e=this;d(a.target).parents().each(function(){if(d.data(this,"sortable-item")==e){c=d(this);return false}});if(d.data(a.target,"sortable-item")==e)c=d(a.target);if(!c)return false;if(this.options.handle&&!b){var f=false;d(this.options.handle,c).find("*").andSelf().each(function(){if(this==a.target)f=true});if(!f)return false}this.currentItem= +c;this._removeCurrentsFromItems();return true},_mouseStart:function(a,b,c){b=this.options;var e=this;this.currentContainer=this;this.refreshPositions();this.helper=this._createHelper(a);this._cacheHelperProportions();this._cacheMargins();this.scrollParent=this.helper.scrollParent();this.offset=this.currentItem.offset();this.offset={top:this.offset.top-this.margins.top,left:this.offset.left-this.margins.left};this.helper.css("position","absolute");this.cssPosition=this.helper.css("position");d.extend(this.offset, +{click:{left:a.pageX-this.offset.left,top:a.pageY-this.offset.top},parent:this._getParentOffset(),relative:this._getRelativeOffset()});this.originalPosition=this._generatePosition(a);this.originalPageX=a.pageX;this.originalPageY=a.pageY;b.cursorAt&&this._adjustOffsetFromHelper(b.cursorAt);this.domPosition={prev:this.currentItem.prev()[0],parent:this.currentItem.parent()[0]};this.helper[0]!=this.currentItem[0]&&this.currentItem.hide();this._createPlaceholder();b.containment&&this._setContainment(); +if(b.cursor){if(d("body").css("cursor"))this._storedCursor=d("body").css("cursor");d("body").css("cursor",b.cursor)}if(b.opacity){if(this.helper.css("opacity"))this._storedOpacity=this.helper.css("opacity");this.helper.css("opacity",b.opacity)}if(b.zIndex){if(this.helper.css("zIndex"))this._storedZIndex=this.helper.css("zIndex");this.helper.css("zIndex",b.zIndex)}if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML")this.overflowOffset=this.scrollParent.offset();this._trigger("start", +a,this._uiHash());this._preserveHelperProportions||this._cacheHelperProportions();if(!c)for(c=this.containers.length-1;c>=0;c--)this.containers[c]._trigger("activate",a,e._uiHash(this));if(d.ui.ddmanager)d.ui.ddmanager.current=this;d.ui.ddmanager&&!b.dropBehaviour&&d.ui.ddmanager.prepareOffsets(this,a);this.dragging=true;this.helper.addClass("ui-sortable-helper");this._mouseDrag(a);return true},_mouseDrag:function(a){this.position=this._generatePosition(a);this.positionAbs=this._convertPositionTo("absolute"); +if(!this.lastPositionAbs)this.lastPositionAbs=this.positionAbs;if(this.options.scroll){var b=this.options,c=false;if(this.scrollParent[0]!=document&&this.scrollParent[0].tagName!="HTML"){if(this.overflowOffset.top+this.scrollParent[0].offsetHeight-a.pageY=0;b--){c=this.items[b];var e=c.item[0],f=this._intersectsWithPointer(c);if(f)if(e!=this.currentItem[0]&&this.placeholder[f==1?"next":"prev"]()[0]!=e&&!d.ui.contains(this.placeholder[0],e)&&(this.options.type=="semi-dynamic"?!d.ui.contains(this.element[0],e):true)){this.direction=f==1?"down":"up";if(this.options.tolerance=="pointer"||this._intersectsWithSides(c))this._rearrange(a, +c);else break;this._trigger("change",a,this._uiHash());break}}this._contactContainers(a);d.ui.ddmanager&&d.ui.ddmanager.drag(this,a);this._trigger("sort",a,this._uiHash());this.lastPositionAbs=this.positionAbs;return false},_mouseStop:function(a,b){if(a){d.ui.ddmanager&&!this.options.dropBehaviour&&d.ui.ddmanager.drop(this,a);if(this.options.revert){var c=this;b=c.placeholder.offset();c.reverting=true;d(this.helper).animate({left:b.left-this.offset.parent.left-c.margins.left+(this.offsetParent[0]== +document.body?0:this.offsetParent[0].scrollLeft),top:b.top-this.offset.parent.top-c.margins.top+(this.offsetParent[0]==document.body?0:this.offsetParent[0].scrollTop)},parseInt(this.options.revert,10)||500,function(){c._clear(a)})}else this._clear(a,b);return false}},cancel:function(){var a=this;if(this.dragging){this._mouseUp();this.options.helper=="original"?this.currentItem.css(this._storedCSS).removeClass("ui-sortable-helper"):this.currentItem.show();for(var b=this.containers.length-1;b>=0;b--){this.containers[b]._trigger("deactivate", +null,a._uiHash(this));if(this.containers[b].containerCache.over){this.containers[b]._trigger("out",null,a._uiHash(this));this.containers[b].containerCache.over=0}}}this.placeholder[0].parentNode&&this.placeholder[0].parentNode.removeChild(this.placeholder[0]);this.options.helper!="original"&&this.helper&&this.helper[0].parentNode&&this.helper.remove();d.extend(this,{helper:null,dragging:false,reverting:false,_noFinalSort:null});this.domPosition.prev?d(this.domPosition.prev).after(this.currentItem): +d(this.domPosition.parent).prepend(this.currentItem);return this},serialize:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};d(b).each(function(){var e=(d(a.item||this).attr(a.attribute||"id")||"").match(a.expression||/(.+)[-=_](.+)/);if(e)c.push((a.key||e[1]+"[]")+"="+(a.key&&a.expression?e[1]:e[2]))});!c.length&&a.key&&c.push(a.key+"=");return c.join("&")},toArray:function(a){var b=this._getItemsAsjQuery(a&&a.connected),c=[];a=a||{};b.each(function(){c.push(d(a.item||this).attr(a.attribute|| +"id")||"")});return c},_intersectsWith:function(a){var b=this.positionAbs.left,c=b+this.helperProportions.width,e=this.positionAbs.top,f=e+this.helperProportions.height,g=a.left,h=g+a.width,i=a.top,k=i+a.height,j=this.offset.click.top,l=this.offset.click.left;j=e+j>i&&e+jg&&b+la[this.floating?"width":"height"]?j:g0?"down":"up")}, +_getDragHorizontalDirection:function(){var a=this.positionAbs.left-this.lastPositionAbs.left;return a!=0&&(a>0?"right":"left")},refresh:function(a){this._refreshItems(a);this.refreshPositions();return this},_connectWith:function(){var a=this.options;return a.connectWith.constructor==String?[a.connectWith]:a.connectWith},_getItemsAsjQuery:function(a){var b=[],c=[],e=this._connectWith();if(e&&a)for(a=e.length-1;a>=0;a--)for(var f=d(e[a]),g=f.length-1;g>=0;g--){var h=d.data(f[g],"sortable");if(h&&h!= +this&&!h.options.disabled)c.push([d.isFunction(h.options.items)?h.options.items.call(h.element):d(h.options.items,h.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),h])}c.push([d.isFunction(this.options.items)?this.options.items.call(this.element,null,{options:this.options,item:this.currentItem}):d(this.options.items,this.element).not(".ui-sortable-helper").not(".ui-sortable-placeholder"),this]);for(a=c.length-1;a>=0;a--)c[a][0].each(function(){b.push(this)});return d(b)},_removeCurrentsFromItems:function(){for(var a= +this.currentItem.find(":data(sortable-item)"),b=0;b=0;f--)for(var g=d(e[f]),h=g.length-1;h>=0;h--){var i=d.data(g[h],"sortable"); +if(i&&i!=this&&!i.options.disabled){c.push([d.isFunction(i.options.items)?i.options.items.call(i.element[0],a,{item:this.currentItem}):d(i.options.items,i.element),i]);this.containers.push(i)}}for(f=c.length-1;f>=0;f--){a=c[f][1];e=c[f][0];h=0;for(g=e.length;h= +0;b--){var c=this.items[b],e=this.options.toleranceElement?d(this.options.toleranceElement,c.item):c.item;if(!a){c.width=e.outerWidth();c.height=e.outerHeight()}e=e.offset();c.left=e.left;c.top=e.top}if(this.options.custom&&this.options.custom.refreshContainers)this.options.custom.refreshContainers.call(this);else for(b=this.containers.length-1;b>=0;b--){e=this.containers[b].element.offset();this.containers[b].containerCache.left=e.left;this.containers[b].containerCache.top=e.top;this.containers[b].containerCache.width= +this.containers[b].element.outerWidth();this.containers[b].containerCache.height=this.containers[b].element.outerHeight()}return this},_createPlaceholder:function(a){var b=a||this,c=b.options;if(!c.placeholder||c.placeholder.constructor==String){var e=c.placeholder;c.placeholder={element:function(){var f=d(document.createElement(b.currentItem[0].nodeName)).addClass(e||b.currentItem[0].className+" ui-sortable-placeholder").removeClass("ui-sortable-helper")[0];if(!e)f.style.visibility="hidden";return f}, +update:function(f,g){if(!(e&&!c.forcePlaceholderSize)){g.height()||g.height(b.currentItem.innerHeight()-parseInt(b.currentItem.css("paddingTop")||0,10)-parseInt(b.currentItem.css("paddingBottom")||0,10));g.width()||g.width(b.currentItem.innerWidth()-parseInt(b.currentItem.css("paddingLeft")||0,10)-parseInt(b.currentItem.css("paddingRight")||0,10))}}}}b.placeholder=d(c.placeholder.element.call(b.element,b.currentItem));b.currentItem.after(b.placeholder);c.placeholder.update(b,b.placeholder)},_contactContainers:function(a){for(var b= +null,c=null,e=this.containers.length-1;e>=0;e--)if(!d.ui.contains(this.currentItem[0],this.containers[e].element[0]))if(this._intersectsWith(this.containers[e].containerCache)){if(!(b&&d.ui.contains(this.containers[e].element[0],b.element[0]))){b=this.containers[e];c=e}}else if(this.containers[e].containerCache.over){this.containers[e]._trigger("out",a,this._uiHash(this));this.containers[e].containerCache.over=0}if(b)if(this.containers.length===1){this.containers[c]._trigger("over",a,this._uiHash(this)); +this.containers[c].containerCache.over=1}else if(this.currentContainer!=this.containers[c]){b=1E4;e=null;for(var f=this.positionAbs[this.containers[c].floating?"left":"top"],g=this.items.length-1;g>=0;g--)if(d.ui.contains(this.containers[c].element[0],this.items[g].item[0])){var h=this.items[g][this.containers[c].floating?"left":"top"];if(Math.abs(h-f)this.containment[2])f=this.containment[2]+this.offset.click.left;if(a.pageY-this.offset.click.top>this.containment[3])g=this.containment[3]+this.offset.click.top}if(b.grid){g=this.originalPageY+Math.round((g-this.originalPageY)/b.grid[1])*b.grid[1];g=this.containment?!(g-this.offset.click.topthis.containment[3])? +g:!(g-this.offset.click.topthis.containment[2])?f:!(f-this.offset.click.left=0;e--)if(d.ui.contains(this.containers[e].element[0],this.currentItem[0])&&!b){c.push(function(f){return function(g){f._trigger("receive", +g,this._uiHash(this))}}.call(this,this.containers[e]));c.push(function(f){return function(g){f._trigger("update",g,this._uiHash(this))}}.call(this,this.containers[e]))}}for(e=this.containers.length-1;e>=0;e--){b||c.push(function(f){return function(g){f._trigger("deactivate",g,this._uiHash(this))}}.call(this,this.containers[e]));if(this.containers[e].containerCache.over){c.push(function(f){return function(g){f._trigger("out",g,this._uiHash(this))}}.call(this,this.containers[e]));this.containers[e].containerCache.over= +0}}this._storedCursor&&d("body").css("cursor",this._storedCursor);this._storedOpacity&&this.helper.css("opacity",this._storedOpacity);if(this._storedZIndex)this.helper.css("zIndex",this._storedZIndex=="auto"?"":this._storedZIndex);this.dragging=false;if(this.cancelHelperRemoval){if(!b){this._trigger("beforeStop",a,this._uiHash());for(e=0;e li > :first-child,> :not(li):even",icons:{header:"ui-icon-triangle-1-e",headerSelected:"ui-icon-triangle-1-s"},navigation:false,navigationFilter:function(){return this.href.toLowerCase()===location.href.toLowerCase()}},_create:function(){var a=this,b=a.options;a.running=0;a.element.addClass("ui-accordion ui-widget ui-helper-reset").children("li").addClass("ui-accordion-li-fix"); +a.headers=a.element.find(b.header).addClass("ui-accordion-header ui-helper-reset ui-state-default ui-corner-all").bind("mouseenter.accordion",function(){b.disabled||c(this).addClass("ui-state-hover")}).bind("mouseleave.accordion",function(){b.disabled||c(this).removeClass("ui-state-hover")}).bind("focus.accordion",function(){b.disabled||c(this).addClass("ui-state-focus")}).bind("blur.accordion",function(){b.disabled||c(this).removeClass("ui-state-focus")});a.headers.next().addClass("ui-accordion-content ui-helper-reset ui-widget-content ui-corner-bottom"); +if(b.navigation){var d=a.element.find("a").filter(b.navigationFilter).eq(0);if(d.length){var f=d.closest(".ui-accordion-header");a.active=f.length?f:d.closest(".ui-accordion-content").prev()}}a.active=a._findActive(a.active||b.active).addClass("ui-state-default ui-state-active").toggleClass("ui-corner-all").toggleClass("ui-corner-top");a.active.next().addClass("ui-accordion-content-active");a._createIcons();a.resize();a.element.attr("role","tablist");a.headers.attr("role","tab").bind("keydown.accordion", +function(g){return a._keydown(g)}).next().attr("role","tabpanel");a.headers.not(a.active||"").attr({"aria-expanded":"false",tabIndex:-1}).next().hide();a.active.length?a.active.attr({"aria-expanded":"true",tabIndex:0}):a.headers.eq(0).attr("tabIndex",0);c.browser.safari||a.headers.find("a").attr("tabIndex",-1);b.event&&a.headers.bind(b.event.split(" ").join(".accordion ")+".accordion",function(g){a._clickHandler.call(a,g,this);g.preventDefault()})},_createIcons:function(){var a=this.options;if(a.icons){c("").addClass("ui-icon "+ +a.icons.header).prependTo(this.headers);this.active.children(".ui-icon").toggleClass(a.icons.header).toggleClass(a.icons.headerSelected);this.element.addClass("ui-accordion-icons")}},_destroyIcons:function(){this.headers.children(".ui-icon").remove();this.element.removeClass("ui-accordion-icons")},destroy:function(){var a=this.options;this.element.removeClass("ui-accordion ui-widget ui-helper-reset").removeAttr("role");this.headers.unbind(".accordion").removeClass("ui-accordion-header ui-accordion-disabled ui-helper-reset ui-state-default ui-corner-all ui-state-active ui-state-disabled ui-corner-top").removeAttr("role").removeAttr("aria-expanded").removeAttr("tabIndex"); +this.headers.find("a").removeAttr("tabIndex");this._destroyIcons();var b=this.headers.next().css("display","").removeAttr("role").removeClass("ui-helper-reset ui-widget-content ui-corner-bottom ui-accordion-content ui-accordion-content-active ui-accordion-disabled ui-state-disabled");if(a.autoHeight||a.fillHeight)b.css("height","");return c.Widget.prototype.destroy.call(this)},_setOption:function(a,b){c.Widget.prototype._setOption.apply(this,arguments);a=="active"&&this.activate(b);if(a=="icons"){this._destroyIcons(); +b&&this._createIcons()}if(a=="disabled")this.headers.add(this.headers.next())[b?"addClass":"removeClass"]("ui-accordion-disabled ui-state-disabled")},_keydown:function(a){if(!(this.options.disabled||a.altKey||a.ctrlKey)){var b=c.ui.keyCode,d=this.headers.length,f=this.headers.index(a.target),g=false;switch(a.keyCode){case b.RIGHT:case b.DOWN:g=this.headers[(f+1)%d];break;case b.LEFT:case b.UP:g=this.headers[(f-1+d)%d];break;case b.SPACE:case b.ENTER:this._clickHandler({target:a.target},a.target); +a.preventDefault()}if(g){c(a.target).attr("tabIndex",-1);c(g).attr("tabIndex",0);g.focus();return false}return true}},resize:function(){var a=this.options,b;if(a.fillSpace){if(c.browser.msie){var d=this.element.parent().css("overflow");this.element.parent().css("overflow","hidden")}b=this.element.parent().height();c.browser.msie&&this.element.parent().css("overflow",d);this.headers.each(function(){b-=c(this).outerHeight(true)});this.headers.next().each(function(){c(this).height(Math.max(0,b-c(this).innerHeight()+ +c(this).height()))}).css("overflow","auto")}else if(a.autoHeight){b=0;this.headers.next().each(function(){b=Math.max(b,c(this).height("").height())}).height(b)}return this},activate:function(a){this.options.active=a;a=this._findActive(a)[0];this._clickHandler({target:a},a);return this},_findActive:function(a){return a?typeof a==="number"?this.headers.filter(":eq("+a+")"):this.headers.not(this.headers.not(a)):a===false?c([]):this.headers.filter(":eq(0)")},_clickHandler:function(a,b){var d=this.options; +if(!d.disabled)if(a.target){a=c(a.currentTarget||b);b=a[0]===this.active[0];d.active=d.collapsible&&b?false:this.headers.index(a);if(!(this.running||!d.collapsible&&b)){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header);if(!b){a.removeClass("ui-state-default ui-corner-all").addClass("ui-state-active ui-corner-top").children(".ui-icon").removeClass(d.icons.header).addClass(d.icons.headerSelected); +a.next().addClass("ui-accordion-content-active")}h=a.next();f=this.active.next();g={options:d,newHeader:b&&d.collapsible?c([]):a,oldHeader:this.active,newContent:b&&d.collapsible?c([]):h,oldContent:f};d=this.headers.index(this.active[0])>this.headers.index(a[0]);this.active=b?c([]):a;this._toggle(h,f,g,b,d)}}else if(d.collapsible){this.active.removeClass("ui-state-active ui-corner-top").addClass("ui-state-default ui-corner-all").children(".ui-icon").removeClass(d.icons.headerSelected).addClass(d.icons.header); +this.active.next().addClass("ui-accordion-content-active");var f=this.active.next(),g={options:d,newHeader:c([]),oldHeader:d.active,newContent:c([]),oldContent:f},h=this.active=c([]);this._toggle(h,f,g)}},_toggle:function(a,b,d,f,g){var h=this,e=h.options;h.toShow=a;h.toHide=b;h.data=d;var j=function(){if(h)return h._completed.apply(h,arguments)};h._trigger("changestart",null,h.data);h.running=b.size()===0?a.size():b.size();if(e.animated){d={};d=e.collapsible&&f?{toShow:c([]),toHide:b,complete:j, +down:g,autoHeight:e.autoHeight||e.fillSpace}:{toShow:a,toHide:b,complete:j,down:g,autoHeight:e.autoHeight||e.fillSpace};if(!e.proxied)e.proxied=e.animated;if(!e.proxiedDuration)e.proxiedDuration=e.duration;e.animated=c.isFunction(e.proxied)?e.proxied(d):e.proxied;e.duration=c.isFunction(e.proxiedDuration)?e.proxiedDuration(d):e.proxiedDuration;f=c.ui.accordion.animations;var i=e.duration,k=e.animated;if(k&&!f[k]&&!c.easing[k])k="slide";f[k]||(f[k]=function(l){this.slide(l,{easing:k,duration:i||700})}); +f[k](d)}else{if(e.collapsible&&f)a.toggle();else{b.hide();a.show()}j(true)}b.prev().attr({"aria-expanded":"false",tabIndex:-1}).blur();a.prev().attr({"aria-expanded":"true",tabIndex:0}).focus()},_completed:function(a){this.running=a?0:--this.running;if(!this.running){this.options.clearStyle&&this.toShow.add(this.toHide).css({height:"",overflow:""});this.toHide.removeClass("ui-accordion-content-active");this._trigger("change",null,this.data)}}});c.extend(c.ui.accordion,{version:"1.8.7",animations:{slide:function(a, +b){a=c.extend({easing:"swing",duration:300},a,b);if(a.toHide.size())if(a.toShow.size()){var d=a.toShow.css("overflow"),f=0,g={},h={},e;b=a.toShow;e=b[0].style.width;b.width(parseInt(b.parent().width(),10)-parseInt(b.css("paddingLeft"),10)-parseInt(b.css("paddingRight"),10)-(parseInt(b.css("borderLeftWidth"),10)||0)-(parseInt(b.css("borderRightWidth"),10)||0));c.each(["height","paddingTop","paddingBottom"],function(j,i){h[i]="hide";j=(""+c.css(a.toShow[0],i)).match(/^([\d+-.]+)(.*)$/);g[i]={value:j[1], +unit:j[2]||"px"}});a.toShow.css({height:0,overflow:"hidden"}).show();a.toHide.filter(":hidden").each(a.complete).end().filter(":visible").animate(h,{step:function(j,i){if(i.prop=="height")f=i.end-i.start===0?0:(i.now-i.start)/(i.end-i.start);a.toShow[0].style[i.prop]=f*g[i.prop].value+g[i.prop].unit},duration:a.duration,easing:a.easing,complete:function(){a.autoHeight||a.toShow.css("height","");a.toShow.css({width:e,overflow:d});a.complete()}})}else a.toHide.animate({height:"hide",paddingTop:"hide", +paddingBottom:"hide"},a);else a.toShow.animate({height:"show",paddingTop:"show",paddingBottom:"show"},a)},bounceslide:function(a){this.slide(a,{easing:a.down?"easeOutBounce":"swing",duration:a.down?1E3:200})}}})})(jQuery); +;/* + * jQuery UI Autocomplete 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Autocomplete + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.position.js + */ +(function(d){d.widget("ui.autocomplete",{options:{appendTo:"body",delay:300,minLength:1,position:{my:"left top",at:"left bottom",collision:"none"},source:null},_create:function(){var a=this,b=this.element[0].ownerDocument,f;this.element.addClass("ui-autocomplete-input").attr("autocomplete","off").attr({role:"textbox","aria-autocomplete":"list","aria-haspopup":"true"}).bind("keydown.autocomplete",function(c){if(!(a.options.disabled||a.element.attr("readonly"))){f=false;var e=d.ui.keyCode;switch(c.keyCode){case e.PAGE_UP:a._move("previousPage", +c);break;case e.PAGE_DOWN:a._move("nextPage",c);break;case e.UP:a._move("previous",c);c.preventDefault();break;case e.DOWN:a._move("next",c);c.preventDefault();break;case e.ENTER:case e.NUMPAD_ENTER:if(a.menu.active){f=true;c.preventDefault()}case e.TAB:if(!a.menu.active)return;a.menu.select(c);break;case e.ESCAPE:a.element.val(a.term);a.close(c);break;default:clearTimeout(a.searching);a.searching=setTimeout(function(){if(a.term!=a.element.val()){a.selectedItem=null;a.search(null,c)}},a.options.delay); +break}}}).bind("keypress.autocomplete",function(c){if(f){f=false;c.preventDefault()}}).bind("focus.autocomplete",function(){if(!a.options.disabled){a.selectedItem=null;a.previous=a.element.val()}}).bind("blur.autocomplete",function(c){if(!a.options.disabled){clearTimeout(a.searching);a.closing=setTimeout(function(){a.close(c);a._change(c)},150)}});this._initSource();this.response=function(){return a._response.apply(a,arguments)};this.menu=d("
    ").addClass("ui-autocomplete").appendTo(d(this.options.appendTo|| +"body",b)[0]).mousedown(function(c){var e=a.menu.element[0];d(c.target).closest(".ui-menu-item").length||setTimeout(function(){d(document).one("mousedown",function(g){g.target!==a.element[0]&&g.target!==e&&!d.ui.contains(e,g.target)&&a.close()})},1);setTimeout(function(){clearTimeout(a.closing)},13)}).menu({focus:function(c,e){e=e.item.data("item.autocomplete");false!==a._trigger("focus",c,{item:e})&&/^key/.test(c.originalEvent.type)&&a.element.val(e.value)},selected:function(c,e){var g=e.item.data("item.autocomplete"), +h=a.previous;if(a.element[0]!==b.activeElement){a.element.focus();a.previous=h;setTimeout(function(){a.previous=h;a.selectedItem=g},1)}false!==a._trigger("select",c,{item:g})&&a.element.val(g.value);a.term=a.element.val();a.close(c);a.selectedItem=g},blur:function(){a.menu.element.is(":visible")&&a.element.val()!==a.term&&a.element.val(a.term)}}).zIndex(this.element.zIndex()+1).css({top:0,left:0}).hide().data("menu");d.fn.bgiframe&&this.menu.element.bgiframe()},destroy:function(){this.element.removeClass("ui-autocomplete-input").removeAttr("autocomplete").removeAttr("role").removeAttr("aria-autocomplete").removeAttr("aria-haspopup"); +this.menu.element.remove();d.Widget.prototype.destroy.call(this)},_setOption:function(a,b){d.Widget.prototype._setOption.apply(this,arguments);a==="source"&&this._initSource();if(a==="appendTo")this.menu.element.appendTo(d(b||"body",this.element[0].ownerDocument)[0])},_initSource:function(){var a=this,b,f;if(d.isArray(this.options.source)){b=this.options.source;this.source=function(c,e){e(d.ui.autocomplete.filter(b,c.term))}}else if(typeof this.options.source==="string"){f=this.options.source;this.source= +function(c,e){a.xhr&&a.xhr.abort();a.xhr=d.ajax({url:f,data:c,dataType:"json",success:function(g,h,i){i===a.xhr&&e(g);a.xhr=null},error:function(g){g===a.xhr&&e([]);a.xhr=null}})}}else this.source=this.options.source},search:function(a,b){a=a!=null?a:this.element.val();this.term=this.element.val();if(a.length").data("item.autocomplete",b).append(d("").text(b.label)).appendTo(a)},_move:function(a,b){if(this.menu.element.is(":visible"))if(this.menu.first()&&/^previous/.test(a)||this.menu.last()&&/^next/.test(a)){this.element.val(this.term);this.menu.deactivate()}else this.menu[a](b);else this.search(null,b)},widget:function(){return this.menu.element}}); +d.extend(d.ui.autocomplete,{escapeRegex:function(a){return a.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&")},filter:function(a,b){var f=new RegExp(d.ui.autocomplete.escapeRegex(b),"i");return d.grep(a,function(c){return f.test(c.label||c.value||c)})}})})(jQuery); +(function(d){d.widget("ui.menu",{_create:function(){var a=this;this.element.addClass("ui-menu ui-widget ui-widget-content ui-corner-all").attr({role:"listbox","aria-activedescendant":"ui-active-menuitem"}).click(function(b){if(d(b.target).closest(".ui-menu-item a").length){b.preventDefault();a.select(b)}});this.refresh()},refresh:function(){var a=this;this.element.children("li:not(.ui-menu-item):has(a)").addClass("ui-menu-item").attr("role","menuitem").children("a").addClass("ui-corner-all").attr("tabindex", +-1).mouseenter(function(b){a.activate(b,d(this).parent())}).mouseleave(function(){a.deactivate()})},activate:function(a,b){this.deactivate();if(this.hasScroll()){var f=b.offset().top-this.element.offset().top,c=this.element.attr("scrollTop"),e=this.element.height();if(f<0)this.element.attr("scrollTop",c+f);else f>=e&&this.element.attr("scrollTop",c+f-e+b.height())}this.active=b.eq(0).children("a").addClass("ui-state-hover").attr("id","ui-active-menuitem").end();this._trigger("focus",a,{item:b})}, +deactivate:function(){if(this.active){this.active.children("a").removeClass("ui-state-hover").removeAttr("id");this._trigger("blur");this.active=null}},next:function(a){this.move("next",".ui-menu-item:first",a)},previous:function(a){this.move("prev",".ui-menu-item:last",a)},first:function(){return this.active&&!this.active.prevAll(".ui-menu-item").length},last:function(){return this.active&&!this.active.nextAll(".ui-menu-item").length},move:function(a,b,f){if(this.active){a=this.active[a+"All"](".ui-menu-item").eq(0); +a.length?this.activate(f,a):this.activate(f,this.element.children(b))}else this.activate(f,this.element.children(b))},nextPage:function(a){if(this.hasScroll())if(!this.active||this.last())this.activate(a,this.element.children(".ui-menu-item:first"));else{var b=this.active.offset().top,f=this.element.height(),c=this.element.children(".ui-menu-item").filter(function(){var e=d(this).offset().top-b-f+d(this).height();return e<10&&e>-10});c.length||(c=this.element.children(".ui-menu-item:last"));this.activate(a, +c)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.last()?":first":":last"))},previousPage:function(a){if(this.hasScroll())if(!this.active||this.first())this.activate(a,this.element.children(".ui-menu-item:last"));else{var b=this.active.offset().top,f=this.element.height();result=this.element.children(".ui-menu-item").filter(function(){var c=d(this).offset().top-b+f-d(this).height();return c<10&&c>-10});result.length||(result=this.element.children(".ui-menu-item:first")); +this.activate(a,result)}else this.activate(a,this.element.children(".ui-menu-item").filter(!this.active||this.first()?":last":":first"))},hasScroll:function(){return this.element.height()").addClass("ui-button-text").html(this.options.label).appendTo(b.empty()).text(),d=this.options.icons,e=d.primary&&d.secondary;if(d.primary||d.secondary){b.addClass("ui-button-text-icon"+(e?"s":d.primary?"-primary":"-secondary"));d.primary&&b.prepend("");d.secondary&&b.append("");if(!this.options.text){b.addClass(e?"ui-button-icons-only":"ui-button-icon-only").removeClass("ui-button-text-icons ui-button-text-icon-primary ui-button-text-icon-secondary"); +this.hasTitle||b.attr("title",c)}}else b.addClass("ui-button-text-only")}}});a.widget("ui.buttonset",{options:{items:":button, :submit, :reset, :checkbox, :radio, a, :data(button)"},_create:function(){this.element.addClass("ui-buttonset")},_init:function(){this.refresh()},_setOption:function(b,c){b==="disabled"&&this.buttons.button("option",b,c);a.Widget.prototype._setOption.apply(this,arguments)},refresh:function(){this.buttons=this.element.find(this.options.items).filter(":ui-button").button("refresh").end().not(":ui-button").button().end().map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-all ui-corner-left ui-corner-right").filter(":first").addClass("ui-corner-left").end().filter(":last").addClass("ui-corner-right").end().end()}, +destroy:function(){this.element.removeClass("ui-buttonset");this.buttons.map(function(){return a(this).button("widget")[0]}).removeClass("ui-corner-left ui-corner-right").end().button("destroy");a.Widget.prototype.destroy.call(this)}})})(jQuery); +;/* + * jQuery UI Dialog 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Dialog + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + * jquery.ui.button.js + * jquery.ui.draggable.js + * jquery.ui.mouse.js + * jquery.ui.position.js + * jquery.ui.resizable.js + */ +(function(c,j){var k={buttons:true,height:true,maxHeight:true,maxWidth:true,minHeight:true,minWidth:true,width:true},l={maxHeight:true,maxWidth:true,minHeight:true,minWidth:true};c.widget("ui.dialog",{options:{autoOpen:true,buttons:{},closeOnEscape:true,closeText:"close",dialogClass:"",draggable:true,hide:null,height:"auto",maxHeight:false,maxWidth:false,minHeight:150,minWidth:150,modal:false,position:{my:"center",at:"center",collision:"fit",using:function(a){var b=c(this).css(a).offset().top;b<0&& +c(this).css("top",a.top-b)}},resizable:true,show:null,stack:true,title:"",width:300,zIndex:1E3},_create:function(){this.originalTitle=this.element.attr("title");if(typeof this.originalTitle!=="string")this.originalTitle="";this.options.title=this.options.title||this.originalTitle;var a=this,b=a.options,d=b.title||" ",e=c.ui.dialog.getTitleId(a.element),g=(a.uiDialog=c("
    ")).appendTo(document.body).hide().addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b.dialogClass).css({zIndex:b.zIndex}).attr("tabIndex", +-1).css("outline",0).keydown(function(i){if(b.closeOnEscape&&i.keyCode&&i.keyCode===c.ui.keyCode.ESCAPE){a.close(i);i.preventDefault()}}).attr({role:"dialog","aria-labelledby":e}).mousedown(function(i){a.moveToTop(false,i)});a.element.show().removeAttr("title").addClass("ui-dialog-content ui-widget-content").appendTo(g);var f=(a.uiDialogTitlebar=c("
    ")).addClass("ui-dialog-titlebar ui-widget-header ui-corner-all ui-helper-clearfix").prependTo(g),h=c('').addClass("ui-dialog-titlebar-close ui-corner-all").attr("role", +"button").hover(function(){h.addClass("ui-state-hover")},function(){h.removeClass("ui-state-hover")}).focus(function(){h.addClass("ui-state-focus")}).blur(function(){h.removeClass("ui-state-focus")}).click(function(i){a.close(i);return false}).appendTo(f);(a.uiDialogTitlebarCloseText=c("")).addClass("ui-icon ui-icon-closethick").text(b.closeText).appendTo(h);c("").addClass("ui-dialog-title").attr("id",e).html(d).prependTo(f);if(c.isFunction(b.beforeclose)&&!c.isFunction(b.beforeClose))b.beforeClose= +b.beforeclose;f.find("*").add(f).disableSelection();b.draggable&&c.fn.draggable&&a._makeDraggable();b.resizable&&c.fn.resizable&&a._makeResizable();a._createButtons(b.buttons);a._isOpen=false;c.fn.bgiframe&&g.bgiframe()},_init:function(){this.options.autoOpen&&this.open()},destroy:function(){var a=this;a.overlay&&a.overlay.destroy();a.uiDialog.hide();a.element.unbind(".dialog").removeData("dialog").removeClass("ui-dialog-content ui-widget-content").hide().appendTo("body");a.uiDialog.remove();a.originalTitle&& +a.element.attr("title",a.originalTitle);return a},widget:function(){return this.uiDialog},close:function(a){var b=this,d,e;if(false!==b._trigger("beforeClose",a)){b.overlay&&b.overlay.destroy();b.uiDialog.unbind("keypress.ui-dialog");b._isOpen=false;if(b.options.hide)b.uiDialog.hide(b.options.hide,function(){b._trigger("close",a)});else{b.uiDialog.hide();b._trigger("close",a)}c.ui.dialog.overlay.resize();if(b.options.modal){d=0;c(".ui-dialog").each(function(){if(this!==b.uiDialog[0]){e=c(this).css("z-index"); +isNaN(e)||(d=Math.max(d,e))}});c.ui.dialog.maxZ=d}return b}},isOpen:function(){return this._isOpen},moveToTop:function(a,b){var d=this,e=d.options;if(e.modal&&!a||!e.stack&&!e.modal)return d._trigger("focus",b);if(e.zIndex>c.ui.dialog.maxZ)c.ui.dialog.maxZ=e.zIndex;if(d.overlay){c.ui.dialog.maxZ+=1;d.overlay.$el.css("z-index",c.ui.dialog.overlay.maxZ=c.ui.dialog.maxZ)}a={scrollTop:d.element.attr("scrollTop"),scrollLeft:d.element.attr("scrollLeft")};c.ui.dialog.maxZ+=1;d.uiDialog.css("z-index",c.ui.dialog.maxZ); +d.element.attr(a);d._trigger("focus",b);return d},open:function(){if(!this._isOpen){var a=this,b=a.options,d=a.uiDialog;a.overlay=b.modal?new c.ui.dialog.overlay(a):null;a._size();a._position(b.position);d.show(b.show);a.moveToTop(true);b.modal&&d.bind("keypress.ui-dialog",function(e){if(e.keyCode===c.ui.keyCode.TAB){var g=c(":tabbable",this),f=g.filter(":first");g=g.filter(":last");if(e.target===g[0]&&!e.shiftKey){f.focus(1);return false}else if(e.target===f[0]&&e.shiftKey){g.focus(1);return false}}}); +c(a.element.find(":tabbable").get().concat(d.find(".ui-dialog-buttonpane :tabbable").get().concat(d.get()))).eq(0).focus();a._isOpen=true;a._trigger("open");return a}},_createButtons:function(a){var b=this,d=false,e=c("
    ").addClass("ui-dialog-buttonpane ui-widget-content ui-helper-clearfix"),g=c("
    ").addClass("ui-dialog-buttonset").appendTo(e);b.uiDialog.find(".ui-dialog-buttonpane").remove();typeof a==="object"&&a!==null&&c.each(a,function(){return!(d=true)});if(d){c.each(a,function(f, +h){h=c.isFunction(h)?{click:h,text:f}:h;f=c('').attr(h,true).unbind("click").click(function(){h.click.apply(b.element[0],arguments)}).appendTo(g);c.fn.button&&f.button()});e.appendTo(b.uiDialog)}},_makeDraggable:function(){function a(f){return{position:f.position,offset:f.offset}}var b=this,d=b.options,e=c(document),g;b.uiDialog.draggable({cancel:".ui-dialog-content, .ui-dialog-titlebar-close",handle:".ui-dialog-titlebar",containment:"document",start:function(f,h){g= +d.height==="auto"?"auto":c(this).height();c(this).height(c(this).height()).addClass("ui-dialog-dragging");b._trigger("dragStart",f,a(h))},drag:function(f,h){b._trigger("drag",f,a(h))},stop:function(f,h){d.position=[h.position.left-e.scrollLeft(),h.position.top-e.scrollTop()];c(this).removeClass("ui-dialog-dragging").height(g);b._trigger("dragStop",f,a(h));c.ui.dialog.overlay.resize()}})},_makeResizable:function(a){function b(f){return{originalPosition:f.originalPosition,originalSize:f.originalSize, +position:f.position,size:f.size}}a=a===j?this.options.resizable:a;var d=this,e=d.options,g=d.uiDialog.css("position");a=typeof a==="string"?a:"n,e,s,w,se,sw,ne,nw";d.uiDialog.resizable({cancel:".ui-dialog-content",containment:"document",alsoResize:d.element,maxWidth:e.maxWidth,maxHeight:e.maxHeight,minWidth:e.minWidth,minHeight:d._minHeight(),handles:a,start:function(f,h){c(this).addClass("ui-dialog-resizing");d._trigger("resizeStart",f,b(h))},resize:function(f,h){d._trigger("resize",f,b(h))},stop:function(f, +h){c(this).removeClass("ui-dialog-resizing");e.height=c(this).height();e.width=c(this).width();d._trigger("resizeStop",f,b(h));c.ui.dialog.overlay.resize()}}).css("position",g).find(".ui-resizable-se").addClass("ui-icon ui-icon-grip-diagonal-se")},_minHeight:function(){var a=this.options;return a.height==="auto"?a.minHeight:Math.min(a.minHeight,a.height)},_position:function(a){var b=[],d=[0,0],e;if(a){if(typeof a==="string"||typeof a==="object"&&"0"in a){b=a.split?a.split(" "):[a[0],a[1]];if(b.length=== +1)b[1]=b[0];c.each(["left","top"],function(g,f){if(+b[g]===b[g]){d[g]=b[g];b[g]=f}});a={my:b.join(" "),at:b.join(" "),offset:d.join(" ")}}a=c.extend({},c.ui.dialog.prototype.options.position,a)}else a=c.ui.dialog.prototype.options.position;(e=this.uiDialog.is(":visible"))||this.uiDialog.show();this.uiDialog.css({top:0,left:0}).position(c.extend({of:window},a));e||this.uiDialog.hide()},_setOptions:function(a){var b=this,d={},e=false;c.each(a,function(g,f){b._setOption(g,f);if(g in k)e=true;if(g in +l)d[g]=f});e&&this._size();this.uiDialog.is(":data(resizable)")&&this.uiDialog.resizable("option",d)},_setOption:function(a,b){var d=this,e=d.uiDialog;switch(a){case "beforeclose":a="beforeClose";break;case "buttons":d._createButtons(b);break;case "closeText":d.uiDialogTitlebarCloseText.text(""+b);break;case "dialogClass":e.removeClass(d.options.dialogClass).addClass("ui-dialog ui-widget ui-widget-content ui-corner-all "+b);break;case "disabled":b?e.addClass("ui-dialog-disabled"):e.removeClass("ui-dialog-disabled"); +break;case "draggable":var g=e.is(":data(draggable)");g&&!b&&e.draggable("destroy");!g&&b&&d._makeDraggable();break;case "position":d._position(b);break;case "resizable":(g=e.is(":data(resizable)"))&&!b&&e.resizable("destroy");g&&typeof b==="string"&&e.resizable("option","handles",b);!g&&b!==false&&d._makeResizable(b);break;case "title":c(".ui-dialog-title",d.uiDialogTitlebar).html(""+(b||" "));break}c.Widget.prototype._setOption.apply(d,arguments)},_size:function(){var a=this.options,b,d,e= +this.uiDialog.is(":visible");this.element.show().css({width:"auto",minHeight:0,height:0});if(a.minWidth>a.width)a.width=a.minWidth;b=this.uiDialog.css({height:"auto",width:a.width}).height();d=Math.max(0,a.minHeight-b);if(a.height==="auto")if(c.support.minHeight)this.element.css({minHeight:d,height:"auto"});else{this.uiDialog.show();a=this.element.css("height","auto").height();e||this.uiDialog.hide();this.element.height(Math.max(a,d))}else this.element.height(Math.max(a.height-b,0));this.uiDialog.is(":data(resizable)")&& +this.uiDialog.resizable("option","minHeight",this._minHeight())}});c.extend(c.ui.dialog,{version:"1.8.7",uuid:0,maxZ:0,getTitleId:function(a){a=a.attr("id");if(!a){this.uuid+=1;a=this.uuid}return"ui-dialog-title-"+a},overlay:function(a){this.$el=c.ui.dialog.overlay.create(a)}});c.extend(c.ui.dialog.overlay,{instances:[],oldInstances:[],maxZ:0,events:c.map("focus,mousedown,mouseup,keydown,keypress,click".split(","),function(a){return a+".dialog-overlay"}).join(" "),create:function(a){if(this.instances.length=== +0){setTimeout(function(){c.ui.dialog.overlay.instances.length&&c(document).bind(c.ui.dialog.overlay.events,function(d){if(c(d.target).zIndex()").addClass("ui-widget-overlay")).appendTo(document.body).css({width:this.width(), +height:this.height()});c.fn.bgiframe&&b.bgiframe();this.instances.push(b);return b},destroy:function(a){var b=c.inArray(a,this.instances);b!=-1&&this.oldInstances.push(this.instances.splice(b,1)[0]);this.instances.length===0&&c([document,window]).unbind(".dialog-overlay");a.remove();var d=0;c.each(this.instances,function(){d=Math.max(d,this.css("z-index"))});this.maxZ=d},height:function(){var a,b;if(c.browser.msie&&c.browser.version<7){a=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight); +b=Math.max(document.documentElement.offsetHeight,document.body.offsetHeight);return a");if(!a.values)a.values=[this._valueMin(),this._valueMin()];if(a.values.length&&a.values.length!==2)a.values=[a.values[0],a.values[0]]}else this.range=d("
    ");this.range.appendTo(this.element).addClass("ui-slider-range");if(a.range==="min"||a.range==="max")this.range.addClass("ui-slider-range-"+a.range);this.range.addClass("ui-widget-header")}d(".ui-slider-handle",this.element).length===0&&d("").appendTo(this.element).addClass("ui-slider-handle"); +if(a.values&&a.values.length)for(;d(".ui-slider-handle",this.element).length").appendTo(this.element).addClass("ui-slider-handle");this.handles=d(".ui-slider-handle",this.element).addClass("ui-state-default ui-corner-all");this.handle=this.handles.eq(0);this.handles.add(this.range).filter("a").click(function(c){c.preventDefault()}).hover(function(){a.disabled||d(this).addClass("ui-state-hover")},function(){d(this).removeClass("ui-state-hover")}).focus(function(){if(a.disabled)d(this).blur(); +else{d(".ui-slider .ui-state-focus").removeClass("ui-state-focus");d(this).addClass("ui-state-focus")}}).blur(function(){d(this).removeClass("ui-state-focus")});this.handles.each(function(c){d(this).data("index.ui-slider-handle",c)});this.handles.keydown(function(c){var e=true,f=d(this).data("index.ui-slider-handle"),h,g,i;if(!b.options.disabled){switch(c.keyCode){case d.ui.keyCode.HOME:case d.ui.keyCode.END:case d.ui.keyCode.PAGE_UP:case d.ui.keyCode.PAGE_DOWN:case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:e= +false;if(!b._keySliding){b._keySliding=true;d(this).addClass("ui-state-active");h=b._start(c,f);if(h===false)return}break}i=b.options.step;h=b.options.values&&b.options.values.length?(g=b.values(f)):(g=b.value());switch(c.keyCode){case d.ui.keyCode.HOME:g=b._valueMin();break;case d.ui.keyCode.END:g=b._valueMax();break;case d.ui.keyCode.PAGE_UP:g=b._trimAlignValue(h+(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.PAGE_DOWN:g=b._trimAlignValue(h-(b._valueMax()-b._valueMin())/5);break;case d.ui.keyCode.UP:case d.ui.keyCode.RIGHT:if(h=== +b._valueMax())return;g=b._trimAlignValue(h+i);break;case d.ui.keyCode.DOWN:case d.ui.keyCode.LEFT:if(h===b._valueMin())return;g=b._trimAlignValue(h-i);break}b._slide(c,f,g);return e}}).keyup(function(c){var e=d(this).data("index.ui-slider-handle");if(b._keySliding){b._keySliding=false;b._stop(c,e);b._change(c,e);d(this).removeClass("ui-state-active")}});this._refreshValue();this._animateOff=false},destroy:function(){this.handles.remove();this.range.remove();this.element.removeClass("ui-slider ui-slider-horizontal ui-slider-vertical ui-slider-disabled ui-widget ui-widget-content ui-corner-all").removeData("slider").unbind(".slider"); +this._mouseDestroy();return this},_mouseCapture:function(b){var a=this.options,c,e,f,h,g;if(a.disabled)return false;this.elementSize={width:this.element.outerWidth(),height:this.element.outerHeight()};this.elementOffset=this.element.offset();c=this._normValueFromMouse({x:b.pageX,y:b.pageY});e=this._valueMax()-this._valueMin()+1;h=this;this.handles.each(function(i){var j=Math.abs(c-h.values(i));if(e>j){e=j;f=d(this);g=i}});if(a.range===true&&this.values(1)===a.min){g+=1;f=d(this.handles[g])}if(this._start(b, +g)===false)return false;this._mouseSliding=true;h._handleIndex=g;f.addClass("ui-state-active").focus();a=f.offset();this._clickOffset=!d(b.target).parents().andSelf().is(".ui-slider-handle")?{left:0,top:0}:{left:b.pageX-a.left-f.width()/2,top:b.pageY-a.top-f.height()/2-(parseInt(f.css("borderTopWidth"),10)||0)-(parseInt(f.css("borderBottomWidth"),10)||0)+(parseInt(f.css("marginTop"),10)||0)};this.handles.hasClass("ui-state-hover")||this._slide(b,g,c);return this._animateOff=true},_mouseStart:function(){return true}, +_mouseDrag:function(b){var a=this._normValueFromMouse({x:b.pageX,y:b.pageY});this._slide(b,this._handleIndex,a);return false},_mouseStop:function(b){this.handles.removeClass("ui-state-active");this._mouseSliding=false;this._stop(b,this._handleIndex);this._change(b,this._handleIndex);this._clickOffset=this._handleIndex=null;return this._animateOff=false},_detectOrientation:function(){this.orientation=this.options.orientation==="vertical"?"vertical":"horizontal"},_normValueFromMouse:function(b){var a; +if(this.orientation==="horizontal"){a=this.elementSize.width;b=b.x-this.elementOffset.left-(this._clickOffset?this._clickOffset.left:0)}else{a=this.elementSize.height;b=b.y-this.elementOffset.top-(this._clickOffset?this._clickOffset.top:0)}a=b/a;if(a>1)a=1;if(a<0)a=0;if(this.orientation==="vertical")a=1-a;b=this._valueMax()-this._valueMin();return this._trimAlignValue(this._valueMin()+a*b)},_start:function(b,a){var c={handle:this.handles[a],value:this.value()};if(this.options.values&&this.options.values.length){c.value= +this.values(a);c.values=this.values()}return this._trigger("start",b,c)},_slide:function(b,a,c){var e;if(this.options.values&&this.options.values.length){e=this.values(a?0:1);if(this.options.values.length===2&&this.options.range===true&&(a===0&&c>e||a===1&&c1){this.options.values[b]=this._trimAlignValue(a);this._refreshValue();this._change(null,b)}if(arguments.length)if(d.isArray(arguments[0])){c=this.options.values;e=arguments[0];for(f=0;f=this._valueMax())return this._valueMax();var a=this.options.step>0?this.options.step:1,c=(b-this._valueMin())%a;alignValue=b-c;if(Math.abs(c)*2>=a)alignValue+=c>0?a:-a;return parseFloat(alignValue.toFixed(5))},_valueMin:function(){return this.options.min},_valueMax:function(){return this.options.max}, +_refreshValue:function(){var b=this.options.range,a=this.options,c=this,e=!this._animateOff?a.animate:false,f,h={},g,i,j,l;if(this.options.values&&this.options.values.length)this.handles.each(function(k){f=(c.values(k)-c._valueMin())/(c._valueMax()-c._valueMin())*100;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";d(this).stop(1,1)[e?"animate":"css"](h,a.animate);if(c.options.range===true)if(c.orientation==="horizontal"){if(k===0)c.range.stop(1,1)[e?"animate":"css"]({left:f+"%"},a.animate); +if(k===1)c.range[e?"animate":"css"]({width:f-g+"%"},{queue:false,duration:a.animate})}else{if(k===0)c.range.stop(1,1)[e?"animate":"css"]({bottom:f+"%"},a.animate);if(k===1)c.range[e?"animate":"css"]({height:f-g+"%"},{queue:false,duration:a.animate})}g=f});else{i=this.value();j=this._valueMin();l=this._valueMax();f=l!==j?(i-j)/(l-j)*100:0;h[c.orientation==="horizontal"?"left":"bottom"]=f+"%";this.handle.stop(1,1)[e?"animate":"css"](h,a.animate);if(b==="min"&&this.orientation==="horizontal")this.range.stop(1, +1)[e?"animate":"css"]({width:f+"%"},a.animate);if(b==="max"&&this.orientation==="horizontal")this.range[e?"animate":"css"]({width:100-f+"%"},{queue:false,duration:a.animate});if(b==="min"&&this.orientation==="vertical")this.range.stop(1,1)[e?"animate":"css"]({height:f+"%"},a.animate);if(b==="max"&&this.orientation==="vertical")this.range[e?"animate":"css"]({height:100-f+"%"},{queue:false,duration:a.animate})}}});d.extend(d.ui.slider,{version:"1.8.7"})})(jQuery); +;/* + * jQuery UI Tabs 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Tabs + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(d,p){function u(){return++v}function w(){return++x}var v=0,x=0;d.widget("ui.tabs",{options:{add:null,ajaxOptions:null,cache:false,cookie:null,collapsible:false,disable:null,disabled:[],enable:null,event:"click",fx:null,idPrefix:"ui-tabs-",load:null,panelTemplate:"
    ",remove:null,select:null,show:null,spinner:"Loading…",tabTemplate:"
  • #{label}
  • "},_create:function(){this._tabify(true)},_setOption:function(b,e){if(b=="selected")this.options.collapsible&& +e==this.options.selected||this.select(e);else{this.options[b]=e;this._tabify()}},_tabId:function(b){return b.title&&b.title.replace(/\s/g,"_").replace(/[^\w\u00c0-\uFFFF-]/g,"")||this.options.idPrefix+u()},_sanitizeSelector:function(b){return b.replace(/:/g,"\\:")},_cookie:function(){var b=this.cookie||(this.cookie=this.options.cookie.name||"ui-tabs-"+w());return d.cookie.apply(null,[b].concat(d.makeArray(arguments)))},_ui:function(b,e){return{tab:b,panel:e,index:this.anchors.index(b)}},_cleanup:function(){this.lis.filter(".ui-state-processing").removeClass("ui-state-processing").find("span:data(label.tabs)").each(function(){var b= +d(this);b.html(b.data("label.tabs")).removeData("label.tabs")})},_tabify:function(b){function e(g,f){g.css("display","");!d.support.opacity&&f.opacity&&g[0].style.removeAttribute("filter")}var a=this,c=this.options,h=/^#.+/;this.list=this.element.find("ol,ul").eq(0);this.lis=d(" > li:has(a[href])",this.list);this.anchors=this.lis.map(function(){return d("a",this)[0]});this.panels=d([]);this.anchors.each(function(g,f){var i=d(f).attr("href"),l=i.split("#")[0],q;if(l&&(l===location.toString().split("#")[0]|| +(q=d("base")[0])&&l===q.href)){i=f.hash;f.href=i}if(h.test(i))a.panels=a.panels.add(a.element.find(a._sanitizeSelector(i)));else if(i&&i!=="#"){d.data(f,"href.tabs",i);d.data(f,"load.tabs",i.replace(/#.*$/,""));i=a._tabId(f);f.href="#"+i;f=a.element.find("#"+i);if(!f.length){f=d(c.panelTemplate).attr("id",i).addClass("ui-tabs-panel ui-widget-content ui-corner-bottom").insertAfter(a.panels[g-1]||a.list);f.data("destroy.tabs",true)}a.panels=a.panels.add(f)}else c.disabled.push(g)});if(b){this.element.addClass("ui-tabs ui-widget ui-widget-content ui-corner-all"); +this.list.addClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.lis.addClass("ui-state-default ui-corner-top");this.panels.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom");if(c.selected===p){location.hash&&this.anchors.each(function(g,f){if(f.hash==location.hash){c.selected=g;return false}});if(typeof c.selected!=="number"&&c.cookie)c.selected=parseInt(a._cookie(),10);if(typeof c.selected!=="number"&&this.lis.filter(".ui-tabs-selected").length)c.selected= +this.lis.index(this.lis.filter(".ui-tabs-selected"));c.selected=c.selected||(this.lis.length?0:-1)}else if(c.selected===null)c.selected=-1;c.selected=c.selected>=0&&this.anchors[c.selected]||c.selected<0?c.selected:0;c.disabled=d.unique(c.disabled.concat(d.map(this.lis.filter(".ui-state-disabled"),function(g){return a.lis.index(g)}))).sort();d.inArray(c.selected,c.disabled)!=-1&&c.disabled.splice(d.inArray(c.selected,c.disabled),1);this.panels.addClass("ui-tabs-hide");this.lis.removeClass("ui-tabs-selected ui-state-active"); +if(c.selected>=0&&this.anchors.length){a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash)).removeClass("ui-tabs-hide");this.lis.eq(c.selected).addClass("ui-tabs-selected ui-state-active");a.element.queue("tabs",function(){a._trigger("show",null,a._ui(a.anchors[c.selected],a.element.find(a._sanitizeSelector(a.anchors[c.selected].hash))))});this.load(c.selected)}d(window).bind("unload",function(){a.lis.add(a.anchors).unbind(".tabs");a.lis=a.anchors=a.panels=null})}else c.selected=this.lis.index(this.lis.filter(".ui-tabs-selected")); +this.element[c.collapsible?"addClass":"removeClass"]("ui-tabs-collapsible");c.cookie&&this._cookie(c.selected,c.cookie);b=0;for(var j;j=this.lis[b];b++)d(j)[d.inArray(b,c.disabled)!=-1&&!d(j).hasClass("ui-tabs-selected")?"addClass":"removeClass"]("ui-state-disabled");c.cache===false&&this.anchors.removeData("cache.tabs");this.lis.add(this.anchors).unbind(".tabs");if(c.event!=="mouseover"){var k=function(g,f){f.is(":not(.ui-state-disabled)")&&f.addClass("ui-state-"+g)},n=function(g,f){f.removeClass("ui-state-"+ +g)};this.lis.bind("mouseover.tabs",function(){k("hover",d(this))});this.lis.bind("mouseout.tabs",function(){n("hover",d(this))});this.anchors.bind("focus.tabs",function(){k("focus",d(this).closest("li"))});this.anchors.bind("blur.tabs",function(){n("focus",d(this).closest("li"))})}var m,o;if(c.fx)if(d.isArray(c.fx)){m=c.fx[0];o=c.fx[1]}else m=o=c.fx;var r=o?function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.hide().removeClass("ui-tabs-hide").animate(o,o.duration||"normal", +function(){e(f,o);a._trigger("show",null,a._ui(g,f[0]))})}:function(g,f){d(g).closest("li").addClass("ui-tabs-selected ui-state-active");f.removeClass("ui-tabs-hide");a._trigger("show",null,a._ui(g,f[0]))},s=m?function(g,f){f.animate(m,m.duration||"normal",function(){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");e(f,m);a.element.dequeue("tabs")})}:function(g,f){a.lis.removeClass("ui-tabs-selected ui-state-active");f.addClass("ui-tabs-hide");a.element.dequeue("tabs")}; +this.anchors.bind(c.event+".tabs",function(){var g=this,f=d(g).closest("li"),i=a.panels.filter(":not(.ui-tabs-hide)"),l=a.element.find(a._sanitizeSelector(g.hash));if(f.hasClass("ui-tabs-selected")&&!c.collapsible||f.hasClass("ui-state-disabled")||f.hasClass("ui-state-processing")||a.panels.filter(":animated").length||a._trigger("select",null,a._ui(this,l[0]))===false){this.blur();return false}c.selected=a.anchors.index(this);a.abort();if(c.collapsible)if(f.hasClass("ui-tabs-selected")){c.selected= +-1;c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){s(g,i)}).dequeue("tabs");this.blur();return false}else if(!i.length){c.cookie&&a._cookie(c.selected,c.cookie);a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this));this.blur();return false}c.cookie&&a._cookie(c.selected,c.cookie);if(l.length){i.length&&a.element.queue("tabs",function(){s(g,i)});a.element.queue("tabs",function(){r(g,l)});a.load(a.anchors.index(this))}else throw"jQuery UI Tabs: Mismatching fragment identifier."; +d.browser.msie&&this.blur()});this.anchors.bind("click.tabs",function(){return false})},_getIndex:function(b){if(typeof b=="string")b=this.anchors.index(this.anchors.filter("[href$="+b+"]"));return b},destroy:function(){var b=this.options;this.abort();this.element.unbind(".tabs").removeClass("ui-tabs ui-widget ui-widget-content ui-corner-all ui-tabs-collapsible").removeData("tabs");this.list.removeClass("ui-tabs-nav ui-helper-reset ui-helper-clearfix ui-widget-header ui-corner-all");this.anchors.each(function(){var e= +d.data(this,"href.tabs");if(e)this.href=e;var a=d(this).unbind(".tabs");d.each(["href","load","cache"],function(c,h){a.removeData(h+".tabs")})});this.lis.unbind(".tabs").add(this.panels).each(function(){d.data(this,"destroy.tabs")?d(this).remove():d(this).removeClass("ui-state-default ui-corner-top ui-tabs-selected ui-state-active ui-state-hover ui-state-focus ui-state-disabled ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide")});b.cookie&&this._cookie(null,b.cookie);return this},add:function(b, +e,a){if(a===p)a=this.anchors.length;var c=this,h=this.options;e=d(h.tabTemplate.replace(/#\{href\}/g,b).replace(/#\{label\}/g,e));b=!b.indexOf("#")?b.replace("#",""):this._tabId(d("a",e)[0]);e.addClass("ui-state-default ui-corner-top").data("destroy.tabs",true);var j=c.element.find("#"+b);j.length||(j=d(h.panelTemplate).attr("id",b).data("destroy.tabs",true));j.addClass("ui-tabs-panel ui-widget-content ui-corner-bottom ui-tabs-hide");if(a>=this.lis.length){e.appendTo(this.list);j.appendTo(this.list[0].parentNode)}else{e.insertBefore(this.lis[a]); +j.insertBefore(this.panels[a])}h.disabled=d.map(h.disabled,function(k){return k>=a?++k:k});this._tabify();if(this.anchors.length==1){h.selected=0;e.addClass("ui-tabs-selected ui-state-active");j.removeClass("ui-tabs-hide");this.element.queue("tabs",function(){c._trigger("show",null,c._ui(c.anchors[0],c.panels[0]))});this.load(0)}this._trigger("add",null,this._ui(this.anchors[a],this.panels[a]));return this},remove:function(b){b=this._getIndex(b);var e=this.options,a=this.lis.eq(b).remove(),c=this.panels.eq(b).remove(); +if(a.hasClass("ui-tabs-selected")&&this.anchors.length>1)this.select(b+(b+1=b?--h:h});this._tabify();this._trigger("remove",null,this._ui(a.find("a")[0],c[0]));return this},enable:function(b){b=this._getIndex(b);var e=this.options;if(d.inArray(b,e.disabled)!=-1){this.lis.eq(b).removeClass("ui-state-disabled");e.disabled=d.grep(e.disabled,function(a){return a!=b});this._trigger("enable",null, +this._ui(this.anchors[b],this.panels[b]));return this}},disable:function(b){b=this._getIndex(b);var e=this.options;if(b!=e.selected){this.lis.eq(b).addClass("ui-state-disabled");e.disabled.push(b);e.disabled.sort();this._trigger("disable",null,this._ui(this.anchors[b],this.panels[b]))}return this},select:function(b){b=this._getIndex(b);if(b==-1)if(this.options.collapsible&&this.options.selected!=-1)b=this.options.selected;else return this;this.anchors.eq(b).trigger(this.options.event+".tabs");return this}, +load:function(b){b=this._getIndex(b);var e=this,a=this.options,c=this.anchors.eq(b)[0],h=d.data(c,"load.tabs");this.abort();if(!h||this.element.queue("tabs").length!==0&&d.data(c,"cache.tabs"))this.element.dequeue("tabs");else{this.lis.eq(b).addClass("ui-state-processing");if(a.spinner){var j=d("span",c);j.data("label.tabs",j.html()).html(a.spinner)}this.xhr=d.ajax(d.extend({},a.ajaxOptions,{url:h,success:function(k,n){e.element.find(e._sanitizeSelector(c.hash)).html(k);e._cleanup();a.cache&&d.data(c, +"cache.tabs",true);e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.success(k,n)}catch(m){}},error:function(k,n){e._cleanup();e._trigger("load",null,e._ui(e.anchors[b],e.panels[b]));try{a.ajaxOptions.error(k,n,b,c)}catch(m){}}}));e.element.dequeue("tabs");return this}},abort:function(){this.element.queue([]);this.panels.stop(false,true);this.element.queue("tabs",this.element.queue("tabs").splice(-2,2));if(this.xhr){this.xhr.abort();delete this.xhr}this._cleanup();return this}, +url:function(b,e){this.anchors.eq(b).removeData("cache.tabs").data("load.tabs",e);return this},length:function(){return this.anchors.length}});d.extend(d.ui.tabs,{version:"1.8.7"});d.extend(d.ui.tabs.prototype,{rotation:null,rotate:function(b,e){var a=this,c=this.options,h=a._rotate||(a._rotate=function(j){clearTimeout(a.rotation);a.rotation=setTimeout(function(){var k=c.selected;a.select(++k')}function E(a,b){d.extend(a,b);for(var c in b)if(b[c]== +null||b[c]==G)a[c]=b[c];return a}d.extend(d.ui,{datepicker:{version:"1.8.7"}});var y=(new Date).getTime();d.extend(K.prototype,{markerClassName:"hasDatepicker",log:function(){this.debug&&console.log.apply("",arguments)},_widgetDatepicker:function(){return this.dpDiv},setDefaults:function(a){E(this._defaults,a||{});return this},_attachDatepicker:function(a,b){var c=null;for(var e in this._defaults){var f=a.getAttribute("date:"+e);if(f){c=c||{};try{c[e]=eval(f)}catch(h){c[e]=f}}}e=a.nodeName.toLowerCase(); +f=e=="div"||e=="span";if(!a.id){this.uuid+=1;a.id="dp"+this.uuid}var i=this._newInst(d(a),f);i.settings=d.extend({},b||{},c||{});if(e=="input")this._connectDatepicker(a,i);else f&&this._inlineDatepicker(a,i)},_newInst:function(a,b){return{id:a[0].id.replace(/([^A-Za-z0-9_-])/g,"\\\\$1"),input:a,selectedDay:0,selectedMonth:0,selectedYear:0,drawMonth:0,drawYear:0,inline:b,dpDiv:!b?this.dpDiv:d('
    ')}}, +_connectDatepicker:function(a,b){var c=d(a);b.append=d([]);b.trigger=d([]);if(!c.hasClass(this.markerClassName)){this._attachments(c,b);c.addClass(this.markerClassName).keydown(this._doKeyDown).keypress(this._doKeyPress).keyup(this._doKeyUp).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});this._autoSize(b);d.data(a,"datepicker",b)}},_attachments:function(a,b){var c=this._get(b,"appendText"),e=this._get(b,"isRTL");b.append&& +b.append.remove();if(c){b.append=d(''+c+"");a[e?"before":"after"](b.append)}a.unbind("focus",this._showDatepicker);b.trigger&&b.trigger.remove();c=this._get(b,"showOn");if(c=="focus"||c=="both")a.focus(this._showDatepicker);if(c=="button"||c=="both"){c=this._get(b,"buttonText");var f=this._get(b,"buttonImage");b.trigger=d(this._get(b,"buttonImageOnly")?d("").addClass(this._triggerClass).attr({src:f,alt:c,title:c}):d('').addClass(this._triggerClass).html(f== +""?c:d("").attr({src:f,alt:c,title:c})));a[e?"before":"after"](b.trigger);b.trigger.click(function(){d.datepicker._datepickerShowing&&d.datepicker._lastInput==a[0]?d.datepicker._hideDatepicker():d.datepicker._showDatepicker(a[0]);return false})}},_autoSize:function(a){if(this._get(a,"autoSize")&&!a.inline){var b=new Date(2009,11,20),c=this._get(a,"dateFormat");if(c.match(/[DM]/)){var e=function(f){for(var h=0,i=0,g=0;gh){h=f[g].length;i=g}return i};b.setMonth(e(this._get(a, +c.match(/MM/)?"monthNames":"monthNamesShort")));b.setDate(e(this._get(a,c.match(/DD/)?"dayNames":"dayNamesShort"))+20-b.getDay())}a.input.attr("size",this._formatDate(a,b).length)}},_inlineDatepicker:function(a,b){var c=d(a);if(!c.hasClass(this.markerClassName)){c.addClass(this.markerClassName).append(b.dpDiv).bind("setData.datepicker",function(e,f,h){b.settings[f]=h}).bind("getData.datepicker",function(e,f){return this._get(b,f)});d.data(a,"datepicker",b);this._setDate(b,this._getDefaultDate(b), +true);this._updateDatepicker(b);this._updateAlternate(b);b.dpDiv.show()}},_dialogDatepicker:function(a,b,c,e,f){a=this._dialogInst;if(!a){this.uuid+=1;this._dialogInput=d('');this._dialogInput.keydown(this._doKeyDown);d("body").append(this._dialogInput);a=this._dialogInst=this._newInst(this._dialogInput,false);a.settings={};d.data(this._dialogInput[0],"datepicker",a)}E(a.settings,e||{}); +b=b&&b.constructor==Date?this._formatDate(a,b):b;this._dialogInput.val(b);this._pos=f?f.length?f:[f.pageX,f.pageY]:null;if(!this._pos)this._pos=[document.documentElement.clientWidth/2-100+(document.documentElement.scrollLeft||document.body.scrollLeft),document.documentElement.clientHeight/2-150+(document.documentElement.scrollTop||document.body.scrollTop)];this._dialogInput.css("left",this._pos[0]+20+"px").css("top",this._pos[1]+"px");a.settings.onSelect=c;this._inDialog=true;this.dpDiv.addClass(this._dialogClass); +this._showDatepicker(this._dialogInput[0]);d.blockUI&&d.blockUI(this.dpDiv);d.data(this._dialogInput[0],"datepicker",a);return this},_destroyDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();d.removeData(a,"datepicker");if(e=="input"){c.append.remove();c.trigger.remove();b.removeClass(this.markerClassName).unbind("focus",this._showDatepicker).unbind("keydown",this._doKeyDown).unbind("keypress",this._doKeyPress).unbind("keyup", +this._doKeyUp)}else if(e=="div"||e=="span")b.removeClass(this.markerClassName).empty()}},_enableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=false;c.trigger.filter("button").each(function(){this.disabled=false}).end().filter("img").css({opacity:"1.0",cursor:""})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().removeClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs, +function(f){return f==a?null:f})}},_disableDatepicker:function(a){var b=d(a),c=d.data(a,"datepicker");if(b.hasClass(this.markerClassName)){var e=a.nodeName.toLowerCase();if(e=="input"){a.disabled=true;c.trigger.filter("button").each(function(){this.disabled=true}).end().filter("img").css({opacity:"0.5",cursor:"default"})}else if(e=="div"||e=="span")b.children("."+this._inlineClass).children().addClass("ui-state-disabled");this._disabledInputs=d.map(this._disabledInputs,function(f){return f==a?null: +f});this._disabledInputs[this._disabledInputs.length]=a}},_isDisabledDatepicker:function(a){if(!a)return false;for(var b=0;b-1}},_doKeyUp:function(a){a=d.datepicker._getInst(a.target);if(a.input.val()!=a.lastVal)try{if(d.datepicker.parseDate(d.datepicker._get(a,"dateFormat"),a.input?a.input.val():null,d.datepicker._getFormatConfig(a))){d.datepicker._setDateFromField(a);d.datepicker._updateAlternate(a);d.datepicker._updateDatepicker(a)}}catch(b){d.datepicker.log(b)}return true}, +_showDatepicker:function(a){a=a.target||a;if(a.nodeName.toLowerCase()!="input")a=d("input",a.parentNode)[0];if(!(d.datepicker._isDisabledDatepicker(a)||d.datepicker._lastInput==a)){var b=d.datepicker._getInst(a);d.datepicker._curInst&&d.datepicker._curInst!=b&&d.datepicker._curInst.dpDiv.stop(true,true);var c=d.datepicker._get(b,"beforeShow");E(b.settings,c?c.apply(a,[a,b]):{});b.lastVal=null;d.datepicker._lastInput=a;d.datepicker._setDateFromField(b);if(d.datepicker._inDialog)a.value="";if(!d.datepicker._pos){d.datepicker._pos= +d.datepicker._findPos(a);d.datepicker._pos[1]+=a.offsetHeight}var e=false;d(a).parents().each(function(){e|=d(this).css("position")=="fixed";return!e});if(e&&d.browser.opera){d.datepicker._pos[0]-=document.documentElement.scrollLeft;d.datepicker._pos[1]-=document.documentElement.scrollTop}c={left:d.datepicker._pos[0],top:d.datepicker._pos[1]};d.datepicker._pos=null;b.dpDiv.empty();b.dpDiv.css({position:"absolute",display:"block",top:"-1000px"});d.datepicker._updateDatepicker(b);c=d.datepicker._checkOffset(b, +c,e);b.dpDiv.css({position:d.datepicker._inDialog&&d.blockUI?"static":e?"fixed":"absolute",display:"none",left:c.left+"px",top:c.top+"px"});if(!b.inline){c=d.datepicker._get(b,"showAnim");var f=d.datepicker._get(b,"duration"),h=function(){d.datepicker._datepickerShowing=true;var i=b.dpDiv.find("iframe.ui-datepicker-cover");if(i.length){var g=d.datepicker._getBorders(b.dpDiv);i.css({left:-g[0],top:-g[1],width:b.dpDiv.outerWidth(),height:b.dpDiv.outerHeight()})}};b.dpDiv.zIndex(d(a).zIndex()+1);d.effects&& +d.effects[c]?b.dpDiv.show(c,d.datepicker._get(b,"showOptions"),f,h):b.dpDiv[c||"show"](c?f:null,h);if(!c||!f)h();b.input.is(":visible")&&!b.input.is(":disabled")&&b.input.focus();d.datepicker._curInst=b}}},_updateDatepicker:function(a){var b=this,c=d.datepicker._getBorders(a.dpDiv);a.dpDiv.empty().append(this._generateHTML(a));var e=a.dpDiv.find("iframe.ui-datepicker-cover");e.length&&e.css({left:-c[0],top:-c[1],width:a.dpDiv.outerWidth(),height:a.dpDiv.outerHeight()});a.dpDiv.find("button, .ui-datepicker-prev, .ui-datepicker-next, .ui-datepicker-calendar td a").bind("mouseout", +function(){d(this).removeClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!=-1&&d(this).removeClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).removeClass("ui-datepicker-next-hover")}).bind("mouseover",function(){if(!b._isDisabledDatepicker(a.inline?a.dpDiv.parent()[0]:a.input[0])){d(this).parents(".ui-datepicker-calendar").find("a").removeClass("ui-state-hover");d(this).addClass("ui-state-hover");this.className.indexOf("ui-datepicker-prev")!= +-1&&d(this).addClass("ui-datepicker-prev-hover");this.className.indexOf("ui-datepicker-next")!=-1&&d(this).addClass("ui-datepicker-next-hover")}}).end().find("."+this._dayOverClass+" a").trigger("mouseover").end();c=this._getNumberOfMonths(a);e=c[1];e>1?a.dpDiv.addClass("ui-datepicker-multi-"+e).css("width",17*e+"em"):a.dpDiv.removeClass("ui-datepicker-multi-2 ui-datepicker-multi-3 ui-datepicker-multi-4").width("");a.dpDiv[(c[0]!=1||c[1]!=1?"add":"remove")+"Class"]("ui-datepicker-multi");a.dpDiv[(this._get(a, +"isRTL")?"add":"remove")+"Class"]("ui-datepicker-rtl");a==d.datepicker._curInst&&d.datepicker._datepickerShowing&&a.input&&a.input.is(":visible")&&!a.input.is(":disabled")&&a.input.focus();if(a.yearshtml){var f=a.yearshtml;setTimeout(function(){f===a.yearshtml&&a.dpDiv.find("select.ui-datepicker-year:first").replaceWith(a.yearshtml);f=a.yearshtml=null},0)}},_getBorders:function(a){var b=function(c){return{thin:1,medium:2,thick:3}[c]||c};return[parseFloat(b(a.css("border-left-width"))),parseFloat(b(a.css("border-top-width")))]}, +_checkOffset:function(a,b,c){var e=a.dpDiv.outerWidth(),f=a.dpDiv.outerHeight(),h=a.input?a.input.outerWidth():0,i=a.input?a.input.outerHeight():0,g=document.documentElement.clientWidth+d(document).scrollLeft(),j=document.documentElement.clientHeight+d(document).scrollTop();b.left-=this._get(a,"isRTL")?e-h:0;b.left-=c&&b.left==a.input.offset().left?d(document).scrollLeft():0;b.top-=c&&b.top==a.input.offset().top+i?d(document).scrollTop():0;b.left-=Math.min(b.left,b.left+e>g&&g>e?Math.abs(b.left+e- +g):0);b.top-=Math.min(b.top,b.top+f>j&&j>f?Math.abs(f+i):0);return b},_findPos:function(a){for(var b=this._get(this._getInst(a),"isRTL");a&&(a.type=="hidden"||a.nodeType!=1);)a=a[b?"previousSibling":"nextSibling"];a=d(a).offset();return[a.left,a.top]},_hideDatepicker:function(a){var b=this._curInst;if(!(!b||a&&b!=d.data(a,"datepicker")))if(this._datepickerShowing){a=this._get(b,"showAnim");var c=this._get(b,"duration"),e=function(){d.datepicker._tidyDialog(b);this._curInst=null};d.effects&&d.effects[a]? +b.dpDiv.hide(a,d.datepicker._get(b,"showOptions"),c,e):b.dpDiv[a=="slideDown"?"slideUp":a=="fadeIn"?"fadeOut":"hide"](a?c:null,e);a||e();if(a=this._get(b,"onClose"))a.apply(b.input?b.input[0]:null,[b.input?b.input.val():"",b]);this._datepickerShowing=false;this._lastInput=null;if(this._inDialog){this._dialogInput.css({position:"absolute",left:"0",top:"-100px"});if(d.blockUI){d.unblockUI();d("body").append(this.dpDiv)}}this._inDialog=false}},_tidyDialog:function(a){a.dpDiv.removeClass(this._dialogClass).unbind(".ui-datepicker-calendar")}, +_checkExternalClick:function(a){if(d.datepicker._curInst){a=d(a.target);a[0].id!=d.datepicker._mainDivId&&a.parents("#"+d.datepicker._mainDivId).length==0&&!a.hasClass(d.datepicker.markerClassName)&&!a.hasClass(d.datepicker._triggerClass)&&d.datepicker._datepickerShowing&&!(d.datepicker._inDialog&&d.blockUI)&&d.datepicker._hideDatepicker()}},_adjustDate:function(a,b,c){a=d(a);var e=this._getInst(a[0]);if(!this._isDisabledDatepicker(a[0])){this._adjustInstDate(e,b+(c=="M"?this._get(e,"showCurrentAtPos"): +0),c);this._updateDatepicker(e)}},_gotoToday:function(a){a=d(a);var b=this._getInst(a[0]);if(this._get(b,"gotoCurrent")&&b.currentDay){b.selectedDay=b.currentDay;b.drawMonth=b.selectedMonth=b.currentMonth;b.drawYear=b.selectedYear=b.currentYear}else{var c=new Date;b.selectedDay=c.getDate();b.drawMonth=b.selectedMonth=c.getMonth();b.drawYear=b.selectedYear=c.getFullYear()}this._notifyChange(b);this._adjustDate(a)},_selectMonthYear:function(a,b,c){a=d(a);var e=this._getInst(a[0]);e._selectingMonthYear= +false;e["selected"+(c=="M"?"Month":"Year")]=e["draw"+(c=="M"?"Month":"Year")]=parseInt(b.options[b.selectedIndex].value,10);this._notifyChange(e);this._adjustDate(a)},_clickMonthYear:function(a){var b=this._getInst(d(a)[0]);b.input&&b._selectingMonthYear&&setTimeout(function(){b.input.focus()},0);b._selectingMonthYear=!b._selectingMonthYear},_selectDay:function(a,b,c,e){var f=d(a);if(!(d(e).hasClass(this._unselectableClass)||this._isDisabledDatepicker(f[0]))){f=this._getInst(f[0]);f.selectedDay=f.currentDay= +d("a",e).html();f.selectedMonth=f.currentMonth=b;f.selectedYear=f.currentYear=c;this._selectDate(a,this._formatDate(f,f.currentDay,f.currentMonth,f.currentYear))}},_clearDate:function(a){a=d(a);this._getInst(a[0]);this._selectDate(a,"")},_selectDate:function(a,b){a=this._getInst(d(a)[0]);b=b!=null?b:this._formatDate(a);a.input&&a.input.val(b);this._updateAlternate(a);var c=this._get(a,"onSelect");if(c)c.apply(a.input?a.input[0]:null,[b,a]);else a.input&&a.input.trigger("change");if(a.inline)this._updateDatepicker(a); +else{this._hideDatepicker();this._lastInput=a.input[0];typeof a.input[0]!="object"&&a.input.focus();this._lastInput=null}},_updateAlternate:function(a){var b=this._get(a,"altField");if(b){var c=this._get(a,"altFormat")||this._get(a,"dateFormat"),e=this._getDate(a),f=this.formatDate(c,e,this._getFormatConfig(a));d(b).each(function(){d(this).val(f)})}},noWeekends:function(a){a=a.getDay();return[a>0&&a<6,""]},iso8601Week:function(a){a=new Date(a.getTime());a.setDate(a.getDate()+4-(a.getDay()||7));var b= +a.getTime();a.setMonth(0);a.setDate(1);return Math.floor(Math.round((b-a)/864E5)/7)+1},parseDate:function(a,b,c){if(a==null||b==null)throw"Invalid arguments";b=typeof b=="object"?b.toString():b+"";if(b=="")return null;for(var e=(c?c.shortYearCutoff:null)||this._defaults.shortYearCutoff,f=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,h=(c?c.dayNames:null)||this._defaults.dayNames,i=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort,g=(c?c.monthNames:null)||this._defaults.monthNames, +j=c=-1,l=-1,u=-1,k=false,o=function(p){(p=z+1-1){j=1;l=u;do{e=this._getDaysInMonth(c,j-1);if(l<=e)break;j++;l-=e}while(1)}w=this._daylightSavingAdjust(new Date(c,j-1,l));if(w.getFullYear()!=c||w.getMonth()+1!=j||w.getDate()!=l)throw"Invalid date";return w},ATOM:"yy-mm-dd",COOKIE:"D, dd M yy",ISO_8601:"yy-mm-dd",RFC_822:"D, d M y",RFC_850:"DD, dd-M-y",RFC_1036:"D, d M y", +RFC_1123:"D, d M yy",RFC_2822:"D, d M yy",RSS:"D, d M y",TICKS:"!",TIMESTAMP:"@",W3C:"yy-mm-dd",_ticksTo1970:(718685+Math.floor(492.5)-Math.floor(19.7)+Math.floor(4.925))*24*60*60*1E7,formatDate:function(a,b,c){if(!b)return"";var e=(c?c.dayNamesShort:null)||this._defaults.dayNamesShort,f=(c?c.dayNames:null)||this._defaults.dayNames,h=(c?c.monthNamesShort:null)||this._defaults.monthNamesShort;c=(c?c.monthNames:null)||this._defaults.monthNames;var i=function(o){(o=k+112?a.getHours()+2:0);return a},_setDate:function(a,b,c){var e=!b,f=a.selectedMonth,h=a.selectedYear;b=this._restrictMinMax(a,this._determineDate(a,b,new Date));a.selectedDay= +a.currentDay=b.getDate();a.drawMonth=a.selectedMonth=a.currentMonth=b.getMonth();a.drawYear=a.selectedYear=a.currentYear=b.getFullYear();if((f!=a.selectedMonth||h!=a.selectedYear)&&!c)this._notifyChange(a);this._adjustInstDate(a);if(a.input)a.input.val(e?"":this._formatDate(a))},_getDate:function(a){return!a.currentYear||a.input&&a.input.val()==""?null:this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay))},_generateHTML:function(a){var b=new Date;b=this._daylightSavingAdjust(new Date(b.getFullYear(), +b.getMonth(),b.getDate()));var c=this._get(a,"isRTL"),e=this._get(a,"showButtonPanel"),f=this._get(a,"hideIfNoPrevNext"),h=this._get(a,"navigationAsDateFormat"),i=this._getNumberOfMonths(a),g=this._get(a,"showCurrentAtPos"),j=this._get(a,"stepMonths"),l=i[0]!=1||i[1]!=1,u=this._daylightSavingAdjust(!a.currentDay?new Date(9999,9,9):new Date(a.currentYear,a.currentMonth,a.currentDay)),k=this._getMinMaxDate(a,"min"),o=this._getMinMaxDate(a,"max");g=a.drawMonth-g;var m=a.drawYear;if(g<0){g+=12;m--}if(o){var n= +this._daylightSavingAdjust(new Date(o.getFullYear(),o.getMonth()-i[0]*i[1]+1,o.getDate()));for(n=k&&nn;){g--;if(g<0){g=11;m--}}}a.drawMonth=g;a.drawYear=m;n=this._get(a,"prevText");n=!h?n:this.formatDate(n,this._daylightSavingAdjust(new Date(m,g-j,1)),this._getFormatConfig(a));n=this._canAdjustMonth(a,-1,m,g)?''+n+"":f?"":''+n+"";var r=this._get(a,"nextText");r=!h?r:this.formatDate(r,this._daylightSavingAdjust(new Date(m,g+j,1)),this._getFormatConfig(a));f=this._canAdjustMonth(a,+1,m,g)?''+r+"":f?"":''+r+"";j=this._get(a,"currentText");r=this._get(a,"gotoCurrent")&&a.currentDay?u:b;j=!h?j:this.formatDate(j,r,this._getFormatConfig(a));h=!a.inline?'":"";e=e?'
    '+(c?h:"")+(this._isInRange(a,r)?'":"")+(c?"":h)+"
    ":"";h=parseInt(this._get(a,"firstDay"),10);h=isNaN(h)?0:h;j=this._get(a,"showWeek");r=this._get(a,"dayNames");this._get(a,"dayNamesShort");var s=this._get(a,"dayNamesMin"),z= +this._get(a,"monthNames"),w=this._get(a,"monthNamesShort"),p=this._get(a,"beforeShowDay"),v=this._get(a,"showOtherMonths"),H=this._get(a,"selectOtherMonths");this._get(a,"calculateWeek");for(var L=this._getDefaultDate(a),I="",C=0;C1)switch(D){case 0:x+=" ui-datepicker-group-first";t=" ui-corner-"+(c?"right":"left");break;case i[1]- +1:x+=" ui-datepicker-group-last";t=" ui-corner-"+(c?"left":"right");break;default:x+=" ui-datepicker-group-middle";t="";break}x+='">'}x+='
    '+(/all|left/.test(t)&&C==0?c?f:n:"")+(/all|right/.test(t)&&C==0?c?n:f:"")+this._generateMonthYearHeader(a,g,m,k,o,C>0||D>0,z,w)+'
    ';var A=j?'":"";for(t=0;t<7;t++){var q= +(t+h)%7;A+="=5?' class="ui-datepicker-week-end"':"")+'>'+s[q]+""}x+=A+"";A=this._getDaysInMonth(m,g);if(m==a.selectedYear&&g==a.selectedMonth)a.selectedDay=Math.min(a.selectedDay,A);t=(this._getFirstDayOfMonth(m,g)-h+7)%7;A=l?6:Math.ceil((t+A)/7);q=this._daylightSavingAdjust(new Date(m,g,1-t));for(var O=0;O";var P=!j?"":'";for(t=0;t<7;t++){var F= +p?p.apply(a.input?a.input[0]:null,[q]):[true,""],B=q.getMonth()!=g,J=B&&!H||!F[0]||k&&qo;P+='";q.setDate(q.getDate()+1);q=this._daylightSavingAdjust(q)}x+= +P+""}g++;if(g>11){g=0;m++}x+="
    '+this._get(a,"weekHeader")+"
    '+this._get(a,"calculateWeek")(q)+""+(B&&!v?" ":J?''+q.getDate()+"":''+q.getDate()+"")+"
    "+(l?""+(i[0]>0&&D==i[1]-1?'
    ':""):"");M+=x}I+=M}I+=e+(d.browser.msie&&parseInt(d.browser.version,10)<7&&!a.inline?'':"");a._keyEvent=false;return I},_generateMonthYearHeader:function(a,b,c,e,f,h,i,g){var j=this._get(a,"changeMonth"),l=this._get(a,"changeYear"),u=this._get(a,"showMonthAfterYear"),k='
    ', +o="";if(h||!j)o+=''+i[b]+"";else{i=e&&e.getFullYear()==c;var m=f&&f.getFullYear()==c;o+='"}u||(k+=o+(h||!(j&& +l)?" ":""));a.yearshtml="";if(h||!l)k+=''+c+"";else{g=this._get(a,"yearRange").split(":");var r=(new Date).getFullYear();i=function(s){s=s.match(/c[+-].*/)?c+parseInt(s.substring(1),10):s.match(/[+-].*/)?r+parseInt(s,10):parseInt(s,10);return isNaN(s)?r:s};b=i(g[0]);g=Math.max(b,i(g[1]||""));b=e?Math.max(b,e.getFullYear()):b;g=f?Math.min(g,f.getFullYear()):g;for(a.yearshtml+='";if(d.browser.mozilla)k+='";else{k+=a.yearshtml;a.yearshtml=null}}k+=this._get(a,"yearSuffix");if(u)k+=(h||!(j&&l)?" ":"")+o;k+="
    ";return k},_adjustInstDate:function(a,b,c){var e= +a.drawYear+(c=="Y"?b:0),f=a.drawMonth+(c=="M"?b:0);b=Math.min(a.selectedDay,this._getDaysInMonth(e,f))+(c=="D"?b:0);e=this._restrictMinMax(a,this._daylightSavingAdjust(new Date(e,f,b)));a.selectedDay=e.getDate();a.drawMonth=a.selectedMonth=e.getMonth();a.drawYear=a.selectedYear=e.getFullYear();if(c=="M"||c=="Y")this._notifyChange(a)},_restrictMinMax:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");b=c&&ba?a:b},_notifyChange:function(a){var b=this._get(a, +"onChangeMonthYear");if(b)b.apply(a.input?a.input[0]:null,[a.selectedYear,a.selectedMonth+1,a])},_getNumberOfMonths:function(a){a=this._get(a,"numberOfMonths");return a==null?[1,1]:typeof a=="number"?[1,a]:a},_getMinMaxDate:function(a,b){return this._determineDate(a,this._get(a,b+"Date"),null)},_getDaysInMonth:function(a,b){return 32-(new Date(a,b,32)).getDate()},_getFirstDayOfMonth:function(a,b){return(new Date(a,b,1)).getDay()},_canAdjustMonth:function(a,b,c,e){var f=this._getNumberOfMonths(a); +c=this._daylightSavingAdjust(new Date(c,e+(b<0?b:f[0]*f[1]),1));b<0&&c.setDate(this._getDaysInMonth(c.getFullYear(),c.getMonth()));return this._isInRange(a,c)},_isInRange:function(a,b){var c=this._getMinMaxDate(a,"min");a=this._getMinMaxDate(a,"max");return(!c||b.getTime()>=c.getTime())&&(!a||b.getTime()<=a.getTime())},_getFormatConfig:function(a){var b=this._get(a,"shortYearCutoff");b=typeof b!="string"?b:(new Date).getFullYear()%100+parseInt(b,10);return{shortYearCutoff:b,dayNamesShort:this._get(a, +"dayNamesShort"),dayNames:this._get(a,"dayNames"),monthNamesShort:this._get(a,"monthNamesShort"),monthNames:this._get(a,"monthNames")}},_formatDate:function(a,b,c,e){if(!b){a.currentDay=a.selectedDay;a.currentMonth=a.selectedMonth;a.currentYear=a.selectedYear}b=b?typeof b=="object"?b:this._daylightSavingAdjust(new Date(e,c,b)):this._daylightSavingAdjust(new Date(a.currentYear,a.currentMonth,a.currentDay));return this.formatDate(this._get(a,"dateFormat"),b,this._getFormatConfig(a))}});d.fn.datepicker= +function(a){if(!d.datepicker.initialized){d(document).mousedown(d.datepicker._checkExternalClick).find("body").append(d.datepicker.dpDiv);d.datepicker.initialized=true}var b=Array.prototype.slice.call(arguments,1);if(typeof a=="string"&&(a=="isDisabled"||a=="getDate"||a=="widget"))return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b));if(a=="option"&&arguments.length==2&&typeof arguments[1]=="string")return d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this[0]].concat(b)); +return this.each(function(){typeof a=="string"?d.datepicker["_"+a+"Datepicker"].apply(d.datepicker,[this].concat(b)):d.datepicker._attachDatepicker(this,a)})};d.datepicker=new K;d.datepicker.initialized=false;d.datepicker.uuid=(new Date).getTime();d.datepicker.version="1.8.7";window["DP_jQuery_"+y]=d})(jQuery); +;/* + * jQuery UI Progressbar 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Progressbar + * + * Depends: + * jquery.ui.core.js + * jquery.ui.widget.js + */ +(function(b,d){b.widget("ui.progressbar",{options:{value:0,max:100},min:0,_create:function(){this.element.addClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").attr({role:"progressbar","aria-valuemin":this.min,"aria-valuemax":this.options.max,"aria-valuenow":this._value()});this.valueDiv=b("
    ").appendTo(this.element);this.oldValue=this._value();this._refreshValue()},destroy:function(){this.element.removeClass("ui-progressbar ui-widget ui-widget-content ui-corner-all").removeAttr("role").removeAttr("aria-valuemin").removeAttr("aria-valuemax").removeAttr("aria-valuenow"); +this.valueDiv.remove();b.Widget.prototype.destroy.apply(this,arguments)},value:function(a){if(a===d)return this._value();this._setOption("value",a);return this},_setOption:function(a,c){if(a==="value"){this.options.value=c;this._refreshValue();this._value()===this.options.max&&this._trigger("complete")}b.Widget.prototype._setOption.apply(this,arguments)},_value:function(){var a=this.options.value;if(typeof a!=="number")a=0;return Math.min(this.options.max,Math.max(this.min,a))},_percentage:function(){return 100* +this._value()/this.options.max},_refreshValue:function(){var a=this.value(),c=this._percentage();if(this.oldValue!==a){this.oldValue=a;this._trigger("change")}this.valueDiv.toggleClass("ui-corner-right",a===this.options.max).width(c.toFixed(0)+"%");this.element.attr("aria-valuenow",a)}});b.extend(b.ui.progressbar,{version:"1.8.7"})})(jQuery); +;/* + * jQuery UI Effects 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/ + */ +jQuery.effects||function(f,j){function n(c){var a;if(c&&c.constructor==Array&&c.length==3)return c;if(a=/rgb\(\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*,\s*([0-9]{1,3})\s*\)/.exec(c))return[parseInt(a[1],10),parseInt(a[2],10),parseInt(a[3],10)];if(a=/rgb\(\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*,\s*([0-9]+(?:\.[0-9]+)?)\%\s*\)/.exec(c))return[parseFloat(a[1])*2.55,parseFloat(a[2])*2.55,parseFloat(a[3])*2.55];if(a=/#([a-fA-F0-9]{2})([a-fA-F0-9]{2})([a-fA-F0-9]{2})/.exec(c))return[parseInt(a[1], +16),parseInt(a[2],16),parseInt(a[3],16)];if(a=/#([a-fA-F0-9])([a-fA-F0-9])([a-fA-F0-9])/.exec(c))return[parseInt(a[1]+a[1],16),parseInt(a[2]+a[2],16),parseInt(a[3]+a[3],16)];if(/rgba\(0, 0, 0, 0\)/.exec(c))return o.transparent;return o[f.trim(c).toLowerCase()]}function s(c,a){var b;do{b=f.curCSS(c,a);if(b!=""&&b!="transparent"||f.nodeName(c,"body"))break;a="backgroundColor"}while(c=c.parentNode);return n(b)}function p(){var c=document.defaultView?document.defaultView.getComputedStyle(this,null):this.currentStyle, +a={},b,d;if(c&&c.length&&c[0]&&c[c[0]])for(var e=c.length;e--;){b=c[e];if(typeof c[b]=="string"){d=b.replace(/\-(\w)/g,function(g,h){return h.toUpperCase()});a[d]=c[b]}}else for(b in c)if(typeof c[b]==="string")a[b]=c[b];return a}function q(c){var a,b;for(a in c){b=c[a];if(b==null||f.isFunction(b)||a in t||/scrollbar/.test(a)||!/color/i.test(a)&&isNaN(parseFloat(b)))delete c[a]}return c}function u(c,a){var b={_:0},d;for(d in a)if(c[d]!=a[d])b[d]=a[d];return b}function k(c,a,b,d){if(typeof c=="object"){d= +a;b=null;a=c;c=a.effect}if(f.isFunction(a)){d=a;b=null;a={}}if(typeof a=="number"||f.fx.speeds[a]){d=b;b=a;a={}}if(f.isFunction(b)){d=b;b=null}a=a||{};b=b||a.duration;b=f.fx.off?0:typeof b=="number"?b:b in f.fx.speeds?f.fx.speeds[b]:f.fx.speeds._default;d=d||a.complete;return[c,a,b,d]}function m(c){if(!c||typeof c==="number"||f.fx.speeds[c])return true;if(typeof c==="string"&&!f.effects[c])return true;return false}f.effects={};f.each(["backgroundColor","borderBottomColor","borderLeftColor","borderRightColor", +"borderTopColor","borderColor","color","outlineColor"],function(c,a){f.fx.step[a]=function(b){if(!b.colorInit){b.start=s(b.elem,a);b.end=n(b.end);b.colorInit=true}b.elem.style[a]="rgb("+Math.max(Math.min(parseInt(b.pos*(b.end[0]-b.start[0])+b.start[0],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[1]-b.start[1])+b.start[1],10),255),0)+","+Math.max(Math.min(parseInt(b.pos*(b.end[2]-b.start[2])+b.start[2],10),255),0)+")"}});var o={aqua:[0,255,255],azure:[240,255,255],beige:[245,245,220],black:[0, +0,0],blue:[0,0,255],brown:[165,42,42],cyan:[0,255,255],darkblue:[0,0,139],darkcyan:[0,139,139],darkgrey:[169,169,169],darkgreen:[0,100,0],darkkhaki:[189,183,107],darkmagenta:[139,0,139],darkolivegreen:[85,107,47],darkorange:[255,140,0],darkorchid:[153,50,204],darkred:[139,0,0],darksalmon:[233,150,122],darkviolet:[148,0,211],fuchsia:[255,0,255],gold:[255,215,0],green:[0,128,0],indigo:[75,0,130],khaki:[240,230,140],lightblue:[173,216,230],lightcyan:[224,255,255],lightgreen:[144,238,144],lightgrey:[211, +211,211],lightpink:[255,182,193],lightyellow:[255,255,224],lime:[0,255,0],magenta:[255,0,255],maroon:[128,0,0],navy:[0,0,128],olive:[128,128,0],orange:[255,165,0],pink:[255,192,203],purple:[128,0,128],violet:[128,0,128],red:[255,0,0],silver:[192,192,192],white:[255,255,255],yellow:[255,255,0],transparent:[255,255,255]},r=["add","remove","toggle"],t={border:1,borderBottom:1,borderColor:1,borderLeft:1,borderRight:1,borderTop:1,borderWidth:1,margin:1,padding:1};f.effects.animateClass=function(c,a,b, +d){if(f.isFunction(b)){d=b;b=null}return this.each(function(){f.queue(this,"fx",function(){var e=f(this),g=e.attr("style")||" ",h=q(p.call(this)),l,v=e.attr("className");f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});l=q(p.call(this));e.attr("className",v);e.animate(u(h,l),a,b,function(){f.each(r,function(w,i){c[i]&&e[i+"Class"](c[i])});if(typeof e.attr("style")=="object"){e.attr("style").cssText="";e.attr("style").cssText=g}else e.attr("style",g);d&&d.apply(this,arguments)});h=f.queue(this);l= +h.splice(h.length-1,1)[0];h.splice(1,0,l);f.dequeue(this)})})};f.fn.extend({_addClass:f.fn.addClass,addClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{add:c},a,b,d]):this._addClass(c)},_removeClass:f.fn.removeClass,removeClass:function(c,a,b,d){return a?f.effects.animateClass.apply(this,[{remove:c},a,b,d]):this._removeClass(c)},_toggleClass:f.fn.toggleClass,toggleClass:function(c,a,b,d,e){return typeof a=="boolean"||a===j?b?f.effects.animateClass.apply(this,[a?{add:c}:{remove:c}, +b,d,e]):this._toggleClass(c,a):f.effects.animateClass.apply(this,[{toggle:c},a,b,d])},switchClass:function(c,a,b,d,e){return f.effects.animateClass.apply(this,[{add:a,remove:c},b,d,e])}});f.extend(f.effects,{version:"1.8.7",save:function(c,a){for(var b=0;b").addClass("ui-effects-wrapper").css({fontSize:"100%", +background:"transparent",border:"none",margin:0,padding:0});c.wrap(b);b=c.parent();if(c.css("position")=="static"){b.css({position:"relative"});c.css({position:"relative"})}else{f.extend(a,{position:c.css("position"),zIndex:c.css("z-index")});f.each(["top","left","bottom","right"],function(d,e){a[e]=c.css(e);if(isNaN(parseInt(a[e],10)))a[e]="auto"});c.css({position:"relative",top:0,left:0})}return b.css(a).show()},removeWrapper:function(c){if(c.parent().is(".ui-effects-wrapper"))return c.parent().replaceWith(c); +return c},setTransition:function(c,a,b,d){d=d||{};f.each(a,function(e,g){unit=c.cssUnit(g);if(unit[0]>0)d[g]=unit[0]*b+unit[1]});return d}});f.fn.extend({effect:function(c){var a=k.apply(this,arguments),b={options:a[1],duration:a[2],callback:a[3]};a=b.options.mode;var d=f.effects[c];if(f.fx.off||!d)return a?this[a](b.duration,b.callback):this.each(function(){b.callback&&b.callback.call(this)});return d.call(this,b)},_show:f.fn.show,show:function(c){if(m(c))return this._show.apply(this,arguments); +else{var a=k.apply(this,arguments);a[1].mode="show";return this.effect.apply(this,a)}},_hide:f.fn.hide,hide:function(c){if(m(c))return this._hide.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="hide";return this.effect.apply(this,a)}},__toggle:f.fn.toggle,toggle:function(c){if(m(c)||typeof c==="boolean"||f.isFunction(c))return this.__toggle.apply(this,arguments);else{var a=k.apply(this,arguments);a[1].mode="toggle";return this.effect.apply(this,a)}},cssUnit:function(c){var a=this.css(c), +b=[];f.each(["em","px","%","pt"],function(d,e){if(a.indexOf(e)>0)b=[parseFloat(a),e]});return b}});f.easing.jswing=f.easing.swing;f.extend(f.easing,{def:"easeOutQuad",swing:function(c,a,b,d,e){return f.easing[f.easing.def](c,a,b,d,e)},easeInQuad:function(c,a,b,d,e){return d*(a/=e)*a+b},easeOutQuad:function(c,a,b,d,e){return-d*(a/=e)*(a-2)+b},easeInOutQuad:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a+b;return-d/2*(--a*(a-2)-1)+b},easeInCubic:function(c,a,b,d,e){return d*(a/=e)*a*a+b},easeOutCubic:function(c, +a,b,d,e){return d*((a=a/e-1)*a*a+1)+b},easeInOutCubic:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a+b;return d/2*((a-=2)*a*a+2)+b},easeInQuart:function(c,a,b,d,e){return d*(a/=e)*a*a*a+b},easeOutQuart:function(c,a,b,d,e){return-d*((a=a/e-1)*a*a*a-1)+b},easeInOutQuart:function(c,a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a+b;return-d/2*((a-=2)*a*a*a-2)+b},easeInQuint:function(c,a,b,d,e){return d*(a/=e)*a*a*a*a+b},easeOutQuint:function(c,a,b,d,e){return d*((a=a/e-1)*a*a*a*a+1)+b},easeInOutQuint:function(c, +a,b,d,e){if((a/=e/2)<1)return d/2*a*a*a*a*a+b;return d/2*((a-=2)*a*a*a*a+2)+b},easeInSine:function(c,a,b,d,e){return-d*Math.cos(a/e*(Math.PI/2))+d+b},easeOutSine:function(c,a,b,d,e){return d*Math.sin(a/e*(Math.PI/2))+b},easeInOutSine:function(c,a,b,d,e){return-d/2*(Math.cos(Math.PI*a/e)-1)+b},easeInExpo:function(c,a,b,d,e){return a==0?b:d*Math.pow(2,10*(a/e-1))+b},easeOutExpo:function(c,a,b,d,e){return a==e?b+d:d*(-Math.pow(2,-10*a/e)+1)+b},easeInOutExpo:function(c,a,b,d,e){if(a==0)return b;if(a== +e)return b+d;if((a/=e/2)<1)return d/2*Math.pow(2,10*(a-1))+b;return d/2*(-Math.pow(2,-10*--a)+2)+b},easeInCirc:function(c,a,b,d,e){return-d*(Math.sqrt(1-(a/=e)*a)-1)+b},easeOutCirc:function(c,a,b,d,e){return d*Math.sqrt(1-(a=a/e-1)*a)+b},easeInOutCirc:function(c,a,b,d,e){if((a/=e/2)<1)return-d/2*(Math.sqrt(1-a*a)-1)+b;return d/2*(Math.sqrt(1-(a-=2)*a)+1)+b},easeInElastic:function(c,a,b,d,e){c=1.70158;var g=0,h=d;if(a==0)return b;if((a/=e)==1)return b+d;g||(g=e*0.3);if(h").css({position:"absolute",visibility:"visible",left:-f*(h/d),top:-e*(i/c)}).parent().addClass("ui-effects-explode").css({position:"absolute",overflow:"hidden",width:h/d,height:i/c,left:g.left+f*(h/d)+(a.options.mode=="show"?(f-Math.floor(d/2))*(h/d):0),top:g.top+e*(i/c)+(a.options.mode=="show"?(e-Math.floor(c/2))*(i/c):0),opacity:a.options.mode=="show"?0:1}).animate({left:g.left+f*(h/d)+(a.options.mode=="show"?0:(f-Math.floor(d/2))*(h/d)),top:g.top+ +e*(i/c)+(a.options.mode=="show"?0:(e-Math.floor(c/2))*(i/c)),opacity:a.options.mode=="show"?1:0},a.duration||500);setTimeout(function(){a.options.mode=="show"?b.css({visibility:"visible"}):b.css({visibility:"visible"}).hide();a.callback&&a.callback.apply(b[0]);b.dequeue();j("div.ui-effects-explode").remove()},a.duration||500)})}})(jQuery); +;/* + * jQuery UI Effects Fade 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fade + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.fade=function(a){return this.queue(function(){var c=b(this),d=b.effects.setMode(c,a.options.mode||"hide");c.animate({opacity:d},{queue:false,duration:a.duration,easing:a.options.easing,complete:function(){a.callback&&a.callback.apply(this,arguments);c.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Fold 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Fold + * + * Depends: + * jquery.effects.core.js + */ +(function(c){c.effects.fold=function(a){return this.queue(function(){var b=c(this),j=["position","top","left"],d=c.effects.setMode(b,a.options.mode||"hide"),g=a.options.size||15,h=!!a.options.horizFirst,k=a.duration?a.duration/2:c.fx.speeds._default/2;c.effects.save(b,j);b.show();var e=c.effects.createWrapper(b).css({overflow:"hidden"}),f=d=="show"!=h,l=f?["width","height"]:["height","width"];f=f?[e.width(),e.height()]:[e.height(),e.width()];var i=/([0-9]+)%/.exec(g);if(i)g=parseInt(i[1],10)/100* +f[d=="hide"?0:1];if(d=="show")e.css(h?{height:0,width:g}:{height:g,width:0});h={};i={};h[l[0]]=d=="show"?f[0]:g;i[l[1]]=d=="show"?f[1]:0;e.animate(h,k,a.options.easing).animate(i,k,a.options.easing,function(){d=="hide"&&b.hide();c.effects.restore(b,j);c.effects.removeWrapper(b);a.callback&&a.callback.apply(b[0],arguments);b.dequeue()})})}})(jQuery); +;/* + * jQuery UI Effects Highlight 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Highlight + * + * Depends: + * jquery.effects.core.js + */ +(function(b){b.effects.highlight=function(c){return this.queue(function(){var a=b(this),e=["backgroundImage","backgroundColor","opacity"],d=b.effects.setMode(a,c.options.mode||"show"),f={backgroundColor:a.css("backgroundColor")};if(d=="hide")f.opacity=0;b.effects.save(a,e);a.show().css({backgroundImage:"none",backgroundColor:c.options.color||"#ffff99"}).animate(f,{queue:false,duration:c.duration,easing:c.options.easing,complete:function(){d=="hide"&&a.hide();b.effects.restore(a,e);d=="show"&&!b.support.opacity&& +this.style.removeAttribute("filter");c.callback&&c.callback.apply(this,arguments);a.dequeue()}})})}})(jQuery); +;/* + * jQuery UI Effects Pulsate 1.8.7 + * + * Copyright 2010, AUTHORS.txt (http://jqueryui.com/about) + * Dual licensed under the MIT or GPL Version 2 licenses. + * http://jquery.org/license + * + * http://docs.jquery.com/UI/Effects/Pulsate + * + * Depends: + * jquery.effects.core.js + */ +(function(d){d.effects.pulsate=function(a){return this.queue(function(){var b=d(this),c=d.effects.setMode(b,a.options.mode||"show");times=(a.options.times||5)*2-1;duration=a.duration?a.duration/2:d.fx.speeds._default/2;isVisible=b.is(":visible");animateTo=0;if(!isVisible){b.css("opacity",0).show();animateTo=1}if(c=="hide"&&isVisible||c=="show"&&!isVisible)times--;for(c=0;c').appendTo(document.body).addClass(a.options.className).css({top:d.top,left:d.left,height:b.innerHeight(),width:b.innerWidth(),position:"absolute"}).animate(c,a.duration,a.options.easing,function(){f.remove();a.callback&&a.callback.apply(b[0],arguments); +b.dequeue()})})}})(jQuery); +; \ No newline at end of file diff --git a/src/sunstone/public/js/jquery.dataTables.min.js b/src/sunstone/public/js/jquery.dataTables.min.js new file mode 100644 index 0000000000..cd6587553c --- /dev/null +++ b/src/sunstone/public/js/jquery.dataTables.min.js @@ -0,0 +1,142 @@ +/* + * File: jquery.dataTables.min.js + * Version: 1.7.5 + * Author: Allan Jardine (www.sprymedia.co.uk) + * Info: www.datatables.net + * + * Copyright 2008-2010 Allan Jardine, all rights reserved. + * + * This source file is free software, under either the GPL v2 license or a + * BSD style license, as supplied with this software. + * + * This source file is distributed in the hope that it will be useful, but + * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY + * or FITNESS FOR A PARTICULAR PURPOSE. See the license files for details. + */ +(function(j,qa,p){j.fn.dataTableSettings=[];var D=j.fn.dataTableSettings;j.fn.dataTableExt={};var n=j.fn.dataTableExt;n.sVersion="1.7.5";n.sErrMode="alert";n.iApiIndex=0;n.oApi={};n.afnFiltering=[];n.aoFeatures=[];n.ofnSearch={};n.afnSortData=[];n.oStdClasses={sPagePrevEnabled:"paginate_enabled_previous",sPagePrevDisabled:"paginate_disabled_previous",sPageNextEnabled:"paginate_enabled_next",sPageNextDisabled:"paginate_disabled_next",sPageJUINext:"",sPageJUIPrev:"",sPageButton:"paginate_button",sPageButtonActive:"paginate_active", +sPageButtonStaticDisabled:"paginate_button",sPageFirst:"first",sPagePrevious:"previous",sPageNext:"next",sPageLast:"last",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"sorting_asc",sSortDesc:"sorting_desc",sSortable:"sorting",sSortableAsc:"sorting_asc_disabled",sSortableDesc:"sorting_desc_disabled", +sSortableNone:"sorting_disabled",sSortColumn:"sorting_",sSortJUIAsc:"",sSortJUIDesc:"",sSortJUI:"",sSortJUIAscAllowed:"",sSortJUIDescAllowed:"",sSortJUIWrapper:"",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead",sScrollHeadInner:"dataTables_scrollHeadInner",sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:""};n.oJUIClasses={sPagePrevEnabled:"fg-button ui-button ui-state-default ui-corner-left",sPagePrevDisabled:"fg-button ui-button ui-state-default ui-corner-left ui-state-disabled", +sPageNextEnabled:"fg-button ui-button ui-state-default ui-corner-right",sPageNextDisabled:"fg-button ui-button ui-state-default ui-corner-right ui-state-disabled",sPageJUINext:"ui-icon ui-icon-circle-arrow-e",sPageJUIPrev:"ui-icon ui-icon-circle-arrow-w",sPageButton:"fg-button ui-button ui-state-default",sPageButtonActive:"fg-button ui-button ui-state-default ui-state-disabled",sPageButtonStaticDisabled:"fg-button ui-button ui-state-default ui-state-disabled",sPageFirst:"first ui-corner-tl ui-corner-bl", +sPagePrevious:"previous",sPageNext:"next",sPageLast:"last ui-corner-tr ui-corner-br",sStripOdd:"odd",sStripEven:"even",sRowEmpty:"dataTables_empty",sWrapper:"dataTables_wrapper",sFilter:"dataTables_filter",sInfo:"dataTables_info",sPaging:"dataTables_paginate fg-buttonset ui-buttonset fg-buttonset-multi ui-buttonset-multi paging_",sLength:"dataTables_length",sProcessing:"dataTables_processing",sSortAsc:"ui-state-default",sSortDesc:"ui-state-default",sSortable:"ui-state-default",sSortableAsc:"ui-state-default", +sSortableDesc:"ui-state-default",sSortableNone:"ui-state-default",sSortColumn:"sorting_",sSortJUIAsc:"css_right ui-icon ui-icon-triangle-1-n",sSortJUIDesc:"css_right ui-icon ui-icon-triangle-1-s",sSortJUI:"css_right ui-icon ui-icon-carat-2-n-s",sSortJUIAscAllowed:"css_right ui-icon ui-icon-carat-1-n",sSortJUIDescAllowed:"css_right ui-icon ui-icon-carat-1-s",sSortJUIWrapper:"DataTables_sort_wrapper",sScrollWrapper:"dataTables_scroll",sScrollHead:"dataTables_scrollHead ui-state-default",sScrollHeadInner:"dataTables_scrollHeadInner", +sScrollBody:"dataTables_scrollBody",sScrollFoot:"dataTables_scrollFoot ui-state-default",sScrollFootInner:"dataTables_scrollFootInner",sFooterTH:"ui-state-default"};n.oPagination={two_button:{fnInit:function(g,m,r){var s,w,y;if(g.bJUI){s=p.createElement("a");w=p.createElement("a");y=p.createElement("span");y.className=g.oClasses.sPageJUINext;w.appendChild(y);y=p.createElement("span");y.className=g.oClasses.sPageJUIPrev;s.appendChild(y)}else{s=p.createElement("div");w=p.createElement("div")}s.className= +g.oClasses.sPagePrevDisabled;w.className=g.oClasses.sPageNextDisabled;s.title=g.oLanguage.oPaginate.sPrevious;w.title=g.oLanguage.oPaginate.sNext;m.appendChild(s);m.appendChild(w);j(s).click(function(){g.oApi._fnPageChange(g,"previous")&&r(g)});j(w).click(function(){g.oApi._fnPageChange(g,"next")&&r(g)});j(s).bind("selectstart",function(){return false});j(w).bind("selectstart",function(){return false});if(g.sTableId!==""&&typeof g.aanFeatures.p=="undefined"){m.setAttribute("id",g.sTableId+"_paginate"); +s.setAttribute("id",g.sTableId+"_previous");w.setAttribute("id",g.sTableId+"_next")}},fnUpdate:function(g){if(g.aanFeatures.p)for(var m=g.aanFeatures.p,r=0,s=m.length;r=w-s){s=w-r+1;x=w}else{s=y-Math.ceil(r/2)+1;x=s+r-1}for(r=s;r<= +x;r++)F+=y!=r?''+r+"":''+r+"";x=g.aanFeatures.p;var z,U=function(){g._iDisplayStart=(this.innerHTML*1-1)*g._iDisplayLength;m(g);return false},C=function(){return false};r=0;for(s=x.length;rm?1:0},"string-desc":function(g,m){g=g.toLowerCase();m=m.toLowerCase();return gm?-1:0},"html-asc":function(g,m){g=g.replace(/<.*?>/g,"").toLowerCase();m=m.replace(/<.*?>/g,"").toLowerCase();return gm?1:0},"html-desc":function(g,m){g=g.replace(/<.*?>/g,"").toLowerCase();m=m.replace(/<.*?>/g,"").toLowerCase();return gm?-1:0},"date-asc":function(g,m){g=Date.parse(g);m=Date.parse(m);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(m)|| +m==="")m=Date.parse("01/01/1970 00:00:00");return g-m},"date-desc":function(g,m){g=Date.parse(g);m=Date.parse(m);if(isNaN(g)||g==="")g=Date.parse("01/01/1970 00:00:00");if(isNaN(m)||m==="")m=Date.parse("01/01/1970 00:00:00");return m-g},"numeric-asc":function(g,m){return(g=="-"||g===""?0:g*1)-(m=="-"||m===""?0:m*1)},"numeric-desc":function(g,m){return(m=="-"||m===""?0:m*1)-(g=="-"||g===""?0:g*1)}};n.aTypes=[function(g){if(g.length===0)return"numeric";var m,r=false;m=g.charAt(0);if("0123456789-".indexOf(m)== +-1)return null;for(var s=1;s")!=-1)return"html";return null}];n.fnVersionCheck=function(g){var m=function(x,v){for(;x.length=parseInt(w,10)};n._oExternConfig={iNextUnique:0};j.fn.dataTable=function(g){function m(){this.fnRecordsTotal=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsTotal,10):this.aiDisplayMaster.length};this.fnRecordsDisplay=function(){return this.oFeatures.bServerSide?parseInt(this._iRecordsDisplay,10):this.aiDisplay.length};this.fnDisplayEnd=function(){return this.oFeatures.bServerSide?this.oFeatures.bPaginate===false||this._iDisplayLength==-1? +this._iDisplayStart+this.aiDisplay.length:Math.min(this._iDisplayStart+this._iDisplayLength,this._iRecordsDisplay):this._iDisplayEnd};this.sInstance=this.oInstance=null;this.oFeatures={bPaginate:true,bLengthChange:true,bFilter:true,bSort:true,bInfo:true,bAutoWidth:true,bProcessing:false,bSortClasses:true,bStateSave:false,bServerSide:false};this.oScroll={sX:"",sXInner:"",sY:"",bCollapse:false,bInfinite:false,iLoadGap:100,iBarWidth:0,bAutoCss:true};this.aanFeatures=[];this.oLanguage={sProcessing:"Processing...", +sLengthMenu:"Show _MENU_ entries",sZeroRecords:"No matching records found",sEmptyTable:"No data available in table",sInfo:"Showing _START_ to _END_ of _TOTAL_ entries",sInfoEmpty:"Showing 0 to 0 of 0 entries",sInfoFiltered:"(filtered from _MAX_ total entries)",sInfoPostFix:"",sSearch:"Search:",sUrl:"",oPaginate:{sFirst:"First",sPrevious:"Previous",sNext:"Next",sLast:"Last"},fnInfoCallback:null};this.aoData=[];this.aiDisplay=[];this.aiDisplayMaster=[];this.aoColumns=[];this.iNextId=0;this.asDataSearch= +[];this.oPreviousSearch={sSearch:"",bRegex:false,bSmart:true};this.aoPreSearchCols=[];this.aaSorting=[[0,"asc",0]];this.aaSortingFixed=null;this.asStripClasses=[];this.asDestoryStrips=[];this.sDestroyWidth=0;this.fnFooterCallback=this.fnHeaderCallback=this.fnRowCallback=null;this.aoDrawCallback=[];this.fnInitComplete=null;this.sTableId="";this.nTableWrapper=this.nTBody=this.nTFoot=this.nTHead=this.nTable=null;this.bInitialised=false;this.aoOpenRows=[];this.sDom="lfrtip";this.sPaginationType="two_button"; +this.iCookieDuration=7200;this.sCookiePrefix="SpryMedia_DataTables_";this.fnCookieCallback=null;this.aoStateSave=[];this.aoStateLoad=[];this.sAjaxSource=this.oLoadedState=null;this.bAjaxDataGet=true;this.fnServerData=function(a,b,c){j.ajax({url:a,data:b,success:c,dataType:"json",cache:false,error:function(d,f){f=="parsererror"&&alert("DataTables warning: JSON data from server could not be parsed. This is caused by a JSON formatting error.")}})};this.fnFormatNumber=function(a){if(a<1E3)return a;else{var b= +a+"";a=b.split("");var c="";b=b.length;for(var d=0;d=a.fnRecordsDisplay()?0:a.iInitDisplayStart;a.iInitDisplayStart=-1;E(a)}if(!(!a.bDestroying&&a.oFeatures.bServerSide&&!sa(a))){a.oFeatures.bServerSide||a.iDraw++;if(a.aiDisplay.length!==0){var i=a._iDisplayStart,h=a._iDisplayEnd;if(a.oFeatures.bServerSide){i=0;h=a.aoData.length}for(i= +i;itr",a.nTHead)[0],V(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay); +typeof a.fnFooterCallback=="function"&&a.fnFooterCallback.call(a.oInstance,j(">tr",a.nTFoot)[0],V(a),a._iDisplayStart,a.fnDisplayEnd(),a.aiDisplay);f=p.createDocumentFragment();b=p.createDocumentFragment();if(a.nTBody){e=a.nTBody.parentNode;b.appendChild(a.nTBody);if(!a.oScroll.bInfinite||!a._bInitComplete||a.bSorted||a.bFiltered){c=a.nTBody.childNodes;for(b=c.length-1;b>=0;b--)c[b].parentNode.removeChild(c[b])}b=0;for(c=d.length;b=0;b--)a.aoDrawCallback[b].fn.call(a.oInstance,a);a.bSorted=false;a.bFiltered=false;a.bDrawing=false;if(a.oFeatures.bServerSide){K(a,false);typeof a._bInitComplete=="undefined"&&w(a)}}}function W(a){if(a.oFeatures.bSort)O(a,a.oPreviousSearch);else if(a.oFeatures.bFilter)P(a,a.oPreviousSearch);else{E(a);C(a)}}function sa(a){if(a.bAjaxDataGet){K(a,true);var b=a.aoColumns.length,c=[],d;a.iDraw++;c.push({name:"sEcho",value:a.iDraw});c.push({name:"iColumns",value:b});c.push({name:"sColumns", +value:ca(a)});c.push({name:"iDisplayStart",value:a._iDisplayStart});c.push({name:"iDisplayLength",value:a.oFeatures.bPaginate!==false?a._iDisplayLength:-1});if(a.oFeatures.bFilter!==false){c.push({name:"sSearch",value:a.oPreviousSearch.sSearch});c.push({name:"bRegex",value:a.oPreviousSearch.bRegex});for(d=0;d")c=c.parentNode; +else if(i=="l"&&a.oFeatures.bPaginate&&a.oFeatures.bLengthChange){f=va(a);e=1}else if(i=="f"&&a.oFeatures.bFilter){f=wa(a);e=1}else if(i=="r"&&a.oFeatures.bProcessing){f=xa(a);e=1}else if(i=="t"){f=ya(a);e=1}else if(i=="i"&&a.oFeatures.bInfo){f=za(a);e=1}else if(i=="p"&&a.oFeatures.bPaginate){f=Aa(a);e=1}else if(n.aoFeatures.length!==0){h=n.aoFeatures;q=0;for(k=h.length;qcaption",a.nTable);i=0;for(k=d.length;ij(a.nTable).height()-a.oScroll.iLoadGap)if(a.fnDisplayEnd()0&&a.nTable.removeChild(i[0]);if(a.nTFoot!==null){k=a.nTable.getElementsByTagName("tfoot");k.length>0&&a.nTable.removeChild(k[0])}i=a.nTHead.cloneNode(true);a.nTable.insertBefore(i,a.nTable.childNodes[0]);if(a.nTFoot!==null){k=a.nTFoot.cloneNode(true);a.nTable.insertBefore(k,a.nTable.childNodes[1])}var J=fa(i);f=0;for(e=J.length;ff-a.oScroll.iBarWidth)a.nTable.style.width=u(f)}else a.nTable.style.width= +u(f);f=j(a.nTable).outerWidth();e=a.nTHead.getElementsByTagName("tr");i=i.getElementsByTagName("tr");L(function(B,I){l=B.style;l.paddingTop="0";l.paddingBottom="0";l.borderTopWidth="0";l.borderBottomWidth="0";l.height=0;t=j(B).width();I.style.width=u(t);G.push(t)},i,e);j(i).height(0);if(a.nTFoot!==null){h=k.getElementsByTagName("tr");k=a.nTFoot.getElementsByTagName("tr");L(function(B,I){l=B.style;l.paddingTop="0";l.paddingBottom="0";l.borderTopWidth="0";l.borderBottomWidth="0";t=j(B).width();I.style.width= +u(t);G.push(t)},h,k);j(h).height(0)}L(function(B){B.innerHTML="";B.style.width=u(G.shift())},i);a.nTFoot!==null&&L(function(B){B.innerHTML="";B.style.width=u(G.shift())},h);if(j(a.nTable).outerWidth()d.offsetWidth?a.oScroll.iBarWidth:0;if(a.nTable.offsetHeight';var c=j("input",b);c.val(a.oPreviousSearch.sSearch.replace('"',"""));c.keyup(function(){for(var d=a.aanFeatures.f,f=0,e=d.length;f=0;d--){f=ja(a.aoData[a.aiDisplay[d]]._aData[c],a.aoColumns[c].sType);if(!b.test(f)){a.aiDisplay.splice(d,1);e++}}}}function Ca(a,b,c,d,f){var e=ia(b,d,f);if(typeof c=="undefined"||c===null)c=0;if(n.afnFiltering.length!==0)c=1;if(b.length<=0){a.aiDisplay.splice(0,a.aiDisplay.length);a.aiDisplay=a.aiDisplayMaster.slice()}else if(a.aiDisplay.length==a.aiDisplayMaster.length||a.oPreviousSearch.sSearch.length>b.length||c==1||b.indexOf(a.oPreviousSearch.sSearch)!== +0){a.aiDisplay.splice(0,a.aiDisplay.length);ha(a,1);for(c=0;c/g,"");else if(typeof a=="string")return a.replace(/\n/g," ");return a}function O(a,b){var c,d,f,e,i,h,k=[],l=[],q=n.oSort,t=a.aoData,G=a.aoColumns;if(!a.oFeatures.bServerSide&&(a.aaSorting.length!==0||a.aaSortingFixed!==null)){k=a.aaSortingFixed!==null?a.aaSortingFixed.concat(a.aaSorting):a.aaSorting.slice();for(f=0;f=i)for(b=0;b=0?a._iDisplayStart-a._iDisplayLength:0;if(a._iDisplayStart<0)a._iDisplayStart=0}else if(b=="next")if(a._iDisplayLength>=0){if(a._iDisplayStart+a._iDisplayLength=0){b=parseInt((a.fnRecordsDisplay()-1)/a._iDisplayLength,10)+1;a._iDisplayStart=(b-1)*a._iDisplayLength}else a._iDisplayStart=0;else H(a,0,"Unknown paging action: "+b);return c!=a._iDisplayStart}function za(a){var b=p.createElement("div");b.className=a.oClasses.sInfo;if(typeof a.aanFeatures.i=="undefined"){a.aoDrawCallback.push({fn:Fa,sName:"information"});a.sTableId!==""&&b.setAttribute("id",a.sTableId+"_info")}return b} +function Fa(a){if(!(!a.oFeatures.bInfo||a.aanFeatures.i.length===0)){var b=a._iDisplayStart+1,c=a.fnDisplayEnd(),d=a.fnRecordsTotal(),f=a.fnRecordsDisplay(),e=a.fnFormatNumber(b),i=a.fnFormatNumber(c),h=a.fnFormatNumber(d),k=a.fnFormatNumber(f);if(a.oScroll.bInfinite)e=a.fnFormatNumber(1);e=a.fnRecordsDisplay()===0&&a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfoEmpty+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()===0?a.oLanguage.sInfoEmpty+" "+a.oLanguage.sInfoFiltered.replace("_MAX_", +h)+a.oLanguage.sInfoPostFix:a.fnRecordsDisplay()==a.fnRecordsTotal()?a.oLanguage.sInfo.replace("_START_",e).replace("_END_",i).replace("_TOTAL_",k)+a.oLanguage.sInfoPostFix:a.oLanguage.sInfo.replace("_START_",e).replace("_END_",i).replace("_TOTAL_",k)+" "+a.oLanguage.sInfoFiltered.replace("_MAX_",a.fnFormatNumber(a.fnRecordsTotal()))+a.oLanguage.sInfoPostFix;if(a.oLanguage.fnInfoCallback!==null)e=a.oLanguage.fnInfoCallback(a,b,c,d,f,e);a=a.aanFeatures.i;b=0;for(c=a.length;b",c,d;if(a.aLengthMenu.length==2&&typeof a.aLengthMenu[0]=="object"&&typeof a.aLengthMenu[1]=="object"){c=0;for(d=a.aLengthMenu[0].length;c'+a.aLengthMenu[1][c]+""}else{c=0;for(d=a.aLengthMenu.length;c'+a.aLengthMenu[c]+""}b+="";var f=p.createElement("div"); +a.sTableId!==""&&typeof a.aanFeatures.l=="undefined"&&f.setAttribute("id",a.sTableId+"_length");f.className=a.oClasses.sLength;f.innerHTML=a.oLanguage.sLengthMenu.replace("_MENU_",b);j('select option[value="'+a._iDisplayLength+'"]',f).attr("selected",true);j("select",f).change(function(){var e=j(this).val(),i=a.aanFeatures.l;c=0;for(d=i.length;ca.aiDisplay.length||a._iDisplayLength==-1?a.aiDisplay.length:a._iDisplayStart+a._iDisplayLength}function Ga(a,b){if(!a||a===null||a==="")return 0;if(typeof b=="undefined")b=p.getElementsByTagName("body")[0];var c=p.createElement("div");c.style.width=a;b.appendChild(c);a=c.offsetWidth; +b.removeChild(c);return a}function $(a){var b=0,c,d=0,f=a.aoColumns.length,e,i=j("th",a.nTHead);for(e=0;etd",b);e.each(function(h){this.style.width="";h=ga(a,h);if(h!==null&&a.aoColumns[h].sWidthOrig!=="")this.style.width=a.aoColumns[h].sWidthOrig});for(e=0;etd",b);if(f.length===0)f=j("thead tr:eq(0)>th",b);for(e=c=0;e +0)a.aoColumns[e].sWidth=u(d);c++}a.nTable.style.width=u(j(b).outerWidth());b.parentNode.removeChild(b)}}function Ia(a,b){if(a.oScroll.sX===""&&a.oScroll.sY!==""){j(b).width();b.style.width=u(j(b).outerWidth()-a.oScroll.iBarWidth)}else if(a.oScroll.sX!=="")b.style.width=u(j(b).outerWidth())}function Ha(a,b,c){if(typeof c=="undefined"||c){c=Ja(a,b);b=M(a,b);if(c<0)return null;return a.aoData[c].nTr.getElementsByTagName("td")[b]}var d=-1,f,e;c=-1;var i=p.createElement("div");i.style.visibility="hidden"; +i.style.position="absolute";p.body.appendChild(i);f=0;for(e=a.aoData.length;fd){d=i.offsetWidth;c=f}}p.body.removeChild(i);if(c>=0){b=M(a,b);if(a=a.aoData[c].nTr.getElementsByTagName("td")[b])return a}return null}function Ja(a,b){for(var c=-1,d=-1,f=0;fc){c=e.length;d=f}}return d}function u(a){if(a===null)return"0px";if(typeof a=="number"){if(a<0)return"0px";return a+"px"}var b= +a.charCodeAt(a.length-1);if(b<48||b>57)return a;return a+"px"}function Oa(a,b){if(a.length!=b.length)return 1;for(var c=0;cb&&a[d]--;c!=-1&&a.splice(c,1)}function ua(a,b){b=b.split(",");for(var c=[],d=0,f=a.aoColumns.length;d4096){a=p.cookie.split(";");for(var h=0,k=a.length;h=d.aiDisplay.length){d._iDisplayStart-=d._iDisplayLength;if(d._iDisplayStart<0)d._iDisplayStart=0}if(typeof c=="undefined"||c){E(d);C(d)}return f};this.fnClearTable=function(a){var b=A(this[n.iApiIndex]);da(b);if(typeof a=="undefined"||a)C(b)};this.fnOpen=function(a,b,c){var d=A(this[n.iApiIndex]);this.fnClose(a);var f= +p.createElement("tr"),e=p.createElement("td");f.appendChild(e);e.className=c;e.colSpan=S(d);e.innerHTML=b;b=j("tr",d.nTBody);j.inArray(a,b)!=-1&&j(f).insertAfter(a);d.aoOpenRows.push({nTr:f,nParent:a});return f};this.fnClose=function(a){for(var b=A(this[n.iApiIndex]),c=0;ctr",d.nTHead)[0];i=j(">tr",d.nTFoot)[0];q=[];h=[];for(f=0;f=S(d)){l.appendChild(q[a]);l=j(">tr",d.nTHead);f=1;for(e=l.length;ftr",d.nTFoot);f=1;for(e=l.length;ftr",d.nTHead);f=1;for(e=l.length;ftr",d.nTFoot);f=1;for(e=l.length;ftd:eq("+k+")",d.aoData[f].nTr)[0])}}d.aoColumns[a].bVisible=true}else{l.removeChild(q[a]);f=0;for(e=d.aoColumns[a].anThExtra.length;ftr>td."+a.oClasses.sRowEmpty,a.nTable).parent().remove();if(a.nTable!=a.nTHead.parentNode){j(">thead",a.nTable).remove();a.nTable.appendChild(a.nTHead)}if(a.nTFoot&&a.nTable!=a.nTFoot.parentNode){j(">tfoot",a.nTable).remove();a.nTable.appendChild(a.nTFoot)}a.nTable.parentNode.removeChild(a.nTable);j(a.nTableWrapper).remove();a.aaSorting=[];a.aaSortingFixed=[];T(a);j(R(a)).removeClass(a.asStripClasses.join(" "));if(a.bJUI){j("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oJUIClasses.sSortableAsc, +n.oJUIClasses.sSortableDesc,n.oJUIClasses.sSortableNone].join(" "));j("th span",a.nTHead).remove()}else j("th",a.nTHead).removeClass([n.oStdClasses.sSortable,n.oStdClasses.sSortableAsc,n.oStdClasses.sSortableDesc,n.oStdClasses.sSortableNone].join(" "));b.appendChild(a.nTable);d=0;for(f=a.aoData.length;dtr:even",c).addClass(a.asDestoryStrips[0]);j(">tr:odd",c).addClass(a.asDestoryStrips[1]);d=0;for(f=D.length;dt<"F"ip>'}if(e.oScroll.sX!==""||e.oScroll.sY!=="")e.oScroll.iBarWidth=Ma();if(typeof g.iDisplayStart!="undefined"&&typeof e.iInitDisplayStart=="undefined"){e.iInitDisplayStart=g.iDisplayStart;e._iDisplayStart=g.iDisplayStart}if(typeof g.bStateSave!="undefined"){e.oFeatures.bStateSave=g.bStateSave;La(e,g);e.aoDrawCallback.push({fn:na,sName:"state_save"})}if(typeof g.aaData!="undefined")h= +true;if(typeof g!="undefined"&&typeof g.aoData!="undefined")g.aoColumns=g.aoData;if(typeof g.oLanguage!="undefined")if(typeof g.oLanguage.sUrl!="undefined"&&g.oLanguage.sUrl!==""){e.oLanguage.sUrl=g.oLanguage.sUrl;j.getJSON(e.oLanguage.sUrl,null,function(q){y(e,q,true)});i=true}else y(e,g.oLanguage,false)}else g={};if(typeof g.asStripClasses=="undefined"){e.asStripClasses.push(e.oClasses.sStripOdd);e.asStripClasses.push(e.oClasses.sStripEven)}c=false;d=j("tbody>tr",this);a=0;for(b=e.asStripClasses.length;a< +b;a++)if(d.filter(":lt(2)").hasClass(e.asStripClasses[a])){c=true;break}if(c){e.asDestoryStrips=["",""];if(j(d[0]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[0]+=e.oClasses.sStripOdd+" ";if(j(d[0]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[0]+=e.oClasses.sStripEven;if(j(d[1]).hasClass(e.oClasses.sStripOdd))e.asDestoryStrips[1]+=e.oClasses.sStripOdd+" ";if(j(d[1]).hasClass(e.oClasses.sStripEven))e.asDestoryStrips[1]+=e.oClasses.sStripEven;d.removeClass(e.asStripClasses.join(" "))}a=this.getElementsByTagName("thead"); +c=a.length===0?[]:fa(a[0]);var k;if(typeof g.aoColumns=="undefined"){k=[];a=0;for(b=c.length;a=0;a--){var l=g.aoColumnDefs[a].aTargets;j.isArray(l)||H(e,1,"aTargets must be an array of targets, not a "+typeof l); +c=0;for(d=l.length;c=0){for(;e.aoColumns.length<=l[c];)F(e);x(e,l[c],g.aoColumnDefs[a])}else if(typeof l[c]=="number"&&l[c]<0)x(e,e.aoColumns.length+l[c],g.aoColumnDefs[a]);else if(typeof l[c]=="string"){b=0;for(f=e.aoColumns.length;b=e.aoColumns.length)e.aaSorting[a][0]= +0;k=e.aoColumns[e.aaSorting[a][0]];if(typeof e.aaSorting[a][2]=="undefined")e.aaSorting[a][2]=0;if(typeof g.aaSorting=="undefined"&&typeof e.saved_aaSorting=="undefined")e.aaSorting[a][1]=k.asSorting[0];c=0;for(d=k.asSorting.length;c0)e.nTFoot=this.getElementsByTagName("tfoot")[0];if(h)for(a=0;a').addClass((o&&o.position)?o.position:$.jGrowl.defaults.position).appendTo('body');$('#jGrowl').jGrowl(m,o);};$.fn.jGrowl=function(m,o){if($.isFunction(this.each)){var args=arguments;return this.each(function(){var self=this;if($(this).data('jGrowl.instance')==undefined){$(this).data('jGrowl.instance',$.extend(new $.fn.jGrowl(),{notifications:[],element:null,interval:null}));$(this).data('jGrowl.instance').startup(this);} +if($.isFunction($(this).data('jGrowl.instance')[m])){$(this).data('jGrowl.instance')[m].apply($(this).data('jGrowl.instance'),$.makeArray(args).slice(1));}else{$(this).data('jGrowl.instance').create(m,o);}});};};$.extend($.fn.jGrowl.prototype,{defaults:{pool:0,header:'',group:'',sticky:false,position:'top-right',glue:'after',theme:'default',themeState:'highlight',corners:'10px',check:250,life:3000,closeDuration:'normal',openDuration:'normal',easing:'swing',closer:true,closeTemplate:'×',closerTemplate:'
    [ close all ]
    ',log:function(e,m,o){},beforeOpen:function(e,m,o){},afterOpen:function(e,m,o){},open:function(e,m,o){},beforeClose:function(e,m,o){},close:function(e,m,o){},animateOpen:{opacity:'show'},animateClose:{opacity:'hide'}},notifications:[],element:null,interval:null,create:function(message,o){var o=$.extend({},this.defaults,o);if(typeof o.speed!=='undefined'){o.openDuration=o.speed;o.closeDuration=o.speed;} +this.notifications.push({message:message,options:o});o.log.apply(this.element,[this.element,message,o]);},render:function(notification){var self=this;var message=notification.message;var o=notification.options;var notification=$('
    '+'
    '+o.closeTemplate+'
    '+'
    '+o.header+'
    '+'
    '+message+'
    ').data("jGrowl",o).addClass(o.theme).children('div.jGrowl-close').bind("click.jGrowl",function(){$(this).parent().trigger('jGrowl.close');}).parent();$(notification).bind("mouseover.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",true);}).bind("mouseout.jGrowl",function(){$('div.jGrowl-notification',self.element).data("jGrowl.pause",false);}).bind('jGrowl.beforeOpen',function(){if(o.beforeOpen.apply(notification,[notification,message,o,self.element])!=false){$(this).trigger('jGrowl.open');}}).bind('jGrowl.open',function(){if(o.open.apply(notification,[notification,message,o,self.element])!=false){if(o.glue=='after'){$('div.jGrowl-notification:last',self.element).after(notification);}else{$('div.jGrowl-notification:first',self.element).before(notification);} +$(this).animate(o.animateOpen,o.openDuration,o.easing,function(){if($.browser.msie&&(parseInt($(this).css('opacity'),10)===1||parseInt($(this).css('opacity'),10)===0)) +this.style.removeAttribute('filter');$(this).data("jGrowl").created=new Date();$(this).trigger('jGrowl.afterOpen');});}}).bind('jGrowl.afterOpen',function(){o.afterOpen.apply(notification,[notification,message,o,self.element]);}).bind('jGrowl.beforeClose',function(){if(o.beforeClose.apply(notification,[notification,message,o,self.element])!=false) +$(this).trigger('jGrowl.close');}).bind('jGrowl.close',function(){$(this).data('jGrowl.pause',true);$(this).animate(o.animateClose,o.closeDuration,o.easing,function(){$(this).remove();var close=o.close.apply(notification,[notification,message,o,self.element]);if($.isFunction(close)) +close.apply(notification,[notification,message,o,self.element]);});}).trigger('jGrowl.beforeOpen');if(o.corners!=''&&$.fn.corner!=undefined)$(notification).corner(o.corners);if($('div.jGrowl-notification:parent',self.element).size()>1&&$('div.jGrowl-closer',self.element).size()==0&&this.defaults.closer!=false){$(this.defaults.closerTemplate).addClass('jGrowl-closer ui-state-highlight ui-corner-all').addClass(this.defaults.theme).appendTo(self.element).animate(this.defaults.animateOpen,this.defaults.speed,this.defaults.easing).bind("click.jGrowl",function(){$(this).siblings().trigger("jGrowl.beforeClose");if($.isFunction(self.defaults.closer)){self.defaults.closer.apply($(this).parent()[0],[$(this).parent()[0]]);}});};},update:function(){$(this.element).find('div.jGrowl-notification:parent').each(function(){if($(this).data("jGrowl")!=undefined&&$(this).data("jGrowl").created!=undefined&&($(this).data("jGrowl").created.getTime()+parseInt($(this).data("jGrowl").life))<(new Date()).getTime()&&$(this).data("jGrowl").sticky!=true&&($(this).data("jGrowl.pause")==undefined||$(this).data("jGrowl.pause")!=true)){$(this).trigger('jGrowl.beforeClose');}});if(this.notifications.length>0&&(this.defaults.pool==0||$(this.element).find('div.jGrowl-notification:parent').size()');this.interval=setInterval(function(){$(e).data('jGrowl.instance').update();},parseInt(this.defaults.check));if($.browser.msie&&parseInt($.browser.version)<7&&!window["XMLHttpRequest"]){$(this.element).addClass('ie6');}},shutdown:function(){$(this.element).removeClass('jGrowl').find('div.jGrowl-notification').remove();clearInterval(this.interval);},close:function(){$(this.element).find('div.jGrowl-notification').each(function(){$(this).trigger('jGrowl.beforeClose');});}});$.jGrowl.defaults=$.fn.jGrowl.prototype.defaults;})(jQuery); \ No newline at end of file diff --git a/src/sunstone/public/js/jquery.layout.min-1.2.0.js b/src/sunstone/public/js/jquery.layout.min-1.2.0.js new file mode 100644 index 0000000000..bcc2f0f227 --- /dev/null +++ b/src/sunstone/public/js/jquery.layout.min-1.2.0.js @@ -0,0 +1,80 @@ +/* + * jquery.layout 1.2.0 + * + * Copyright (c) 2008 + * Fabrizio Balliano (http://www.fabrizioballiano.net) + * Kevin Dalman (http://allpro.net) + * + * Dual licensed under the GPL (http://www.gnu.org/licenses/gpl.html) + * and MIT (http://www.opensource.org/licenses/mit-license.php) licenses. + * + * $Date: 2008-12-27 02:17:22 +0100 (sab, 27 dic 2008) $ + * $Rev: 203 $ + * + * NOTE: For best code readability, view this with a fixed-space font and tabs equal to 4-chars + */ +(function($){$.fn.layout=function(opts){var +prefix="ui-layout-",defaults={paneClass:prefix+"pane",resizerClass:prefix+"resizer",togglerClass:prefix+"toggler",togglerInnerClass:prefix+"",buttonClass:prefix+"button",contentSelector:"."+prefix+"content",contentIgnoreSelector:"."+prefix+"ignore"};var options={name:"",scrollToBookmarkOnLoad:true,defaults:{applyDefaultStyles:false,closable:true,resizable:true,slidable:true,contentSelector:defaults.contentSelector,contentIgnoreSelector:defaults.contentIgnoreSelector,paneClass:defaults.paneClass,resizerClass:defaults.resizerClass,togglerClass:defaults.togglerClass,buttonClass:defaults.buttonClass,resizerDragOpacity:1,maskIframesOnResize:true,minSize:0,maxSize:0,spacing_open:6,spacing_closed:6,togglerLength_open:50,togglerLength_closed:50,togglerAlign_open:"center",togglerAlign_closed:"center",togglerTip_open:"Close",togglerTip_closed:"Open",resizerTip:"Resize",sliderTip:"Slide Open",sliderCursor:"pointer",slideTrigger_open:"click",slideTrigger_close:"mouseout",hideTogglerOnSlide:false,togglerContent_open:"",togglerContent_closed:"",showOverflowOnHover:false,enableCursorHotkey:true,customHotkeyModifier:"SHIFT",fxName:"slide",fxSpeed:null,fxSettings:{},initClosed:false,initHidden:false},north:{paneSelector:"."+prefix+"north",size:"auto",resizerCursor:"n-resize"},south:{paneSelector:"."+prefix+"south",size:"auto",resizerCursor:"s-resize"},east:{paneSelector:"."+prefix+"east",size:200,resizerCursor:"e-resize"},west:{paneSelector:"."+prefix+"west",size:200,resizerCursor:"w-resize"},center:{paneSelector:"."+prefix+"center"}};var effects={slide:{all:{duration:"fast"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},drop:{all:{duration:"slow"},north:{direction:"up"},south:{direction:"down"},east:{direction:"right"},west:{direction:"left"}},scale:{all:{duration:"fast"}}};var config={allPanes:"north,south,east,west,center",borderPanes:"north,south,east,west",zIndex:{resizer_normal:1,pane_normal:2,mask:4,sliding:100,resizing:10000,animation:10000},resizers:{cssReq:{position:"absolute",padding:0,margin:0,fontSize:"1px",textAlign:"left",overflow:"hidden",zIndex:1},cssDef:{background:"#DDD",border:"none"}},togglers:{cssReq:{position:"absolute",display:"block",padding:0,margin:0,overflow:"hidden",textAlign:"center",fontSize:"1px",cursor:"pointer",zIndex:1},cssDef:{background:"#AAA"}},content:{cssReq:{overflow:"auto"},cssDef:{}},defaults:{cssReq:{position:"absolute",margin:0,zIndex:2},cssDef:{padding:"10px",background:"#FFF",border:"1px solid #BBB",overflow:"auto"}},north:{edge:"top",sizeType:"height",dir:"horz",cssReq:{top:0,bottom:"auto",left:0,right:0,width:"auto"}},south:{edge:"bottom",sizeType:"height",dir:"horz",cssReq:{top:"auto",bottom:0,left:0,right:0,width:"auto"}},east:{edge:"right",sizeType:"width",dir:"vert",cssReq:{left:"auto",right:0,top:"auto",bottom:"auto",height:"auto"}},west:{edge:"left",sizeType:"width",dir:"vert",cssReq:{left:0,right:"auto",top:"auto",bottom:"auto",height:"auto"}},center:{dir:"center",cssReq:{left:"auto",right:"auto",top:"auto",bottom:"auto",height:"auto",width:"auto"}}};var state={id:Math.floor(Math.random()*10000),container:{},north:{},south:{},east:{},west:{},center:{}};var +altEdge={top:"bottom",bottom:"top",left:"right",right:"left"},altSide={north:"south",south:"north",east:"west",west:"east"};var isStr=function(o){if(typeof o=="string")return true;else if(typeof o=="object"){try{var match=o.constructor.toString().match(/string/i);return(match!==null);}catch(e){}}return false;};var str=function(o){if(typeof o=="string"||isStr(o))return $.trim(o);else return o;};var min=function(x,y){return Math.min(x,y);};var max=function(x,y){return Math.max(x,y);};var transformData=function(d){var json={defaults:{fxSettings:{}},north:{fxSettings:{}},south:{fxSettings:{}},east:{fxSettings:{}},west:{fxSettings:{}},center:{fxSettings:{}}};d=d||{};if(d.effects||d.defaults||d.north||d.south||d.west||d.east||d.center)json=$.extend(json,d);else +$.each(d,function(key,val){a=key.split("__");json[a[1]?a[0]:"defaults"][a[1]?a[1]:a[0]]=val;});return json;};var setFlowCallback=function(action,pane,param){var +cb=action+","+pane+","+(param?1:0),cP,cbPane;$.each(c.borderPanes.split(","),function(i,p){if(c[p].isMoving){bindCallback(p);return false;}});function bindCallback(p,test){cP=c[p];if(!cP.doCallback){cP.doCallback=true;cP.callback=cb;}else{cpPane=cP.callback.split(",")[1];if(cpPane!=p&&cpPane!=pane)bindCallback(cpPane,true);}}};var execFlowCallback=function(pane){var cP=c[pane];c.isLayoutBusy=false;delete cP.isMoving;if(!cP.doCallback||!cP.callback)return;cP.doCallback=false;var +cb=cP.callback.split(","),param=(cb[2]>0?true:false);if(cb[0]=="open")open(cb[1],param);else if(cb[0]=="close")close(cb[1],param);if(!cP.doCallback)cP.callback=null;};var execUserCallback=function(pane,v_fn){if(!v_fn)return;var fn;try{if(typeof v_fn=="function")fn=v_fn;else if(typeof v_fn!="string")return;else if(v_fn.indexOf(",")>0){var +args=v_fn.split(","),fn=eval(args[0]);if(typeof fn=="function"&&args.length>1)return fn(args[1]);}else +fn=eval(v_fn);if(typeof fn=="function")return fn(pane,$Ps[pane],$.extend({},state[pane]),$.extend({},options[pane]),options.name);}catch(ex){}};var cssNum=function($E,prop){var +val=0,hidden=false,visibility="";if(!$.browser.msie){if($.curCSS($E[0],"display",true)=="none"){hidden=true;visibility=$.curCSS($E[0],"visibility",true);$E.css({display:"block",visibility:"hidden"});}}val=parseInt($.curCSS($E[0],prop,true),10)||0;if(hidden){$E.css({display:"none"});if(visibility&&visibility!="hidden")$E.css({visibility:visibility});}return val;};var cssW=function(e,outerWidth){var $E;if(isStr(e)){e=str(e);$E=$Ps[e];}else +$E=$(e);if(outerWidth<=0)return 0;else if(!(outerWidth>0))outerWidth=isStr(e)?getPaneSize(e):$E.outerWidth();if(!$.boxModel)return outerWidth;else +return outerWidth +-cssNum($E,"paddingLeft")-cssNum($E,"paddingRight")-($.curCSS($E[0],"borderLeftStyle",true)=="none"?0:cssNum($E,"borderLeftWidth"))-($.curCSS($E[0],"borderRightStyle",true)=="none"?0:cssNum($E,"borderRightWidth"));};var cssH=function(e,outerHeight){var $E;if(isStr(e)){e=str(e);$E=$Ps[e];}else +$E=$(e);if(outerHeight<=0)return 0;else if(!(outerHeight>0))outerHeight=(isStr(e))?getPaneSize(e):$E.outerHeight();if(!$.boxModel)return outerHeight;else +return outerHeight +-cssNum($E,"paddingTop")-cssNum($E,"paddingBottom")-($.curCSS($E[0],"borderTopStyle",true)=="none"?0:cssNum($E,"borderTopWidth"))-($.curCSS($E[0],"borderBottomStyle",true)=="none"?0:cssNum($E,"borderBottomWidth"));};var cssSize=function(pane,outerSize){if(c[pane].dir=="horz")return cssH(pane,outerSize);else +return cssW(pane,outerSize);};var getPaneSize=function(pane,inclSpace){var +$P=$Ps[pane],o=options[pane],s=state[pane],oSp=(inclSpace?o.spacing_open:0),cSp=(inclSpace?o.spacing_closed:0);if(!$P||s.isHidden)return 0;else if(s.isClosed||(s.isSliding&&inclSpace))return cSp;else if(c[pane].dir=="horz")return $P.outerHeight()+oSp;else +return $P.outerWidth()+oSp;};var setPaneMinMaxSizes=function(pane){var +d=cDims,edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$altPane=$Ps[altSide[pane]],paneSpacing=o.spacing_open,altPaneSpacing=options[altSide[pane]].spacing_open,altPaneSize=(!$altPane?0:(dir=="horz"?$altPane.outerHeight():$altPane.outerWidth())),containerSize=(dir=="horz"?d.innerHeight:d.innerWidth),limitSize=containerSize-paneSpacing-altPaneSize-altPaneSpacing,minSize=s.minSize||0,maxSize=Math.min(s.maxSize||9999,limitSize),minPos,maxPos;switch(pane){case"north":minPos=d.offsetTop+minSize;maxPos=d.offsetTop+maxSize;break;case"west":minPos=d.offsetLeft+minSize;maxPos=d.offsetLeft+maxSize;break;case"south":minPos=d.offsetTop+d.innerHeight-maxSize;maxPos=d.offsetTop+d.innerHeight-minSize;break;case"east":minPos=d.offsetLeft+d.innerWidth-maxSize;maxPos=d.offsetLeft+d.innerWidth-minSize;break;}$.extend(s,{minSize:minSize,maxSize:maxSize,minPosition:minPos,maxPosition:maxPos});};var getPaneDims=function(){var d={top:getPaneSize("north",true),bottom:getPaneSize("south",true),left:getPaneSize("west",true),right:getPaneSize("east",true),width:0,height:0};with(d){width=cDims.innerWidth-left-right;height=cDims.innerHeight-bottom-top;top+=cDims.top;bottom+=cDims.bottom;left+=cDims.left;right+=cDims.right;}return d;};var getElemDims=function($E){var +d={},e,b,p;$.each("Left,Right,Top,Bottom".split(","),function(){e=str(this);b=d["border"+e]=cssNum($E,"border"+e+"Width");p=d["padding"+e]=cssNum($E,"padding"+e);d["offset"+e]=b+p;if($E==$Container)d[e.toLowerCase()]=($.boxModel?p:0);});d.innerWidth=d.outerWidth=$E.outerWidth();d.innerHeight=d.outerHeight=$E.outerHeight();if($.boxModel){d.innerWidth-=(d.offsetLeft+d.offsetRight);d.innerHeight-=(d.offsetTop+d.offsetBottom);}return d;};var setTimer=function(pane,action,fn,ms){var +Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name])return;else Timers[name]=setTimeout(fn,ms);};var clearTimer=function(pane,action){var +Layout=window.layout=window.layout||{},Timers=Layout.timers=Layout.timers||{},name="layout_"+state.id+"_"+pane+"_"+action;if(Timers[name]){clearTimeout(Timers[name]);delete Timers[name];return true;}else +return false;};var create=function(){initOptions();initContainer();initPanes();initHandles();initResizable();sizeContent("all");if(options.scrollToBookmarkOnLoad)with(self.location)if(hash)replace(hash);initHotkeys();$(window).resize(function(){var timerID="timerLayout_"+state.id;if(window[timerID])clearTimeout(window[timerID]);window[timerID]=null;if(true||$.browser.msie)window[timerID]=setTimeout(resizeAll,100);else +resizeAll();});};var initContainer=function(){try{if($Container[0].tagName=="BODY"){$("html").css({height:"100%",overflow:"hidden"});$("body").css({position:"relative",height:"100%",overflow:"hidden",margin:0,padding:0,border:"none"});}else{var +CSS={overflow:"hidden"},p=$Container.css("position"),h=$Container.css("height");if(!$Container.hasClass("ui-layout-pane")){if(!p||"fixed,absolute,relative".indexOf(p)<0)CSS.position="relative";if(!h||h=="auto")CSS.height="100%";}$Container.css(CSS);}}catch(ex){}cDims=state.container=getElemDims($Container);};var initHotkeys=function(){$.each(c.borderPanes.split(","),function(i,pane){var o=options[pane];if(o.enableCursorHotkey||o.customHotkey){$(document).keydown(keyDown);return false;}});};var initOptions=function(){opts=transformData(opts);if(opts.effects){$.extend(effects,opts.effects);delete opts.effects;}$.each("name,scrollToBookmarkOnLoad".split(","),function(idx,key){if(opts[key]!==undefined)options[key]=opts[key];else if(opts.defaults[key]!==undefined){options[key]=opts.defaults[key];delete opts.defaults[key];}});$.each("paneSelector,resizerCursor,customHotkey".split(","),function(idx,key){delete opts.defaults[key];});$.extend(options.defaults,opts.defaults);c.center=$.extend(true,{},c.defaults,c.center);$.extend(options.center,opts.center);var o_Center=$.extend(true,{},options.defaults,opts.defaults,options.center);$.each("paneClass,contentSelector,contentIgnoreSelector,applyDefaultStyles,showOverflowOnHover".split(","),function(idx,key){options.center[key]=o_Center[key];});var defs=options.defaults;$.each(c.borderPanes.split(","),function(i,pane){c[pane]=$.extend(true,{},c.defaults,c[pane]);o=options[pane]=$.extend(true,{},options.defaults,options[pane],opts.defaults,opts[pane]);if(!o.paneClass)o.paneClass=defaults.paneClass;if(!o.resizerClass)o.resizerClass=defaults.resizerClass;if(!o.togglerClass)o.togglerClass=defaults.togglerClass;$.each(["_open","_close",""],function(i,n){var +sName="fxName"+n,sSpeed="fxSpeed"+n,sSettings="fxSettings"+n;o[sName]=opts[pane][sName]||opts[pane].fxName||opts.defaults[sName]||opts.defaults.fxName||o[sName]||o.fxName||defs[sName]||defs.fxName||"none";var fxName=o[sName];if(fxName=="none"||!$.effects||!$.effects[fxName]||(!effects[fxName]&&!o[sSettings]&&!o.fxSettings))fxName=o[sName]="none";var +fx=effects[fxName]||{},fx_all=fx.all||{},fx_pane=fx[pane]||{};o[sSettings]=$.extend({},fx_all,fx_pane,defs.fxSettings||{},defs[sSettings]||{},o.fxSettings,o[sSettings],opts.defaults.fxSettings,opts.defaults[sSettings]||{},opts[pane].fxSettings,opts[pane][sSettings]||{});o[sSpeed]=opts[pane][sSpeed]||opts[pane].fxSpeed||opts.defaults[sSpeed]||opts.defaults.fxSpeed||o[sSpeed]||o[sSettings].duration||o.fxSpeed||o.fxSettings.duration||defs.fxSpeed||defs.fxSettings.duration||fx_pane.duration||fx_all.duration||"normal";});});};var initPanes=function(){$.each(c.allPanes.split(","),function(){var +pane=str(this),o=options[pane],s=state[pane],fx=s.fx,dir=c[pane].dir,size=o.size=="auto"||isNaN(o.size)?0:o.size,minSize=o.minSize||1,maxSize=o.maxSize||9999,spacing=o.spacing_open||0,sel=o.paneSelector,isIE6=($.browser.msie&&$.browser.version<7),CSS={},$P,$C;$Cs[pane]=false;if(sel.substr(0,1)==="#")$P=$Ps[pane]=$Container.find(sel+":first");else{$P=$Ps[pane]=$Container.children(sel+":first");if(!$P.length)$P=$Ps[pane]=$Container.children("form:first").children(sel+":first");}if(!$P.length){$Ps[pane]=false;return true;}$P.attr("pane",pane).addClass(o.paneClass+" "+o.paneClass+"-"+pane);if(pane!="center"){s.isClosed=false;s.isSliding=false;s.isResizing=false;s.isHidden=false;s.noRoom=false;c[pane].pins=[];}CSS=$.extend({visibility:"visible",display:"block"},c.defaults.cssReq,c[pane].cssReq);if(o.applyDefaultStyles)$.extend(CSS,c.defaults.cssDef,c[pane].cssDef);$P.css(CSS);CSS={};switch(pane){case"north":CSS.top=cDims.top;CSS.left=cDims.left;CSS.right=cDims.right;break;case"south":CSS.bottom=cDims.bottom;CSS.left=cDims.left;CSS.right=cDims.right;break;case"west":CSS.left=cDims.left;break;case"east":CSS.right=cDims.right;break;case"center":}if(dir=="horz"){if(size===0||size=="auto"){$P.css({height:"auto"});size=$P.outerHeight();}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerHeight-spacing);CSS.height=max(1,cssH(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.height+1);$P.css(CSS);}else if(dir=="vert"){if(size===0||size=="auto"){$P.css({width:"auto",float:"left"});size=$P.outerWidth();$P.css({float:"none"});}size=max(size,minSize);size=min(size,maxSize);size=min(size,cDims.innerWidth-spacing);CSS.width=max(1,cssW(pane,size));s.size=size;s.maxSize=maxSize;s.minSize=max(minSize,size-CSS.width+1);$P.css(CSS);sizeMidPanes(pane,null,true);}else if(pane=="center"){$P.css(CSS);sizeMidPanes("center",null,true);}if(o.initClosed&&o.closable){$P.hide().addClass("closed");s.isClosed=true;}else if(o.initHidden||o.initClosed){hide(pane,true);s.isHidden=true;}else +$P.addClass("open");if(o.showOverflowOnHover)$P.hover(allowOverflow,resetOverflow);if(o.contentSelector){$C=$Cs[pane]=$P.children(o.contentSelector+":first");if(!$C.length){$Cs[pane]=false;return true;}$C.css(c.content.cssReq);if(o.applyDefaultStyles)$C.css(c.content.cssDef);$P.css({overflow:"hidden"});}});};var initHandles=function(){$.each(c.borderPanes.split(","),function(){var +pane=str(this),o=options[pane],s=state[pane],rClass=o.resizerClass,tClass=o.togglerClass,$P=$Ps[pane];$Rs[pane]=false;$Ts[pane]=false;if(!$P||(!o.closable&&!o.resizable))return;var +edge=c[pane].edge,isOpen=$P.is(":visible"),spacing=(isOpen?o.spacing_open:o.spacing_closed),_pane="-"+pane,_state=(isOpen?"-open":"-closed"),$R,$T;$R=$Rs[pane]=$("");if(isOpen&&o.resizable);else if(!isOpen&&o.slidable)$R.attr("title",o.sliderTip).css("cursor",o.sliderCursor);$R.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-resizer":"")).attr("resizer",pane).css(c.resizers.cssReq).css(edge,cDims[edge]+getPaneSize(pane)).addClass(rClass+" "+rClass+_pane+" "+rClass+_state+" "+rClass+_pane+_state).appendTo($Container);if(o.applyDefaultStyles)$R.css(c.resizers.cssDef);if(o.closable){$T=$Ts[pane]=$("
    ");$T.attr("id",(o.paneSelector.substr(0,1)=="#"?o.paneSelector.substr(1)+"-toggler":"")).css(c.togglers.cssReq).attr("title",(isOpen?o.togglerTip_open:o.togglerTip_closed)).click(function(evt){toggle(pane);evt.stopPropagation();}).mouseover(function(evt){evt.stopPropagation();}).addClass(tClass+" "+tClass+_pane+" "+tClass+_state+" "+tClass+_pane+_state).appendTo($R);if(o.togglerContent_open)$(""+o.togglerContent_open+"").addClass("content content-open").css("display",s.isClosed?"none":"block").appendTo($T);if(o.togglerContent_closed)$(""+o.togglerContent_closed+"").addClass("content content-closed").css("display",s.isClosed?"block":"none").appendTo($T);if(o.applyDefaultStyles)$T.css(c.togglers.cssDef);if(!isOpen)bindStartSlidingEvent(pane,true);}});sizeHandles("all",true);};var initResizable=function(){var +draggingAvailable=(typeof $.fn.draggable=="function"),minPosition,maxPosition,edge;$.each(c.borderPanes.split(","),function(){var +pane=str(this),o=options[pane],s=state[pane];if(!draggingAvailable||!$Ps[pane]||!o.resizable){o.resizable=false;return true;}var +rClass=o.resizerClass,dragClass=rClass+"-drag",dragPaneClass=rClass+"-"+pane+"-drag",draggingClass=rClass+"-dragging",draggingPaneClass=rClass+"-"+pane+"-dragging",draggingClassSet=false,$P=$Ps[pane],$R=$Rs[pane];if(!s.isClosed)$R.attr("title",o.resizerTip).css("cursor",o.resizerCursor);$R.draggable({containment:$Container[0],axis:(c[pane].dir=="horz"?"y":"x"),delay:200,distance:1,helper:"clone",opacity:o.resizerDragOpacity,zIndex:c.zIndex.resizing,start:function(e,ui){if(false===execUserCallback(pane,o.onresize_start))return false;s.isResizing=true;clearTimer(pane,"closeSlider");$R.addClass(dragClass+" "+dragPaneClass);draggingClassSet=false;var resizerWidth=(pane=="east"||pane=="south"?o.spacing_open:0);setPaneMinMaxSizes(pane);s.minPosition-=resizerWidth;s.maxPosition-=resizerWidth;edge=(c[pane].dir=="horz"?"top":"left");$(o.maskIframesOnResize===true?"iframe":o.maskIframesOnResize).each(function(){$('
    ').css({background:"#fff",opacity:"0.001",zIndex:9,position:"absolute",width:this.offsetWidth+"px",height:this.offsetHeight+"px"}).css($(this).offset()).appendTo(this.parentNode);});},drag:function(e,ui){if(!draggingClassSet){$(".ui-draggable-dragging").addClass(draggingClass+" "+draggingPaneClass).children().css("visibility","hidden");draggingClassSet=true;if(s.isSliding)$Ps[pane].css("zIndex",c.zIndex.sliding);}if(ui.position[edge]s.maxPosition)ui.position[edge]=s.maxPosition;},stop:function(e,ui){var +dragPos=ui.position,resizerPos,newSize;$R.removeClass(dragClass+" "+dragPaneClass);switch(pane){case"north":resizerPos=dragPos.top;break;case"west":resizerPos=dragPos.left;break;case"south":resizerPos=cDims.outerHeight-dragPos.top-$R.outerHeight();break;case"east":resizerPos=cDims.outerWidth-dragPos.left-$R.outerWidth();break;}newSize=resizerPos-cDims[c[pane].edge];sizePane(pane,newSize);$("div.ui-layout-mask").remove();s.isResizing=false;}});});};var hide=function(pane,onInit){var +o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||s.isHidden)return;if(false===execUserCallback(pane,o.onhide_start))return;s.isSliding=false;if($R)$R.hide();if(onInit||s.isClosed){s.isClosed=true;s.isHidden=true;$P.hide();sizeMidPanes(c[pane].dir=="horz"?"all":"center");execUserCallback(pane,o.onhide_end||o.onhide);}else{s.isHiding=true;close(pane,false);}};var show=function(pane,openPane){var +o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];if(!$P||!s.isHidden)return;if(false===execUserCallback(pane,o.onshow_start))return;s.isSliding=false;s.isShowing=true;if($R&&o.spacing_open>0)$R.show();if(openPane===false)close(pane,true);else +open(pane);};var toggle=function(pane){var s=state[pane];if(s.isHidden)show(pane);else if(s.isClosed)open(pane);else +close(pane);};var close=function(pane,force,noAnimation){var +$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&!s.isClosed&&(o.fxName_close!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_sliding="-sliding",_closed="-closed",isShowing=s.isShowing,isHiding=s.isHiding;delete s.isShowing;delete s.isHiding;if(!$P||(!o.resizable&&!o.closable))return;else if(!force&&s.isClosed&&!isShowing)return;if(c.isLayoutBusy){setFlowCallback("close",pane,force);return;}if(!isShowing&&false===execUserCallback(pane,o.onclose_start))return;c[pane].isMoving=true;c.isLayoutBusy=true;s.isClosed=true;if(isHiding)s.isHidden=true;else if(isShowing)s.isHidden=false;syncPinBtns(pane,false);if(!s.isSliding)sizeMidPanes(c[pane].dir=="horz"?"all":"center");if($R){$R.css(edge,cDims[edge]).removeClass(rClass+_open+" "+rClass+_pane+_open).removeClass(rClass+_sliding+" "+rClass+_pane+_sliding).addClass(rClass+_closed+" "+rClass+_pane+_closed);if(o.resizable)$R.draggable("disable").css("cursor","default").attr("title","");if($T){$T.removeClass(tClass+_open+" "+tClass+_pane+_open).addClass(tClass+_closed+" "+tClass+_pane+_closed).attr("title",o.togglerTip_closed);}sizeHandles();}if(doFX){lockPaneForFX(pane,true);$P.hide(o.fxName_close,o.fxSettings_close,o.fxSpeed_close,function(){lockPaneForFX(pane,false);if(!s.isClosed)return;close_2();});}else{$P.hide();close_2();}function close_2(){bindStartSlidingEvent(pane,true);if(!isShowing)execUserCallback(pane,o.onclose_end||o.onclose);if(isShowing)execUserCallback(pane,o.onshow_end||o.onshow);if(isHiding)execUserCallback(pane,o.onhide_end||o.onhide);execFlowCallback(pane);}};var open=function(pane,slide,noAnimation){var +$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane],o=options[pane],s=state[pane],doFX=!noAnimation&&s.isClosed&&(o.fxName_open!="none"),edge=c[pane].edge,rClass=o.resizerClass,tClass=o.togglerClass,_pane="-"+pane,_open="-open",_closed="-closed",_sliding="-sliding",isShowing=s.isShowing;delete s.isShowing;if(!$P||(!o.resizable&&!o.closable))return;else if(!s.isClosed&&!s.isSliding)return;if(s.isHidden&&!isShowing){show(pane,true);return;}if(c.isLayoutBusy){setFlowCallback("open",pane,slide);return;}if(false===execUserCallback(pane,o.onopen_start))return;c[pane].isMoving=true;c.isLayoutBusy=true;if(s.isSliding&&!slide)bindStopSlidingEvents(pane,false);s.isClosed=false;if(isShowing)s.isHidden=false;setPaneMinMaxSizes(pane);if(s.size>s.maxSize)$P.css(c[pane].sizeType,max(1,cssSize(pane,s.maxSize)));bindStartSlidingEvent(pane,false);if(doFX){lockPaneForFX(pane,true);$P.show(o.fxName_open,o.fxSettings_open,o.fxSpeed_open,function(){lockPaneForFX(pane,false);if(s.isClosed)return;open_2();});}else{$P.show();open_2();}function open_2(){if(!s.isSliding)sizeMidPanes(c[pane].dir=="vert"?"center":"all");if($R){$R.css(edge,cDims[edge]+getPaneSize(pane)).removeClass(rClass+_closed+" "+rClass+_pane+_closed).addClass(rClass+_open+" "+rClass+_pane+_open).addClass(!s.isSliding?"":rClass+_sliding+" "+rClass+_pane+_sliding);if(o.resizable)$R.draggable("enable").css("cursor",o.resizerCursor).attr("title",o.resizerTip);else +$R.css("cursor","default");if($T){$T.removeClass(tClass+_closed+" "+tClass+_pane+_closed).addClass(tClass+_open+" "+tClass+_pane+_open).attr("title",o.togglerTip_open);}sizeHandles("all");}sizeContent(pane);syncPinBtns(pane,!s.isSliding);execUserCallback(pane,o.onopen_end||o.onopen);if(isShowing)execUserCallback(pane,o.onshow_end||o.onshow);execFlowCallback(pane);}};var lockPaneForFX=function(pane,doLock){var $P=$Ps[pane];if(doLock){$P.css({zIndex:c.zIndex.animation});if(pane=="south")$P.css({top:cDims.top+cDims.innerHeight-$P.outerHeight()});else if(pane=="east")$P.css({left:cDims.left+cDims.innerWidth-$P.outerWidth()});}else{if(!state[pane].isSliding)$P.css({zIndex:c.zIndex.pane_normal});if(pane=="south")$P.css({top:"auto"});else if(pane=="east")$P.css({left:"auto"});}};var bindStartSlidingEvent=function(pane,enable){var +o=options[pane],$R=$Rs[pane],trigger=o.slideTrigger_open;if(!$R||!o.slidable)return;if(trigger!="click"&&trigger!="dblclick"&&trigger!="mouseover")trigger="click";$R +[enable?"bind":"unbind"](trigger,slideOpen).css("cursor",(enable?o.sliderCursor:"default")).attr("title",(enable?o.sliderTip:""));};var bindStopSlidingEvents=function(pane,enable){var +o=options[pane],s=state[pane],trigger=o.slideTrigger_close,action=(enable?"bind":"unbind"),$P=$Ps[pane],$R=$Rs[pane];s.isSliding=enable;clearTimer(pane,"closeSlider");$P.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.pane_normal)});$R.css({zIndex:(enable?c.zIndex.sliding:c.zIndex.resizer_normal)});if(trigger!="click"&&trigger!="mouseout")trigger="mouseout";if(enable){$P.bind(trigger,slideClosed);$R.bind(trigger,slideClosed);if(trigger="mouseout"){$P.bind("mouseover",cancelMouseOut);$R.bind("mouseover",cancelMouseOut);}}else{$P.unbind(trigger);$R.unbind(trigger);if(trigger="mouseout"){$P.unbind("mouseover");$R.unbind("mouseover");clearTimer(pane,"closeSlider");}}function cancelMouseOut(evt){clearTimer(pane,"closeSlider");evt.stopPropagation();}};var slideOpen=function(){var pane=$(this).attr("resizer");if(state[pane].isClosed){bindStopSlidingEvents(pane,true);open(pane,true);}};var slideClosed=function(){var +$E=$(this),pane=$E.attr("pane")||$E.attr("resizer"),o=options[pane],s=state[pane];if(s.isClosed||s.isResizing)return;else if(o.slideTrigger_close=="click")close_NOW();else +setTimer(pane,"closeSlider",close_NOW,300);function close_NOW(){bindStopSlidingEvents(pane,false);if(!s.isClosed)close(pane);}};var sizePane=function(pane,size){var +edge=c[pane].edge,dir=c[pane].dir,o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane];setPaneMinMaxSizes(pane);s.minSize=max(s.minSize,o.minSize);if(o.maxSize>0)s.maxSize=min(s.maxSize,o.maxSize);size=max(size,s.minSize);size=min(size,s.maxSize);s.size=size;$R.css(edge,size+cDims[edge]);$P.css(c[pane].sizeType,max(1,cssSize(pane,size)));if(!s.isSliding)sizeMidPanes(dir=="horz"?"all":"center");sizeHandles();sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize);};var sizeMidPanes=function(panes,overrideDims,onInit){if(!panes||panes=="all")panes="east,west,center";var d=getPaneDims();if(overrideDims)$.extend(d,overrideDims);$.each(panes.split(","),function(){if(!$Ps[this])return;var +pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],hasRoom=true,CSS={};if(pane=="center"){d=getPaneDims();CSS=$.extend({},d);CSS.width=max(1,cssW(pane,CSS.width));CSS.height=max(1,cssH(pane,CSS.height));hasRoom=(CSS.width>1&&CSS.height>1);if($.browser.msie&&(!$.boxModel||$.browser.version<7)){if($Ps.north)$Ps.north.css({width:cssW($Ps.north,cDims.innerWidth)});if($Ps.south)$Ps.south.css({width:cssW($Ps.south,cDims.innerWidth)});}}else{CSS.top=d.top;CSS.bottom=d.bottom;CSS.height=max(1,cssH(pane,d.height));hasRoom=(CSS.height>1);}if(hasRoom){$P.css(CSS);if(s.noRoom){s.noRoom=false;if(s.isHidden)return;else show(pane,!s.isClosed);}if(!onInit){sizeContent(pane);execUserCallback(pane,o.onresize_end||o.onresize);}}else if(!s.noRoom){s.noRoom=true;if(s.isHidden)return;if(onInit){$P.hide();if($R)$R.hide();}else hide(pane);}});};var sizeContent=function(panes){if(!panes||panes=="all")panes=c.allPanes;$.each(panes.split(","),function(){if(!$Cs[this])return;var +pane=str(this),ignore=options[pane].contentIgnoreSelector,$P=$Ps[pane],$C=$Cs[pane],e_C=$C[0],height=cssH($P);;$P.children().each(function(){if(this==e_C)return;var $E=$(this);if(!ignore||!$E.is(ignore))height-=$E.outerHeight();});if(height>0)height=cssH($C,height);if(height<1)$C.hide();else +$C.css({height:height}).show();});};var sizeHandles=function(panes,onInit){if(!panes||panes=="all")panes=c.borderPanes;$.each(panes.split(","),function(){var +pane=str(this),o=options[pane],s=state[pane],$P=$Ps[pane],$R=$Rs[pane],$T=$Ts[pane];if(!$P||!$R||(!o.resizable&&!o.closable))return;var +dir=c[pane].dir,_state=(s.isClosed?"_closed":"_open"),spacing=o["spacing"+_state],togAlign=o["togglerAlign"+_state],togLen=o["togglerLength"+_state],paneLen,offset,CSS={};if(spacing==0){$R.hide();return;}else if(!s.noRoom&&!s.isHidden)$R.show();if(dir=="horz"){paneLen=$P.outerWidth();$R.css({width:max(1,cssW($R,paneLen)),height:max(1,cssH($R,spacing)),left:cssNum($P,"left")});}else{paneLen=$P.outerHeight();$R.css({height:max(1,cssH($R,paneLen)),width:max(1,cssW($R,spacing)),top:cDims.top+getPaneSize("north",true)});}if($T){if(togLen==0||(s.isSliding&&o.hideTogglerOnSlide)){$T.hide();return;}else +$T.show();if(!(togLen>0)||togLen=="100%"||togLen>paneLen){togLen=paneLen;offset=0;}else{if(typeof togAlign=="string"){switch(togAlign){case"top":case"left":offset=0;break;case"bottom":case"right":offset=paneLen-togLen;break;case"middle":case"center":default:offset=Math.floor((paneLen-togLen)/2);}}else{var x=parseInt(togAlign);if(togAlign>=0)offset=x;else offset=paneLen-togLen+x;}}var +$TC_o=(o.togglerContent_open?$T.children(".content-open"):false),$TC_c=(o.togglerContent_closed?$T.children(".content-closed"):false),$TC=(s.isClosed?$TC_c:$TC_o);if($TC_o)$TC_o.css("display",s.isClosed?"none":"block");if($TC_c)$TC_c.css("display",s.isClosed?"block":"none");if(dir=="horz"){var width=cssW($T,togLen);$T.css({width:max(0,width),height:max(1,cssH($T,spacing)),left:offset});if($TC)$TC.css("marginLeft",Math.floor((width-$TC.outerWidth())/2));}else{var height=cssH($T,togLen);$T.css({height:max(0,height),width:max(1,cssW($T,spacing)),top:offset});if($TC)$TC.css("marginTop",Math.floor((height-$TC.outerHeight())/2));}}if(onInit&&o.initHidden){$R.hide();if($T)$T.hide();}});};var resizeAll=function(){var +oldW=cDims.innerWidth,oldH=cDims.innerHeight;cDims=state.container=getElemDims($Container);var +checkH=(cDims.innerHeights.maxSize)sizePane(pane,s.maxSize);}});sizeMidPanes("all");sizeHandles("all");};function keyDown(evt){if(!evt)return true;var code=evt.keyCode;if(code<33)return true;var +PANE={38:"north",40:"south",37:"west",39:"east"},isCursorKey=(code>=37&&code<=40),ALT=evt.altKey,SHIFT=evt.shiftKey,CTRL=evt.ctrlKey,pane=false,s,o,k,m,el;if(!CTRL&&!SHIFT)return true;else if(isCursorKey&&options[PANE[code]].enableCursorHotkey)pane=PANE[code];else +$.each(c.borderPanes.split(","),function(i,p){o=options[p];k=o.customHotkey;m=o.customHotkeyModifier;if((SHIFT&&m=="SHIFT")||(CTRL&&m=="CTRL")||(CTRL&&SHIFT)){if(k&&code==(isNaN(k)||k<=9?k.toUpperCase().charCodeAt(0):k)){pane=p;return false;}}});if(!pane)return true;o=options[pane];s=state[pane];if(!o.enableCursorHotkey||s.isHidden||!$Ps[pane])return true;el=evt.target||evt.srcElement;if(el&&SHIFT&&isCursorKey&&(el.tagName=="TEXTAREA"||(el.tagName=="INPUT"&&(code==37||code==39))))return true;toggle(pane);evt.stopPropagation();evt.returnValue=false;return false;};function allowOverflow(elem){if(this&&this.tagName)elem=this;var $P;if(typeof elem=="string")$P=$Ps[elem];else{if($(elem).attr("pane"))$P=$(elem);else $P=$(elem).parents("div[pane]:first");}if(!$P.length)return;var +pane=$P.attr("pane"),s=state[pane];if(s.cssSaved)resetOverflow(pane);if(s.isSliding||s.isResizing||s.isClosed){s.cssSaved=false;return;}var +newCSS={zIndex:(c.zIndex.pane_normal+1)},curCSS={},of=$P.css("overflow"),ofX=$P.css("overflowX"),ofY=$P.css("overflowY");if(of!="visible"){curCSS.overflow=of;newCSS.overflow="visible";}if(ofX&&ofX!="visible"&&ofX!="auto"){curCSS.overflowX=ofX;newCSS.overflowX="visible";}if(ofY&&ofY!="visible"&&ofY!="auto"){curCSS.overflowY=ofX;newCSS.overflowY="visible";}s.cssSaved=curCSS;$P.css(newCSS);$.each(c.allPanes.split(","),function(i,p){if(p!=pane)resetOverflow(p);});};function resetOverflow(elem){if(this&&this.tagName)elem=this;var $P;if(typeof elem=="string")$P=$Ps[elem];else{if($(elem).hasClass("ui-layout-pane"))$P=$(elem);else $P=$(elem).parents("div[pane]:first");}if(!$P.length)return;var +pane=$P.attr("pane"),s=state[pane],CSS=s.cssSaved||{};if(!s.isSliding&&!s.isResizing)$P.css("zIndex",c.zIndex.pane_normal);$P.css(CSS);s.cssSaved=false;};function getBtn(selector,pane,action){var +$E=$(selector),err="Error Adding Button \n\nInvalid ";if(!$E.length)alert(err+"selector: "+selector);else if(c.borderPanes.indexOf(pane)==-1)alert(err+"pane: "+pane);else{var btn=options[pane].buttonClass+"-"+action;$E.addClass(btn+" "+btn+"-"+pane);return $E;}return false;};function addToggleBtn(selector,pane){var $E=getBtn(selector,pane,"toggle");if($E)$E.attr("title",state[pane].isClosed?"Open":"Close").click(function(evt){toggle(pane);evt.stopPropagation();});};function addOpenBtn(selector,pane){var $E=getBtn(selector,pane,"open");if($E)$E.attr("title","Open").click(function(evt){open(pane);evt.stopPropagation();});};function addCloseBtn(selector,pane){var $E=getBtn(selector,pane,"close");if($E)$E.attr("title","Close").click(function(evt){close(pane);evt.stopPropagation();});};function addPinBtn(selector,pane){var $E=getBtn(selector,pane,"pin");if($E){var s=state[pane];$E.click(function(evt){setPinState($(this),pane,(s.isSliding||s.isClosed));if(s.isSliding||s.isClosed)open(pane);else close(pane);evt.stopPropagation();});setPinState($E,pane,(!s.isClosed&&!s.isSliding));c[pane].pins.push(selector);}};function syncPinBtns(pane,doPin){$.each(c[pane].pins,function(i,selector){setPinState($(selector),pane,doPin);});};function setPinState($Pin,pane,doPin){var updown=$Pin.attr("pin");if(updown&&doPin==(updown=="down"))return;var +root=options[pane].buttonClass,class1=root+"-pin",class2=class1+"-"+pane,UP1=class1+"-up",UP2=class2+"-up",DN1=class1+"-down",DN2=class2+"-down";$Pin.attr("pin",doPin?"down":"up").attr("title",doPin?"Un-Pin":"Pin").removeClass(doPin?UP1:DN1).removeClass(doPin?UP2:DN2).addClass(doPin?DN1:UP1).addClass(doPin?DN2:UP2);};var +$Container=$(this).css({overflow:"hidden"}),$Ps={},$Cs={},$Rs={},$Ts={},c=config,cDims=state.container;create();return{options:options,state:state,panes:$Ps,toggle:toggle,open:open,close:close,hide:hide,show:show,resizeContent:sizeContent,sizePane:sizePane,resizeAll:resizeAll,addToggleBtn:addToggleBtn,addOpenBtn:addOpenBtn,addCloseBtn:addCloseBtn,addPinBtn:addPinBtn,allowOverflow:allowOverflow,resetOverflow:resetOverflow,cssWidth:cssW,cssHeight:cssH};}})(jQuery); \ No newline at end of file diff --git a/src/sunstone/public/js/layout.js b/src/sunstone/public/js/layout.js new file mode 100755 index 0000000000..fd1da90ed4 --- /dev/null +++ b/src/sunstone/public/js/layout.js @@ -0,0 +1,102 @@ +/* -------------------------------------------------------------------------- */ +/* 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("south"); +} + +function popDialog(content){ + $("#dialog").html(content); + innerLayout.open("south"); +} + +function popDialogLoading(){ + var loading = '
    loading...
    '; + 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 a").click(function(){ + var tab = $(this).attr('href'); + showTab(tab); + return false; + }) + + outerLayout = $('body').layout({ + applyDefaultStyles: false + , center__paneSelector: ".outer-center" + , west__paneSelector: ".outer-west" + , west__size: 130 + , 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.6; + var dialog_height = Math.floor($(".outer-center").height()*factor); + + innerLayout = $('div.outer-center').layout({ + fxName: "slide" + , initClosed: true + , center__paneSelector: ".inner-center" + , south__paneSelector: ".inner-south" + , south__size: dialog_height + , spacing_open: 8 // ALL panes + , spacing_closed: 12 // ALL panes + }); + + showTab("#dashboard"); +}); + diff --git a/src/sunstone/public/js/login.js b/src/sunstone/public/js/login.js new file mode 100644 index 0000000000..48de29347a --- /dev/null +++ b/src/sunstone/public/js/login.js @@ -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 = "/"; +} + +function auth_error(req, error){ + + var status = error.error.http_status; + + switch (status){ + case 401: + $("#one_error").hide(); + $("#auth_error").show(); + break; + case 500: + $("#auth_error").hide(); + $("#one_error").show(); + break; + } +} + +function authenticate(){ + var username = $("#username").val(); + var password = $("#password").val(); + var remember = $("#check_remember").is(":checked"); + + OpenNebula.Auth.login({ data: {username: username + , password: password} + , remember: remember + , success: auth_success + , error: auth_error + }); +} + +function logout(){ + OpenNebula.Auth.logout(); +} + + +$(document).ready(function(){ + $("#login_btn").click(function () { + authenticate(); + }); + + $("input").keydown(function (e){ + if (e.keyCode == 13) { + authenticate(); + } + }); + + $("#logout_btn").click(function () { + logout(); + }); + + $("input#username.box").get(0).focus(); +}); diff --git a/src/sunstone/public/js/one-ui_views.js b/src/sunstone/public/js/one-ui_views.js new file mode 100644 index 0000000000..b3b5cbc7a7 --- /dev/null +++ b/src/sunstone/public/js/one-ui_views.js @@ -0,0 +1,3215 @@ +/* -------------------------------------------------------------------------- */ +/* 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. */ +/* -------------------------------------------------------------------------- */ + + +/*###################################################################### + * GLOBAL VARIABLES + * ###################################################################*/ + +var dataTable_hosts=null; +//~ var dataTable_clusters=null; +var dataTable_vMachines=null; +var dataTable_vNetworks=null; +var dataTable_users=null; +var dataTable_images=null; +var host_list_json = {}; +var cluster_list_json = {}; +var vmachine_list_json = {}; +var network_list_json = {}; +var user_list_json = {}; +var image_list_json = {}; +var hosts_select=""; +var clusters_select=""; +var vnetworks_select=""; +var images_select=""; +var cookie = {}; +var username = ''; +var uid = ''; +var spinner = 'retrieving'; + +/*###################################################################### + * DOCUMENT READY FUNCTIONS + * ###################################################################*/ + +$(document).ready(function() { + + readCookie(); + setLogin(); + insertTemplates(); //put templates in place + initDataTables(); + initCheckAllBoxes(); + initListButtons(); + setupCreateDialogs(); + setupTips(); + hideUnauthorizedDivs(); + refreshButtonListener(); //listen to manual refresh image clicks + confirmButtonListener(); //listen to buttons that require confirmation + confirmWithSelectListener(); //listen to buttons requiring a selector + actionButtonListener(); //listens to all simple actions (not creates) + setupImageAttributesDialogs(); //setups the add/update/remove attr dialogs + + //Jquery-ui eye-candy + $('button').button(); + $('div#select_helpers').hide(); + emptyDashboard(); + preloadTables(); + setupAutoRefresh(); + + $(".ui-widget-overlay").live("click", function (){ + $("div:ui-dialog:visible").dialog("close"); + }); + + //Dashboard link listener + $("#dashboard_table h3 a").live("click", function (){ + var tab = $(this).attr('href'); + showTab(tab); + return false; + }); + + //Close select lists... + $('*:not(.action_list,.list_button)').click(function(){ + $('.action_list:visible').hide(); + }); + + +}); + +//reads the cookie and places its info in the 'cookie' var +function readCookie(){ + $.each(document.cookie.split("; "), function(i,e){ + var e_split = e.split("="); + var key = e_split[0]; + var value = e_split[1]; + cookie[key] = value; + }); +} + +//sets the user info in the top bar and creates a listner in the signout button +function setLogin(){ + username = cookie["one-user"]; + uid = cookie["one-user_id"]; + + $("#user").html(username); + $("#logout").click(function(){ + OpenNebula.Auth.logout({success:function(){ + window.location.href = "/login"; + } + }); + return false; + }); +} + +function hideUnauthorizedDivs(){ + // hide all the oneadmin divs if user is not oneadmin + if (uid != 0) { + $(".oneadmin").hide(); + } +} +//puts predifined templates into the document body +//templates can be found in one-ui_views.templates.js +function insertTemplates(){ + $('div#dashboard').html(dashboard_tmpl); + $('div#hosts').html(hostlist_tmpl); + //$('div#clusters').html(clusterlist_tmpl); + $('div#virtualMachines').html(vmachinelist_tmpl); + $('div#virtualNetworks').html(vnetworklist_tmpl); + $('div#users').html(userlist_tmpl); + $('div#images').html(imagelist_tmpl); +} + + +//initializes the dataTables and sets the options +function initDataTables(){ + + dataTable_hosts = $("#datatable_hosts").dataTable({ + "bJQueryUI": true, + "bSortClasses": false, + "bAutoWidth":false, + "sPaginationType": "full_numbers", + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "60px", "aTargets": [0,4] }, + { "sWidth": "35px", "aTargets": [1] }, + { "sWidth": "120px", "aTargets": [5,6] } + ] + }); + + + //~ dataTable_clusters = $("#datatable_clusters").dataTable({ + //~ "bJQueryUI": true, + //~ "bSortClasses": false, + //~ "sPaginationType": "full_numbers", + //~ "aoColumnDefs": [ + //~ { "bSortable": false, "aTargets": ["check"] } + //~ ] + //~ }); + + dataTable_vMachines = $("#datatable_vmachines").dataTable({ + "bJQueryUI": true, + "bSortClasses": false, + "sPaginationType": "full_numbers", + "bAutoWidth":false, + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "60px", "aTargets": [0] }, + { "sWidth": "35px", "aTargets": [1] } + ] + }); + + dataTable_vNetworks = $("#datatable_vnetworks").dataTable({ + "bJQueryUI": true, + "bSortClasses": false, + "bAutoWidth":false, + "sPaginationType": "full_numbers", + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "60px", "aTargets": [0,5,6,7] }, + { "sWidth": "35px", "aTargets": [1] } + ] + }); + + if (uid == 0) { + dataTable_users = $("#datatable_users").dataTable({ + "bJQueryUI": true, + "bSortClasses": false, + "sPaginationType": "full_numbers", + "bAutoWidth":false, + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "60px", "aTargets": [0] }, + { "sWidth": "35px", "aTargets": [1] } + ] + }); + } + + dataTable_images = $("#datatable_images").dataTable({ + "bJQueryUI": true, + "bSortClasses": false, + "bAutoWidth":false, + "sPaginationType": "full_numbers", + "aoColumnDefs": [ + { "bSortable": false, "aTargets": ["check"] }, + { "sWidth": "60px", "aTargets": [0,3] }, + { "sWidth": "35px", "aTargets": [1] } + ] + }); + +} + +//Adds a listener to checks all the elements of a table +function initCheckAllBoxes(){ + //not showing nice in that position + //$('.check_all').button({ icons: {primary : "ui-icon-check" }, + // text : true}); + $('.check_all').css({"border":"2px"}); + $('.check_all').click(function(){ + if ($(this).attr("checked")) { + $('tbody input:checkbox', + $(this).parents("table")).each(function(){ + $(this).attr("checked","checked"); + }); + + } else { + $('tbody input:checkbox', + $(this).parents("table")).each(function(){ + $(this).removeAttr("checked"); + }); } + }); +} + +//Converts selects into buttons which show a of actions when clicked +function initListButtons(){ + + //for each multi_action select + $('.multi_action_slct').each(function(){ + //prepare replacement buttons + buttonset = $('
    Previous action').button(); + button1.attr("disabled","disabled"); + button2 = $('').button({ + text:false, + icons: { primary: "ui-icon-triangle-1-s" } + }); + buttonset.append(button1); + buttonset.append(button2); + buttonset.buttonset(); + + //prepare list + options = $('option', $(this)); + list = $('
      '); + $.each(options,function(){ + classes = $(this).attr("class"); + item = $('
    • '); + a = $(''+$(this).text()+''); + a.val($(this).val()); + item.html(a); + list.append(item); + }); + list.css({ + "display":"none" + }); + + + //replace the select and insert the buttons + $(this).before(buttonset); + $(this).parents('.action_blocks').append(list); + $(this).remove(); + //$(this).replaceWith(list); + + }); + + + //listen for events on this buttons and list + + //enable run the last action button + $('.action_list li a').click(function(){ + //enable run last action button + prev_action_button = $('.last_action_button',$(this).parents('.action_blocks')); + prev_action_button.val($(this).val()); + prev_action_button.removeClass("confirm_with_select_button"); + prev_action_button.removeClass("confirm_button"); + prev_action_button.addClass($(this).attr("class")); + confirmButtonListener(); + confirmWithSelectListener(); + actionButtonListener(); + prev_action_button.button("option","label",$(this).text()); + prev_action_button.button("enable"); + $(this).parents('ul').hide("blind",100); + return false; + }); + + + //Show the list of actions in place + $('.list_button').click(function(){ + $('.action_list',$(this).parents('.action_blocks')).css({ + "left": $(this).prev().position().left, + "top": $(this).prev().position().top+13, + "width": $(this).parent().outerWidth()-11 + }); + $('.action_list',$(this).parents('.action_blocks')).toggle("blind",100); + return false; + }); + + +} + +//Sets up all the "+ New Thing" dialogs. +function setupCreateDialogs(){ + createHostDialog(); + createClusterDialog(); + createVMachineDialog(); + createVNetworkDialog(); + createUserDialog(); + createImageDialog(); +} + +function refreshButtonListener(){ + $('.refresh_image').click(function(){ + action = $(this).attr('alt'); + callback = null; + + waiting_nodes = function(dataTable){ + nodes = dataTable.fnGetData(); + for (var i=0;i
      '); + }; + + $('div#confirm_dialog').html( + '
      \ +
      Do you want to proceed?
      \ +
      \ +
      Do you want to proceed?
      \ +
      \ +
      \ + \ + \ +
      \ +
      '); + + //prepare the jquery dialog + $('div#confirm_dialog').dialog({ + resizable:false, + modal:true, + width:300, + heigth:200, + autoOpen:false + }); + + $('div#confirm_dialog button').button(); + + //add listeners + $('.confirm_button').click(function(){ + val=$(this).val(); + tip=""; + //supported cases + switch (val) { + case "OpenNebula.VM.deploy": + tip="This will deploy the selected VMs on the selected host."; + break; + case "OpenNebula.VM.migrate": + tip="This will migrate the selected VMs to the selected host. "; + tip+="This is a \"cold\" migration, as the VMs will be stopped "; + tip+="prior to that migration"; + break; + case "OpenNebula.VM.livemigrate": + tip="This will live-migrate the selected VMs to the selected host."; + break; + case "OpenNebula.VM.hold": + tip="This will pause the selected VMs."; + break; + case "OpenNebula.VM.release": + tip="This will release the selected VMs"; + break; + case "OpenNebula.VM.suspend": + tip="This will suspend the selected VMs. You can resume them later."; + break; + case "OpenNebula.VM.resume": + tip="This will resume the selected VMs from their suspend state"; + break; + case "OpenNebula.VM.stop": + tip="This will shutdown the selected VMs."; + break; + case "OpenNebula.VM.restart": + tip="This will reboot the selected VMs."; + break; + case "OpenNebula.VM.shutdown": + tip="This will try to properly shutdown the selected VMs."; + break; + case "OpenNebula.VM.cancel": + tip="This will destroy the selected VMs"; + break; + case "OpenNebula.VM.delete": + tip="This will delete the selected VMs"; + break; + default: return false; + + } + $('div#confirm_tip').text(tip); + $('div#confirm_dialog button#proceed').val(val); + $('div#confirm_dialog').dialog("open"); + + return false; + }); + + $('div#confirm_dialog #cancel').click(function(){ + $('div#confirm_dialog').dialog("close"); + return false; + }); + +} + +//Listens to ".confirm_with_select_button" elements. Shows a dialog +//allowing to confirm or cancel an action, with a tip and a +//select input field. Depending on the action, the select can +//contain different values. If wanting to proceed, the action is +//executed for each of the checked elements of the table, with the +//selected item of the box as extra parameter. +function confirmWithSelectListener(){ + //add this dialog to the dialogs. + if (!($('div#confirm_with_select_dialog').length)){ + $('div#dialogs').append('
      '); + }; + + $('div#confirm_with_select_dialog').html( + '
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      '); + + //prepare the jquery dialog + $('div#confirm_with_select_dialog').dialog({ + resizable:false, + modal:true, + width:300, + heigth:300, + autoOpen:false + }); + + $('div#confirm_with_select_dialog button').button(); + //add listeners + $('.confirm_with_select_button').click(function(){ + val=$(this).val(); + tip=""; + dataTable=null; + select_helper=null; + callback=null; + //supported cases + switch (val) { + case "OpenNebula.Cluster.addhost": + tip="This will add the selected Hosts the the following cluster:"; + dataTable="dataTable_hosts"; + callback = function(req){ + OpenNebula.Host.show({data:{id:req.request.data}, success: updateHostElement, error: onError}); + }; + select_var = clusters_select; + break; + case "OpenNebula.Cluster.delete": + tip="Select the cluster you want to delete"; + dataTable="null"; + select_var = clusters_select; + callback = function (){ + OpenNebula.Host.list({success: updateClustersView,error: onError}); + } + break; + case "OpenNebula.VM.deploy": + tip="This will deploy the selected VMs. Please select a host for the deployment:"; + dataTable = "dataTable_vMachines"; + callback = function(req){ + OpenNebula.VM.show({data:{id:req.request.data},success: updateVMachineElement,error: onError})}; + select_var = hosts_select; + break; + case "OpenNebula.VM.migrate": + tip="This will migrate the selected VMs. Please select a host as destination for the migration:"; + dataTable = "dataTable_vMachines"; + callback = function(req){ + OpenNebula.VM.show({data:{id:req.request.data},success: updateVMachineElement, error: onError})}; + select_var = hosts_select; + break; + case "OpenNebula.VM.livemigrate": + tip="This will live-migrate the selected VMs. Please select a host as destination for the migration:"; + dataTable = "dataTable_vMachines"; + callback = function(req){ + OpenNebula.VM.show({data:{id:req.request.data},success: updateVMachineElement,error: onError})}; + select_var = hosts_select; + break; + default: return false; + + } + + //insert options + $('select#confirm_select').html(select_var); + + $('div#confirm_with_select_tip').text(tip); + + $('button#confirm_with_select_proceed').val(val); + $('button#confirm_with_select_proceed').attr("dataTable",dataTable); + $('div#confirm_with_select_dialog').dialog("open"); + + return false; + }); + + $('button#confirm_with_select_proceed').click(function(){ + action=$(this).val(); + + selected_item_id = $('#confirm_select :selected').val(); + dataTable=eval($(this).attr("dataTable")); + + var data; + switch (action) { + case "OpenNebula.Cluster.addhost": + data = {cluster_id: selected_item_id}; + break; + case "OpenNebula.Cluster.delete": + data = {cluster_id: selected_item_id}; + break; + case "OpenNebula.VM.deploy": + data = {host_id: selected_item_id}; + break; + case "OpenNebula.VM.migrate": + data = {host_id: selected_item_id}; + break; + case "OpenNebula.VM.livemigrate": + data = {host_id: selected_item_id}; + break; + default: return false; + } + + if (dataTable != null && selected_item_id.length){ + nodes = $('input:checked',dataTable.fnGetNodes()); + //prepare array for notification + var nodes_id = new Array(); + $.each(nodes, function(){ + nodes_id.push($(this).val()); + data.id = $(this).val(); + (eval(action)({data: data, success: callback, error: onError })); + }); + notifySubmit(action,nodes_id,selected_item_id); + } + else { //we execute the action only on the selected item + (eval(action)({data:{id: selected_item_id},success: callback,error: onError})); + } + + $('div#confirm_with_select_dialog').dialog("close"); + return false; + }); + + $('button#confirm_with_select_cancel').click(function(){ + $('div#confirm_with_select_dialog').dialog("close"); + return false; + }); + +} + +//Listens to click on ".action_button" elements. According to the value +//of the element, it sends actions to OpenNebula.js. This function +//handles all the simple actions of the UI: delete, enables, disables, etc... +function actionButtonListener(){ + //Listener + $('.action_button').click(function(){ + dataTable=null; //Which dataTable should be updated afterwards? + callback = null; //Which callback function should be used on success? + + //Actions have 1 fixed parametre (the element they primarly + //affect, fectched from the checkboxes of the list. + //Does our action need two params? (ex. add host to cluster) + extra_param = null; + + + action = $(this).val(); //Fetch the value of the action + + //Actions are grouped. For some of them no need to make a + //difference + switch (action){ + //Host list actions + //case "OpenNebula.Cluster.addhost": + case "OpenNebula.Cluster.removehost": + extra_param="0"; + case "OpenNebula.Host.enable": + case "OpenNebula.Host.disable": + dataTable = dataTable_hosts; + callback = function(req){ + OpenNebula.Host.show({data:{id:req.request.data[0]},success: updateHostElement,error: onError}); + }; + break; + + case "OpenNebula.Host.delete": + dataTable = dataTable_hosts; + callback = deleteHostElement; + break; + + //~ //Cluster list actions - now it is confirm with select + //~ case "OpenNebula.Cluster.delete": + //~ dataTable = dataTable_clusters; + //~ callback = deleteClusterElement; + //~ break; + + //VMachine list actions + case "OpenNebula.VM.deploy": + case "OpenNebula.VM.migrate": + case "OpenNebula.VM.livemigrate": + //Set an extra param if is a deploy, migrate or livemigrate + host = $('#vm_host :selected').val(); + //Making sure we selected a host + if (!host.length){ + break; + }; + extra_param = host; + + case "OpenNebula.VM.hold": + case "OpenNebula.VM.release": + case "OpenNebula.VM.suspend": + case "OpenNebula.VM.resume": + case "OpenNebula.VM.stop": + case "OpenNebula.VM.restart": + case "OpenNebula.VM.shutdown": + case "OpenNebula.VM.cancel": + dataTable = dataTable_vMachines; + callback = function(req){ + OpenNebula.VM.show({data:{id:req.request.data},success: updateVMachineElement,error: onError})}; + break; + case "OpenNebula.VM.delete": + dataTable = dataTable_vMachines; + callback = deleteVMachineElement; + break; + + //VNET list actions + case "OpenNebula.Network.publish": + case "OpenNebula.Network.unpublish": + dataTable = dataTable_vNetworks; + callback = function(req){ + OpenNebula.Network.show({data:{id:req.request.data},success: updateVNetworkElement, error: onError})}; + break; + break; + case "OpenNebula.Network.delete": + dataTable = dataTable_vNetworks; + callback = deleteVNetworkElement; + break; + case "OpenNebula.User.delete": + dataTable = dataTable_users; + callback = deleteUserElement; + break; + + //Images + case "OpenNebula.Image.delete": + dataTable = dataTable_images; + callback = deleteImageElement; + break; + case "OpenNebula.Image.enable": + case "OpenNebula.Image.disable": + case "OpenNebula.Image.persistent": + case "OpenNebula.Image.nonpersistent": + case "OpenNebula.Image.publish": + case "OpenNebula.Image.unpublish": + dataTable = dataTable_images; + callback = function(req){ + OpenNebula.Image.show({data:{id:req.request.data[0]},success: updateImageElement, error: onError}); + }; + break; + } + + $('div#confirm_dialog').dialog("close"); //in case we required it + + //If there is not a datatable set to fetch the elements affected, + //we assume the action was not recognised. + if (dataTable != null){ + + //Which rows of the datatable are checked? + nodes = $('input:checked',dataTable.fnGetNodes()); + + //For each we execute the action + var nodes_id = new Array(); + $.each(nodes, function(){ + //prepare array for notification + nodes_id.push($(this).val()); + //Calling action(id,callback,error_callback) + if (extra_param!=null){ //action with two parameters + data = extra_param; + data.id = $(this).val(); + (eval(action)({data: data, success: callback, error: onError})); + } else { //action with one parameter + (eval(action)({data:{id:$(this).val()},success: callback,error: onError})); + }; + }); + //Notify + if (extra_param!=null) { + notifySubmit(action,nodes_id,extra_param); + } else { + notifySubmit(action,nodes_id); + } + } + return false; + }); +} + +function preloadTables(){ + dataTable_hosts.fnClearTable(); + addElement([ + spinner, + '','','','','','',''],dataTable_hosts); + OpenNebula.Host.list({success: updateHostsView,error: onError}); + + //~ dataTable_clusters.fnClearTable(); + //~ addElement([ + //~ spinner, + //~ '',''],dataTable_clusters); + OpenNebula.Cluster.list({success: updateClustersView,error: onError}); + + dataTable_vNetworks.fnClearTable(); + addElement([ + spinner, + '','','','','','',''],dataTable_vNetworks); + OpenNebula.Network.list({success: updateVNetworksView, error: onError}); + + dataTable_vMachines.fnClearTable(); + addElement([ + spinner, + '','','','','','','',''],dataTable_vMachines); + OpenNebula.VM.list({success: updateVMachinesView, error: onError}); + + if (uid == 0){ + dataTable_users.fnClearTable(); + addElement([ + spinner, + '',''],dataTable_users); + OpenNebula.User.list({success: updateUsersView,error: onError}); + } + + dataTable_images.fnClearTable(); + addElement([ + spinner, + '','','','','','','','',''],dataTable_images); + OpenNebula.Image.list({success: updateImagesView, error: onError}); +} + + + +function setupImageAttributesDialogs(){ + $('div#dialogs').append('
      '); + + $('#image_attributes_dialog').html( + '
      \ +
      \ +
      \ +
      \ +
      \ + \ + \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      '); + + $('#image_attributes_dialog').dialog({ + autoOpen:false, + width:400, + modal:true, + height:270, + resizable:false, + }); + + $('.image_attribute_button').click(function(){ + action = $(this).val(); + desc = ""; + switch (action){ + case "OpenNebula.Image.addattr": + case "OpenNebula.Image.update": + $('#img_attr_value').show(); + $('#img_attr_value').prev().show(); + desc = "Please write the name and value of the attribute. It will be added or updated in all selected images:"; + $('#img_attr_action').val("OpenNebula.Image.addattr"); + break; + case "OpenNebula.Image.rmattr": + $('#img_attr_value').hide(); + $('#img_attr_value').prev().hide(); + desc = "Please type the attribute you want to remove:"; + $('#img_attr_action').val("OpenNebula.Image.rmattr"); + break; + } + + $('#img_attr_action_desc').html(desc); + $('#image_attributes_dialog').dialog('open'); + return false; + }); + + $('#img_attr_name').keyup(function(){ + $(this).val($(this).val().toUpperCase()); + }); + + $('#image_attributes_dialog #img_attr_proceed').click(function(){ + action = $('#img_attr_action').val(); + nodes = $('input:checked',dataTable_images.fnGetNodes()); + name = $('#img_attr_name').val(); + value = $('#img_attr_value').val(); + switch (action) { + case "OpenNebula.Image.addattr": + case "OpenNebula.Image.update": + $.each(nodes,function(){ + OpenNebula.Image.addattr({data: { + id: $(this).val() + , name: name + , value: value + } + , success: 0 + , error: onError + }); + }); + break; + case "OpenNebula.Image.rmattr": + $.each(nodes,function(){ + OpenNebula.Image.rmattr({data: { + id: $(this).val() + , name: name + , value: value + } + , success: 0 + , error: onError + }); + }); + break; + } + $('#image_attributes_dialog').dialog('close'); + return false; + }); + + $('#image_attributes_dialog #img_attr_cancel').click(function(){ + $('#image_attributes_dialog').dialog('close'); + return false; + }); + +} + +//Sets refresh intevals for the tables. +function setupAutoRefresh(){ + interval=120000; //2 minutes + //hosts + setInterval(function(){ + nodes = $('input:checked',dataTable_hosts.fnGetNodes()); + filter = $("#datatable_hosts_filter input").attr("value"); + if (!nodes.length && !filter.length){ + OpenNebula.Host.list({timeout: true, success: updateHostsView,error: onError}); + } + },interval); + + + //clusters + //~ setInterval(function(){ + //~ nodes = $('input:checked',dataTable_clusters.fnGetNodes()); + //~ if (!nodes.length){ + //~ OpenNebula.Cluster.list(updateClustersView,onError); + //~ } + //~ },interval+4000); //so that not all refreshing is done at the same time + + //clusters + setInterval(function(){ + OpenNebula.Cluster.list({timeout: true, success: updateClustersView,error: onError}); + },interval+4000); //so that not all refreshing is done at the same time + + + //Networks + setInterval(function(){ + nodes = $('input:checked',dataTable_vNetworks.fnGetNodes()); + filter = $("#datatable_vnetworks_filter input").attr("value"); + if (!nodes.length && !filter.length){ + OpenNebula.Network.list({timeout: true, success: updateVNetworksView, error: onError}); + } + },interval+8000); //so that not all refreshing is done at the same time + + //VMs + setInterval(function(){ + nodes = $('input:checked',dataTable_vMachines.fnGetNodes()); + filter = $("#datatable_vmachines_filter input").attr("value"); + if (!nodes.length && !filter.length){ + OpenNebula.VM.list({timeout: true, success: updateVMachinesView,error: onError}); + } + },interval+12000); //so that not all refreshing is done at the same time + + + //Users + //do not update if user is not oneadmin + if (uid == 0) { + setInterval(function(){ + nodes = $('input:checked',dataTable_users.fnGetNodes()); + filter = $("#datatable_users_filter input").attr("value"); + if (!nodes.length && !filter.length){ + OpenNebula.User.list({timeout: true, success: updateUsersView, error: onError}); + } + },interval+14000); //so that not all refreshing is done at the same time + } + + //Images + setInterval(function(){ + nodes = $('input:checked',dataTable_images.fnGetNodes()); + filter = $("#datatable_images_filter input").attr("value"); + if (!nodes.length && !filter.length){ + OpenNebula.Image.list({timeout: true, success: updateImagesView, error: onError}); + } + },interval+16000); +} + +/*###################################################################### + * CREATE DIALOGS + * ###################################################################*/ + + /*## HOSTS ## */ + +function createHostDialog(){ + + //We put the template in place + $('#create_host_dialog').html(create_host_tmpl); + + //Enable the jquery dialog but we keep it hidden + $create_host_dialog = $('#create_host_dialog').dialog({ + autoOpen: false, + modal: true, + width: 500 + }); + + //$('#create_host_dialog div.radioset').buttonset(); + //not working properly: sometimes selected option comes as undefined + //$('#create_host_button').button(); + + //Listen to the + New Host button and open dialog when clicked + $('.create_host_button').click(function(){ + $create_host_dialog.dialog('open'); + return false; + }); + + //Handle the form submission + $('#create_host_form').submit(function(){ + if (!($('#name',this).val().length)){ + notifyError("Host name missing!"); + return false; + } + host_json = { "host": { "name": $('#name',this).val(), + "tm_mad": $('#tm_mad :selected',this).val(), + "vm_mad": $('#vmm_mad :selected',this).val(), + "im_mad": $('#im_mad :selected',this).val()}} + + //Create the OpenNebula.Host. + //If it's successfull we refresh the list. + OpenNebula.Host.create({data: host_json, success: addHostElement, error: onError}); + $create_host_dialog.dialog('close'); + return false; + }); +} + + /*## CLUSTERS ## */ + +function createClusterDialog(){ + //Insert HTML in place + $('#create_cluster_dialog').html(create_cluster_tmpl); + + //Prepare the JQUERY dialog. Set style options here. + $create_cluster_dialog = $('#create_cluster_dialog').dialog({ + autoOpen: false, + modal: true, + width: 400 + }); + + //$('#create_cluster_button').button(); + + //Listen to a click on the + New Cluster button + $('.create_cluster_button').click(function(){ + $create_cluster_dialog.dialog('open'); + return false; + }); + + //Handle the submission of the form + $('#create_cluster_form').submit(function(){ + name=$('#name',this).val(); + cluster_json = { "cluster" : { "name" : name }}; + //Create the Cluster. + //If it's successfull we refresh the list. + OpenNebula.Cluster.create({ data:cluster_json, + success: function(){ + OpenNebula.Cluster.list(updateClustersView,onError)}, + error: onError}); + $create_cluster_dialog.dialog('close'); + return false; + }); +} + + /*## VNETS ## */ + +function createVNetworkDialog(){ + + //Insert dialog HTML in place + $('#create_vn_dialog').html(create_vn_tmpl); + + //Prepare the jquery-ui dialog. Set style options here. + $create_vn_dialog = $('#create_vn_dialog').dialog({ + autoOpen: false, + modal: true, + width: 475, + height: 500 + }); + + //Make the tabs look nice for the creation mode + $('#vn_tabs').tabs(); + $('div#ranged').hide(); + $('#fixed_check').click(function(){ + $('div#fixed').show(); + $('div#ranged').hide(); + }); + $('#ranged_check').click(function(){ + $('div#fixed').hide(); + $('div#ranged').show(); + }); + //$('#create_vn_button').button(); + + //We listen to the + New Vnet button and open the dialog when clicked + $('.create_vn_button').click(function(){ + $create_vn_dialog.dialog('open'); + return false; + }); + + //When we hit the add lease button... + $('#add_lease').click(function(){ + create_form = $('#create_vn_form_easy'); //this is our scope + + //Fetch the interesting values + lease_ip = $('#leaseip',create_form).val(); + lease_mac = $('#leasemac',create_form).val(); + + //We don't add anything to the list if there is nothing to add + if (lease_ip == null) { + notifyError("Please provide a lease IP"); + return false; + }; + + + lease = ""; //contains the HTML to be included in the select box + if (lease_mac == "") { + lease=''; + } else { + lease=''; + }; + + //We append the HTML into the select box. + $('select#leases').append(lease); + return false; + }); + + $('#remove_lease').click(function(){ + $('select#leases :selected').remove(); + return false; + }); + + //Handle submission of the easy mode + $('#create_vn_form_easy').submit(function(){ + //Fetch values + name = $('#name',this).val(); + if (!name.length){ + notifyError("Virtual Network name missing!"); + return false; + } + bridge = $('#bridge',this).val(); + type = $('input:checked',this).val(); + + //TBD: Name and bridge provided?! + + network_json = null; + if (type == "fixed") { + leases = $('#leases option', this); + leases_obj=[]; + + //for each specified lease we prepare the JSON object + $.each(leases,function(){ + leases_obj.push({"ip": $(this).val() }); + }); + + //and construct the final data for the request + network_json = { + "vnet" : { + "type" : "FIXED", + "leases" : leases_obj, + "bridge" : bridge, + "name" : name }}; + } + else { //type ranged + + network_addr = $('#net_address',this).val(); + network_size = $('#net_size',this).val(); + if (!network_addr.length){ + notifyError("Please provide a network address"); + return false; + }; + + //we form the object for the request + network_json = { + "vnet" : { + "type" : "RANGED", + "bridge" : bridge, + "network_size" : network_size, + "network_address" : network_addr, + "name" : name } + }; + }; + + //Create the VNetwork. + //If it's successfull we refresh the list. + OpenNebula.Network.create({ + data: network_json, + success: addVNetworkElement, + error: onError}); + $create_vn_dialog.dialog('close'); + return false; + }); + + $('#create_vn_form_manual').submit(function(){ + template=$('#template',this).val(); + vnet_json = {vnet: {vnet_raw: template}}; + OpenNebula.Network.create({data: vnet_json, success: addVNetworkElement,error: onError}); + $create_vn_dialog.dialog('close'); + return false; + }); + +} + + /*## VMACHINES ## */ + +function createVMachineDialog(){ + + /* #### createVMachineDialog() helper functions #### */ + + vmTabChange = function(event,ui){ + // ui.tab // anchor element of the selected (clicked) tab + // ui.panel // element, that contains the selected/clicked tab contents + // ui.index // zero-based index of the selected (clicked) tab + switch(ui.index){ + case 0: + enable_kvm(); + break; + case 1: + enable_xen(); + break; + case 2: + break; + case 3: + break; + } + } + + update_dynamic_css = function(){ + //This function used to be useful to add specific + //css to elements that changed. + //Now its not needed anymore apparently + /* + if (templ_type=="kvm"){ + $(xen_man_items).css({"font-weight":"normal"}); + $(kvm_man_items).css({"background":"green","font-weight":"bold"}); + $(kvm_opt_items).css({"background":"yellow"}); + } else if (templ_type=="xen"){ + $(kvm_man_items).css({"font-weight":"normal"}); + $(xen_man_items).css({"background":"green","font-weight":"bold"}); + $(xen_opt_items).css({"background":"yellow"}); + };*/ + }; + + enable_kvm = function(){ + man_class="kvm"; + opt_class="kvm_opt"; + $(xen_items).attr("disabled","disabled"); + $(xen_items).css("background",""); + $(kvm_items).removeAttr("disabled"); + //$(items+':disabled').hide(); + + + //particularities + $('div#disks select#TYPE option:selected').removeAttr("selected"); + $('div#disks select#TYPE').prepend( + ''); + $('div#disks select#TYPE option#no_type').attr("selected","selected"); + + $('select#boot_method option').removeAttr("selected"); + $('select#boot_method option#no_boot').html("Driver default"); + $('select#boot_method option').removeAttr("selected"); + $('.kernel, .bootloader', $('div#os_boot_opts')).hide(); + + $('input#TYPE', section_raw).val("kvm"); + + $(section_inputs).show(); + + update_dynamic_css(); + }; + + enable_xen = function(){ + man_class="xen"; + opt_class="xen_opt"; + $(kvm_items).attr("disabled","disabled"); + $(kvm_items).css("background",""); + $(xen_items).removeAttr("disabled"); + //$(items+':disabled').hide(); + + + //particularities + $('div#disks select#TYPE option#no_type').remove(); + + $('select#boot_method option:selected').removeAttr("selected"); + $('select#boot_method option#no_boot').html("Please choose"); + $('.kernel, .bootloader', $('div#os_boot_opts')).hide(); + + + $('input#TYPE', section_raw).val("kvm"); + $(section_inputs).hide(); //not present for xen + update_dynamic_css(); + }; + + mandatory_filter = function(context){ + man_items = ""; + if (templ_type == "kvm") + { man_items = ".kvm"; } + else if (templ_type == "xen") + { man_items = ".xen"; } + else {return false;}; + + //find enabled mandatory items in this context + man_items = $(man_items+' input:visible',context); + r = true; + $.each(man_items,function(){ + if ($(this).parents(".vm_param").attr("disabled") || + !($(this).val().length)) { + r = false; + return false; + }; + }); + return r; + + }; + + box_add_element = function(context,box_tag,filter){ + value=""; + params= $('.vm_param',context); + inputs= $('input:enabled',params); + selects = $('select:enabled',params); + fields = $.merge(inputs,selects); + + //are fields correctly set? + result = filter(); + if (!result) { + notifyError("There are mandatory parameters missing in this section"); + return false; + } + + value={}; + $.each(fields,function(){ + if (!($(this).parents(".vm_param").attr("disabled")) && + $(this).val().length){ + id = $(this).attr('id').length ? $(this).attr('id') : $(this).parent().attr('id'); + value[id] = $(this).val(); + } + }); + string = JSON.stringify(value); + option= ''; + $('select'+box_tag,context).append(option); + return false; + }; + + box_remove_element = function(section_tag,box_tag){ + context = $(section_tag); + $('select'+box_tag+' :selected',context).remove(); + return false; + }; + + addSectionJSON = function(template_json,context){ + params= $('.vm_param',context); + inputs= $('input:enabled',params); + selects = $('select:enabled',params); + fields = $.merge(inputs,selects); + + fields.each(function(){ + if (!($(this).parents(".vm_param").attr("disabled"))){ //if ! disabled + if ($(this).val().length){ //if has a length + template_json[$(this).attr('id')]=$(this).val(); + } + } + }); + } + + addBoxJSON = function(array,context,box_tag){ + $('select'+box_tag+' option',context).each(function(){ + array.push( JSON.parse($(this).val()) ); + }); + } + + removeEmptyObjects = function(obj){ + for (elem in obj){ + remove = false; + value = obj[elem]; + if (value instanceof Array) + { + if (value.length == 0) + remove = true; + } + else if (value instanceof Object) + { + var obj_length = 0; + for (e in value) + obj_length += 1; + if (obj_length == 0) + remove = true; + } + else + { + value = String(value); + if (value.length == 0) + remove = true; + } + if (remove) + delete obj[elem]; + } + return obj; + } + + iconToggle = function(){ + $('.icon_right').toggle( + function(e){ + $('span',e.currentTarget).removeClass("ui-icon-plusthick"); + $('span',e.currentTarget).addClass("ui-icon-minusthick"); + },function(e){ + $('span',e.currentTarget).removeClass("ui-icon-minusthick"); + $('span',e.currentTarget).addClass("ui-icon-plusthick"); + }); + } + + capacity_setup = function(){ + + //$('fieldset',section_capacity).hide(); + + //~ $('#add_capacity',section_capacity).click(function(){ + //~ $('fieldset',section_capacity).toggle(); + //~ return false; + //~ }); + + } + + os_boot_setup = function(){ + $('fieldset',section_os_boot).hide(); + $('.bootloader, .kernel',section_os_boot).hide(); + + $('#add_os_boot_opts',section_os_boot).click(function(){ + $('fieldset',section_os_boot).toggle(); + return false; + }); + + + //Chrome workaround + $('#boot_method').change(function(){ + $(this).trigger("click"); + }); + + $('#boot_method',section_os_boot).click(function(){ + select = $(this).val(); + switch (select) + { + case "kernel": + $('.bootloader',section_os_boot).hide(); + $('.bootloader',section_os_boot).attr("disabled","disabled"); + $('.kernel',section_os_boot).show(); + $('.kernel',section_os_boot).removeAttr("disabled"); + break; + case "bootloader": + $('.kernel',section_os_boot).hide(); + $('.kernel',section_os_boot).attr("disabled","disabled"); + $('.bootloader',section_os_boot).show(); + $('.bootloader',section_os_boot).removeAttr("disabled"); + break; + default: + $('.kernel, .bootloader',section_os_boot).hide(); + $('.kernel, .bootloader',section_os_boot).attr("disabled","disabled"); + $('.kernel input, .bootloader input',section_os_boot).val(""); + }; + }); + }; + + disks_setup = function(){ + + $('fieldset',section_disks).hide(); + $('.vm_param', section_disks).hide(); + //$('#image_vs_disk',section_disks).show(); + + $('#add_disks', section_disks).click(function(){ + $('fieldset',section_disks).toggle(); + return false; + }); + + $('#image_vs_disk input',section_disks).click(function(){ + //$('fieldset',section_disks).show(); + $('.vm_param', section_disks).show(); + select = $('#image_vs_disk :checked',section_disks).val(); + switch (select) + { + case "disk": + $('.add_image',section_disks).hide(); + $('.add_image',section_disks).attr("disabled","disabled"); + $('.add_disk',section_disks).show(); + $('.add_disk',section_disks).removeAttr("disabled"); + $('#TARGET',section_disks).parent().removeClass(opt_class); + $('#TARGET',section_disks).parent().addClass(man_class); + break; + case "image": + $('.add_disk',section_disks).hide(); + $('.add_disk',section_disks).attr("disabled","disabled"); + $('.add_image',section_disks).show(); + $('.add_image',section_disks).removeAttr("disabled"); + $('#TARGET',section_disks).parent().removeClass(man_class); + $('#TARGET',section_disks).parent().addClass(opt_class); + break; + } + $('#SIZE',section_disks).parent().hide(); + $('#SIZE',section_disks).parent().attr("disabled","disabled"); + $('#FORMAT',section_disks).parent().hide(); + $('#SIZE',section_disks).parent().attr("disabled","disabled"); + $('#TYPE :selected',section_disks).removeAttr("selected"); + + update_dynamic_css(); + }); + + + + //activate correct mandatory attributes when + //selecting disk type + + //Chrome workaround + $('select#TYPE',section_disks).change(function(){ + $(this).trigger('click'); + }); + + $('select#TYPE',section_disks).click(function(){ + select = $(this).val(); + switch (select) { + //size,format,target + case "swap": + //size mandatory + $('#SIZE',section_disks).parent().show(); + $('#SIZE',section_disks).parent().removeAttr("disabled"); + $('#SIZE',section_disks).parent().removeClass(opt_class); + $('#SIZE',section_disks).parent().addClass(man_class); + + //target optional + $('#TARGET',section_disks).parent().removeClass(man_class); + $('#TARGET',section_disks).parent().addClass(opt_class); + + //format hidden + $('#FORMAT',section_disks).parent().hide(); + $('#FORMAT',section_disks).parent().attr("disabled","disabled"); + break; + case "fs": + //size mandatory + $('#SIZE',section_disks).parent().show(); + $('#SIZE',section_disks).parent().removeAttr("disabled"); + $('#SIZE',section_disks).parent().removeClass(opt_class); + $('#SIZE',section_disks).parent().addClass(man_class); + + //target mandatory + $('#TARGET',section_disks).parent().removeClass(opt_class); + $('#TARGET',section_disks).parent().addClass(man_class); + + //format mandatory + $('#FORMAT',section_disks).parent().show(); + $('#FORMAT',section_disks).parent().removeAttr("disabled"); + $('#FORMAT',section_disks).parent().removeClass(opt_class); + $('#FORMAT',section_disks).parent().addClass(man_class); + + break; + case "block": + //size shown and optional + $('#SIZE',section_disks).parent().show(); + $('#SIZE',section_disks).parent().removeAttr("disabled"); + $('#SIZE',section_disks).parent().removeClass(man_class); + $('#SIZE',section_disks).parent().addClass(opt_class); + + //target mandatory + $('#TARGET',section_disks).parent().removeClass(opt_class); + $('#TARGET',section_disks).parent().addClass(man_class); + + //format hidden + $('#FORMAT',section_disks).parent().hide(); + $('#FORMAT',section_disks).parent().attr("disabled","disabled"); + break; + case "floppy": + case "disk": + case "cdrom": + //size hidden + $('#SIZE',section_disks).parent().hide(); + $('#SIZE',section_disks).parent().attr("disabled","disabled"); + + //target mandatory + $('#TARGET',section_disks).parent().removeClass(opt_class); + $('#TARGET',section_disks).parent().addClass(man_class); + + //format optional + $('#FORMAT',section_disks).parent().hide(); + $('#FORMAT',section_disks).parent().attr("disabled","disabled"); + + } + update_dynamic_css(); + }); + + diskFilter = function(){ + return mandatory_filter(section_disks); + }; + + $('#add_disk_button',section_disks).click(function(){ + box_add_element(section_disks,'#disks_box',diskFilter); + return false; + }); + $('#remove_disk_button',section_disks).click(function(){ + box_remove_element(section_disks,'#disks_box'); + return false; + }); + }; + + networks_setup = function(){ + + $('.vm_param',section_networks).hide(); + $('fieldset',section_networks).hide(); + + $('#add_networks',section_networks).click(function(){ + $('fieldset',section_networks).toggle(); + return false; + }); + + $('#network_vs_niccfg input',section_networks).click(function(){ + + select = $('#network_vs_niccfg :checked',section_networks).val(); + switch (select) { + case "network": + $('.niccfg',section_networks).hide(); + $('.niccfg',section_networks).attr("disabled","disabled"); + $('.network',section_networks).show(); + $('.network',section_networks).removeAttr("disabled"); + break; + case "niccfg": + $('.network',section_networks).hide(); + $('.network',section_networks).attr("disabled","disabled"); + $('.niccfg',section_networks).show(); + $('.niccfg',section_networks).removeAttr("disabled"); + break; + } + }); + + nicFilter = function(){ + network = $('select#network :selected',section_networks).attr('id'); + ip = $('#IP',section_networks).val(); + mac = $('#MAC',section_networks).val(); + + return (network != "no_network" || ip.length || mac.length); + }; + + $('#add_nic_button',section_networks).click(function(){ + box_add_element(section_networks,'#nics_box',nicFilter); + return false; + }); + $('#remove_nic_button',section_networks).click(function(){ + box_remove_element(section_networks,'#nics_box'); + return false; + }); + + }; + + inputs_setup = function() { + $('fieldset',section_inputs).hide(); + + $('#add_inputs',section_inputs).click(function(){ + $('fieldset',section_inputs).toggle(); + return false; + }); + + $('#add_input_button',section_inputs).click(function(){ + //no filter + box_add_element(section_inputs,'#inputs_box',function(){return true;}); + return false; + }); + $('#remove_input_button',section_inputs).click(function(){ + box_remove_element(section_inputs,'#inputs_box'); + return false; + }); + }; + + graphics_setup = function(){ + $('fieldset',section_graphics).hide(); + $('.vm_param',section_graphics).hide(); + $('select#TYPE',section_graphics).parent().show(); + + $('#add_graphics',section_graphics).click(function(){ + $('fieldset',section_graphics).toggle(); + return false; + }); + + //Chrome workaround + $('select#TYPE',section_graphics).change(function(){ + $(this).trigger("click"); + }); + $('select#TYPE',section_graphics).click(function(){ + g_type = $(this).val(); + switch (g_type) { + case "vnc": + $('#LISTEN',section_graphics).parent().show(); + $('#PORT',section_graphics).parent().show(); + $('#PASSWD',section_graphics).parent().show(); + $('#KEYMAP',section_graphics).parent().show(); + $('#PORT',section_graphics).parent().removeAttr("disabled"); + $('#PASSWD',section_graphics).parent().removeAttr("disabled"); + $('#KEYMAP',section_graphics).parent().removeAttr("disabled"); + break; + case "sdl": + $('#LISTEN',section_graphics).parent().show(); + $('#PORT',section_graphics).parent().hide(); + $('#PASSWD',section_graphics).parent().hide(); + $('#KEYMAP',section_graphics).parent().hide(); + $('#PORT',section_graphics).parent().attr("disabled","disabled"); + $('#PASSWD',section_graphics).parent().attr("disabled","disabled"); + $('#KEYMAP',section_graphics).parent().attr("disabled","disabled"); + break; + default: + $('#LISTEN',section_graphics).parent().hide(); + $('#PORT',section_graphics).parent().hide(); + $('#PASSWD',section_graphics).parent().hide(); + $('#KEYMAP',section_graphics).parent().hide(); + + } + }); + + } + + context_setup = function(){ + $('fieldset',section_context).hide(); + + $('#add_context',section_context).click(function(){ + $('fieldset',section_context).toggle(); + return false; + }); + + }; + + placement_setup = function(){ + $('fieldset',section_placement).hide(); + + $('#add_placement',section_placement).click(function(){ + $('fieldset',section_placement).toggle(); + return false; + }); + + }; + + raw_setup = function(){ + $('fieldset',section_raw).hide(); + + $('#add_raw',section_raw).click(function(){ + $('fieldset',section_raw).toggle(); + return false; + }); + }; + + /* #### createVMachineDialog() main body #### */ + + //Insert HTML in place + $('#create_vm_dialog').html(create_vm_tmpl); + $('#vm_create_tabs').tabs({ + select:vmTabChange + }); + + //Prepare jquery dialog + var height = Math.floor($(window).height()*0.8); //set height to a percentage of the window + $create_vm_dialog = $('#create_vm_dialog').dialog({ + autoOpen: false, + modal: true, + width: 700, + height: height + }); + + //Listen to the + New VM button and open dialog + $('.create_vm_button').click(function(){ + $create_vm_dialog.dialog('open'); + return false; + }); + + iconToggle(); //toogle +/- buttons + + //Sections, used to stay within their scope + section_capacity = $('#capacity'); + section_os_boot = $('#os_boot_opts'); + section_disks = $('#disks'); + section_networks = $('#networks'); + section_inputs = $('#inputs'); + section_graphics = $('#graphics'); + section_context = $('#context'); + section_placement = $('#placement'); + section_raw = $('#raw'); + + //Different selector for items of kvm and xen (mandatory and optional) + items = '.vm_section input,.vm_section select'; + kvm_man_items = '.kvm input,.kvm select'; + kvm_opt_items = '.kvm_opt input, .kvm_opt select'; + kvm_items = kvm_man_items +','+kvm_opt_items; + xen_man_items = '.xen input,.xen select'; + xen_opt_items = '.xen_opt input, .xen_opt select'; + xen_items = xen_man_items +','+ xen_opt_items; + + //Starting template type, optional items class and mandatory items class + templ_type = "kvm"; + opt_class=".kvm_opt"; + man_class=".kvm"; + + $('#template_type #kvm').attr("checked","checked"); //check KVM + enable_kvm(); //enable all kvm options + + //handle change between templates. + $("#template_type input").click(function(){ + templ_type = $("#template_type :checked").val(); + switch (templ_type) + { + case "kvm": + enable_kvm(); + break; + case "xen": + enable_xen(); + break; + } + }); + + $('#fold_unfold_vm_params').toggle( + function(){ + $('.vm_section fieldset').show(); + return false; + }, + function(){ + $('.vm_section fieldset').hide(); + $('.vm_section fieldset').first().show(); + return false; + }); + + capacity_setup(); + os_boot_setup(); + disks_setup(); + networks_setup(); + inputs_setup(); + graphics_setup(); + context_setup(); + placement_setup(); + raw_setup(); + + $('button#create_vm_form_easy').click(function(){ + //validate form + + vm_json = {}; + + //process capacity options + scope = section_capacity; + + if (!mandatory_filter(scope)){ + notifyError("There are mandatory fields missing in the capacity section"); + return false; + }; + addSectionJSON(vm_json,scope); + + //process os_boot_opts + scope= section_os_boot; + switch (templ_type){ + case "xen": + boot_method = $('#boot_method option:selected',scope).val(); + if (!boot_method.length){ + notifyError("Xen templates must specify a boot method"); + return false;} + }; + + if (!mandatory_filter(scope)){ + notifyError("There are mandatory fields missing in the OS Boot options section"); + return false; + }; + addSectionJSON(vm_json,scope); + + //process disks + scope = section_disks; + vm_json["DISK"] = []; + addBoxJSON(vm_json["DISK"],scope,'#disks_box'); + + //process nics -> fetch from box + scope = section_networks; + vm_json["NIC"] = []; + addBoxJSON(vm_json["NIC"],scope,'#nics_box'); + + //process inputs -> fetch from box + scope = section_inputs; + vm_json["INPUT"] = []; + addBoxJSON(vm_json["INPUT"],scope,'#inputs_box'); + + //process graphics -> fetch fields with value + scope = section_graphics; + vm_json["GRAPHICS"] = {}; + addSectionJSON(vm_json["GRAPHICS"],scope); + + //context -> include + scope = section_context; + var context = $('#CONTEXT',scope).val(); + if (context) + vm_json["CONTEXT"] = context; + + //placement -> fetch with value + scope = section_placement; + addSectionJSON(vm_json,scope); + + //raw -> if value set type to driver and fetch + scope = section_raw; + vm_json["RAW"] = {}; + addSectionJSON(vm_json["RAW"],scope); + + // remove empty elements + vm_json = removeEmptyObjects(vm_json); + + //wrap it in the "vm" object + vm_json = {vm: vm_json} + OpenNebula.VM.create({data: vm_json, + success: addVMachineElement, + error: onError}); + + $create_vm_dialog.dialog('close'); + return false; + }); + + $('button#create_vm_form_manual').click(function(){ + template = $('#vm_template').val(); + + //wrap it in the "vm" object + template = {vm: {vm_raw: template}}; + + OpenNebula.VM.create({data: template, + success: addVMachineElement, + error: onError}); + $create_vm_dialog.dialog('close'); + return false; + }); + + $('button#reset').click(function(){ + $('select#disks_box option',section_disks).remove(); + $('select#nics_box option',section_networks).remove(); + $('select#inputs_box option',section_inputs).remove(); + return true; + }); + + } + + /*## USERS ## */ + +function createUserDialog(){ + + //Insert HTML in place + $('#create_user_dialog').html(create_user_tmpl); + + //Prepare jquery dialog + $create_user_dialog = $('#create_user_dialog').dialog({ + autoOpen: false, + modal:true, + width: 400 + }); + + //$('#create_user_button').button(); + + //Listen to the + New User button and open dialog + $('.create_user_button').click(function(){ + $create_user_dialog.dialog('open'); + return false; + }); + + //Handle form submission + $('#create_user_form').submit(function(){ + user_name=$('#username',this).val(); + user_password=$('#pass',this).val(); + user_json = { "user" : + { "name" : user_name, + "password" : user_password } + }; + OpenNebula.User.create({data: user_json, + success: addUserElement, + error: onError}); + $create_user_dialog.dialog('close'); + return false; + }); +} + +function createImageDialog(){ + //Insert HTML in place + $('#create_image_dialog').html(create_image_tmpl); + + //Prepare jquery dialog + $create_image_dialog = $('#create_image_dialog').dialog({ + autoOpen: false, + modal:true, + width: 520 + }); + + //Listen to the Register image button and open dialog + $('.create_image_button').click(function(){ + $create_image_dialog.dialog('open'); + return false; + }); + + //Effects + $('#img_tabs').tabs(); + $('#img_type option').first().attr("selected","selected"); + $('#datablock_img').attr("disabled","disabled"); + + //Chrome workaround + $('select#img_type').change(function(){ + $(this).trigger("click"); + }); + + $('select#img_type').click(function(){ + value = $(this).val(); + switch (value){ + case "DATABLOCK": + $('#datablock_img').removeAttr("disabled"); + break; + default: + $('#datablock_img').attr("disabled","disabled"); + $('#path_img').attr("checked","checked"); + $('#img_source,#img_fstype,#img_size').parent().hide(); + $('#img_path').parent().show(); + } + }); + + $('#img_source,#img_fstype,#img_size').parent().hide(); + $('#path_img').attr("checked","checked"); + $('#img_path').parent().addClass("img_man"); + + $('#img_public').click(function(){ + $('#img_persistent').removeAttr("checked"); + }); + + $('#img_persistent').click(function(){ + $('#img_public').removeAttr("checked"); + }); + + + + $('#src_path_select input').click(function(){ + value = $(this).val(); + switch (value){ + case "path": + $('#img_source,#img_fstype,#img_size').parent().hide(); + $('#img_source,#img_fstype,#img_size').parent().removeClass("img_man"); + $('#img_path').parent().show(); + $('#img_path').parent().addClass("img_man"); + break; + case "source": + $('#img_path,#img_fstype,#img_size').parent().hide(); + $('#img_path,#img_fstype,#img_size').parent().removeClass("img_man"); + $('#img_source').parent().show(); + $('#img_source').parent().addClass("img_man"); + break; + case "datablock": + $('#img_source,#img_path').parent().hide(); + $('#img_source,#img_path').parent().removeClass("img_man"); + $('#img_fstype,#img_size').parent().show(); + $('#img_fstype,#img_size').parent().addClass("img_man"); + break; + } + }); + + + $('#create_image_form_easy').submit(function(){ + exit = false; + $('.img_man',this).each(function(){ + if (!$('input',this).val().length){ + notifyError("There are mandatory missing parameters"); + exit = true; + return false; + } + }); + if (exit) { return false; } + img_json = {}; + + name = $('#img_name').val(); + img_json["NAME"] = name; + + desc = $('#img_desc').val(); + if (desc.length){ + img_json["DESCRIPTION"] = desc; + } + + type = $('#img_type').val(); + img_json["TYPE"]= type; + + img_json["PUBLIC"] = $('#img_public:checked').length ? "YES" : "NO"; + + img_json["PERSISTENT"] = $('#img_persistent:checked').length ? "YES" : "NO"; + + dev_prefix = $('#img_dev_prefix').val(); + if (dev_prefix.length){ + img_json["DEV_PREFIX"] = dev_prefix; + } + + bus = $('#img_bus').val(); + img_json["BUS"] = bus; + + switch ($('#src_path_select input:checked').val()){ + case "path": + path = $('#img_path').val(); + img_json["PATH"] = path; + break; + case "source": + source = $('#img_source').val(); + img_json["SOURCE"] = source; + break; + case "datablock": + size = $('#img_size').val(); + fstype = $('#img_fstype').val(); + img_json["SIZE"] = size; + img_json["FSTYPE"] = fstype; + break; + } + obj = { "image" : img_json }; + OpenNebula.Image.create({data: obj,success: addImageElement,error: onError}); + + $create_image_dialog.dialog('close'); + return false; + }); + + $('#create_image_form_manual').submit(function(){ + template=$('#template',this).val(); + OpenNebula.Image.create({data: template,success: addImageElement,error: onError}); + $create_image_dialog.dialog('close'); + return false; + }); + + +} + +/*###################################################################### + * UTIL FUNCTIONS + * ###################################################################*/ + +//Notifications +function notifySubmit(action, args, extra_param){ + var action_text = action.replace(/OpenNebula\./,'').replace(/\./,' '); + + var msg = "

      Submitted

      "; + msg += action_text + ": " + args; + if (extra_param != null) + msg += " >> " + extra_param; + + $.jGrowl(msg, {theme: "jGrowl-notify-submit"}); +} + +function notifyError(msg){ + msg = "

      Error

      " + msg; + + $.jGrowl(msg, {theme: "jGrowl-notify-error", sticky: true }); +} + +// Returns an HTML string with the json keys and values in the form +// key: value
      +// It recursively explores objects, and flattens their contents in +// the result. +function prettyPrintJSON(template_json){ + str = "" + for (field in template_json) { + if (typeof template_json[field] == 'object'){ + str += prettyPrintJSON(template_json[field]) + ''; + } else { + str += ''+field+''+template_json[field]+''; + }; + }; + return str; +} + +//Replaces all class"tip" divs with an information icon that +//displays the tip information on mouseover. +function setupTips(){ + $('div.tip').each(function(){ + tip = $(this).html(); + $(this).html(''); + $(this).append(''); + + $(this).append(''); + + + $('span.tipspan',this).html(tip); + $(this).parent().append('
      '); + $('span.tipspan',this).hide(); + $('span.info_icon',this).hover(function(e){ + var top, left; + top = e.pageY - 15;// - $(this).parents('#create_vm_dialog').offset().top - 15; + left = e.pageX + 15;// - $(this).parents('#create_vm_dialog').offset().left; + $(this).next().css( + {"top":top+"px", + "left":left+"px"}); + $(this).next().fadeIn(); + },function(){ + $(this).next().fadeOut(); + }); + }); +} + +//Returns the username of a user providing the uid. +//Crawls the user dataTable for that. If such user is not found, +//we return the uid. +function getUserName(uid){ + nodes = dataTable_users.fnGetData(); + user = "uid "+uid; + $.each(nodes,function(){ + if (uid == this[1]) { + user = this[2]; + return false; + } + }); + return user; + +} + +// Returns an string in the form key=value key=value ... +// Does not explore objects in depth. +function stringJSON(json){ + str = "" + for (field in json) { + str+= field + '=' + json[field] + ' '; + } + return str; +} + +// Returns the running time data +function str_start_time(vm){ + return pretty_time(vm.STIME); +} + +// Updates a data_table, with a 2D array containing +// Does a partial redraw, so the filter and pagination are kept +function updateView(item_list,data_table){ + if (data_table!=null) { + data_table.fnClearTable(); + data_table.fnAddData(item_list); + data_table.fnDraw(false); + }; +} + +function updateSingleElement(element,data_table,tag){ + tr = $(tag).parents('tr')[0]; + position = data_table.fnGetPosition(tr); + data_table.fnUpdate(element,position,0); +} + +function tableCheckboxesListener(dataTable){ + context = dataTable.parents('form'); + last_action_b = $('.last_action_button',context); + $('.top_button, .list_button',context).button("disable"); + if (last_action_b.length && last_action_b.val().length){ + last_action_b.button("disable"); + }; + $('.new_button',context).button("enable"); + + //listen to changes + $('input',dataTable).click(function(){ + dataTable = $(this).parents('table').dataTable(); + context = dataTable.parents('form'); + last_action_b = $('.last_action_button',context); + nodes_length = $('input:checked',dataTable.fnGetNodes()).length; + + if (nodes_length){ + $('.top_button, .list_button',context).button("enable"); + if (last_action_b.length && last_action_b.val().length){ + last_action_b.button("enable"); + }; + $('.new_button',context).button("enable"); + } else { + $('.top_button, .list_button',context).button("disable"); + last_action_b.button("disable"); + $('.new_button',context).button("enable"); + } + }); + +} + +function deleteElement(data_table,tag){ + tr = $(tag).parents('tr')[0]; + data_table.fnDeleteRow(tr); +} + +function addElement(element,data_table){ + data_table.fnAddData(element); +} + +function hostElementArray(host_json){ + host = host_json.HOST; + acpu = parseInt(host.HOST_SHARE.MAX_CPU); + if (!acpu) {acpu=100}; + acpu = acpu - parseInt(host.HOST_SHARE.CPU_USAGE); + + + total_mem = parseInt(host.HOST_SHARE.MAX_MEM); + free_mem = parseInt(host.HOST_SHARE.FREE_MEM); + ratio_mem = Math.round(((total_mem - free_mem) / total_mem) * 100); + + + total_cpu = parseInt(host.HOST_SHARE.MAX_CPU); + used_cpu = Math.max(total_cpu - parseInt(host.HOST_SHARE.USED_CPU),acpu); + + ratio_cpu = Math.round(((total_cpu - used_cpu) / total_cpu) * 100); + + + + pb_mem = +'
      \ +
      \ + '+ratio_mem+'%\ +
      \ +
      '; + + pb_cpu = +'
      \ +
      \ + '+ratio_cpu+'%\ +
      \ +
      '; + + + return [ '', + host.ID, + host.NAME, + host.CLUSTER, + host.HOST_SHARE.RUNNING_VMS, //rvm + pb_cpu, + pb_mem, + OpenNebula.Helper.resource_state("host",host.STATE) ]; + + + //~ return [ '', + //~ host.ID, + //~ host.NAME, + //~ host.CLUSTER, + //~ host.HOST_SHARE.RUNNING_VMS, //rvm + //~ host.HOST_SHARE.MAX_CPU, //tcpu + //~ parseInt(host.HOST_SHARE.MAX_CPU) - parseInt(host.HOST_SHARE.USED_CPU), //fcpu + //~ acpu, + //~ humanize_size(host.HOST_SHARE.MAX_MEM), + //~ humanize_size(host.HOST_SHARE.FREE_MEM), + //~ OpenNebula.Helper.resource_state("host",host.STATE) ]; +} + +//Adds a listener to show the extended info when clicking on a row +function hostInfoListener(){ + $('#tbodyhosts tr').click(function(e){ + //do nothing if we are clicking a checkbox! + if ($(e.target).is('input')) {return true;} + + popDialogLoading(); + aData = dataTable_hosts.fnGetData(this); + id = $(aData[0]).val(); + OpenNebula.Host.show({data:{id:id},success: updateHostInfo,error: onError}); + return false; + }); +} + +//~ function clusterElementArray(cluster_json){ + //~ cluster = cluster_json.CLUSTER; + //~ return ['', + //~ cluster.ID, + //~ cluster.NAME + //~ ] +//~ } + +function vMachineElementArray(vm_json){ + vm = vm_json.VM; + return [ + '', + vm.ID, + vm.USERNAME ? vm.USERNAME : getUserName(vm.UID), + vm.NAME, + OpenNebula.Helper.resource_state("vm",vm.STATE), + vm.CPU, + humanize_size(vm.MEMORY), + vm.HISTORY ? vm.HISTORY.HOSTNAME : "--", + str_start_time(vm) + ] +} + +//Adds a listener to show the extended info when clicking on a row +function vMachineInfoListener(){ + $('#tbodyvmachines tr').click(function(e){ + if ($(e.target).is('input')) {return true;} + aData = dataTable_vMachines.fnGetData(this); + id = $(aData[0]).val(); + OpenNebula.VM.show({data: {id:id},success: updateVMInfo,error: onError}); + return false; + }); +} + +function vNetworkElementArray(vn_json){ + network = vn_json.VNET; + if (network.TOTAL_LEASES != undefined){ + total_leases = network.TOTAL_LEASES; + }else if (network.LEASES.LEASE != undefined){ + total_leases = network.LEASES.LEASE.length ? network.LEASES.LEASE.length : "1"; + } else{ + total_leases = "0"; + } + username = network.USERNAME? network.USERNAME : getUserName(network.UID) + return ['', + network.ID, + username, + network.NAME, + parseInt(network.TYPE) ? "FIXED" : "RANGED", + network.BRIDGE, + parseInt(network.PUBLIC) ? "yes" : "no", + total_leases ]; +} +//Adds a listener to show the extended info when clicking on a row +function vNetworkInfoListener(){ + $('#tbodyvnetworks tr').click(function(e){ + if ($(e.target).is('input')) {return true;} + aData = dataTable_vNetworks.fnGetData(this); + id = $(aData[0]).val(); + OpenNebula.Network.show({data:{id: id},success: updateVNetworkInfo,error: onError}); + return false; + }); +} + +function userElementArray(user_json){ + user = user_json.USER; + return [ + '', + user.ID, + user.NAME + ] +} + +function imageElementArray(image_json){ + image = image_json.IMAGE; + return [ + '', + image.ID, + image.USERNAME ? image.USERNAME : getUserName(image.ID), + image.NAME, + OpenNebula.Helper.image_type(image.TYPE), + pretty_time(image.REGTIME), + parseInt(image.PUBLIC) ? "yes" : "no", + parseInt(image.PERSISTENT) ? "yes" : "no", + OpenNebula.Helper.resource_state("image",image.STATE), + image.RUNNING_VMS + ]; +} + +function imageInfoListener(){ + $('#tbodyimages tr').click(function(e){ + if ($(e.target).is('input')) {return true;} + aData = dataTable_images.fnGetData(this); + id = $(aData[0]).val(); + OpenNebula.Image.show({data: {id: id},success: updateImageInfo,error: onError}); + return false; + }); +} + +function updateHostSelect(host_list){ + + //update select helper + hosts_select=""; + hosts_select += ""; + $.each(host_list, function(){ + hosts_select += ""; + }); + + //update static selectors + $('#vm_host').html(hosts_select); +} + +function updateClusterSelect(cluster_list){ + + //update select helper + clusters_select= ""; + clusters_select+=""; + $.each(cluster_list, function(){ + clusters_select += ""; + }); + + //update static selectors + //$('#host_cluster').html(clusters_select); + +} + +function updateNetworkSelect(network_list){ + //update select helper + vnetworks_select=""; + vnetworks_select += ""; + $.each(network_list, function(){ + vnetworks_select += ""; + + }); + + //update static selectors + $('div.vm_section#networks select#NETWORK').html(vnetworks_select); +} + +function updateImageSelect(image_list){ + images_select=""; + images_select += ""; + $.each(image_list, function(){ + images_select += ""; + }); + + //update static selectors + $('div.vm_section#disks select#IMAGE').html(images_select); +} + + +// New layout +//~ function tabSelect(event,ui){ + //~ // ui.tab // anchor element of the selected (clicked) tab + //~ // ui.panel // element, that contains the selected/clicked tab contents + //~ // ui.index // zero-based index of the selected (clicked) tab + //~ switch(ui.index) + //~ { + //~ case 0: + //~ emptyDashboard(); + //~ preloadTables(); + //~ break; + //~ case 1: // Hosts + //~ OpenNebula.Host.list(updateHostsView,onError); + //~ break; + //~ case 2: // Clusters + //~ OpenNebula.Cluster.list(updateClustersView,onError); + //~ break; + //~ case 3: //VMs + //~ OpenNebula.VM.list(updateVMachinesView,onError); + //~ break; + //~ case 4: //VNs + //~ OpenNebula.Network.list(updateVNetworksView,onError); + //~ break; + //~ case 5: //Users + //~ OpenNebula.User.list(updateUsersView,onError); + //~ break; + //~ } +//~ } + +//puts the dashboard values into "retrieving" +function emptyDashboard(){ + $("#dashboard .value_td span").html(spinner); +} + +function updateDashboard(what){ + db = $('#dashboard'); + switch (what){ + case "hosts": + total_hosts=host_list_json.length; + active_hosts=0; + $.each(host_list_json,function(){ + if (parseInt(this.HOST.STATE) < 3){ + active_hosts++;} + }); + $('#total_hosts',db).html(total_hosts); + $('#active_hosts',db).html(active_hosts); + break; + case "clusters": + total_clusters=cluster_list_json.length; + $('#total_clusters',db).html(total_clusters); + break; + case "vms": + total_vms=vmachine_list_json.length; + running_vms=0; + failed_vms=0; + $.each(vmachine_list_json,function(){ + vm_state = parseInt(this.VM.STATE); + if (vm_state == 3){ + running_vms++; + } + else if (vm_state == 7) { + failed_vms++; + } + }); + $('#total_vms',db).html(total_vms); + $('#running_vms',db).html(running_vms); + $('#failed_vms',db).html(failed_vms); + break; + case "vnets": + public_vnets=0; + total_vnets=network_list_json.length; + $.each(network_list_json,function(){ + if (parseInt(this.VNET.PUBLIC)){ + public_vnets++;} + }); + $('#total_vnets',db).html(total_vnets); + $('#public_vnets',db).html(public_vnets); + break; + case "users": + total_users=user_list_json.length; + $('#total_users',db).html(total_users); + break; + case "images": + total_images=image_list_json.length; + public_images=0; + $.each(image_list_json,function(){ + if (parseInt(this.IMAGE.PUBLIC)){ + public_images++;} + }); + $('#total_images',db).html(total_images); + $('#public_images',db).html(public_images); + break; + } +} + +/*###################################################################### + * UPDATE VIEWS - CALLBACKS + * ##################################################################*/ +function onError(request,error_json) { + var method; + var action; + var object; + var id; + var reason; + var m; + var message = error_json.error.message; + + //redirect to login if unauthenticated + if (error_json.error.http_status=="401") { + window.location.href = "/login"; + }; + + //Parse known errors: + var action_error = new RegExp("^\\[(\\w+)\\] Error trying to (\\w+) (\\w+) \\[(\\w+)\\].*Reason: (.*)\.$"); + var get_error = new RegExp("^\\[(\\w+)\\] Error getting (\\w+) \\[(\\w+)\\]\.$"); + var auth_error = /^\[(\w+)\] User \[.\] not authorized to perform (\w+) on (\w+) \[?(\w+)\]?\.?$/; + + if (m = message.match(action_error)) { + method = m[1]; + action = m[2]; + object = m[3]; + id = m[4]; + reason = m[5]; + } else if (m = message.match(get_error)) { + method = m[1]; + action = "SHOW"; + object = m[2]; + id = m[3]; + } else if (m = message.match(auth_error)) { + method = m[1]; + action = m[2]; + object = m[3]; + id = m[4]; + } + + if (m) { + var rows; + var i; + var value; + rows = ["method","action","object","id","reason"]; + message = ""; + for (i in rows){ + key = rows[i]; + value = eval(key); + if (value) + message += ""+key+""+value+""; + } + message = "" + message + "
      "; + } + + notifyError(message); + return true; +} + +/* All the following functions follow a similar function: + * 'update*View' functions clear and fully repopulate the tables. + * 'update*Element' functions find and update a single element with new + * info. + * 'delete*Element' functions find and remove an element from the list. + * 'add*Element' functions add a new element to the list. + * */ + +function updateHostElement(request, host_json){ + id = host_json.HOST.ID; + element = hostElementArray(host_json); + updateSingleElement(element,dataTable_hosts,'#host_'+id) +} + +function deleteHostElement(req){ + deleteElement(dataTable_hosts,'#host_'+req.request.data); +} + +function addHostElement(request,host_json){ + element = hostElementArray(host_json); + addElement(element,dataTable_hosts); + hostInfoListener(); + tableCheckboxesListener(dataTable_hosts); +} + +function updateHostsView (request,host_list){ + host_list_json = host_list; + host_list_array = [] + + $.each(host_list,function(){ + //Grab table data from the host_list + host_list_array.push(hostElementArray(this)); + }); + + updateView(host_list_array,dataTable_hosts); + updateHostSelect(host_list); + updateDashboard("hosts"); + + //We need to re-add this listener as list has been refreshed + hostInfoListener(); + tableCheckboxesListener(dataTable_hosts); +} + + +//~ function updateClusterElement(request, cluster_json){ + //~ id = cluster_json.CLUSTER.ID; + //~ element = clusterElementArray(cluster_json); + //~ updateSingleElement(element,dataTable_clusters,'#cluster_'+id) +//~ } +//~ +//~ function deleteClusterElement(req){ + //~ deleteElement(dataTable_clusters,'#cluster_'+req.request.data); +//~ } +//~ +//~ function addClusterElement(request,cluster_json){ + //~ element = clusterElementArray(cluster_json); + //~ addElement(element,dataTable_clusters); +//~ } + +function updateClustersView(request, cluster_list){ + cluster_list_json = cluster_list; + //~ cluster_list_array = []; + + //~ $.each(cluster_list, function(){ + //~ cluster_list_array.push(clusterElementArray(this)); + //~ }); + //~ updateView(cluster_list_array,dataTable_clusters); + updateClusterSelect(cluster_list); + updateDashboard("clusters"); +} + + +function updateVMachineElement(request, vm_json){ + id = vm_json.VM.ID; + element = vMachineElementArray(vm_json); + updateSingleElement(element,dataTable_vMachines,'#vm_'+id) +} + +function deleteVMachineElement(req){ + deleteElement(dataTable_vMachines,'#vm_'+req.request.data); +} + +function addVMachineElement(request,vm_json){ + notifySubmit('OpenNebula.VM.create',vm_json.VM.ID); + element = vMachineElementArray(vm_json); + addElement(element,dataTable_vMachines); + vMachineInfoListener(); + updateVMInfo(null,vm_json); + tableCheckboxesListener(dataTable_vMachines); +} + +function updateVMachinesView(request, vmachine_list){ + vmachine_list_json = vmachine_list; + vmachine_list_array = []; + + $.each(vmachine_list,function(){ + vmachine_list_array.push( vMachineElementArray(this)); + }); + + updateView(vmachine_list_array,dataTable_vMachines); + vMachineInfoListener(); + tableCheckboxesListener(dataTable_vMachines); + updateDashboard("vms"); +} + + +function updateVNetworkElement(request, vn_json){ + id = vn_json.VNET.ID; + element = vNetworkElementArray(vn_json); + updateSingleElement(element,dataTable_vNetworks,'#vnetwork_'+id); + tableCheckboxesListener(dataTable_vNetworks); +} + +function deleteVNetworkElement(req){ + deleteElement(dataTable_vNetworks,'#vnetwork_'+req.request.data); +} + +function addVNetworkElement(request,vn_json){ + element = vNetworkElementArray(vn_json); + addElement(element,dataTable_vNetworks); + vNetworkInfoListener(); +} + +function updateVNetworksView(request, network_list){ + network_list_json = network_list; + network_list_array = []; + + $.each(network_list,function(){ + network_list_array.push(vNetworkElementArray(this)); + }); + + updateView(network_list_array,dataTable_vNetworks); + updateNetworkSelect(network_list); + vNetworkInfoListener(); + updateDashboard("vnets"); + tableCheckboxesListener(dataTable_vNetworks); + +} + +function updateUserElement(request, user_json){ + id = user_json.USER.ID; + element = userElementArray(user_json); + updateSingleElement(element,dataTable_users,'#user_'+id); + tableCheckboxesListener(dataTable_users); +} + +function deleteUserElement(req){ + deleteElement(dataTable_users,'#user_'+req.request.data); +} + +function addUserElement(request,user_json){ + element = userElementArray(user_json); + addElement(element,dataTable_users); +} + +function updateUsersView(request,users_list){ + user_list_json = users_list; + user_list_array = []; + + $.each(user_list_json,function(){ + user_list_array.push(userElementArray(this)); + }); + updateView(user_list_array,dataTable_users); + updateDashboard("users"); + tableCheckboxesListener(dataTable_users); +} + + +function updateImageElement(request, image_json){ + id = image_json.IMAGE.ID; + element = imageElementArray(image_json); + updateSingleElement(element,dataTable_images,'#image_'+id); + tableCheckboxesListener(dataTable_images); + imageInfoListener(); +} + +function deleteImageElement(req){ + deleteElement(dataTable_images,'#image_'+req.request.data); +} + +function addImageElement(request, image_json){ + element = imageElementArray(image_json); + addElement(element,dataTable_images); +} + +function updateImagesView(request, images_list){ + image_list_json = images_list; + image_list_array = []; + $.each(image_list_json,function(){ + image_list_array.push(imageElementArray(this)); + }); + + updateView(image_list_array,dataTable_images); + updateImageSelect(images_list); + imageInfoListener(); + tableCheckboxesListener(dataTable_images); + updateDashboard("images"); + + +} + + +/*###################################################################### + * UPDATE INFO DIALOGS FUNCTIONS - CALLBACKS + * ###################################################################*/ +//All functions in this section are callbacks for the "show" +//action. They receive the element JSON, format it and add it to the +//shown dialog. + + +function updateHostInfo(request,host){ + host_info = host.HOST + rendered_info = +'
      \ + \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Host information - '+host_info.NAME+'
      ID'+host_info.ID+'
      State'+OpenNebula.Helper.resource_state("host",host_info.STATE)+'
      Cluster'+host_info.CLUSTER+'
      IM MAD'+host_info.IM_MAD+'
      VM MAD'+host_info.VM_MAD+'
      TM MAD'+host_info.TM_MAD+'
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Host shares
      Max Mem'+humanize_size(host_info.HOST_SHARE.MAX_MEM)+'
      Used Mem (real)'+humanize_size(host_info.HOST_SHARE.USED_MEM)+'
      Used Mem (allocated)'+humanize_size(host_info.HOST_SHARE.MAX_USAGE)+'
      Used CPU (real)'+host_info.HOST_SHARE.USED_CPU+'
      Used CPU(allocated)'+host_info.HOST_SHARE.CPU_USAGE+'
      Running VMs'+host_info.HOST_SHARE.RUNNING_VMS+'
      \ +
      \ +
      \ + \ + '+ + prettyPrintJSON(host_info.TEMPLATE)+ + '
      Host template
      \ +
      \ +
      '; + popDialog(rendered_info); + $('#host_informations').tabs(); + + $('.host_info_action_button').button(); + //listen to buttons + $('.host_info_action_button').click(function(){ + id = host_info.ID; + action=$(this).val(); + + switch (action){ + case "OpenNebula.Host.delete": + $('#host_info_dialog').dialog("close"); + (eval(action)({data: {id: id}, + success: deleteHostElement, + error: onError})); + break; + case "OpenNebula.Host.enable": + case "OpenNebula.Host.disable": + (eval(action)({ data:{id:id}, + success: function(){ + updateBoth = function(req,res){ + updateHostElement(req,res); + updateHostInfo(req,res); + }; + OpenNebula.Host.show({data:{id: id},success: updateBoth, error: onError}); + + }, + error: onError})); + } + return false; + }); + + +} + +// Used as an event method to the VM info tabs. +function fetch_log(event, ui) { + if (ui.index == 2) //tab + { + var vm_id = $("#vm_log pre").attr('id').substr(10); + OpenNebula.VM.log({ data: {id: vm_id}, + success: function(req, res){ + log_lines = res.split("\n"); + var colored_log = ''; + for (line in log_lines){ + line = log_lines[line]; + if (line.match(/\[E\]/)){ + line = ''+line+'' + } + colored_log += line + "\n"; + } + $("#vm_log pre").html(colored_log); + }, + error: function(request,error_json){ + $("#vm_log pre").html(''); + onError(request,error_json); + } + }); + } +} + +function updateVMInfo(request,vm){ + vm_info = vm.VM; + id = vm_info.ID; + rendered_info = +'
      \ + \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Virtual Machine information - '+vm_info.NAME+'
      ID'+vm_info.ID+'
      Name'+vm_info.NAME+'
      State'+OpenNebula.Helper.resource_state("vm",vm_info.STATE)+'
      LCM State'+OpenNebula.Helper.resource_state("vm",vm_info.LCMSTATE)+'
      Start time'+pretty_time(vm_info.STIME)+'
      Deploy ID'+(vm_info.DEPLOY_ID ? vm_info.DEPLOY_ID : "-")+'
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Monitoring information
      Net_TX'+vm_info.NET_TX+'
      Net_RX'+vm_info.NET_RX+'
      Used Memory'+humanize_size(vm_info.MEMORY)+'
      Used CPU'+vm_info.CPU+'
      \ +
      \ +
      \ + \ + '+ + prettyPrintJSON(vm_info.TEMPLATE)+ + '
      VM template
      \ +
      \ +

      Virtual Machine Log - '+vm_info.NAME+'

      \ +
      '+spinner+'
      \ +
      \ +
      '; + + $('#vm_info_error',rendered_info).hide(); + popDialog(rendered_info); + $('#vm_informations').tabs({select: fetch_log}); + + /* Not used + $('#vm_info_simple_action').button(); + + + $('#vm_info_simple_action').click(function(){ + action = $('#vm_info_opt_actions').val(); + if (!action.length) { return false; }; + (eval(action)(id, + function(){OpenNebula.VM.show(id,updateVMInfo,onError)}, + function(request,error_json){ + $('#vm_info_error').html( + 'The request failed with the following error: '+ + error_json.error.message + + '. Resource: '+ request.request.resource + + '. Method: '+ request.request.method + '.'); + $('#vm_info_error').addClass("ui-state-error"); + $('#vm_info_error').show(); + + })); + });*/ +} + +function updateVNetworkInfo(request,vn){ + vn_info = vn.VNET; + rendered_info = +'
      \ + \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Virtual Network '+vn_info.ID+' information
      ID'+vn_info.ID+'
      UID'+vn_info.UID+'
      Public'+(parseInt(vn_info.PUBLIC) ? "yes" : "no" )+'
      \ + \ + \ + \ + '+ + prettyPrintJSON(vn_info.LEASES)+ + '
      Leases information
      \ +
      \ +
      \ + \ + '+ + prettyPrintJSON(vn_info.TEMPLATE)+ + '
      Virtual Network template
      \ +
      \ +
      '; + + popDialog(rendered_info); + $('#vn_informations').tabs(); +} + +function updateImageInfo(request,img){ + img_info = img.IMAGE; + rendered_info = +'
      \ + \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Image "'+img_info.NAME+'" information
      ID'+img_info.ID+'
      Name'+img_info.NAME+'
      Type'+OpenNebula.Helper.image_type(img_info.TYPE)+'
      Register time'+pretty_time(img_info.REGTIME)+'
      Public'+(img_info.PUBLIC ? "yes" : "no")+'
      Persistent'+(img_info.PERSISTENT ? "yes" : "no")+'
      Source'+img_info.SOURCE+'
      State'+img_info.STATE+'
      \ +
      \ +
      \ + \ + '+ + prettyPrintJSON(img_info.TEMPLATE)+ + '
      Image template
      \ +
      \ +
      '; + popDialog(rendered_info); + $('#image_informations').tabs(); +} + +// Auxiliary functions +function pad(number,length) { + var str = '' + number; + while (str.length < length) + str = '0' + str; + return str; +} + +function pretty_time(time_seconds) +{ + var d = new Date(); + d.setTime(time_seconds*1000); + + var secs = pad(d.getSeconds(),2); + var hour = pad(d.getHours(),2); + var mins = pad(d.getMinutes(),2); + var day = pad(d.getDate(),2); + var month = pad(d.getMonth(),2); + var year = d.getFullYear(); + + return hour + ":" + mins +":" + secs + " " + month + "/" + day + "/" + year; +} + +function humanize_size(value) { + if (typeof(value) === "undefined") { + value = 0; + } + var binarySufix = ["K", "M", "G", "T" ]; + var i=0; + while (value > 1024 && i < 3){ + value = value / 1024; + i++; + } + value = Math.round(value * 10) / 10; + + if (value - Math.round(value) == 0) { + value = Math.round(value); + } + + var st = value + binarySufix[i]; + return st; +} diff --git a/src/sunstone/public/js/one-ui_views.templates.js b/src/sunstone/public/js/one-ui_views.templates.js new file mode 100644 index 0000000000..67dbaa50b6 --- /dev/null +++ b/src/sunstone/public/js/one-ui_views.templates.js @@ -0,0 +1,1096 @@ +/* -------------------------------------------------------------------------- */ +/* 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_tmpl = +'\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      \ +
      \ +

      Hosts\ +
      \ + +\ +
      \ +

      \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Total
      Active
      \ +
      \ +
      \ +
      \ +
      \ +

      Clusters\ +
      \ + +\ +
      \ +

      \ +
      \ + \ + \ + \ + \ + \ +
      Total
      \ +
      \ +
      \ +
      \ +
      \ +

      Virtual Machines\ +
      \ + +\ +
      \ +

      \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Total
      Running
      Failed
      \ +
      \ +
      \ +
      \ +
      \ +

      Virtual Networks\ +
      \ + +\ +
      \ +

      \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Total
      Public
      \ +
      \ +
      \ + \ +
      \ +
      \ +

      \ + Images\ +
      \ + +\ +
      \ +

      \ +
      \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      Total
      Public
      \ +
      \ +
      \ +
      \ +
      \ +

      Users\ +
      \ + +\ +
      \ +

      \ +
      \ + \ + \ + \ + \ + \ +
      Total
      \ +
      \ +
      \ +
      '; + + + + + + +var hostlist_tmpl = +'
      \ +
      \ +
      \ + OpenNebula.Host.list\ +
      \ +
      \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ + \ +
      \ +
      \ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      AllIDNameClusterRunning VMsCPU UseMemory useStatus
      \ +
      '; + +var create_host_tmpl = +'
      \ +
      \ + Host parameters\ + \ +
      \ +

      Drivers

      \ +
      \ +
      \ + \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      '; + +//~ var clusterlist_tmpl = +//~ '
      \ + //~
      \ + //~
      \ + //~ OpenNebula.Cluster.list\ + //~
      \ + //~
      \ + //~ \ + //~
      \ + //~
      \ + //~ \ + //~
      \ + //~
      \ +//~ \ + //~ \ + //~ \ + //~ \ + //~ \ + //~ \ + //~ \ + //~ \ + //~ \ + //~ \ +//~
      AllIDName
      \ +//~
      '; + +var create_cluster_tmpl = +'
      \ +
      \ +
      \ + \ +
      \ +
      \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      '; + +var vmachinelist_tmpl = +'
      \ +
      \ +
      \ + OpenNebula.VM.list\ +
      \ +
      \ + \ +
      \ +
      \ + \ +
      \ +
      \ + \ +
      \ +
      \ + \ +
      \ +
      \ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      AllIDUserNameStatusCPUMemoryHostnameStart Time
      \ +
      '; + +var create_vm_tmpl = +'
      \ + \ +
      \ +
      \ +
      \ + \ +

      Fields marked with are mandatory
      \ + Fold / Unfold all sections

      \ +
      \ +\ + \ +
      \ +
      \ +

      Capacity options

      \ +
      \ +
      Capacity\ +
      \ + \ + \ +
      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-<VID>.
      \ +
      \ +
      \ + \ + \ +
      Amount of RAM required for the VM, in Megabytes.
      \ +
      \ +
      \ + \ + \ +
      Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.
      \ +
      \ +
      \ + \ + \ +
      Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.
      \ +
      \ +
      \ +
      \ + \ +
      \ +
      \ +

      Boot/OS options

      \ +
      \ +
      OS and Boot options\ +
      \ + \ + \ +
      CPU architecture to virtualization
      \ +
      \ + \ +
      \ + \ + \ +
      Select boot method
      \ +
      \ +
      \ + \ + \ +
      Path to the OS kernel to boot the image
      \ +
      \ +
      \ + \ + \ +
      Path to the initrd image
      \ +
      \ +
      \ + \ + \ +
      Device to be mounted as root
      \ +
      \ +
      \ + \ + \ +
      Arguments for the booting kernel
      \ +
      \ +
      \ + \ + \ +
      Path to the bootloader executable
      \ +
      \ +
      \ + \ + \ +
      Boot device type
      \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ +

      Add disks/images

      \ +
      \ +
      Disks\ +
      \ + \ + Disk\ + \ + Image\ + \ +
      \ +
      \ +
      \ + \ + \ +
      Name of the image to use
      \ +
      \ +
      \ + \ + \ +
      Type of disk device to emulate: ide, scsi
      \ +
      \ +
      \ + \ + \ +
      Device to map image disk. If set, it will overwrite the default device mapping
      \ +
      \ +
      \ + \ + \ +
      Specific image mapping driver. KVM: raw, qcow2. Xen:tap:aio:, file:. VMware unsupported
      \ +
      \ +
      \ + \ + \ +
      Disk type
      \ +
      \ +
      \ + \ + \ +
      Disk file location path or URL
      \ +
      \ +
      \ + \ + \ + \ +
      Disk file location path or URL. Mandatory for swap, fs and block images
      \ +
      \ +
      \ + \ + \ + \ +
      Filesystem type for the fs images
      \ +
      \ +
      \ + \ + \ +
      Clone this image
      \ +
      \ +
      \ + \ + \ +
      Save this image after shutting down the VM
      \ +
      \ +
      \ + \ + \ +
      Mount image as read-only
      \ +
      \ +
      \ + \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +\ + \ +
      \ +
      \ +

      Setup Networks

      \ +
      \ +
      Network\ +
      \ + \ + Predefined\ + \ + Manual\ + \ + \ +
      \ +
      \ +
      \ + \ + \ +
      Name of the network to attach this device
      \ +
      \ +
      \ + \ + \ +
      Request an specific IP from the Network
      \ +
      \ +
      \ + \ + \ +
      HW address associated with the network interface
      \ +
      \ +
      \ + \ + \ +
      Name of the bridge the network device is going to be attached to
      \ +
      \ +
      \ + \ + \ +
      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
      \ +
      \ +
      \ + \ + \ +
      Hardware that will emulate this network interface. With Xen this is the type attribute of the vif.
      \ +
      \ +
      \ + \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ +

      Add inputs

      \ +
      \ +
      Inputs\ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ +

      Add Graphics

      \ +
      \ +
      Graphics\ +
      \ + \ + \ +
      \ +
      \ +
      \ + \ + \ +
      IP to listen on
      \ +
      \ +
      \ + \ + \ +
      Port for the VNC server
      \ +
      \ +
      \ + \ + \ +
      Password for the VNC server
      \ +
      \ +
      \ + \ + \ +
      Keyboard configuration locale to use in the VNC display
      \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ +

      Add context

      \ +
      \ +
      Context\ +
      \ + \ + \ + \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ +

      Add placement options

      \ +
      \ +
      Placement\ +
      \ + \ + \ +
      Boolean expression that rules out provisioning hosts from list of machines suitable to run this VM
      \ +
      \ +
      \ + \ + \ +
      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
      \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ +

      Add Hypervisor raw options

      \ +
      \ +
      Raw\ + \ +
      \ + \ + \ + \ +
      Raw data to be passed directly to the hypervisor
      \ +
      \ +
      \ +
      \ +\ +\ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +

      Write the Virtual Machine template here

      \ +
      \ + \ +
      \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      '; + + +var vnetworklist_tmpl = +'
      \ +
      \ +
      \ + OpenNebula.Network.list\ +
      \ +
      \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ + \ +
      \ +
      \ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      AllIDUserNameTypeBridgePublic?Total Leases
      \ +
      '; + +var create_vn_tmpl = +'
      \ + \ +
      \ +
      \ +
      \ + \ +
      \ +
      \ +
      \ + \ +
      \ +
      \ +
      \ + \ + Fixed network
      \ + Ranged network
      \ +
      \ +
      \ +
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ + \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ + \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +

      Write the Virtual Network template here

      \ +
      \ + \ +
      \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      '; + +var userlist_tmpl = +'
      \ +
      \ +
      \ + OpenNebula.VM.list\ +
      \ +
      \ + \ +
      \ +
      \ + \ +
      \ +
      \ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      AllIDName
      \ +
      '; + +var create_user_tmpl = +'
      \ +
      \ +
      \ + \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      '; + + +var imagelist_tmpl = +'
      \ +
      \ +
      \ + OpenNebula.Image.list\ +
      \ +
      \ + \ +
      \ +
      \ + \ + \ + \ +
      \ +
      \ + \ +
      \ +
      \ + \ +
      \ +
      \ +\ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
      AllIDUserNameTypeRegistration timePublicPersistentState#VMS
      \ +
      '; + +var create_image_tmpl = +'
      \ + \ +
      \ +
      \ +

      Fields marked with are mandatory
      \ +

      \ +
      \ + \ + \ +
      Name that the Image will get. Every image must have a unique name.
      \ +
      \ +
      \ + \ + \ +
      Human readable description of the image for other users.
      \ +
      \ +
      \ +
      \ +
      \ + \ + \ +
      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).
      \ +
      \ +
      \ + \ + \ +
      Public scope of the image
      \ +
      \ +
      \ + \ + \ +
      Persistence of the image
      \ +
      \ +
      \ + \ + \ +
      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”).
      \ +
      \ +
      \ + \ + \ +
      Type of disk device to emulate.
      \ +
      \ +
      \ +
      \ +
      \ + \ + Provide a path
      \ + Provide a source
      \ + Create an empty datablock\ +
      Please choose path if you have a file-based image. Choose source otherwise or create an empty datablock disk.
      \ +
      \ +
      \ + \ + \ +
      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.
      \ +
      \ +
      \ + \ + \ +
      Source to be used in the DISK attribute. Useful for not file-based images.
      \ +
      \ +
      \ + \ + \ +
      Size of the datablock in MB.
      \ +
      \ +
      \ + \ + \ +
      Type of file system to be built. This can be any value understood by mkfs unix command.
      \ +
      \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +
      \ +

      Write the image template here

      \ + \ +
      \ +
      \ +
      \ + \ + \ +
      \ +
      \ +
      \ +
      \ +
      '; diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js new file mode 100644 index 0000000000..74fdbe8027 --- /dev/null +++ b/src/sunstone/public/js/opennebula.js @@ -0,0 +1,1832 @@ +/* -------------------------------------------------------------------------- */ +/* 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 OpenNebula = { + + "Error": function(resp) + { + var error = {}; + if (resp.responseText) + { + error = JSON.parse(resp.responseText); + } + else + { + error.error = {}; + } + error.error.http_status = resp.status; + return error; + }, + + "is_error": function(obj) + { + if (obj.error) + { + return true; + } + else + { + return false; + } + }, + + "Helper": { + "resource_state": function(type, value) + { + switch(type) + { + case "HOST","host": + return ["INIT", + "MONITORING", + "MONITORED", + "ERROR", + "DISABLED"][value]; + break; + case "VM","vm": + return ["INIT", + "PENDING", + "HOLD", + "ACTIVE", + "STOPPED", + "SUSPENDED", + "DONE", + "FAILED"][value]; + break; + case "IMAGE","image": + return ["INIT", + "READY", + "USED", + "DISABLED"][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 + "_POOL"; + var type = resource; + var pool; + + if (typeof(pool_name) == "undefined") + { + return Error('Incorrect Pool'); + } + + var p_pool = []; + + pool = response[pool_name][type]; + + if (pool == null) + { + return p_pool; + } + else if (pool.length) + { + for (i=0;i + + + OpenNebula Admin Console + + + + + + + + + + + + + + + + + + + + + +
      +
      +
      +
      + +
      +
      +
      +
      +
      +
      +
      + + + + + + + +
      +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      + +
      +
      +
      + + diff --git a/src/sunstone/templates/login.html b/src/sunstone/templates/login.html new file mode 100644 index 0000000000..031f6b35f7 --- /dev/null +++ b/src/sunstone/templates/login.html @@ -0,0 +1,48 @@ + + + + OpenNebula Admin Console Login + + + + + + + + + + + + +
      +
      +
      +
      +
      +
      + Username + + Password + +
      + + + +
      +
      +
      + +
      + Invalid username or password +
      +
      + OpenNebula is not running +
      +
      + + + diff --git a/src/sunstone/test/examples/cluster/addhost.json b/src/sunstone/test/examples/cluster/addhost.json new file mode 100644 index 0000000000..4dea067a19 --- /dev/null +++ b/src/sunstone/test/examples/cluster/addhost.json @@ -0,0 +1,8 @@ +{ + "action": { + "params": { + "host_id": "0" + }, + "perform": "add_host" + } +} diff --git a/src/sunstone/test/examples/cluster/cluster1.json b/src/sunstone/test/examples/cluster/cluster1.json new file mode 100644 index 0000000000..56122e6cd6 --- /dev/null +++ b/src/sunstone/test/examples/cluster/cluster1.json @@ -0,0 +1,5 @@ +{ + "cluster": { + "name": "cluster_one" + } +} diff --git a/src/sunstone/test/examples/cluster/cluster2.json b/src/sunstone/test/examples/cluster/cluster2.json new file mode 100644 index 0000000000..27f53c62b4 --- /dev/null +++ b/src/sunstone/test/examples/cluster/cluster2.json @@ -0,0 +1,5 @@ +{ + "cluster": { + "name": "cluster_two" + } +} diff --git a/src/sunstone/test/examples/cluster/rmhost.json b/src/sunstone/test/examples/cluster/rmhost.json new file mode 100644 index 0000000000..a6bc0e3d43 --- /dev/null +++ b/src/sunstone/test/examples/cluster/rmhost.json @@ -0,0 +1,8 @@ +{ + "action": { + "params": { + "host_id": "0" + }, + "perform": "remove_host" + } +} diff --git a/src/sunstone/test/examples/error/wrong_action.json b/src/sunstone/test/examples/error/wrong_action.json new file mode 100644 index 0000000000..14624e7dc1 --- /dev/null +++ b/src/sunstone/test/examples/error/wrong_action.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "dance" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/host/disable.json b/src/sunstone/test/examples/host/disable.json new file mode 100644 index 0000000000..61df114117 --- /dev/null +++ b/src/sunstone/test/examples/host/disable.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "disable" + } +} diff --git a/src/sunstone/test/examples/host/enable.json b/src/sunstone/test/examples/host/enable.json new file mode 100644 index 0000000000..430eec2ce1 --- /dev/null +++ b/src/sunstone/test/examples/host/enable.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "enable" + } +} diff --git a/src/sunstone/test/examples/host/host0.json b/src/sunstone/test/examples/host/host0.json new file mode 100644 index 0000000000..714bf8e839 --- /dev/null +++ b/src/sunstone/test/examples/host/host0.json @@ -0,0 +1,8 @@ +{ + "host": { + "vm_mad": "vmm_dummy", + "tm_mad": "tm_dummy", + "name": "host_one", + "im_mad": "im_dummy" + } +} diff --git a/src/sunstone/test/examples/host/host1.json b/src/sunstone/test/examples/host/host1.json new file mode 100644 index 0000000000..87c0449339 --- /dev/null +++ b/src/sunstone/test/examples/host/host1.json @@ -0,0 +1,8 @@ +{ + "host": { + "vm_mad": "vmm_dummy", + "tm_mad": "tm_dummy", + "name": "host_two", + "im_mad": "im_dummy" + } +} diff --git a/src/sunstone/test/examples/image/disable.json b/src/sunstone/test/examples/image/disable.json new file mode 100644 index 0000000000..61df114117 --- /dev/null +++ b/src/sunstone/test/examples/image/disable.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "disable" + } +} diff --git a/src/sunstone/test/examples/image/enable.json b/src/sunstone/test/examples/image/enable.json new file mode 100644 index 0000000000..430eec2ce1 --- /dev/null +++ b/src/sunstone/test/examples/image/enable.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "enable" + } +} diff --git a/src/sunstone/test/examples/image/image0.json b/src/sunstone/test/examples/image/image0.json new file mode 100644 index 0000000000..1a4321f714 --- /dev/null +++ b/src/sunstone/test/examples/image/image0.json @@ -0,0 +1,7 @@ +{ + "image": { + "name": "first_image", + "type": "OS", + "path": "/etc/hosts" + } +} diff --git a/src/sunstone/test/examples/image/image1.json b/src/sunstone/test/examples/image/image1.json new file mode 100644 index 0000000000..91354fe95c --- /dev/null +++ b/src/sunstone/test/examples/image/image1.json @@ -0,0 +1,7 @@ +{ + "image": { + "name": "second_image", + "type": "CDROM", + "size": "512" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/image/nonpersistent.json b/src/sunstone/test/examples/image/nonpersistent.json new file mode 100644 index 0000000000..d3ec668784 --- /dev/null +++ b/src/sunstone/test/examples/image/nonpersistent.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "nonpersistent" + } +} diff --git a/src/sunstone/test/examples/image/persistent.json b/src/sunstone/test/examples/image/persistent.json new file mode 100644 index 0000000000..e3368bb656 --- /dev/null +++ b/src/sunstone/test/examples/image/persistent.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "persistent" + } +} diff --git a/src/sunstone/test/examples/image/publish.json b/src/sunstone/test/examples/image/publish.json new file mode 100644 index 0000000000..71ec3f7eb0 --- /dev/null +++ b/src/sunstone/test/examples/image/publish.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "publish" + } +} diff --git a/src/sunstone/test/examples/image/removeattr.json b/src/sunstone/test/examples/image/removeattr.json new file mode 100644 index 0000000000..a0a5672893 --- /dev/null +++ b/src/sunstone/test/examples/image/removeattr.json @@ -0,0 +1,8 @@ +{ + "action": { + "params": { + "name": "FOO" + }, + "perform": "rm_attr" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/image/unpublish.json b/src/sunstone/test/examples/image/unpublish.json new file mode 100644 index 0000000000..da41ade888 --- /dev/null +++ b/src/sunstone/test/examples/image/unpublish.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "unpublish" + } +} diff --git a/src/sunstone/test/examples/image/update.json b/src/sunstone/test/examples/image/update.json new file mode 100644 index 0000000000..960a10428b --- /dev/null +++ b/src/sunstone/test/examples/image/update.json @@ -0,0 +1,9 @@ +{ + "action": { + "params": { + "name": "FOO", + "value": "mock" + }, + "perform": "update" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/user/passwd.json b/src/sunstone/test/examples/user/passwd.json new file mode 100644 index 0000000000..240ac5d136 --- /dev/null +++ b/src/sunstone/test/examples/user/passwd.json @@ -0,0 +1,8 @@ +{ + "action": { + "params": { + "password": "newpass" + }, + "perform": "passwd" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/user/user1.json b/src/sunstone/test/examples/user/user1.json new file mode 100644 index 0000000000..4c54e16fb7 --- /dev/null +++ b/src/sunstone/test/examples/user/user1.json @@ -0,0 +1,6 @@ +{ + "user": { + "name": "user_one", + "password": "pass1" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/user/user2.json b/src/sunstone/test/examples/user/user2.json new file mode 100644 index 0000000000..39aa8683ef --- /dev/null +++ b/src/sunstone/test/examples/user/user2.json @@ -0,0 +1,6 @@ +{ + "user": { + "name": "user_two", + "password": "pass2" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/vm/deploy.json b/src/sunstone/test/examples/vm/deploy.json new file mode 100644 index 0000000000..57182ed694 --- /dev/null +++ b/src/sunstone/test/examples/vm/deploy.json @@ -0,0 +1,8 @@ +{ + "action": { + "params": { + "host_id": "0" + }, + "perform": "deploy" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/vm/hold.json b/src/sunstone/test/examples/vm/hold.json new file mode 100644 index 0000000000..cff6fd4f16 --- /dev/null +++ b/src/sunstone/test/examples/vm/hold.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "hold" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/vm/save_as.json b/src/sunstone/test/examples/vm/save_as.json new file mode 100644 index 0000000000..8f4ae8e40e --- /dev/null +++ b/src/sunstone/test/examples/vm/save_as.json @@ -0,0 +1,9 @@ +{ + "action": { + "params": { + "disk_id": "0", + "image_name": "new_image" + }, + "perform": "save_as" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/vm/vm0.json b/src/sunstone/test/examples/vm/vm0.json new file mode 100644 index 0000000000..54a30daf01 --- /dev/null +++ b/src/sunstone/test/examples/vm/vm0.json @@ -0,0 +1,12 @@ +{ + "vm": { + "memory": "256", + "cpu": "1", + "disk": { + "type": "fs", + "format": "ext3", + "size": "1024" + }, + "name": "vm1" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/vm/vm1.json b/src/sunstone/test/examples/vm/vm1.json new file mode 100644 index 0000000000..a44c2f7fda --- /dev/null +++ b/src/sunstone/test/examples/vm/vm1.json @@ -0,0 +1,7 @@ +{ + "vm": { + "memory": "512", + "cpu": "2", + "name": "vm2" + } +} \ No newline at end of file diff --git a/src/sunstone/test/examples/vnet/fixed_vnet.json b/src/sunstone/test/examples/vnet/fixed_vnet.json new file mode 100644 index 0000000000..98c08bbb73 --- /dev/null +++ b/src/sunstone/test/examples/vnet/fixed_vnet.json @@ -0,0 +1,16 @@ +{ + "vnet": { + "type": "FIXED", + "leases": [ + { + "ip": "10.0.1.1" + }, + { + "ip": "10.0.1.2" + } + ], + "bridge": "vbr2", + "network_address": "10.0.1.0", + "name": "fixed_vnet" + } +} diff --git a/src/sunstone/test/examples/vnet/publish.json b/src/sunstone/test/examples/vnet/publish.json new file mode 100644 index 0000000000..71ec3f7eb0 --- /dev/null +++ b/src/sunstone/test/examples/vnet/publish.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "publish" + } +} diff --git a/src/sunstone/test/examples/vnet/ranged_vnet.json b/src/sunstone/test/examples/vnet/ranged_vnet.json new file mode 100644 index 0000000000..55dae7ae6f --- /dev/null +++ b/src/sunstone/test/examples/vnet/ranged_vnet.json @@ -0,0 +1,9 @@ +{ + "vnet": { + "type": "RANGED", + "bridge": "vbr1", + "network_size": "200", + "network_address": "10.0.0.0", + "name": "ranged_vnet" + } +} diff --git a/src/sunstone/test/examples/vnet/unpublish.json b/src/sunstone/test/examples/vnet/unpublish.json new file mode 100644 index 0000000000..da41ade888 --- /dev/null +++ b/src/sunstone/test/examples/vnet/unpublish.json @@ -0,0 +1,5 @@ +{ + "action": { + "perform": "unpublish" + } +} diff --git a/src/sunstone/test/spec/cluster_spec.rb b/src/sunstone/test/spec/cluster_spec.rb new file mode 100644 index 0000000000..b483b9563c --- /dev/null +++ b/src/sunstone/test/spec/cluster_spec.rb @@ -0,0 +1,176 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require File.expand_path(File.dirname(__FILE__) + '/spec_helper') + +describe 'Cluster tests' do + before(:all) do + basic_authorize('oneadmin','opennebula') + post '/login' + last_response.status.should eql(204) + + @host0_s = File.read(EXAMPLES_PATH + '/host/host0.json') + post '/host', @host0_s + last_response.status.should eql(201) + + @cluster1_s = File.read(EXAMPLES_PATH + '/cluster/cluster1.json') + @cluster1_h = JSON.parse(@cluster1_s) + + @cluster2_s = File.read(EXAMPLES_PATH + '/cluster/cluster2.json') + @cluster2_h = JSON.parse(@cluster2_s) + + @action_addhost = File.read(EXAMPLES_PATH + '/cluster/addhost.json') + @action_rmhost = File.read(EXAMPLES_PATH + '/cluster/rmhost.json') + @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') + end + + it "should create a first cluster" do + post '/cluster', @cluster1_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['CLUSTER']['ID'].should eql("1") + end + + it "should create a second cluster" do + post '/cluster', @cluster2_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['CLUSTER']['ID'].should eql("2") + end + + it "should get Cluster 1 information" do + get '/cluster/1' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['CLUSTER']['NAME'].should eql(@cluster1_h['cluster']['name']) + end + + it "should add Host 0 to Cluster 1" do + post '/cluster/1/action', @action_addhost + + last_response.status.should eql(204) + end + + it "should get Host 0 information after adding it to the Cluster 1" do + get '/host/0' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['CLUSTER'].should eql("cluster_one") + end + + it "should remove Host 0 from Cluster 1" do + post '/cluster/1/action', @action_rmhost + + last_response.status.should eql(204) + end + + it "should get Host 0 information after removing it from Cluster 1" do + get '/host/0' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['CLUSTER'].should eql("default") + end + + it "should get Cluster 2 information" do + get '/cluster/2' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['CLUSTER']['NAME'].should eql(@cluster2_h['cluster']['name']) + end + + it "should get cluster_pool information" do + get '/cluster' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['CLUSTER_POOL']['CLUSTER'].size.should eql(3) + json_response['CLUSTER_POOL']['CLUSTER'].each do |cluster| + if cluster['ID'] == '1' + cluster['NAME'].should eql(@cluster1_h['cluster']['name']) + elsif cluster['ID'] == '2' + cluster['NAME'].should eql(@cluster2_h['cluster']['name']) + else + cluster['NAME'].should eql("default") + end + end + end + + it "should try to get Cluster 3 information and check the error, because " << + "it does not exist" do + get '/cluster/3' + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to add Host 0 to Cluster 3 and check the error, because " << + "it does not exist" do + post '/cluster/3/action', @action_addhost + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to remove Host 0 from Cluster 3 and check the error, " << + "because it does not exist" do + post '/cluster/3/action', @action_removehost + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to perform a wrong action and check the error" do + post '/cluster/0/action', @wrong_action + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should delete the Cluster 2" do + delete '/cluster/2' + + last_response.status.should eql(204) + end + + it "should try to get the deleted Cluster information and check the error" do + url = '/cluster/2' + get url + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end +end diff --git a/src/sunstone/test/spec/host_spec.rb b/src/sunstone/test/spec/host_spec.rb new file mode 100644 index 0000000000..f652353438 --- /dev/null +++ b/src/sunstone/test/spec/host_spec.rb @@ -0,0 +1,203 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require File.expand_path(File.dirname(__FILE__) + '/spec_helper') + +describe 'Host tests NOKOGIRI' do + before(:all) do + basic_authorize('oneadmin','opennebula') + post '/login' + last_response.status.should eql(204) + + @host0_s = File.read(EXAMPLES_PATH + '/host/host0.json') + @host0_h = JSON.parse(@host0_s) + + @host1_s = File.read(EXAMPLES_PATH + '/host/host1.json') + @host1_h = JSON.parse(@host1_s) + + @action_enable = File.read(EXAMPLES_PATH + '/host/enable.json') + @action_disable = File.read(EXAMPLES_PATH + '/host/disable.json') + @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') + end + + it "should get empty host_pool information" do + get '/host' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST_POOL'].empty?.should eql(true) + end + + it "should create a first host" do + post '/host', @host0_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['ID'].should eql("0") + end + + it "should create a second host" do + post '/host', @host1_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['ID'].should eql("1") + end + + it "should get host 0 information" do + url = '/host/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['NAME'].should eql(@host0_h['host']['name']) + json_response['HOST']['IM_MAD'].should eql(@host0_h['host']['im_mad']) + json_response['HOST']['VM_MAD'].should eql(@host0_h['host']['vm_mad']) + json_response['HOST']['TM_MAD'].should eql(@host0_h['host']['tm_mad']) + json_response['HOST']['CLUSTER'].should eql("default") + json_response['HOST']['STATE'].should eql("0") + end + + it "should disable host 0" do + url = '/host/0/action' + post url, @action_disable + + last_response.status.should eql(204) + end + + it "should get host 0 information after disabling it" do + url = '/host/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['STATE'].should eql("4") + end + + it "should enable host 0" do + url = '/host/0/action' + post url, @action_enable + + last_response.status.should eql(204) + end + + it "should get host 0 information after enabling it" do + url = '/host/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['STATE'].should eql("0") + end + + it "should get host 1 information" do + url = '/host/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST']['NAME'].should eql(@host1_h['host']['name']) + json_response['HOST']['IM_MAD'].should eql(@host1_h['host']['im_mad']) + json_response['HOST']['VM_MAD'].should eql(@host1_h['host']['vm_mad']) + json_response['HOST']['TM_MAD'].should eql(@host1_h['host']['tm_mad']) + json_response['HOST']['CLUSTER'].should eql("default") + json_response['HOST']['STATE'].should eql("0") + end + + it "should get host_pool information" do + get '/host' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['HOST_POOL']['HOST'].size.should eql(2) + json_response['HOST_POOL']['HOST'].each do |host| + if host['ID'] == '0' + host['NAME'].should eql(@host0_h['host']['name']) + host['IM_MAD'].should eql(@host0_h['host']['im_mad']) + host['VM_MAD'].should eql(@host0_h['host']['vm_mad']) + host['TM_MAD'].should eql(@host0_h['host']['tm_mad']) + elsif host['ID'] == '1' + host['NAME'].should eql(@host1_h['host']['name']) + host['IM_MAD'].should eql(@host1_h['host']['im_mad']) + host['VM_MAD'].should eql(@host1_h['host']['vm_mad']) + host['TM_MAD'].should eql(@host1_h['host']['tm_mad']) + end + end + end + + it "should try to get host 3 information and check the error, because " << + "it does not exist" do + get '/host/3' + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to enable host 3 and check the error, because " << + "it does not exist" do + post '/host/3/action', @action_enable + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to disable a third host and check the error, because " << + "it does not exist" do + post '/host/3/action', @action_disable + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to perform a wrong action and check the error" do + post '/host/0/action', @wrong_action + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should delete host 1" do + url = '/host/1' + delete url + + last_response.status.should eql(204) + end + + it "should try to get the deleted host information and check the error" do + url = '/host/1' + get url + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end +end + diff --git a/src/sunstone/test/spec/image_spec.rb b/src/sunstone/test/spec/image_spec.rb new file mode 100644 index 0000000000..447d9f6613 --- /dev/null +++ b/src/sunstone/test/spec/image_spec.rb @@ -0,0 +1,327 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require File.expand_path(File.dirname(__FILE__) + '/spec_helper') + +describe 'Image tests' do + before(:all) do + basic_authorize('oneadmin','opennebula') + post '/login' + last_response.status.should eql(204) + + @image0_s = File.read(EXAMPLES_PATH + '/image/image0.json') + @image0_h = JSON.parse(@image0_s) + + @image1_s = File.read(EXAMPLES_PATH + '/image/image1.json') + @image1_h = JSON.parse(@image1_s) + + @action_enable = File.read(EXAMPLES_PATH + '/image/enable.json') + @action_disable = File.read(EXAMPLES_PATH + '/image/disable.json') + + @action_nonpersistent = File.read(EXAMPLES_PATH + '/image/nonpersistent.json') + @action_persistent = File.read(EXAMPLES_PATH + '/image/persistent.json') + + @action_publish = File.read(EXAMPLES_PATH + '/image/publish.json') + @action_unpublish = File.read(EXAMPLES_PATH + '/image/unpublish.json') + + @action_update = File.read(EXAMPLES_PATH + '/image/update.json') + @action_removeattr = File.read(EXAMPLES_PATH + '/image/removeattr.json') + + @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') + end + + it "should create a first Image" do + post '/image', @image0_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['ID'].should eql("0") + end + + it "should create a second Image" do + post '/image', @image1_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['ID'].should eql("1") + end + + it "should get Image 0 information" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['NAME'].should eql(@image0_h['image']['name']) + json_response['IMAGE']['TYPE'].should eql("0") + json_response['IMAGE']['TEMPLATE']['PATH'].should eql(@image0_h['image']['path']) + json_response['IMAGE']['PUBLIC'].should eql("0") + json_response['IMAGE']['PERSISTENT'].should eql("0") + end + + ############################################################################ + # Publish / Unpublish + ############################################################################ + it "should publish Image 0" do + url = '/image/0/action' + post url, @action_publish + + last_response.status.should eql(204) + end + + it "should get Image 0 information after publishing it" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['PUBLIC'].should eql("1") + end + + it "should unpublish Image 0" do + url = '/image/0/action' + post url, @action_unpublish + + last_response.status.should eql(204) + end + + it "should get Image 0 information after unpublishing it" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['PUBLIC'].should eql("0") + end + + ############################################################################ + # Persistent / NonPersstent + ############################################################################ + it "should do Image 0 persistent" do + url = '/image/0/action' + post url, @action_persistent + + last_response.status.should eql(204) + end + + it "should get Image 0 information after doing it persistent" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['PERSISTENT'].should eql("1") + end + + it "should do Image 0 nonpersistent" do + url = '/image/0/action' + post url, @action_nonpersistent + + last_response.status.should eql(204) + end + + it "should get Image 0 information after doing it nonpersistent" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['PERSISTENT'].should eql("0") + end + + ############################################################################ + # Disable / Enable + ############################################################################ + it "should disable Image 0" do + url = '/image/0/action' + post url, @action_disable + + last_response.status.should eql(204) + end + + it "should Image 0 information after disabling it" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['STATE'].should eql("3") + end + + it "should enable Image 0" do + url = '/image/0/action' + post url, @action_enable + + last_response.status.should eql(204) + end + + it "should get Image 0 information after enabling it" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['STATE'].should eql("1") + end + + ############################################################################ + # Update / Remove attr + ############################################################################ + it "should add a new attribute to Image 0" do + url = '/image/0/action' + post url, @action_update + + last_response.status.should eql(204) + end + + it "should get first Image information after adding a new attribute" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['TEMPLATE']['FOO'].should eql("mock") + end + + it "should remove an attribute from Image 0" do + url = '/image/0/action' + post url, @action_removeattr + + last_response.status.should eql(204) + end + + it "should get Image 0 information after removing an attribute" do + url = '/image/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['TEMPLATE']['FOO'].should eql(nil) + end + + + it "should get Image 1 information" do + url = '/image/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE']['NAME'].should eql(@image1_h['image']['name']) + json_response['IMAGE']['TYPE'].should eql("1") + json_response['IMAGE']['TEMPLATE']['SIZE'].should eql(@image1_h['image']['size']) + end + + ############################################################################ + # Pool + ############################################################################ + it "should get image_pool information" do + get '/image' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['IMAGE_POOL']['IMAGE'].size.should eql(2) + json_response['IMAGE_POOL']['IMAGE'].each do |image| + if image['ID'] == '0' + image['NAME'].should eql(@image0_h['image']['name']) + image['TYPE'].should eql("0") + image['TEMPLATE']['PATH'].should eql(@image0_h['image']['path']) + image['PUBLIC'].should eql("0") + image['PERSISTENT'].should eql("0") + elsif image['ID'] == '1' + image['NAME'].should eql(@image1_h['image']['name']) + image['TYPE'].should eql("1") + image['TEMPLATE']['SIZE'].should eql(@image1_h['image']['size']) + image['PUBLIC'].should eql("0") + image['PERSISTENT'].should eql("0") + end + end + end + + ############################################################################ + # Delete + ############################################################################ + it "should delete Image 1" do + url = '/image/1' + delete url + + last_response.status.should eql(204) + end + + ############################################################################ + # Errors + ############################################################################ + it "should try to get Image 3 information and check the error, because " << + "it does not exist" do + get '/image/3' + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to publish Image 3 and check the error, because " << + "it does not exist" do + post '/image/3/action', @action_publish + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to unpublish Image 3 and check the error, because " << + "it does not exist" do + post '/image/3/action', @action_unpublish + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to perform a wrong action and check the error" do + post '/image/0/action', @wrong_action + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to get the deleted Image information and check the error" do + url = '/image/1' + get url + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end +end diff --git a/src/sunstone/test/spec/spec_helper.rb b/src/sunstone/test/spec/spec_helper.rb new file mode 100644 index 0000000000..52bc72f514 --- /dev/null +++ b/src/sunstone/test/spec/spec_helper.rb @@ -0,0 +1,41 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +EXAMPLES_PATH = File.join(File.dirname(__FILE__),'../examples') +ONEUI_LIB_LOCATION = File.join(File.dirname(__FILE__), '..', '..') +$: << ONEUI_LIB_LOCATION + +# Load the testing libraries +require 'rubygems' +require 'spec' +require 'rack/test' +require 'json' + +# Load the Sinatra app +require 'one-ui' + +# Make Rack::Test available to all spec contexts +Spec::Runner.configure do |conf| + conf.include Rack::Test::Methods +end + +# Set the Sinatra environment +set :environment, :test + +# Add an app method for RSpec +def app + Sinatra::Application +end diff --git a/src/sunstone/test/spec/user_spec.rb b/src/sunstone/test/spec/user_spec.rb new file mode 100644 index 0000000000..c054419e20 --- /dev/null +++ b/src/sunstone/test/spec/user_spec.rb @@ -0,0 +1,161 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require File.expand_path(File.dirname(__FILE__) + '/spec_helper') + +describe 'User tests' do + before(:all) do + basic_authorize('oneadmin','opennebula') + post '/login' + last_response.status.should eql(204) + + @user1_s = File.read(EXAMPLES_PATH + '/user/user1.json') + @user1_h = JSON.parse(@user1_s) + + @user2_s = File.read(EXAMPLES_PATH + '/user/user2.json') + @user2_h = JSON.parse(@user2_s) + + @action_passwd = File.read(EXAMPLES_PATH + '/user/passwd.json') + @action_passwd_h = JSON.parse(@action_passwd) + @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') + end + + it "should create a first User" do + post '/user', @user1_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['USER']['ID'].should eql("1") + end + + it "should create a second User" do + post '/user', @user2_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['USER']['ID'].should eql("2") + end + + it "should get User 1 information" do + url = '/user/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['USER']['NAME'].should eql(@user1_h['user']['name']) + password = Digest::SHA1.hexdigest(@user1_h['user']['password']) + json_response['USER']['PASSWORD'].should eql(password) + end + + it "should change User 1 password" do + url = '/user/1/action' + post url, @action_passwd + + last_response.status.should eql(204) + end + + it "should get User 1 information after changing its password" do + url = '/user/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['USER']['NAME'].should eql(@user1_h['user']['name']) + password = Digest::SHA1.hexdigest(@action_passwd_h['action']['params']['password']) + json_response['USER']['PASSWORD'].should eql(password) + end + + it "should get User 2 information" do + url = '/user/2' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['USER']['NAME'].should eql(@user2_h['user']['name']) + password = Digest::SHA1.hexdigest(@user2_h['user']['password']) + json_response['USER']['PASSWORD'].should eql(password) + end + + it "should get user_pool information" do + get '/user' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['USER_POOL']['USER'].size.should eql(3) + json_response['USER_POOL']['USER'].each do |user| + if user['ID'] == '1' + user['NAME'].should eql(@user1_h['user']['name']) + password = Digest::SHA1.hexdigest(@action_passwd_h['action']['params']['password']) + user['PASSWORD'].should eql(password) + elsif user['ID'] == '2' + user['NAME'].should eql(@user2_h['user']['name']) + password = Digest::SHA1.hexdigest(@user2_h['user']['password']) + user['PASSWORD'].should eql(password) + end + end + end + + it "should try to get User 3 information and check the error, because " << + "it does not exist" do + get '/user/3' + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to change password of User 3 and check the error, because " << + "it does not exist" do + post '/user/3/action', @action_passwd + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to perform a wrong action and check the error" do + post '/user/0/action', @wrong_action + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should delete User 2" do + url = '/user/2' + delete url + + last_response.status.should eql(204) + end + + it "should try to get the deleted User information and check the error" do + url = '/user/2' + get url + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end +end diff --git a/src/sunstone/test/spec/vm_spec.rb b/src/sunstone/test/spec/vm_spec.rb new file mode 100644 index 0000000000..cecd164724 --- /dev/null +++ b/src/sunstone/test/spec/vm_spec.rb @@ -0,0 +1,251 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require File.expand_path(File.dirname(__FILE__) + '/spec_helper') + +describe 'VirtualMachine tests' do + before(:all) do + basic_authorize('oneadmin','opennebula') + post '/login' + last_response.status.should eql(204) + + @host0_s = File.read(EXAMPLES_PATH + '/host/host0.json') + post '/host', @host0_s + last_response.status.should eql(201) + sleep 2 + + @vm0_s = File.read(EXAMPLES_PATH + '/vm/vm0.json') + @vm0_h = JSON.parse(@vm0_s) + + @vm1_s = File.read(EXAMPLES_PATH + '/vm/vm1.json') + @vm1_h = JSON.parse(@vm1_s) + + @action_deploy = File.read(EXAMPLES_PATH + '/vm/deploy.json') + @action_hold = File.read(EXAMPLES_PATH + '/vm/hold.json') + @action_saveas = File.read(EXAMPLES_PATH + '/vm/save_as.json') + @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') + end + + it "should get empty vm_pool information" do + get '/vm' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM_POOL'].empty?.should eql(true) + end + + it "should create a first VirtualMachine" do + post '/vm', @vm0_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['VM']['ID'].should eql("0") + end + + + it "should get VirtualMachine 0 information" do + url = '/vm/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM']['NAME'].should eql(@vm0_h['vm']['name']) + json_response['VM']['STATE'].should eql("1") + json_response['VM']['TEMPLATE']['CPU'].should eql(@vm0_h['vm']['cpu']) + json_response['VM']['TEMPLATE']['MEMORY'].should eql(@vm0_h['vm']['memory']) + end + + it "should create a second VirtualMachine" do + post '/vm', @vm1_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['VM']['ID'].should eql("1") + end + + it "should get VirtualMachine 1 information" do + url = '/vm/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM']['NAME'].should eql(@vm1_h['vm']['name']) + json_response['VM']['TEMPLATE']['CPU'].should eql(@vm1_h['vm']['cpu']) + json_response['VM']['TEMPLATE']['MEMORY'].should eql(@vm1_h['vm']['memory']) + end + + ############################################################################ + # Deploy + ############################################################################ + it "should deploy VirtualMachine 0 in Host 0" do + url = '/vm/0/action' + post url, @action_deploy + + last_response.status.should eql(204) + end + + it "should get first VirtualMachine information after deploying it" do + url = '/vm/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM']['STATE'].should eql("3") + json_response['VM']['NAME'].should eql(@vm0_h['vm']['name']) + json_response['VM']['TEMPLATE']['CPU'].should eql(@vm0_h['vm']['cpu']) + json_response['VM']['TEMPLATE']['MEMORY'].should eql(@vm0_h['vm']['memory']) + end + + it "should try to delete a host with running VMs and check the error" do + delete '/host/0' + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + ############################################################################ + # Save_as + ############################################################################ + it "should prepare the VirtualMachine 0 disk to be saved" do + url = '/vm/0/action' + post url, @action_saveas + + last_response.status.should eql(204) + end + + it "should get VirtualMachine 0 information after save_as action" do + url = '/vm/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM']['STATE'].should eql("3") + json_response['VM']['NAME'].should eql(@vm0_h['vm']['name']) + json_response['VM']['TEMPLATE']['CPU'].should eql(@vm0_h['vm']['cpu']) + json_response['VM']['TEMPLATE']['MEMORY'].should eql(@vm0_h['vm']['memory']) + json_response['VM']['TEMPLATE']['DISK']["SAVE_AS"].should eql("0") + end + + ############################################################################ + # Stop + ############################################################################ + it "should stop VirtualMachine 1" do + url = '/vm/1/action' + post url, @action_hold + + last_response.status.should eql(204) + end + + it "should get VirtualMachine 1 information after stopping it" do + url = '/vm/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM']['STATE'].should eql("2") + json_response['VM']['NAME'].should eql(@vm1_h['vm']['name']) + json_response['VM']['TEMPLATE']['CPU'].should eql(@vm1_h['vm']['cpu']) + json_response['VM']['TEMPLATE']['MEMORY'].should eql(@vm1_h['vm']['memory']) + end + + ############################################################################ + # Pool + ############################################################################ + it "should get vm_pool information" do + get '/vm' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM_POOL']['VM'].size.should eql(2) + json_response['VM_POOL']['VM'].each do |vm| + if vm['ID'] == '0' + vm['NAME'].should eql(@vm0_h['vm']['name']) + vm['TEMPLATE']['CPU'].should eql(@vm0_h['vm']['cpu']) + vm['TEMPLATE']['MEMORY'].should eql(@vm0_h['vm']['memory']) + elsif vm['ID'] == '1' + vm['NAME'].should eql(@vm1_h['vm']['name']) + vm['TEMPLATE']['CPU'].should eql(@vm1_h['vm']['cpu']) + vm['TEMPLATE']['MEMORY'].should eql(@vm1_h['vm']['memory']) + end + end + end + + ############################################################################ + # Delete + ############################################################################ + it "should delete VirtualMachine 1" do + url = '/vm/1' + delete url + + last_response.status.should eql(204) + end + + it "should get the deleted VirtualMchine information" do + url = '/vm/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VM']['STATE'].should eql("6") + json_response['VM']['NAME'].should eql(@vm1_h['vm']['name']) + json_response['VM']['TEMPLATE']['CPU'].should eql(@vm1_h['vm']['cpu']) + json_response['VM']['TEMPLATE']['MEMORY'].should eql(@vm1_h['vm']['memory']) + end + + ############################################################################ + # Errors + ############################################################################ + it "should try to get VirtualMachine 3 information and check the error, " << + " because it does not exist" do + get '/vm/3' + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to deploy VirtualMachine 3 and check the error, because " << + "it does not exist" do + post '/vm/3/action', @action_deploy + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to perform a wrong action and check the error" do + post '/vm/0/action', @wrong_action + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end +end diff --git a/src/sunstone/test/spec/vnet_spec.rb b/src/sunstone/test/spec/vnet_spec.rb new file mode 100644 index 0000000000..08dd7eb209 --- /dev/null +++ b/src/sunstone/test/spec/vnet_spec.rb @@ -0,0 +1,207 @@ +# -------------------------------------------------------------------------- # +# 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. # +#--------------------------------------------------------------------------- # + +require File.expand_path(File.dirname(__FILE__) + '/spec_helper') + +describe 'VirtualNetwork tests' do + before(:all) do + basic_authorize('oneadmin','opennebula') + post '/login' + last_response.status.should eql(204) + + @ranged_vnet_s = File.read(EXAMPLES_PATH + '/vnet/ranged_vnet.json') + @ranged_vnet_h = JSON.parse(@ranged_vnet_s) + + @fixed_vnet_s = File.read(EXAMPLES_PATH + '/vnet/fixed_vnet.json') + @fixed_vnet_h = JSON.parse(@fixed_vnet_s) + + @action_publish = File.read(EXAMPLES_PATH + '/vnet/publish.json') + @action_unpublish = File.read(EXAMPLES_PATH + '/vnet/unpublish.json') + @wrong_action = File.read(EXAMPLES_PATH + '/error/wrong_action.json') + end + + it "should get empty host_pool information" do + get '/vnet' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VNET_POOL'].empty?.should eql(true) + end + + it "should create a ranged VirtualNetwork" do + post '/vnet', @ranged_vnet_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['VNET']['ID'].should eql("0") + end + + it "should create a fixed VirtualNetwork" do + post '/vnet', @fixed_vnet_s + + last_response.status.should eql(201) + + json_response = JSON.parse(last_response.body) + json_response['VNET']['ID'].should eql("1") + end + + it "should get VirtualNetwork 0 information" do + url = '/vnet/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VNET']['NAME'].should eql(@ranged_vnet_h['vnet']['name']) + json_response['VNET']['TYPE'].should eql("0") + json_response['VNET']['BRIDGE'].should eql(@ranged_vnet_h['vnet']['bridge']) + json_response['VNET']['TEMPLATE']['NETWORK_SIZE'].should eql(@ranged_vnet_h['vnet']['network_size']) + json_response['VNET']['TEMPLATE']['NETWORK_ADDRESS'].should eql(@ranged_vnet_h['vnet']['network_address']) + json_response['VNET']['PUBLIC'].should eql("0") + end + + it "should publish VirtualNetwork 0" do + url = '/vnet/0/action' + post url, @action_publish + + last_response.status.should eql(204) + end + + it "should get VirtualNetwork 0 information after publishing it" do + url = '/vnet/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VNET']['PUBLIC'].should eql("1") + end + + it "should unpublish VirtualNetwork 0" do + url = '/vnet/0/action' + post url, @action_unpublish + + last_response.status.should eql(204) + end + + it "should get VirtualNetwork 0 information after unpublishing it" do + url = '/vnet/0' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VNET']['PUBLIC'].should eql("0") + end + + + it "should get VirtualNetwork 1 information" do + url = '/vnet/1' + get url + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VNET']['NAME'].should eql(@fixed_vnet_h['vnet']['name']) + json_response['VNET']['TYPE'].should eql("1") + json_response['VNET']['BRIDGE'].should eql(@fixed_vnet_h['vnet']['bridge']) + json_response['VNET']['TEMPLATE']['NETWORK_ADDRESS'].should eql(@fixed_vnet_h['vnet']['network_address']) + json_response['VNET']['PUBLIC'].should eql("0") + end + + it "should get vnet_pool information" do + get '/vnet' + + last_response.status.should eql(200) + + json_response = JSON.parse(last_response.body) + json_response['VNET_POOL']['VNET'].size.should eql(2) + json_response['VNET_POOL']['VNET'].each do |vnet| + if vnet['ID'] == '0' + vnet['NAME'].should eql(@ranged_vnet_h['vnet']['name']) + vnet['TYPE'].should eql("0") + vnet['BRIDGE'].should eql(@ranged_vnet_h['vnet']['bridge']) + vnet['TEMPLATE']['NETWORK_SIZE'].should eql(@ranged_vnet_h['vnet']['network_size']) + vnet['TEMPLATE']['NETWORK_ADDRESS'].should eql(@ranged_vnet_h['vnet']['network_address']) + vnet['PUBLIC'].should eql("0") + elsif vnet['ID'] == '1' + vnet['NAME'].should eql(@fixed_vnet_h['vnet']['name']) + vnet['TYPE'].should eql("1") + vnet['BRIDGE'].should eql(@fixed_vnet_h['vnet']['bridge']) + vnet['TEMPLATE']['NETWORK_ADDRESS'].should eql(@fixed_vnet_h['vnet']['network_address']) + vnet['PUBLIC'].should eql("0") + end + end + end + + it "should try to get VirtualNetwork 3 information and check the error, because " << + "it does not exist" do + get '/vnet/3' + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to publish VirtualNetwork 3 and check the error, because " << + "it does not exist" do + post '/vnet/3/action', @action_publish + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to unpublish VirtualNetwork 3 and check the error, because " << + "it does not exist" do + post '/vnet/3/action', @action_unpublish + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should try to perform a wrong action and check the error" do + post '/vnet/0/action', @wrong_action + + last_response.status.should eql(500) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end + + it "should delete VirtualNetwork 1" do + url = '/vnet/1' + delete url + + last_response.status.should eql(204) + end + + it "should try to get the deleted VirtualNetwork information and check the error" do + url = '/vnet/1' + get url + + last_response.status.should eql(404) + + json_response = JSON.parse(last_response.body) + json_response['error']['message'].should_not eql(nil) + end +end diff --git a/src/sunstone/test/test.sh b/src/sunstone/test/test.sh new file mode 100644 index 0000000000..1878677758 --- /dev/null +++ b/src/sunstone/test/test.sh @@ -0,0 +1,49 @@ +#!/bin/bash + +# -------------------------------------------------------------------------- # +# 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 [ -z $ONE_LOCATION ]; then + echo "ONE_LOCATION not defined." + exit -1 +fi + +VAR_LOCATION="$ONE_LOCATION/var" + +if [ "$(ls -A $VAR_LOCATION)" ]; then + echo "$VAR_LOCATION is not empty." + exit -1 +fi + +for j in `ls ./spec/*_spec.rb` ; do + PID=$$ + + oned -f & + sleep 2s; + + spec $j -f s + CODE=$? + + pkill -P $PID oned + sleep 2s; + pkill -9 -P $PID oned + + if [ $CODE != 0 ] ; then + exit 1 + fi + + find $VAR_LOCATION -mindepth 1 -delete +done From 88f4bc43b136d2e387cd617046dec9f4e8c9e46f Mon Sep 17 00:00:00 2001 From: Jaime Melis Date: Tue, 22 Feb 2011 11:48:01 +0100 Subject: [PATCH 20/21] Updated NOTICE --- NOTICE | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/NOTICE b/NOTICE index 39e1fb5a94..e35b54607c 100644 --- a/NOTICE +++ b/NOTICE @@ -1,5 +1,5 @@ OpenNebula Open Source Project -Copyright 2002-2010, OpenNebula Project Leads (OpenNebula.org) +Copyright 2002-2011, OpenNebula Project Leads (OpenNebula.org) ----------------------------------------- You can find more information about the project, release notes and @@ -13,8 +13,9 @@ AUTHORS ACKNOWLEDGEMENTS The following people have contributed to the development of the technology -- Javier Fontan Muiños (jfontan@fdi.ucm.es) -- Constantino Vazquez Blanco (tinova@fdi.ucm.es) -- Jaime Melis Bayo (j.melis@fdi.ucm.es) -- Carlos Martin Sanchez (cmartins@fdi.ucm.es) -- Daniel Molina Aranda (danmolin@pdi.ucm.es) +- Javier Fontan Muiños (jfontan@opennebula.org) +- Constantino Vazquez Blanco (tinova@opennebula.org) +- Jaime Melis Bayo (jmelis@opennebula.org) +- Carlos Martin Sanchez (cmartin@opennebula.org) +- Daniel Molina Aranda (dmolina@opennebula.org) +- Hector Sanjuan Redondo (hsanjuan@opennebula.org) From ad8faa9f41e210258b50ea9840c214cc8d31cee4 Mon Sep 17 00:00:00 2001 From: "Ruben S. Montero" Date: Tue, 22 Feb 2011 15:54:42 +0100 Subject: [PATCH 21/21] bug #486: Included EMULATOR in kvm.conf file. Defaults to /usr/bin/kvm in the driver code. --- src/vmm/LibVirtDriverKVM.cc | 11 ++++++++++- src/vmm_mad/ssh/vmm_ssh_kvm.conf | 10 +++++++--- src/vmm_mad/ssh/vmm_ssh_xen.conf | 4 ++-- 3 files changed, 19 insertions(+), 6 deletions(-) diff --git a/src/vmm/LibVirtDriverKVM.cc b/src/vmm/LibVirtDriverKVM.cc index 2a8e71f614..bcd665b98c 100644 --- a/src/vmm/LibVirtDriverKVM.cc +++ b/src/vmm/LibVirtDriverKVM.cc @@ -35,6 +35,8 @@ int LibVirtDriver::deployment_description_kvm( int memory_in_kb = 0; + string emulator_path = ""; + string kernel = ""; string initrd = ""; string boot = ""; @@ -256,7 +258,14 @@ int LibVirtDriver::deployment_description_kvm( if (emulator == "kvm") { - file << "\t\t/usr/bin/kvm" << endl; + get_default("EMULATOR",emulator_path); + + if(emulator_path.empty()) + { + emulator_path = "/usr/bin/kvm"; + } + + file << "\t\t" << emulator_path << "" << endl; } get_default("DISK","DRIVER",default_driver); diff --git a/src/vmm_mad/ssh/vmm_ssh_kvm.conf b/src/vmm_mad/ssh/vmm_ssh_kvm.conf index fc11a10ca9..5ed8ac0a79 100644 --- a/src/vmm_mad/ssh/vmm_ssh_kvm.conf +++ b/src/vmm_mad/ssh/vmm_ssh_kvm.conf @@ -1,15 +1,19 @@ # Default configuration attributes for the KVM driver -# (all domains will use these values as defaults) -# Valid atributes are: +# (all domains will use these values as defaults). These values can +# be overridden in each VM template. Valid atributes are: +# - emulator # - os [kernel,initrd,boot,root,kernel_cmd,arch] # - memory # - cpu # - vcpu # - features [acpi, pae] -# - disk [driver ] +# - disk [driver ]A + +#EMULATOR = /usr/libexec/qemu-kvm #VCPU = 1 #MEMORY = 128 + OS = [ boot = "hd", arch = "i686" ] FEATURES = [ PAE = "no", ACPI = "yes" ] diff --git a/src/vmm_mad/ssh/vmm_ssh_xen.conf b/src/vmm_mad/ssh/vmm_ssh_xen.conf index 8d41b2770b..96267f44dd 100644 --- a/src/vmm_mad/ssh/vmm_ssh_xen.conf +++ b/src/vmm_mad/ssh/vmm_ssh_xen.conf @@ -1,6 +1,6 @@ # Default configuration attributes for the Xen driver -# (all domains will use these values as defaults) -# Valid atributes: +# (all domains will use these values as defaults). These values can +# be overridden in each VM template. Valid atributes are: # - credit # - os [kernel,initrd,root,kernel_cmd] # - memory