From f439c8bda96047b33c320529c8c4eb2acf33df52 Mon Sep 17 00:00:00 2001 From: Daniel Molina Date: Tue, 19 Mar 2013 14:05:30 +0100 Subject: [PATCH] feature #1664: Update configuration tab --- src/sunstone/public/js/locale.js | 24 ++-- src/sunstone/public/js/plugins/config-tab.js | 115 +++++++++---------- 2 files changed, 69 insertions(+), 70 deletions(-) diff --git a/src/sunstone/public/js/locale.js b/src/sunstone/public/js/locale.js index 498fffb029..4349288270 100644 --- a/src/sunstone/public/js/locale.js +++ b/src/sunstone/public/js/locale.js @@ -31,17 +31,17 @@ function tr(str){ //Updates template and session configuration and reloads the view. function setLang(lang_str){ var lang_tmp=""; - var dialog = $('
'+ - tr("Loading new language... please wait")+ - ' '+spinner+'
').dialog({ - draggable:false, - modal:true, - resizable:false, - buttons:{}, - width: 460, - minHeight: 50 - }); + //var dialog = $('
'+ + // tr("Loading new language... please wait")+ + // ' '+spinner+'
').dialog({ + // draggable:false, + // modal:true, + // resizable:false, + // buttons:{}, + // width: 460, + // minHeight: 50 + // }); var updateUserTemplate = function(request,user_json){ var template = user_json.USER.TEMPLATE; @@ -80,7 +80,7 @@ function setLang(lang_str){ }; OpenNebula.User.show(obj); } else { - dialog.dialog('close'); + //dialog.dialog('close'); }; }; diff --git a/src/sunstone/public/js/plugins/config-tab.js b/src/sunstone/public/js/plugins/config-tab.js index d0b0e87aa3..8a409a60ed 100644 --- a/src/sunstone/public/js/plugins/config-tab.js +++ b/src/sunstone/public/js/plugins/config-tab.js @@ -16,59 +16,58 @@ var config_response = {}; var config_tab_content = -'
\ -\ - \ - \ - \ -
\ -
\ -

' + tr("Sunstone UI Configuration") + '

\ -
\ -\ - \ - \ - \ - \ - \ - \ - \ - \ - \ -
' + tr("Language") + '\ - \ -
' + tr("Secure websockets connection") + '\ - \ -
\ -\ -
\ -
\ -
\ -
\ - ?\ -

\ -'+tr("These options are stored in your OpenNebula user template.")+'\ -

\ -

\ -'+tr("WSS connection requires additional configuration of Sunstone Server and that the SSL certificate is considered valid by your browser.")+'\ -

\ +'
\ +
\ +
\ +

\ + \ + '+tr("Configuration")+'\ + \ + \ +  \ + \ + \ +

\ +
\
\ -'; +
\ +
\ +
\ +
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
\ +
\ + \ +
\ +
\ + \ +
\ +
\ +
\ +
'; var config_actions = { "Config.list" : { @@ -95,7 +94,7 @@ function updateConfig(request,response){ //Set wss checkbox to correct value if (config_response['user_config']["wss"] == "yes"){ - $('table#config_table input#wss_checkbox').attr('checked','checked'); + $('input#wss_checkbox').attr('checked','checked'); }; }; @@ -115,7 +114,7 @@ function updateWss(){ var template = user_json.USER.TEMPLATE; var template_str=""; template['VNC_WSS']= - $('#config_table #wss_checkbox').is(':checked') ? "yes" : "no"; + $('#input#wss_checkbox').is(':checked') ? "yes" : "no"; //convert json to ONE template format - simple conversion $.each(template,function(key,value){ template_str += (key + '=' + '"' + value + '"\n'); @@ -132,7 +131,7 @@ function updateWss(){ } }; OpenNebula.User.show(user_info_req); - $.post('config',JSON.stringify({wss : ($('#config_table #wss_checkbox').is(':checked') ? "yes" : "no")})); + $.post('config',JSON.stringify({wss : ($('input#wss_checkbox').is(':checked') ? "yes" : "no")})); }; $(document).ready(function(){ @@ -140,13 +139,13 @@ $(document).ready(function(){ //Set the language select to correct value if (lang) - $('table#config_table #lang_sel option[value="'+lang+'"]').attr('selected','selected'); + $('#lang_sel option[value="'+lang+'"]').attr('selected','selected'); //Listener to change language. setLang in locale.js - $('table#config_table #lang_sel').change(function(){ + $('#lang_sel').change(function(){ setLang($(this).val()); }); //Listener to wss change - $('table#config_table #wss_checkbox').change(updateWss); + $('#wss_checkbox').change(updateWss); }); \ No newline at end of file