Updated Branches: refs/heads/trunk 3633b1e0a -> 288ae2a55
AMBARI-3258. Provide UI page to enable/disable experimental functionality. (srimanth) Project: http://git-wip-us.apache.org/repos/asf/incubator-ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/incubator-ambari/commit/288ae2a5 Tree: http://git-wip-us.apache.org/repos/asf/incubator-ambari/tree/288ae2a5 Diff: http://git-wip-us.apache.org/repos/asf/incubator-ambari/diff/288ae2a5 Branch: refs/heads/trunk Commit: 288ae2a55655b3857fe0601c8b3ba2d8efe92152 Parents: 3633b1e Author: Srimanth Gunturi <[email protected]> Authored: Tue Sep 17 10:18:54 2013 -0700 Committer: Srimanth Gunturi <[email protected]> Committed: Tue Sep 17 10:27:35 2013 -0700 ---------------------------------------------------------------------- ambari-web/app/router.js | 12 +++++ ambari-web/app/templates/experimental.hbs | 68 ++++++++++++++++++++++++++ ambari-web/app/views.js | 1 + ambari-web/app/views/experimental.js | 47 ++++++++++++++++++ 4 files changed, 128 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/288ae2a5/ambari-web/app/router.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index c3746f4..bba910d 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -383,6 +383,18 @@ App.Router = Em.Router.extend({ installer: require('routes/installer'), main: require('routes/main'), + + experimental: Em.Route.extend({ + route: '/experimental', + enter: function (router, context) { + + }, + connectOutlets: function (router, context) { + $('title').text("Ambari Experimental"); + console.log('/experimental:connectOutlet'); + router.get('applicationController').connectOutlet('experimental'); + } + }), logoff: function (router, context) { router.logOff(context); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/288ae2a5/ambari-web/app/templates/experimental.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/experimental.hbs b/ambari-web/app/templates/experimental.hbs new file mode 100644 index 0000000..a6354e8 --- /dev/null +++ b/ambari-web/app/templates/experimental.hbs @@ -0,0 +1,68 @@ +{{! +* Licensed to the Apache Software Foundation (ASF) under one +* or more contributor license agreements. See the NOTICE file +* distributed with this work for additional information +* regarding copyright ownership. The ASF licenses this file +* to you 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. +}} + +<div class="alert alert-error"> + <h2>Ambari's Experimental Functionality</h2> + <p> + <span class="label label-important">Important</span> <strong>Changes made here are neither tested nor supported by Ambari</strong> + </p> + <p> + Ambari's experimental functionality is provided <strong>as-is</strong>.<br> + Any changes will effect application behavior, including data corruption. Users making changes do so at their own risk.<br> + Experimental functionality can be modified or removed at any time without notice. + </p> +</div> + +{{#if App}} + {{#if App.supports}} + <table class="table table-bordered table-striped"> + <thead> + <tr> + <td style="width: 20%; font-weight: bold;">Experimental Functionality</td> + <td style="width: 20%; font-weight: bold;">Enabled?</td> + <td style="width: 60%; font-weight: bold;">Description</td> + </tr> + </thead> + <tbody> + {{#each support in view.supports}} + <tr> + <td>{{support.name}}</td> + <td>{{view Ember.Checkbox checkedBinding="support.selected"}}</td> + <td></td> + </tr> + {{/each}} + </tbody> + </table> + <div class="control-group" style="margin-bottom: 100px;"> + <div class="controls pull-right"> + <button class="btn" {{action doCancel target="view"}}>{{t form.cancel}}</button> + <button class="btn btn-primary" {{action doSave target="view"}}>{{t common.save}}</button> + </div> + </div> + {{else}} + <div class="alert alert-error"> + No application supports found. Please login to Ambari and revisit this page. + </div> + {{/if}} +{{else}} + <div class="alert alert-error"> + No application found. Please login to Ambari and revisit this page. + </div> +{{/if}} + + http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/288ae2a5/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index 9355612..b957ded 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -226,3 +226,4 @@ require('views/wizard/stack_upgrade/step2_view'); require('views/wizard/stack_upgrade/step3_view'); require('views/loading'); +require('views/experimental'); http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/288ae2a5/ambari-web/app/views/experimental.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/experimental.js b/ambari-web/app/views/experimental.js new file mode 100644 index 0000000..a201d81 --- /dev/null +++ b/ambari-web/app/views/experimental.js @@ -0,0 +1,47 @@ +/** + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed with this + * work for additional information regarding copyright ownership. The ASF + * licenses this file to you 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 App = require('app'); + +App.ExperimentalView = Em.View.extend({ + templateName: require('templates/experimental'), + supports: function () { + var supports = []; + for ( var sup in App.supports) { + supports.push(Ember.Object.create({ + name: sup, + selected: App.supports[sup] + })); + } + return supports; + }.property('App.supports'), + + doSave: function () { + var supports = this.get('supports'); + supports.forEach(function(s){ + var propName = 'App.supports.' + s.get('name'); + var propValue = s.get('selected'); + console.log(">>>>>>>> " + propName + " = "+ propValue) + Ember.set(propName, propValue); + }); + App.router.transitionTo('root.index'); + }, + + doCancel: function () { + App.router.transitionTo('root.index'); + } +}); \ No newline at end of file
