From a69b85c1d23d7eefcffb70b4ff6497754aecb050 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Thu, 14 Mar 2013 16:09:09 +0100 Subject: [PATCH] feature #1664: Add capacity tab and resize functionality --- src/oca/ruby/opennebula/virtual_machine.rb | 3 +- .../OpenNebulaJSON/VirtualMachineJSON.rb | 7 + src/sunstone/public/css/app.css | 5 + src/sunstone/public/js/opennebula.js | 5 + .../public/js/plugins/templates-tab.js | 489 +++++++++--------- src/sunstone/public/js/plugins/vms-tab.js | 296 ++++++++--- src/sunstone/public/js/sunstone-util.js | 20 +- src/sunstone/public/sass/app.scss | 4 + 8 files changed, 496 insertions(+), 333 deletions(-) diff --git a/src/oca/ruby/opennebula/virtual_machine.rb b/src/oca/ruby/opennebula/virtual_machine.rb index 058b90ea97..c0e5bab503 100644 --- a/src/oca/ruby/opennebula/virtual_machine.rb +++ b/src/oca/ruby/opennebula/virtual_machine.rb @@ -42,7 +42,8 @@ module OpenNebula :snapshotrevert => "vm.snapshotrevert", :snapshotdelete => "vm.snapshotdelete", :attachnic => "vm.attachnic", - :detachnic => "vm.detachnic" + :detachnic => "vm.detachnic", + :resize => "vm.resize" } VM_STATE=%w{INIT PENDING HOLD ACTIVE STOPPED SUSPENDED DONE FAILED diff --git a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb index 50795da235..7f17a17ae2 100644 --- a/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb +++ b/src/sunstone/models/OpenNebulaJSON/VirtualMachineJSON.rb @@ -62,6 +62,7 @@ module OpenNebulaJSON when "resubmit" then self.resubmit when "chown" then self.chown(action_hash['params']) when "chmod" then self.chmod_octet(action_hash['params']) + when "resize" then self.resize(action_hash['params']) when "attachdisk" then self.attachdisk(action_hash['params']) when "detachdisk" then self.detachdisk(action_hash['params']) when "attachnic" then self.attachnic(action_hash['params']) @@ -103,6 +104,12 @@ module OpenNebulaJSON super(params['octet']) end + def resize(params=Hash.new) + template_json = params['vm_template'] + template = template_to_str(template_json) + super(template, params['enforce']) + end + def attachdisk(params=Hash.new) template_json = params['disk_template'] template = template_to_str(template_json) diff --git a/src/sunstone/public/css/app.css b/src/sunstone/public/css/app.css index a101546eb1..9e460b4595 100644 --- a/src/sunstone/public/css/app.css +++ b/src/sunstone/public/css/app.css @@ -6774,3 +6774,8 @@ a.footer.button { .vm_log_error { color: #c0392b; } + +/* line 773, ../sass/app.scss */ +.noUiSlider { + margin: 10px; +} diff --git a/src/sunstone/public/js/opennebula.js b/src/sunstone/public/js/opennebula.js index 0ddb5eb957..208d4037a0 100644 --- a/src/sunstone/public/js/opennebula.js +++ b/src/sunstone/public/js/opennebula.js @@ -734,6 +734,11 @@ var OpenNebula = { "pool_monitor" : function(params){ OpenNebula.Action.monitor(params,OpenNebula.VM.resource,true); }, + "resize" : function(params){ + var action_obj = params.data.extra_param; + OpenNebula.Action.simple_action(params,OpenNebula.VM.resource, + "resize",action_obj); + }, "attachdisk" : function(params){ var action_obj = {"disk_template": params.data.extra_param}; OpenNebula.Action.simple_action(params,OpenNebula.VM.resource, diff --git a/src/sunstone/public/js/plugins/templates-tab.js b/src/sunstone/public/js/plugins/templates-tab.js index 2b61650fbc..9d151a1638 100644 --- a/src/sunstone/public/js/plugins/templates-tab.js +++ b/src/sunstone/public/js/plugins/templates-tab.js @@ -467,6 +467,247 @@ function updateTemplatesView(request, templates_list){ updateVResDashboard("templates",templates_list); } +function generate_capacity_tab_content() { + var html = '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+tr("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>.")+'
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+tr("Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.")+'
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+tr("Amount of RAM required for the VM, in Megabytes.")+'
'+ + '
'+ + '
'+ + '
'+ + '

'+tr("Advanced options")+'

'+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+ + '
'+ + ''+ + '
'+ + '
'+ + '
'+tr("Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.")+'
'+ + '
'+ + '
'+ + '
' + + return html; +} + +function setup_capacity_tab_content(capacity_section) { + setupTips(capacity_section); + + // Hide advanced options + $('.advanced',capacity_section).hide(); + + $('#advanced_capacity',capacity_section).click(function(){ + $('.advanced',capacity_section).toggle(); + return false; + }); + + // Define the cpu slider + + var cpu_input = $( "#CPU", capacity_section); + + var cpu_slider = $( "#cpu_slider", capacity_section).noUiSlider('init', { + handles: 1, + connect: "lower", + scale: [0,800], +// start: 100, + step: 50, + change: function(type) { + if ( type != "move") + { + var values = $(this).noUiSlider( 'value' ); + + cpu_input.val(values[1] / 100); + } + }, + }); + + cpu_slider.addClass("noUiSlider"); + + cpu_input.change(function() { + cpu_slider.noUiSlider('move',{ + to: this.value * 100 + }) + }); + + cpu_input.val(1); + + // init::start is ignored for some reason + $( "#cpu_slider", capacity_section).noUiSlider('move',{to: 100}); + + + // Define the memory slider + + var final_memory_input = $( "#MEMORY", capacity_section ); + var memory_input = $( "#MEMORY_TMP", capacity_section ); + var memory_unit = $( "#memory_unit", capacity_section ); + + var current_memory_unit = memory_unit.val(); + + var update_final_memory_input = function() { + if (current_memory_unit == 'MB') { + final_memory_input.val( Math.floor(memory_input.val()) ); + } + else { + final_memory_input.val( Math.floor(memory_input.val() * 1024) ); + } + } + + var memory_slider_change = function(type) { + if ( type != "move") + { + var values = $(this).noUiSlider( 'value' ); + + memory_input.val(values[1] / 100); + + update_final_memory_input(); + } + }; + + var memory_slider = $( "#memory_slider", capacity_section).noUiSlider('init', { + handles: 1, + connect: "lower", + scale: [0,409600], + step: 12800, + change: memory_slider_change, + }); + + memory_slider.addClass("noUiSlider"); + + memory_input.change(function() { + memory_slider.noUiSlider('move',{ + to: this.value * 100 + }) + + update_final_memory_input(); + }); + + // init::start is ignored for some reason + memory_slider.noUiSlider('move',{ + to: 0 + }); + + memory_unit.change(function() { + var memory_unit_val = $('#memory_unit :selected', capacity_section).val(); + + if (current_memory_unit != memory_unit_val) + { + current_memory_unit = memory_unit_val + + if (memory_unit_val == 'GB') { + + memory_slider.empty().noUiSlider('init', { + handles: 1, + connect: "lower", + scale: [0,1600], + step: 50, + change: memory_slider_change, + }); + + var new_val = memory_input.val() / 1024; + + memory_input.val( new_val ); + memory_slider.noUiSlider('move',{to: new_val * 100}); + } + else if (memory_unit_val == 'MB') { + + memory_slider.empty().noUiSlider('init', { + handles: 1, + connect: "lower", + scale: [0,409600], + step: 12800, + change: memory_slider_change, + }); + + var new_val = Math.floor( memory_input.val() * 1024 ); + + memory_input.val( new_val ); + memory_slider.noUiSlider('move',{to: new_val * 100}); + } + + update_final_memory_input(); + } + }); + + + // Define the vcpu slider + + var vcpu_input = $( "#VCPU", capacity_section ); + + var vcpu_slider = $( "#vcpu_slider", capacity_section).noUiSlider('init', { + handles: 1, + connect: "lower", + scale: [0,8], + step: 1, + change: function(type) { + if ( type != "move") + { + var values = $(this).noUiSlider( 'value' ); + + vcpu_input.val(values[1]); + } + }, + }); + + vcpu_slider.addClass("noUiSlider"); + + vcpu_input.change(function() { + vcpu_slider.noUiSlider('move',{ + to: this.value + }) + }); + + // init::start is ignored for some reason + vcpu_slider.noUiSlider('move',{to: 0}); +} + function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ var html = '
'+ '
'+ @@ -582,8 +823,7 @@ function generate_disk_tab_content(str_disk_tab_id, str_datatable_id){ '
'+ ''+ '
'+ - '
'+ - '
'+ + '
'+ '
'+ '
'+ ''+ @@ -1330,254 +1570,15 @@ function setupCreateTemplateDialog(){ // Set ups the capacity section var add_capacityTab = function(){ var html_tab_content = '
  • '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("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>.")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Percentage of CPU divided by 100 required for the Virtual Machine. Half a processor is written 0.5.")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Amount of RAM required for the VM, in Megabytes.")+'
    '+ - '
    '+ - '
    '+ - '
    '+ - '

    '+tr("Advanced options")+'

    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - '
    '+ - ''+ - '
    '+ - '
    '+ - '
    '+tr("Number of virtual cpus. This value is optional, the default hypervisor behavior is used, usually one virtual CPU.")+'
    '+ - '
    '+ - '
    '+ - '
    '+ + generate_capacity_tab_content() + '
  • ' $("
    General
    ").appendTo($("dl#template_create_tabs")); $(html_tab_content).appendTo($("ul#template_create_tabs_content")); - setupTips(dialog); - // Enhace buttons - //$('button',dialog).button(); - - // Change tab if the DISKs button is clicked - //$(".tf_btn_nics", dialog).click(add_nic_tab); - //$(".tf_btn_nics").live('click', add_nic_tab); - - // Hide advanced options - $('.advanced',section_capacity).hide(); - - $('#advanced_capacity',section_capacity).click(function(){ - $('.advanced',section_capacity).toggle(); - return false; - }); - - // Define the cpu slider - - var cpu_input = $( "#CPU", section_capacity ); - - var cpu_slider = $( "#cpu_slider").noUiSlider('init', { - handles: 1, - connect: "lower", - scale: [0,800], -// start: 100, - step: 50, - change: function(type) { - if ( type != "move") - { - var values = $(this).noUiSlider( 'value' ); - - cpu_input.val(values[1] / 100); - } - }, - }); - - cpu_slider.addClass("noUiSlider"); - - cpu_input.change(function() { - cpu_slider.noUiSlider('move',{ - to: this.value * 100 - }) - }); - - cpu_input.val(1); - - // init::start is ignored for some reason - cpu_slider.noUiSlider('move',{to: 100}); - - - // Define the memory slider - - var final_memory_input = $( "#MEMORY", section_capacity ); - var memory_input = $( "#MEMORY_TMP", section_capacity ); - var memory_unit = $( "#memory_unit", section_capacity ); - - var current_memory_unit = memory_unit.val(); - - var update_final_memory_input = function() { - if (current_memory_unit == 'MB') { - final_memory_input.val( Math.floor(memory_input.val()) ); - } - else { - final_memory_input.val( Math.floor(memory_input.val() * 1024) ); - } - } - - var memory_slider_change = function(type) { - if ( type != "move") - { - var values = $(this).noUiSlider( 'value' ); - - memory_input.val(values[1] / 100); - - update_final_memory_input(); - } - }; - - var memory_slider = $( "#memory_slider").noUiSlider('init', { - handles: 1, - connect: "lower", - scale: [0,409600], - step: 12800, - change: memory_slider_change, - }); - - memory_slider.addClass("noUiSlider"); - - memory_input.change(function() { - memory_slider.noUiSlider('move',{ - to: this.value * 100 - }) - - update_final_memory_input(); - }); - - // init::start is ignored for some reason - memory_slider.noUiSlider('move',{ - to: 0 - }); - - memory_unit.change(function() { - var memory_unit_val = $('#memory_unit :selected').val(); - - if (current_memory_unit != memory_unit_val) - { - current_memory_unit = memory_unit_val - - if (memory_unit_val == 'GB') { - - memory_slider.empty().noUiSlider('init', { - handles: 1, - connect: "lower", - scale: [0,1600], - step: 50, - change: memory_slider_change, - }); - - var new_val = memory_input.val() / 1024; - - memory_input.val( new_val ); - memory_slider.noUiSlider('move',{to: new_val * 100}); - } - else if (memory_unit_val == 'MB') { - - memory_slider.empty().noUiSlider('init', { - handles: 1, - connect: "lower", - scale: [0,409600], - step: 12800, - change: memory_slider_change, - }); - - var new_val = Math.floor( memory_input.val() * 1024 ); - - memory_input.val( new_val ); - memory_slider.noUiSlider('move',{to: new_val * 100}); - } - - update_final_memory_input(); - } - }); - - - // Define the vcpu slider - - var vcpu_input = $( "#VCPU", section_capacity ); - - var vcpu_slider = $( "#vcpu_slider").noUiSlider('init', { - handles: 1, - connect: "lower", - scale: [0,8], - step: 1, - change: function(type) { - if ( type != "move") - { - var values = $(this).noUiSlider( 'value' ); - - vcpu_input.val(values[1]); - } - }, - }); - - vcpu_slider.addClass("noUiSlider"); - - vcpu_input.change(function() { - vcpu_slider.noUiSlider('move',{ - to: this.value - }) - }); - - // init::start is ignored for some reason - vcpu_slider.noUiSlider('move',{to: 0}); + var capacity_section = $('li#capacityTab', dialog); + setup_capacity_tab_content(capacity_section); } /************************************************************************** diff --git a/src/sunstone/public/js/plugins/vms-tab.js b/src/sunstone/public/js/plugins/vms-tab.js index 1d435c02d8..44493123ae 100644 --- a/src/sunstone/public/js/plugins/vms-tab.js +++ b/src/sunstone/public/js/plugins/vms-tab.js @@ -212,6 +212,15 @@ var vm_actions = { }, error: onError }, + "VM.showcapacity" : { + type: "single", + call: OpenNebula.VM.show, + callback: function(request, vm){ + updateVMachineElement(request, vm); + updateVMCapacityInfo(request, vm); + }, + error: onError + }, "VM.refresh" : { type: "custom", call : function (){ @@ -568,6 +577,15 @@ var vm_actions = { error: onError, notify: true }, + "VM.resize" : { + type: "single", + call: OpenNebula.VM.resize, + callback: function(request) { + Sunstone.runAction("VM.showcapacity", request.request.data[0]); + }, + error: onError, + notify: true + }, "VM.detachnic" : { type: "single", call: OpenNebula.VM.detachnic, @@ -752,30 +770,7 @@ var vm_buttons = { } var vm_info_panel = { - "vm_info_tab" : { - title: tr("Virtual Machine information"), - content: "" - }, - "vm_hotplugging_tab" : { - title: tr("Disks & Hotplugging"), - content: "" - }, - "vm_template_tab" : { - title: tr("VM template"), - content: "" - }, - "vm_log_tab" : { - title: tr("VM log"), - content: "" - }, - "vm_history_tab" : { - title: tr("History information"), - content: "" - }, - "vm_monitoring_tab" : { - title: tr("Graphs"), - content: "" - } + }; var vms_tab = { @@ -1244,6 +1239,11 @@ function updateVMInfo(request,vm){ content: printNics(vm_info) }; + var capacity_tab = { + title: tr("Capacity"), + content: printCapacity(vm_info) + }; + var template_tab = { title: tr("VM Template"), content: @@ -1263,32 +1263,6 @@ function updateVMInfo(request,vm){ content: '\
    \ -
    \ -
    \ -

    '+tr("CPU")+'

    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -

    '+tr("MEMORY")+'

    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \ -
    \
    \
    \

    '+tr("NET RX")+'

    \ @@ -1369,6 +1343,7 @@ function updateVMInfo(request,vm){ }); Sunstone.updateInfoPanelTab("vm_info_panel","vm_info_tab",info_tab); + Sunstone.updateInfoPanelTab("vm_info_panel","vm_capacity_tab",capacity_tab); Sunstone.updateInfoPanelTab("vm_info_panel","vm_hotplugging_tab",hotplugging_tab); Sunstone.updateInfoPanelTab("vm_info_panel","vm_network_tab",network_tab); Sunstone.updateInfoPanelTab("vm_info_panel","vm_template_tab",template_tab); @@ -1475,7 +1450,7 @@ function printDisks(vm_info){ disk.HOTPLUG_SAVE_AS_ACTIVE == "YES") ) { save_as = (disk.SAVE_AS ? disk.SAVE_AS : '-'); - actions = 'hot snapshot in progress' + actions = 'hot snapshot in progress' } // Attach / Detach else if ( @@ -1739,33 +1714,6 @@ function hotpluggingOps(){ - - - - - - - - - - - - - - - - - - - - - - - - - - - function updateVMNicsInfo(request,vm){ $("li#vm_network_tabTab").html(printNics(vm.VM)); } @@ -1967,6 +1915,197 @@ function setup_vm_network_tab(){ +function updateVMCapacityInfo(request,vm){ + $("li#vm_capacity_tabTab").html(printCapacity(vm.VM)); + Sunstone.runAction("VM.monitor",vm.VM.ID, + { monitor_resources : "CPU,MEMORY,NET_TX,NET_RX"}); +} + +function printCapacity(vm_info){ + var html ='\ +
    \ +
    \ +
    \ +
    \ +
    ' + + // If VM is not RUNNING, then we forget about the attach nic form. + if (vm_info.STATE == "0" || vm_info.STATE == "1" || vm_info.STATE == "2" || vm_info.STATE == "7" || vm_info.STATE == "8"){ + html += '\ + ' + } else { + html += '\ + ' + } + + html += '\ +
    \ +
    \ +
    ' + + html += '\ +
    \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ + \ +
    '+tr("CPU")+''+tr("VCPU")+''+tr("MEMORY")+'
    ' + vm_info.TEMPLATE.CPU + '' + (vm_info.TEMPLATE.VCPU ? vm_info.TEMPLATE.VCPU : '-') + '' + humanize_size_from_mb(vm_info.TEMPLATE.MEMORY) + '
    \ +
    \ +
    \ +
    \ +

    '+tr("CPU")+'

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

    '+tr("MEMORY")+'

    \ +
    \ +
    \ +
    \ +
    \ +
    \ +
    \ +
    \ +
    \ +
    \ +
    \ + '; + + return html; +} + +function setupResizeCapacityDialog(){ + dialogs_context.append('
    '); + $resize_capacity_dialog = $('#resize_capacity_dialog',dialogs_context); + var dialog = $resize_capacity_dialog; + + dialog.html('
    \ +

    \ + '+tr("Resize VM capacity")+'\ +

    \ +
    \ +
    \ +
    \ +
    \ +
    \ + \ +
    \ +
    \ + \ +
    \ +
    \ +
    \ +
    \ +
    \ +
    \ + \ +
    \ +
    \ + \ +
    \ +
    \ +
    ' + + tr("If it is set to true, the host capacity will be checked. This will only affect oneadmin requests, regular users resize requests will always be enforced") + + '
    \ +
    \ +
    \ +
    ' + + generate_capacity_tab_content() + + '
    \ +
    \ + \ + \ +
    \ + ×\ +
    ') + + dialog.addClass("reveal-modal large"); + setupTips(dialog); + + $("#template_name_form", dialog).hide(); + + setup_capacity_tab_content(dialog); + + $('#resize_capacity_form',dialog).submit(function(){ + var vm_id = $('#vm_id', this).val(); + + var enforce = false; + if ($("#enforce", this).is(":checked")) { + enforce = true; + } + + var data = {}; + addSectionJSON(data, this); + + var obj = { + "vm_template": data, + "enforce": (enforce == "on" ? true : false), + } + console.log(enforce) + console.log(obj) + + Sunstone.runAction('VM.resize', vm_id, obj); + + $resize_capacity_dialog.trigger("reveal:close") + return false; + }); +}; + +function popUpResizeCapacityDialog(vm_id){ + $('#vm_id',$resize_capacity_dialog).val(vm_id); + $resize_capacity_dialog.reveal(); +} + + +// Listeners to the nics operations (detach, saveas, attach) +function setup_vm_capacity_tab(){ + //setupSaveAsDialog(); + setupResizeCapacityDialog(); + + + $('#resize_capacity').live('click', function(){ + var b = $(this); + var vm_id = b.parents('form').attr('vmid'); + + popUpResizeCapacityDialog(vm_id); + + //b.html(spinner); + return false; + }); + + $('#refresh_capacity').live('click', function(){ + var b = $(this); + var vm_id = b.parents('form').attr('vmid'); + Sunstone.runAction("VM.showcapacity", vm_id); + + return false; + }); +} + + + + + + @@ -2219,6 +2358,7 @@ $(document).ready(function(){ setupVNC(); hotpluggingOps(); setup_vm_network_tab(); + setup_vm_capacity_tab(); initCheckAllBoxes(dataTable_vMachines); diff --git a/src/sunstone/public/js/sunstone-util.js b/src/sunstone/public/js/sunstone-util.js index fa0f51f977..f0fd3c0d6b 100644 --- a/src/sunstone/public/js/sunstone-util.js +++ b/src/sunstone/public/js/sunstone-util.js @@ -152,10 +152,10 @@ function recountCheckboxes(dataTable){ if (checked_length) { //at least 1 element checked //enable action buttons - $('.top_button, .list_button',context).removeAttr('disabled'); + $('.top_button, .list_button',context).attr('disabled', false); //check if the last_action_button should be enabled if (last_action_b.length && last_action_b.val().length){ - last_action_b.prop('disabled', false); + last_action_b.attr('disabled', false); }; //enable checkall box if (total_length == checked_length){ @@ -167,12 +167,12 @@ function recountCheckboxes(dataTable){ //disable action buttons, uncheck checkAll $('.check_all',dataTable).removeAttr('checked'); $('.top_button, .list_button',context).attr('disabled', true); - last_action_b.prop('disabled', true); + last_action_b.attr('disabled', true); }; //any case the create dialog buttons should always be enabled. - $('.create_dialog_button',context).prop('disabled', false); - $('.alwaysActive',context).prop('disabled', false); + $('.create_dialog_button',context).attr('disabled', false); + $('.alwaysActive',context).attr('disabled', false); } //Init action buttons and checkboxes listeners @@ -180,11 +180,11 @@ function tableCheckboxesListener(dataTable){ //Initialization - disable all buttons var context = dataTable.parents('form'); - $('.last_action_button',context).prop('disabled', true); + $('.last_action_button',context).attr('disabled', true); $('.top_button, .list_button',context).attr('disabled', true); //These are always enabled - $('.create_dialog_button',context).prop('disabled', false); - $('.alwaysActive',context).prop('disabled', false); + $('.create_dialog_button',context).attr('disabled', false); + $('.alwaysActive',context).attr('disabled', false); //listen to changes in the visible inputs $('tbody input.check_item',dataTable).live("change",function(){ @@ -700,7 +700,7 @@ function plot_graph(response, info) { var data = response.monitoring[attribute]; - if(info.derivative) { + if(info.derivative == true) { derivative(data); } @@ -783,7 +783,7 @@ function plot_totals(response, info) { if(id != "resource") { var data = response[id][attribute]; - if(info.derivative) { + if(info.derivative == true) { derivative(data); } diff --git a/src/sunstone/public/sass/app.scss b/src/sunstone/public/sass/app.scss index d6bfe56971..217e7e507a 100644 --- a/src/sunstone/public/sass/app.scss +++ b/src/sunstone/public/sass/app.scss @@ -768,4 +768,8 @@ a.footer.button { .vm_log_error { color: $alertColor; +} + +.noUiSlider { + margin: 10px; } \ No newline at end of file