← Back to team overview

yellow team mailing list archive

[Merge] lp:~makyo/charms/precise/juju-gui/juju-gui into lp:~juju-gui/charms/precise/juju-gui/trunk

 

Matthew Scott has proposed merging lp:~makyo/charms/precise/juju-gui/juju-gui into lp:~juju-gui/charms/precise/juju-gui/trunk.

Requested reviews:
  Juju GUI Hackers (juju-gui)
Related bugs:
  Bug #1074425 in juju-gui: "Make charm turn off console and any other debug code"
  https://bugs.launchpad.net/juju-gui/+bug/1074425

For more details, see:
https://code.launchpad.net/~makyo/charms/precise/juju-gui/juju-gui/+merge/136985

Disable console

Adds a configuration variable for whether or not the javascript console object should be enabled or disabled.  Defaults to disabled.

https://codereview.appspot.com/6856112/

-- 
https://code.launchpad.net/~makyo/charms/precise/juju-gui/juju-gui/+merge/136985
Your team Juju GUI Hackers is requested to review the proposed merge of lp:~makyo/charms/precise/juju-gui/juju-gui into lp:~juju-gui/charms/precise/juju-gui/trunk.
=== modified file 'config.yaml'
--- config.yaml	2012-11-20 12:15:10 +0000
+++ config.yaml	2012-11-29 16:44:34 +0000
@@ -9,3 +9,8 @@
       The Juju Bazaar branch containing the improv script.
     type: string
     default: lp:~hazmat/juju/rapi-rollup
+  juju-gui-console-enabled:
+    description:
+      Whether or not the browser's console should be enabled.
+    type: string
+    default: 'false'

=== modified file 'config/config.js.template'
--- config/config.js.template	2012-11-19 17:48:13 +0000
+++ config/config.js.template	2012-11-29 16:44:34 +0000
@@ -1,5 +1,5 @@
 var juju_config = {
-  consoleEnabled: true,
+  consoleEnabled: %(console_enabled)s,
   serverRouting: false,
   html5: true,
   container: '#main',

=== modified file 'hooks/start'
--- hooks/start	2012-11-27 15:52:05 +0000
+++ hooks/start	2012-11-29 16:44:34 +0000
@@ -4,6 +4,7 @@
 import sys
 
 from charmhelpers import (
+    get_config,
     log,
     log_entry,
     log_exit,
@@ -40,8 +41,13 @@
         'juju-gui.conf.template', {'juju_gui_dir': JUJU_GUI_DIR},
         '/etc/init/juju-gui.conf')
     log('Generating the Juju-GUI configuration file.')
+    config = get_config()
     render_to_file(
-        'config.js.template', {'ws_url': ws_url},
+        'config.js.template', 
+        {
+            'ws_url': ws_url,
+            'console_enabled': config['juju-gui-console-enabled']
+        },
         os.path.join(JUJU_GUI_DIR, 'app', 'config.js'))
     log('Starting Juju-GUI.')
     with su('root'):

=== modified file 'revision'
--- revision	2012-11-20 13:55:02 +0000
+++ revision	2012-11-29 16:44:34 +0000
@@ -1,1 +1,1 @@
-10
+11


Follow ups