You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by vs...@apache.org on 2017/06/23 07:02:32 UTC
[23/35] ambari git commit: AMBARI-21330.Remove slider view from
Ambari-3.0.0(Venkata Sairam)
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/sinon-qunit-1.0.0.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/sinon-qunit-1.0.0.js b/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/sinon-qunit-1.0.0.js
deleted file mode 100644
index c26232f..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/sinon-qunit-1.0.0.js
+++ /dev/null
@@ -1,62 +0,0 @@
-/**
- * sinon-qunit 1.0.0, 2010/12/09
- *
- * @author Christian Johansen (christian@cjohansen.no)
- *
- * (The BSD License)
- *
- * Copyright (c) 2010-2011, Christian Johansen, christian@cjohansen.no
- * All rights reserved.
- *
- * Redistribution and use in source and binary forms, with or without modification,
- * are permitted provided that the following conditions are met:
- *
- * * Redistributions of source code must retain the above copyright notice,
- * this list of conditions and the following disclaimer.
- * * Redistributions in binary form must reproduce the above copyright notice,
- * this list of conditions and the following disclaimer in the documentation
- * and/or other materials provided with the distribution.
- * * Neither the name of Christian Johansen nor the names of his contributors
- * may be used to endorse or promote products derived from this software
- * without specific prior written permission.
- *
- * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
- * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
- * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
- * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
- * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
- * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
- * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
- * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
- * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
- * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
- */
-/*global sinon, QUnit, test*/
-sinon.assert.fail = function (msg) {
- QUnit.ok(false, msg);
-};
-
-sinon.assert.pass = function (assertion) {
- QUnit.ok(true, assertion);
-};
-
-sinon.config = {
- injectIntoThis: true,
- injectInto: null,
- properties: ["spy", "stub", "mock", "clock", "sandbox"],
- useFakeTimers: true,
- useFakeServer: false
-};
-
-(function (global) {
- var qTest = QUnit.test;
-
- QUnit.test = global.test = function (testName, expected, callback, async) {
- if (arguments.length === 2) {
- callback = expected;
- expected = null;
- }
-
- return qTest(testName, expected, sinon.test(callback), async);
- };
-}(this));
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/tests.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/tests.js b/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/tests.js
deleted file mode 100644
index b830f0f..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/assets/javascripts/tests.js
+++ /dev/null
@@ -1,29 +0,0 @@
-/**
- * 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 folderOrder = [
- 'test'
-];
-
-folderOrder.forEach(function(folder) {
- window.require.list().filter(function(module) {
- return new RegExp('^' + folder + '/').test(module);
- }).forEach(function(module) {
- require(module);
- });
-});
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/assets/stylesheets/qunit.css
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/stylesheets/qunit.css b/contrib/views/slider/src/main/resources/ui/app/assets/stylesheets/qunit.css
deleted file mode 100644
index 9437b4b..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/assets/stylesheets/qunit.css
+++ /dev/null
@@ -1,237 +0,0 @@
-/*!
- * QUnit 1.15.0
- * http://qunitjs.com/
- *
- * Copyright 2014 jQuery Foundation and other contributors
- * Released under the MIT license
- * http://jquery.org/license
- *
- * Date: 2014-08-08T16:00Z
- */
-
-/** Font Family and Sizes */
-
-#qunit-tests, #qunit-header, #qunit-banner, #qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult {
- font-family: "Helvetica Neue Light", "HelveticaNeue-Light", "Helvetica Neue", Calibri, Helvetica, Arial, sans-serif;
-}
-
-#qunit-testrunner-toolbar, #qunit-userAgent, #qunit-testresult, #qunit-tests li { font-size: small; }
-#qunit-tests { font-size: smaller; }
-
-
-/** Resets */
-
-#qunit-tests, #qunit-header, #qunit-banner, #qunit-userAgent, #qunit-testresult, #qunit-modulefilter {
- margin: 0;
- padding: 0;
-}
-
-
-/** Header */
-
-#qunit-header {
- padding: 0.5em 0 0.5em 1em;
-
- color: #8699A4;
- background-color: #0D3349;
-
- font-size: 1.5em;
- line-height: 1em;
- font-weight: 400;
-
- border-radius: 5px 5px 0 0;
-}
-
-#qunit-header a {
- text-decoration: none;
- color: #C2CCD1;
-}
-
-#qunit-header a:hover,
-#qunit-header a:focus {
- color: #FFF;
-}
-
-#qunit-testrunner-toolbar label {
- display: inline-block;
- padding: 0 0.5em 0 0.1em;
-}
-
-#qunit-banner {
- height: 5px;
-}
-
-#qunit-testrunner-toolbar {
- padding: 0.5em 1em 0.5em 1em;
- color: #5E740B;
- background-color: #EEE;
- overflow: hidden;
-}
-
-#qunit-userAgent {
- padding: 0.5em 1em 0.5em 1em;
- background-color: #2B81AF;
- color: #FFF;
- text-shadow: rgba(0, 0, 0, 0.5) 2px 2px 1px;
-}
-
-#qunit-modulefilter-container {
- float: right;
-}
-
-/** Tests: Pass/Fail */
-
-#qunit-tests {
- list-style-position: inside;
-}
-
-#qunit-tests li {
- padding: 0.4em 1em 0.4em 1em;
- border-bottom: 1px solid #FFF;
- list-style-position: inside;
-}
-
-#qunit-tests.hidepass li.pass, #qunit-tests.hidepass li.running {
- display: none;
-}
-
-#qunit-tests li strong {
- cursor: pointer;
-}
-
-#qunit-tests li a {
- padding: 0.5em;
- color: #C2CCD1;
- text-decoration: none;
-}
-#qunit-tests li a:hover,
-#qunit-tests li a:focus {
- color: #000;
-}
-
-#qunit-tests li .runtime {
- float: right;
- font-size: smaller;
-}
-
-.qunit-assert-list {
- margin-top: 0.5em;
- padding: 0.5em;
-
- background-color: #FFF;
-
- border-radius: 5px;
-}
-
-.qunit-collapsed {
- display: none;
-}
-
-#qunit-tests table {
- border-collapse: collapse;
- margin-top: 0.2em;
-}
-
-#qunit-tests th {
- text-align: right;
- vertical-align: top;
- padding: 0 0.5em 0 0;
-}
-
-#qunit-tests td {
- vertical-align: top;
-}
-
-#qunit-tests pre {
- margin: 0;
- white-space: pre-wrap;
- word-wrap: break-word;
-}
-
-#qunit-tests del {
- background-color: #E0F2BE;
- color: #374E0C;
- text-decoration: none;
-}
-
-#qunit-tests ins {
- background-color: #FFCACA;
- color: #500;
- text-decoration: none;
-}
-
-/*** Test Counts */
-
-#qunit-tests b.counts { color: #000; }
-#qunit-tests b.passed { color: #5E740B; }
-#qunit-tests b.failed { color: #710909; }
-
-#qunit-tests li li {
- padding: 5px;
- background-color: #FFF;
- border-bottom: none;
- list-style-position: inside;
-}
-
-/*** Passing Styles */
-
-#qunit-tests li li.pass {
- color: #3C510C;
- background-color: #FFF;
- border-left: 10px solid #C6E746;
-}
-
-#qunit-tests .pass { color: #528CE0; background-color: #D2E0E6; }
-#qunit-tests .pass .test-name { color: #366097; }
-
-#qunit-tests .pass .test-actual,
-#qunit-tests .pass .test-expected { color: #999; }
-
-#qunit-banner.qunit-pass { background-color: #C6E746; }
-
-/*** Failing Styles */
-
-#qunit-tests li li.fail {
- color: #710909;
- background-color: #FFF;
- border-left: 10px solid #EE5757;
- white-space: pre;
-}
-
-#qunit-tests > li:last-child {
- border-radius: 0 0 5px 5px;
-}
-
-#qunit-tests .fail { color: #000; background-color: #EE5757; }
-#qunit-tests .fail .test-name,
-#qunit-tests .fail .module-name { color: #000; }
-
-#qunit-tests .fail .test-actual { color: #EE5757; }
-#qunit-tests .fail .test-expected { color: #008000; }
-
-#qunit-banner.qunit-fail { background-color: #EE5757; }
-
-
-/** Result */
-
-#qunit-testresult {
- padding: 0.5em 1em 0.5em 1em;
-
- color: #2B81AF;
- background-color: #D2E0E6;
-
- border-bottom: 1px solid #FFF;
-}
-#qunit-testresult .module-name {
- font-weight: 700;
-}
-
-/** Fixture */
-
-#qunit-fixture {
- position: absolute;
- top: -10000px;
- left: -10000px;
- width: 1000px;
- height: 1000px;
-}
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/assets/tests.html
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/assets/tests.html b/contrib/views/slider/src/main/resources/ui/app/assets/tests.html
deleted file mode 100644
index b6591da..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/assets/tests.html
+++ /dev/null
@@ -1,46 +0,0 @@
-<!--
-* 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.
--->
-
-<!DOCTYPE html>
-<html>
-<head>
- <meta charset="utf-8">
- <title>Slider tests</title>
- <link rel="stylesheet" href="stylesheets/qunit.css">
-</head>
-<body>
-<div id="qunit"></div>
-<div id="qunit-fixture"></div>
-<script src="javascripts/qunit.js"></script>
-<script src="javascripts/vendor.js"></script>
-<script src="javascripts/jquery.mockjax.js"></script>
-<script src="javascripts/ember-qunit.js"></script>
-<script src="javascripts/sinon-1.13.0.js"></script>
-<script src="javascripts/sinon-qunit-1.0.0.js"></script>
-<script src="javascripts/app.js"></script>
-<script>
- emq.globalize();
- require('initialize');
- App.setupForTesting();
- App.injectTestHelpers();
- setResolver(Em.DefaultResolver.create({ namespace: App }));
-</script>
-<script src="javascripts/test.js"></script>
-<script src="javascripts/tests.js"></script>
-</body>
-</html>
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/components/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/components/.gitkeep b/contrib/views/slider/src/main/resources/ui/app/components/.gitkeep
deleted file mode 100755
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js b/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
deleted file mode 100644
index 667192f..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/components/configSection.js
+++ /dev/null
@@ -1,164 +0,0 @@
-/**
- * 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.
- */
-
-App.ConfigSectionComponent = Em.Component.extend({
-
- layoutName: 'components/configSection',
-
- config: null,
-
- section: '',
-
- /**
- * label for current section
- * @return {String}
- */
- sectionLabel: function () {
- return this.get('section').classify().replace(/([A-Z])/g, ' $1');
- }.property(),
-
- /**
- * Return True is section name equals 'general'
- * @type {Boolean}
- */
- isGeneral: Ember.computed.equal('section', 'general'),
-
- /**
- * Return True is section name equals 'custom'
- * @type {Boolean}
- */
- isCustom: Ember.computed.equal('section', 'custom'),
-
- /**
- * Filtered configs for current section
- * @type {Array}
- */
- sectionConfigs: Ember.computed.filter('config', function (item) {
- if (item.isSet) {
- return item.section === this.get('section');
- }
- if (this.get('isGeneral')) {
- return !item.name.match('^site.') && this.get('predefinedConfigNames').contains(item.name);
- }
- else {
- if (this.get('isCustom')) {
- return !this.get('predefinedConfigNames').contains(item.name);
- }
- else {
- return !!item.name.match('^site.' + this.get('section'));
- }
- }
- }),
-
- /**
- * Is button "Add Property" visible
- * True - yes, false - no (and "App Property"-form is visible)
- * @type {bool}
- */
- buttonVisible: true,
-
- /**
- * Template for new config
- * @type {Ember.Object}
- */
- newConfig: Em.Object.create({
- name: '',
- value: '',
- nameError: '',
- hasError: false
- }),
-
- /**
- * Clear <code>newConfig</code>
- * @method cleanNewConfig
- */
- cleanNewConfig: function() {
- this.get('newConfig').setProperties({
- name: '',
- value: '',
- messsage: '',
- hasError: false
- });
- },
-
- addPropertyModalButtons: [
- Ember.Object.create({title: Em.I18n.t('common.cancel'), clicked:"discard", dismiss: 'modal'}),
- Ember.Object.create({title: Em.I18n.t('common.add'), clicked:"submit", type:'success'})
- ],
-
- addPropertyModalTitle: Em.I18n.t('configs.add_property'),
-
- tooltipRemove: Em.I18n.t('common.remove'),
-
- actions: {
-
- /**
- * Click on "App Property"-button
- * @method addProperty
- */
- addProperty: function() {
- return Bootstrap.ModalManager.show('addPropertyModal');
- },
-
- /**
- * Delete custom config added by user
- * @param {{name: string, label: string, value: *}} config
- * @method deleteConfig
- */
- deleteConfig: function(config) {
- this.get('config').removeObject(config);
- },
-
- /**
- * Validate and save custom config added by user
- * @method submit
- */
- submit: function() {
- var name = this.get('newConfig.name'),
- value = this.get('newConfig.value');
- if (this.get('config').mapBy('name').contains(name)) {
- this.get('newConfig').setProperties({
- hasError: true,
- messsage: Em.I18n.t('configs.add_property.name_exists')
- });
- return;
- }
- if (!/^[A-Za-z][A-Za-z0-9_\-\.]*$/.test(name)) {
- this.get('newConfig').setProperties({
- hasError: true,
- messsage: Em.I18n.t('configs.add_property.invalid_name')
- });
- return;
- }
- this.get('config').pushObject(App.ConfigProperty.create({name: name, value: value, label: name}));
- this.cleanNewConfig();
- this.toggleProperty('buttonVisible');
- Bootstrap.ModalManager.hide('addPropertyModal');
- },
-
- /**
- * Hide "Add Property"-form
- * @method discard
- */
- discard: function() {
- this.cleanNewConfig();
- this.toggleProperty('buttonVisible');
- }
- }
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/config/app.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/config/app.js b/contrib/views/slider/src/main/resources/ui/app/config/app.js
deleted file mode 100755
index 8af3d3e..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/config/app.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.
- */
-
-'use strict';
-
-var config = {
- LOG_TRANSITIONS: true,
- LOG_TRANSITIONS_INTERNAL: false,
- rootElement: window.QUnit ? '#qunit-fixture' : 'body'
-};
-
-module.exports = Ember.Application.createWithMixins(Bootstrap, config);
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/config/env.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/config/env.js b/contrib/views/slider/src/main/resources/ui/app/config/env.js
deleted file mode 100644
index 363ce0e..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/config/env.js
+++ /dev/null
@@ -1,33 +0,0 @@
-/**
- * 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.
- */
-
-'use strict';
-
-module.exports = (function() {
- var envObject = {};
- var moduleNames = window.require.list().filter(function(module) {
- return new RegExp('^envs/').test(module);
- });
-
- moduleNames.forEach(function(module) {
- var key = module.split('/').reverse()[0];
- envObject[key] = require(module);
- });
-
- return envObject;
-}());
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/config/router.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/config/router.js b/contrib/views/slider/src/main/resources/ui/app/config/router.js
deleted file mode 100755
index 2a1825a..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/config/router.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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.
- */
-
-'use strict';
-
-module.exports = App.Router.map(function () {
- this.resource("slider_apps", { path: "/" }, function () {
- this.resource('createAppWizard', function(){
- this.route('step1');
- this.route('step2');
- this.route('step3');
- this.route('step4');
- });
- });
- this.resource('slider_app', { path: 'apps/:slider_app_id' }, function() {
- this.route('configs');
- this.route('summary');
- });
-});
-
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/config/store.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/config/store.js b/contrib/views/slider/src/main/resources/ui/app/config/store.js
deleted file mode 100755
index a77aaf4..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/config/store.js
+++ /dev/null
@@ -1,23 +0,0 @@
-/**
- * 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.
- */
-
-'use strict';
-
-module.exports = App.Store = DS.Store.extend({
- revision: 13
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/.gitkeep b/contrib/views/slider/src/main/resources/ui/app/controllers/.gitkeep
deleted file mode 100755
index e69de29..0000000
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/application_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/application_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/application_controller.js
deleted file mode 100644
index 7b5e025..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/application_controller.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.
- */
-
-App.ApplicationController = Ember.Controller.extend({
-
- /**
- * Determines if Slider View instance has any configuration errors
- * @type {boolean}
- */
- hasConfigErrors: false
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
deleted file mode 100644
index bcbb6cb..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step1_controller.js
+++ /dev/null
@@ -1,251 +0,0 @@
-/**
- * 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.
- */
-
-App.CreateAppWizardStep1Controller = Ember.Controller.extend(App.AjaxErrorHandler, {
-
- needs: "createAppWizard",
-
- appWizardController: Ember.computed.alias("controllers.createAppWizard"),
-
- /**
- * New App object
- * @type {App.SliderApp}
- */
- newApp: null,
-
- /**
- * List of available types for App
- * @type {Array}
- */
- availableTypes: [],
-
- /**
- * Selected type for new App
- * @type {App.SliderAppType}
- */
- selectedType: null,
-
- /**
- * Define if <code>newAppName</code> pass validation
- * @type {Boolean}
- */
- isNameError: false,
-
- /**
- * Error message describing App name validation error
- * @type {String}
- */
- nameErrorMessage: '',
-
- /**
- * Define if <code>frequency</code> value is valid
- * @type {Boolean}
- */
- isFrequencyError: false,
-
- /**
- * Error message describing frequency validation error
- * @type {String}
- */
- frequencyErrorMessage: '',
-
- /**
- * Determines if request for validating new App name is sent
- * If true - "Next" button should be disabled
- * Set to false after request is finished
- * @type {bool}
- */
- validateAppNameRequestExecuting: false,
-
- /**
- * Define if there are existing App types
- * @type {Boolean}
- */
- isAppTypesError: Em.computed.equal('availableTypes.content.length', 0),
-
- /**
- * Define description depending on selected App type
- * @type {string}
- */
- typeDescription: function () {
- var selectedType = this.get('selectedType');
- return selectedType ? Em.I18n.t('wizard.step1.typeDescription').format(selectedType.get('displayName')) : '';
- }.property('selectedType'),
-
- /**
- * Define if submit button is disabled
- * <code>newApp.name</code> should pass validation and be not empty
- * @type {bool}
- */
- isSubmitDisabled: function () {
- return this.get('validateAppNameRequestExecuting') || !this.get('newApp.name') || this.get('isNameError') ||
- this.get('isFrequencyError') || this.get('isAppTypesError');
- }.property('newApp.name', 'isNameError', 'isAppTypesError', 'validateAppNameRequestExecuting', 'isFrequencyError'),
-
- /**
- * Initialize new App and set it to <code>newApp</code>
- * @method initializeNewApp
- */
- initializeNewApp: function () {
- var app = this.get('appWizardController.newApp'),
- properties = Em.A(['name', 'includeFilePatterns', 'excludeFilePatterns', 'frequency', 'queueName', 'specialLabel', 'selectedYarnLabel']),
- newApp = Ember.Object.create({
- appType: null,
- twoWaySSLEnabled: false,
- configs: {}
- });
-
- properties.forEach(function(p) {
- newApp.set(p, '');
- });
- newApp.set('selectedYarnLabel', 0);
-
- if (app) {
- properties.forEach(function(p) {
- newApp.set(p, app.get(p));
- });
- }
-
- this.set('newApp', newApp);
- },
-
- /**
- * Load all available types for App
- * @method loadAvailableTypes
- */
- loadAvailableTypes: function () {
- this.set('availableTypes', this.store.all('sliderAppType'));
- },
-
- /**
- * Validate <code>newAppName</code>
- * It should consist only of letters, numbers, '-', '_' and first character should be a letter
- * @method nameValidator
- * @return {Boolean}
- */
- nameValidator: function () {
- var newAppName = this.get('newApp.name');
- if (newAppName) {
- // new App name should consist only of letters, numbers, '-', '_' and first character should be a letter
- if (!/^[a-z][a-z0-9_-]*$/.test(newAppName)) {
- this.set('isNameError', true);
- this.set('nameErrorMessage', Em.I18n.t('wizard.step1.nameFormatError'));
- return false;
- }
- // new App name should be unique
- if (this.store.all('sliderApp').mapProperty('name').contains(newAppName)) {
- this.set('isNameError', true);
- this.set('nameErrorMessage', Em.I18n.t('wizard.step1.nameRepeatError'));
- return false;
- }
- }
- this.set('isNameError', false);
- return true;
- }.observes('newApp.name'),
-
- /**
- * Validate <code>frequency</code> value
- * It should be numeric
- * @method frequencyValidator
- * @return {Boolean}
- */
- frequencyValidator: function () {
- var frequency = this.get('newApp.frequency');
- var isFrequencyError = frequency && /\D/.test(frequency);
- this.setProperties({
- isFrequencyError: isFrequencyError,
- frequencyErrorMessage: isFrequencyError ? Em.I18n.t('wizard.step1.frequencyError') : ''
- });
- return !isFrequencyError;
- }.observes('newApp.frequency'),
-
- /**
- * Proceed if app name has passed server validation
- * @method {validateAppNameSuccessCallback}
- */
- validateAppNameSuccessCallback: function () {
- var self = this;
- Em.run(function () {
- self.saveApp();
- self.get('appWizardController').nextStep();
- });
- },
-
- /**
- * Proceed if app name has failed server validation
- * @method {validateAppNameErrorCallback}
- */
- validateAppNameErrorCallback: function (request, ajaxOptions, error, opt, params) {
- if (request.status == 409) {
- Bootstrap.ModalManager.open(
- 'app-name-conflict',
- Em.I18n.t('common.error'),
- Em.View.extend({
- classNames: ['alert', 'alert-danger'],
- template: Em.Handlebars.compile(Em.I18n.t('wizard.step1.validateAppNameError').format(params.name))
- }),
- [
- Em.Object.create({
- title: Em.I18n.t('ok'),
- dismiss: 'modal',
- type: 'success'
- })
- ],
- this
- );
- } else {
- this.defaultErrorHandler(request, opt.url, opt.type, true);
- }
- },
-
- /**
- * Complete-callback for validating newAppName request
- * @method validateAppNameCompleteCallback
- */
- validateAppNameCompleteCallback: function() {
- this.set('validateAppNameRequestExecuting', false);
- },
-
- /**
- * Save new application data to wizard controller
- * @method saveApp
- */
- saveApp: function () {
- var newApp = this.get('newApp');
- newApp.set('appType', this.get('selectedType'));
- newApp.set('configs', this.get('selectedType.configs'));
- newApp.set('predefinedConfigNames', Em.keys(this.get('selectedType.configs')));
- this.set('appWizardController.newApp', newApp);
- },
-
- actions: {
- submit: function () {
- this.set('validateAppNameRequestExecuting', true);
- return App.ajax.send({
- name: 'validateAppName',
- sender: this,
- data: {
- name: this.get('newApp.name')
- },
- success: 'validateAppNameSuccessCallback',
- error: 'validateAppNameErrorCallback',
- complete: 'validateAppNameCompleteCallback'
- });
- }
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
deleted file mode 100644
index 181e81d..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step2_controller.js
+++ /dev/null
@@ -1,136 +0,0 @@
-/**
- * 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.
- */
-
-App.CreateAppWizardStep2Controller = Ember.ArrayController.extend({
-
- needs: "createAppWizard",
-
- appWizardController: Ember.computed.alias("controllers.createAppWizard"),
-
- /**
- * List of app type components
- * @type {Em.Object[]}
- * @see <code>loadTypeComponents</code> for information about elements type
- */
- content: [],
-
- /**
- * New App object
- * @type {App.SliderApp}
- */
- newApp: null,
-
- /**
- * Validate all input fields are integer
- * @type {Boolean}
- */
- isError: function () {
- var result = false;
- this.get('content').forEach(function (component) {
- if (!result && (this.isNotInteger(component.get('numInstances')) || this.isNotInteger(component.get('yarnMemory')) || this.isNotInteger(component.get('yarnCPU')))) {
- result = true;
- }
- }, this);
- return result;
- }.property('content.@each.numInstances', 'content.@each.yarnMemory', 'content.@each.yarnCPU'),
-
- /**
- * Define if submit button is disabled
- * <code>isError</code> should be true
- * @type {bool}
- */
- isSubmitDisabled: Em.computed.alias('isError'),
-
- /**
- * Initialize new App to use it scope of controller
- * @method initializeNewApp
- */
- initializeNewApp: function () {
- var newApp = this.get('appWizardController.newApp');
- this.set('newApp', newApp);
- this.loadTypeComponents();
- },
-
- /**
- * @type {Em.Object}
- */
- typeComponent: Em.Object.extend({
- yarnLabelChecked: false,
- yarnLabelNotChecked: Em.computed.not('yarnLabelChecked'),
- yarnLabel: ''
- }),
-
- /**
- * Fill <code>content</code> with objects created from <code>App.SliderAppTypeComponent</code>
- * If user come from 3 or 4 step, <code>newApp.components</code> are used
- * @method loadTypeComponents
- */
- loadTypeComponents: function () {
- var content = [],
- component = this.get('typeComponent'),
- allTypeComponents = this.get('newApp.appType.components'),
- existingComponents = this.get('appWizardController.newApp.components'); // user may back to current step from 3 or 4
- if (existingComponents && existingComponents.get('length')) {
- this.set('content', existingComponents);
- }
- else {
- if (allTypeComponents && allTypeComponents.get('length')) {
- allTypeComponents.forEach(function (typeComponent) {
- content.push(component.create({
- displayName: typeComponent.get('displayName'),
- name: typeComponent.get('name'),
- priority: typeComponent.get('priority'),
- numInstances: typeComponent.get('defaultNumInstances').toString(),
- yarnMemory: typeComponent.get('defaultYARNMemory').toString(),
- yarnCPU: typeComponent.get('defaultYARNCPU').toString()
- }));
- });
- this.set('content', content);
- }
- }
- },
-
- /**
- * Check if param is integer (and >= 0)
- * @param {string} value value to check
- * @return {Boolean}
- * @method isNotInteger
- */
- isNotInteger: function (value) {
- return !(value && value.trim().length && (value % 1 == 0) && value >= 0);
- },
-
- /**
- * Save all data about components to <code>appWizardController.newApp.components</code>
- * @method saveComponents
- */
- saveComponents: function () {
- this.set('appWizardController.newApp.components', this.get('content'));
- },
-
- actions: {
- /**
- * Save data and proceed to the next step
- * @method submit
- */
- submit: function () {
- this.saveComponents();
- this.get('appWizardController').nextStep();
- }
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
deleted file mode 100644
index b01a927..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step3_controller.js
+++ /dev/null
@@ -1,250 +0,0 @@
-/**
- * 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.
- */
-
-App.CreateAppWizardStep3Controller = Ember.ObjectController.extend({
-
- needs: "createAppWizard",
-
- appWizardController: Ember.computed.alias("controllers.createAppWizard"),
-
- newAppConfigs: Ember.computed.alias("appWizardController.newApp.configs"),
-
- /**
- * Configs entered in TextFields
- * @type Array
- */
- configs: Em.A(),
-
- /**
- * predefined settings of configuration properties
- */
- configSettings: {
- 'site.global.metric_collector_host': {
- },
- 'site.global.metric_collector_port': {
- },
- 'site.global.metric_collector_lib': {
- }
- },
-
- /**
- * Convert configs to array of unique section names
- * @type {Array}
- */
- sectionKeys: function () {
- var configs = this.get('newAppConfigs') || {},
- k = ["general"];
-
- Object.keys(configs).forEach(function (key) {
- if (key.split('.')[0] == "site") {
- k.push(key.split('.')[1])
- }
- });
- k.push('custom');
- return k.uniq();
- }.property('newAppConfigs'),
-
- /**
- * Defines if <code>configs</code> are properly key-value formatted
- * @type {Boolean}
- */
- isError: false,
-
- /**
- * Config object converted from <code>configs</code>
- * @type {Object}
- */
- configsObject: {},
-
- /**
- * config that describe configurations set
- */
- configsSet: [
- {
- name: 'ams_metrics',
- trigger: {value: false, label: Em.I18n.t('configs.enable.metrics'), viewType: 'checkbox'},
- isSet: true,
- section: 'global',
- configNames: ["site.global.metric_collector_host", "site.global.metric_collector_port", "site.global.metric_collector_lib"],
- configs: [],
- dependencies: []
- }
- ],
-
- /**
- * Load all data required for step
- * @method loadStep
- */
- loadStep: function () {
- this.clearStep();
- this.initConfigs(true);
- },
-
- /**
- * Format init value for <code>configs</code> property
- * @param {bool} setDefaults
- * @method initConfigs
- */
- initConfigs: function (setDefaults) {
- var self = this,
- newAppConfigs = this.get('newAppConfigs') || {},
- defaultConfigs = self.get('appWizardController.newApp.appType.configs');
- configs = Em.A(),
- configsSet = $.extend(true, [], this.get('configsSet')),
- allSetConfigs = {},
- configSettings = this.get('configSettings');
-
- configsSet.forEach(function (item) {
- item.configNames.forEach(function (configName) {
- allSetConfigs[configName] = item;
- if(!newAppConfigs[configName] && defaultConfigs && defaultConfigs[configName]){
- newAppConfigs[configName] = defaultConfigs[configName];
- }
- });
- });
-
- Object.keys(newAppConfigs).forEach(function (key) {
- var label = (!!key.match('^site.')) ? key.substr(5) : key;
- var configSetting = (configSettings[key]) ?
- $.extend({name: key, value: newAppConfigs[key], label: label}, configSettings[key]) :
- {name: key, value: newAppConfigs[key], label: label};
-
- if (key === 'java_home' && !!setDefaults && App.get('javaHome')) {
- configSetting.value = App.get('javaHome');
- }
-
- if (key === "site.global.metric_collector_host" && !!setDefaults && App.get('metricsHost')) {
- configSetting.value = App.get('metricsHost');
- }
-
- if (key === "site.global.metric_collector_port" && !!setDefaults && App.get('metricsPort')) {
- configSetting.value = App.get('metricsPort');
- }
-
- if (key === "site.global.metric_collector_lib" && !!setDefaults && App.get('metricsLibPath')) {
- configSetting.value = App.get('metricsLibPath');
- }
-
- if (allSetConfigs[key]) {
- allSetConfigs[key].configs.push(App.ConfigProperty.create(configSetting));
- } else {
- configs.push(App.ConfigProperty.create(configSetting));
- }
- });
-
- configsSet.forEach(function (configSet) {
- if (configSet.configs.length === configSet.configNames.length) {
- delete configSet.configNames;
- configSet.trigger = App.ConfigProperty.create(configSet.trigger);
- this.initConfigSetDependencies(configSet);
- configs.unshift(configSet);
- }
- }, this);
-
- this.set('configs', configs);
- },
-
- /**
- * initialize dependencies map for config set by name
- * configSet map changed by reference
- *
- * @param {object} configSet
- * @method initConfigSetDependencies
- */
- initConfigSetDependencies: function (configSet) {
- configSet.dependencies.forEach(function (item) {
- item.map = Em.get(item.name);
- });
- },
-
- /**
- * Clear all initial data
- * @method clearStep
- */
- clearStep: function () {
- this.set('isError', false);
- },
-
- /**
- * Validate <code>configs</code> to be key-value formatted amd convert it to object
- * @return {Boolean}
- * @method validateConfigs
- */
- validateConfigs: function () {
- var self = this,
- result = true,
- configs = this.addConfigSetProperties(this.get('configs')),
- configsObject = {};
-
- try {
- configs.forEach(function (item) {
- configsObject[item.name] = item.value;
- });
- self.set('configsObject', configsObject);
- } catch (e) {
- self.set('isError', true);
- result = false;
- }
- return result;
- },
-
- /**
- * add config properties from config sets to general configs array
- * @param configs
- * @return {Array}
- */
- addConfigSetProperties: function (configs) {
- var newConfigs = [];
- configs.filterBy('isSet').forEach(function (item) {
- if (item.trigger.value) {
- newConfigs.pushObjects(item.configs);
- }
- });
- return configs.filterBy('isSet', false).concat(newConfigs);
- },
-
- /**
- * Save converted configs to new App configs
- * @method saveConfigs
- */
- saveConfigs: function () {
- var configsToSet = this.get('configsObject');
- if (configsToSet['site.global.metrics_enabled']!=null) {
- if (configsToSet['site.global.metric_collector_host']!=null &&
- configsToSet['site.global.metric_collector_port']!=null) {
- configsToSet['site.global.metrics_enabled'] = "true";
- } else {
- configsToSet['site.global.metrics_enabled'] = "false";
- }
- }
- this.set('newAppConfigs', configsToSet);
- },
-
- actions: {
-
- /**
- * If <code>configs</code> is valid, than save it and proceed to the next step
- */
- submit: function () {
- if (this.validateConfigs()) {
- this.saveConfigs();
- this.get('appWizardController').nextStep();
- }
- }
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
deleted file mode 100644
index 79dc4ba..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/createAppWizard/step4_controller.js
+++ /dev/null
@@ -1,176 +0,0 @@
-/**
- * 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.
- */
-
-App.CreateAppWizardStep4Controller = Ember.ObjectController.extend(App.AjaxErrorHandler, {
-
- needs: "createAppWizard",
-
- appWizardController: Ember.computed.alias("controllers.createAppWizard"),
-
- /**
- * New App object
- * @type {App.SliderApp}
- */
- newApp: null,
-
- /**
- * Define if submit button is disabled
- * @type {Boolean}
- */
- isSubmitDisabled: false,
-
- /**
- * Return formatted configs to show them on preview page
- * @return {String}
- */
- configsFormatted: function () {
- var result = '';
- var configs = this.get('newApp.configs');
- if (configs) {
- result = JSON.stringify(configs);
- result = result.substring(1, result.length - 1);
- result = result.replace(/",/g, '",\n');
- }
- return result;
- }.property('newApp.configs'),
-
- /**
- * Return formatted object to send it in request to server
- * @type {Object[]}
- */
- resourcesFormatted: function () {
- var resources = {};
- var newApp = this.get('newApp');
- // Log Aggregation
- var includeFilePatterns = newApp.get('includeFilePatterns');
- var excludeFilePatterns = newApp.get('excludeFilePatterns');
- var frequency = newApp.get('frequency');
- if ((includeFilePatterns != null && includeFilePatterns.trim().length > 0)
- || (excludeFilePatterns != null && excludeFilePatterns.trim().length > 0)
- || (frequency != null && frequency.trim().length > 0)) {
- resources.global = {
- "yarn.log.include.patterns": includeFilePatterns,
- "yarn.log.exclude.patterns": excludeFilePatterns,
- "yarn.log.interval": frequency
- };
- }
- // Components
- resources.components = newApp.get('components').map(function (component) {
- var componentObj = {
- 'id': component.get('name'),
- 'instanceCount': component.get('numInstances'),
- 'yarnMemory': component.get('yarnMemory'),
- 'yarnCpuCores': component.get('yarnCPU'),
- 'priority': component.get('priority')
- };
- if (component.get('yarnLabelChecked')) {
- componentObj.yarnLabel = component.get('yarnLabel') == null ? ""
- : component.get('yarnLabel').trim();
- }
- return componentObj;
- });
- // YARN Labels
- var yarnLabelOption = newApp.get('selectedYarnLabel');
- if (yarnLabelOption > 0) {
- // 1=empty label. 2=specific label
- var label = "";
- if (yarnLabelOption == 2) {
- label = newApp.get('specialLabel');
- }
- resources.components.push({
- 'id': 'slider-appmaster',
- 'yarn.label.expression': label
- });
- }
- return resources;
- }.property('newApp.components.@each.numInstances', 'newApp.components.@each.yarnMemory', 'newApp.components.@each.yarnCPU', 'newApp.components.@each.priority', 'newApp.components.@each.yarnLabelChecked', 'newApp.components.@each.yarnLabel'),
-
- /**
- * Load all required data for step
- * @method loadStep
- */
- loadStep: function () {
- this.initializeNewApp();
- },
-
- /**
- * Initialize new App to use it scope of controller
- * @method initializeNewApp
- */
- initializeNewApp: function () {
- var newApp = this.get('appWizardController.newApp');
- this.set('newApp', newApp);
- },
-
- /**
- * Send request to server to deploy new App
- * @return {$.ajax}
- * @method sendAppDataToServer
- */
- sendAppDataToServer: function () {
- var app = this.get('newApp');
- var dataObj = {
- typeName: app.get('appType.index'),
- typeVersion: app.get('appType.version'),
- name: app.get('name'),
- twoWaySSLEnabled: app.get('twoWaySSLEnabled') + "",
- resources: this.get('resourcesFormatted'),
- typeConfigs: app.get('configs')
- };
- if (app.queueName != null && app.queueName.trim().length > 0) {
- dataObj.queue = app.queueName.trim();
- }
- this.set('isSubmitDisabled', true);
- return App.ajax.send({
- name: 'createNewApp',
- sender: this,
- data: {
- data: dataObj
- },
- success: 'sendAppDataToServerSuccessCallback',
- complete: 'sendAppDataToServerCompleteCallback'
- });
- },
-
- /**
- * Success-callback for "create new app"-request
- * @method sendAppDataToServerSuccessCallback
- */
- sendAppDataToServerSuccessCallback: function() {
- this.get('appWizardController').hidePopup();
- },
-
- /**
- * Complete-callback for "create new app"-request
- * @method sendAppDataToServerCompleteCallback
- */
- sendAppDataToServerCompleteCallback: function () {
- this.set('isSubmitDisabled', false);
- },
-
- actions: {
-
- /**
- * Onclick handler for finish button
- * @method finish
- */
- finish: function () {
- this.sendAppDataToServer();
- }
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
deleted file mode 100644
index ee46ee6..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/create_app_wizard_controller.js
+++ /dev/null
@@ -1,122 +0,0 @@
-/**
- * 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.
- */
-
-App.CreateAppWizardController = Ember.ObjectController.extend({
-
- /**
- * New app created via current wizard
- * Populated with data step by step
- * @type {object|null}
- */
- newApp: null,
-
- /**
- * Current step number
- * @type {number}
- */
- currentStep: 1,
-
- /**
- * Overall steps count
- * @type {number}
- */
- TOTAL_STEPS_NUMBER: 4,
-
- /**
- * Init controller's data
- * @method loadStep
- */
- loadStep: function () {
- this.set('currentStep', 1);
- this.gotoStep(this.get('currentStep'));
- },
-
- /**
- * Proceed user to selected step
- * @param {number} step step's number
- * @param {bool} fromNextButton is user came from "Next"-button click
- * @method gotoStep
- */
- gotoStep: function (step, fromNextButton) {
- if (step > this.get('TOTAL_STEPS_NUMBER') || step < 1 || (!fromNextButton && step > this.get('currentStep'))) {
- return;
- }
- this.set('currentStep', step);
-
- if (step == 1) {
- this.dropCustomConfigs();
- }
- this.transitionToRoute('createAppWizard.step' + step);
- },
-
- /**
- * Custom configs added by used should be dropped if user come back to the 1st step
- * @method dropCustomConfigs
- */
- dropCustomConfigs: function() {
- var configs = this.get('newApp.configs'),
- predefined = this.get('newApp.predefinedConfigNames'),
- filtered = {};
- if (!configs) return;
- Em.keys(configs).forEach(function(name) {
- if (predefined.contains(name)) {
- filtered[name] = configs[name];
- }
- });
- this.set('newApp.configs', filtered);
- },
-
- /**
- * Proceed user no next step
- * @method nextStep
- */
- nextStep: function () {
- this.gotoStep(this.get('currentStep') + 1, true);
- },
-
- /**
- * Proceed user to prev step
- * @method prevStep
- */
- prevStep: function () {
- this.gotoStep(this.get('currentStep') - 1);
- },
-
- /**
- * Hide wizard-popup
- * @method hidePopup
- */
- hidePopup: function () {
- $('#createAppWizard').hide();
- this.set('newApp', null);
- this.transitionToRoute('slider_apps');
- },
-
- actions: {
-
- /**
- * Proceed user to selected step
- * @param {number} step step's number
- * @method gotoStep
- */
- gotoStep: function (step) {
- this.gotoStep(step);
- }
- }
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
deleted file mode 100644
index d9a4a4a..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app/summary_controller.js
+++ /dev/null
@@ -1,27 +0,0 @@
-/**
- * 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.
- */
-
-App.SliderAppSummaryController = Ember.Controller.extend({
-
- /**
- * Alias for model-displayName
- * @type {string}
- */
- appType: Em.computed.alias('model.appType.displayName')
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
deleted file mode 100644
index bdebf13..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_app_controller.js
+++ /dev/null
@@ -1,472 +0,0 @@
-/**
- * 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.
- */
-
-App.SliderAppController = Ember.ObjectController.extend(App.AjaxErrorHandler, {
-
- /**
- * List of Slider App tabs
- * @type {{title: string, linkTo: string}[]}
- */
- sliderAppTabs: function () {
- var configs = this.get("model.configs");
- var tabs = Ember.A([
- Ember.Object.create({title: Ember.I18n.t('common.summary'), linkTo: 'slider_app.summary'})
- ]);
- if(typeof configs == "object" && Object.keys(configs).length > 0){
- tabs.pushObject(Ember.Object.create({title: Ember.I18n.t('common.configs'), linkTo: 'slider_app.configs'}));
- }
- return tabs;
- }.property('model.configs'),
-
- /**
- * Do we have quicklinks ?
- * @type {bool}
- */
- weHaveQuicklinks: function () {
- return (Em.get(this.get('model'), 'quickLinks.content.content.length') > 0);
- }.property('model.quickLinks.content.content.length'),
-
- /**
- * Quick links in custom order.
- *
- * @type {Array}
- **/
- quickLinksOrdered: function() {
- var copy = this.get('model.quickLinks').slice(0);
- var toTail = ['Metrics UI', 'Metrics API'];
-
- if (this.get('weHaveQuicklinks')) {
- toTail.forEach(function(labelName) {
- if (copy.findBy('label', labelName)) {
- copy = copy.concat(copy.splice(copy.indexOf(copy.findBy('label', labelName)), 1));
- }
- });
- }
- return copy;
- }.property('model.quickLinks.content.content.length', 'weHaveQuicklinks'),
-
- /**
- * List of all possible actions for slider app
- * @type {Em.Object}
- */
- appActions: Em.Object.create({
- stop: {
- title: 'Stop',
- action: 'freeze',
- confirm: true
- },
- flex: {
- title: 'Flex',
- action: 'flex',
- confirm: false
- },
- destroy: {
- title: 'Destroy',
- action: 'destroy',
- customConfirm: 'confirmDestroy'
- },
- start: {
- title: 'Start',
- action: 'thaw',
- confirm: false
- }
- }),
-
- /**
- * map of available action for slider app according to its status
- * key - status, value - list of actions
- * @type {Em.Object}
- */
- statusActionsMap: Em.Object.create({
- NEW: ['stop'],
- NEW_SAVING: ['stop'],
- ACCEPTED: ['stop'],
- RUNNING: ['stop', 'flex'],
- FINISHED: ['start', 'destroy'],
- FAILED: ['destroy'],
- KILLED: ['destroy'],
- FROZEN: ['start', 'destroy']
- }),
-
- /**
- * List of available for model actions
- * Based on <code>model.status</code>
- * @type {Ember.Object[]}
- */
- availableActions: function() {
- var actions = Em.A([]),
- advanced = Em.A([]),
- appActions = this.get('appActions'),
- statusActionsMap = this.get('statusActionsMap'),
- status = this.get('model.status');
-
- if (this.get('model.isActionFinished')) this.get('model').set('isActionPerformed', false);
- statusActionsMap[status].forEach(function(action) {
- if ('destroy' === action) {
- advanced.pushObject(appActions[action]);
- }
- else {
- actions.pushObject(appActions[action]);
- }
- });
-
- if (advanced.length) {
- actions.pushObject({
- title: 'Advanced',
- submenu: advanced
- });
- }
- return actions;
- }.property('model.status'),
-
- /**
- * Checkbox in the destroy-modal
- * If true - enable "Destroy"-button
- * @type {bool}
- */
- confirmChecked: false,
-
- /**
- * Inverted <code>confirmChecked</code>-value
- * Used in <code>App.DestroyAppPopupFooterView</code> to enable "Destroy"-button
- * @type {bool}
- */
- destroyButtonEnabled: Ember.computed.not('confirmChecked'),
-
- /**
- * Method's name that should be called for model
- * @type {string}
- */
- currentAction: null,
-
- /**
- * Grouped components by name
- * @type {{name: string, count: number}[]}
- */
- groupedComponents: [],
-
- /**
- * Does new instance counts are invalid
- * @type {bool}
- */
- groupedComponentsHaveErrors: false,
-
- /**
- * Custom popup for "Destroy"-action
- * @method destroyConfirm
- */
- confirmDestroy: function() {
- var modalComponent = this.container.lookup('component-lookup:main').
- lookupFactory('bs-modal', this.get('container')).create();
- modalComponent.setProperties({
- name: 'confirm-modal',
- title: Ember.I18n.t('sliderApp.destroy.confirm.title'),
- manual: true,
- targetObject: this,
- body: App.DestroyAppPopupView,
- controller: this,
- footerViews: [App.DestroyAppPopupFooterView]
- });
- Bootstrap.ModalManager.register('confirm-modal', modalComponent);
- },
-
- /**
- * Try call controller's method with name stored in <code>currentAction</code>
- * @method tryDoAction
- */
- tryDoAction: function() {
- var currentAction = this.get('currentAction');
- if (Em.isNone(currentAction)) return;
- if(Em.typeOf(this[currentAction]) !== 'function') return;
- this[currentAction]();
- },
-
- /**
- * Do request to <strong>thaw</strong> current slider's app
- * @returns {$.ajax}
- * @method freeze
- */
- thaw: function() {
- var model = this.get('model');
- this.setStartAction();
- return App.ajax.send({
- name: 'changeAppState',
- sender: this,
- data: {
- id: model.get('id'),
- data: {
- id: model.get('id'),
- name: model.get('name'),
- state: "RUNNING"
- }
- },
- success: 'thawSuccessCallback',
- error: 'actionErrorCallback'
- });
- },
-
- /**
- * Redirect to Slider Apps Table page on successful thawing
- * @method thawSuccessCallback
- */
- thawSuccessCallback: function () {
- this.transitionToRoute('slider_apps.index');
- },
-
- /**
- * Do request to <strong>freeze</strong> current slider's app
- * @returns {$.ajax}
- * @method freeze
- */
- freeze: function() {
- var model = this.get('model');
- this.setStartAction();
- return App.ajax.send({
- name: 'changeAppState',
- sender: this,
- data: {
- id: model.get('id'),
- data: {
- id: model.get('id'),
- name: model.get('name'),
- state: "FROZEN"
- }
- },
- error: 'actionErrorCallback'
- });
- },
-
- /**
- * Group components by <code>componentName</code> and save them to <code>groupedComponents</code>
- * @method groupComponents
- */
- groupComponents: function() {
- var groupedComponents = this.get('appType.components').map(function(c) {
- return {
- name: c.get('name'),
- count: 0
- };
- });
-
- this.get('components').forEach(function(component) {
- var name = component.get('componentName'),
- group = groupedComponents.findBy('name', name);
- if (group) {
- group.count++;
- }
- });
- this.set('groupedComponents', groupedComponents);
- },
-
- /**
- * Validate new instance counts for components (should be integer and >= 0)
- * @method validateGroupedComponents
- * @returns {boolean}
- */
- validateGroupedComponents: function() {
- var hasErrors = false;
- this.get('groupedComponents').forEach(function(c) {
- if (!/^\d+$/.test(c.count)) {
- hasErrors = true;
- return;
- }
- var count = parseInt(c.count + 0);
- if (count < 0) {
- hasErrors = true;
- }
- });
- this.set('groupedComponentsHaveErrors', hasErrors);
- return hasErrors;
- },
-
- /**
- * Do request to <strong>flex</strong> current slider's app
- * @method flex
- */
- flex: function() {
- this.groupComponents();
- Bootstrap.ModalManager.open(
- 'flex-popup',
- 'Flex',
- 'slider_app/flex_popup',
- Em.A([
- Ember.Object.create({title: Em.I18n.t('common.cancel'), clicked:"closeFlex", dismiss: 'modal'}),
- Ember.Object.create({title: Em.I18n.t('common.save'), clicked:"submitFlex", type:'success'})
- ]),
- this
- );
- },
-
- /**
- * Map <code>model.components</code> for Flex request
- * Output format:
- * <code>
- * {
- * COMPONENT_NAME_1: {
- * instanceCount: 1
- * },
- * COMPONENT_NAME_2: {
- * instanceCount: 2
- * },
- * ....
- * }
- * </code>
- * @returns {object}
- * @method mapComponentsForFlexRequest
- */
- mapComponentsForFlexRequest: function() {
- var components = {};
- this.get('groupedComponents').forEach(function(component) {
- components[Em.get(component, 'name')] = {
- instanceCount: Em.get(component, 'count')
- }
- });
- return components;
- },
-
- /**
- * Do request to <strong>delete</strong> current slider's app
- * @return {$.ajax}
- * @method destroy
- */
- destroy: function() {
- this.setStartAction();
- return App.ajax.send({
- name: 'destroyApp',
- sender: this,
- data: {
- model: this.get('model'),
- id: this.get('model.id')
- },
- success: 'destroySuccessCallback',
- error: 'actionErrorCallback'
- });
- },
-
- /**
- * Complete-callback for "destroy app"-request
- * @method destroyCompleteCallback
- */
- destroySuccessCallback: function(data, opt, params) {
- params.model.deleteRecord();
- this.store.dematerializeRecord(params.model);
- this.transitionToRoute('slider_apps');
- },
-
- actionErrorCallback: function() {
- this.defaultErrorHandler(arguments[0], arguments[3].url, arguments[3].type, true);
- this.get('model').set('isActionPerformed', false);
- },
-
- actions: {
-
- /**
- * Submit new instance counts for app components
- * @method submitFlex
- * @returns {*}
- */
- submitFlex: function() {
- if (this.validateGroupedComponents()) return;
- var model = this.get('model'),
- components = this.mapComponentsForFlexRequest();
- this.get('groupedComponents').clear();
- this.set('groupedComponentsHaveErrors', false);
- Bootstrap.ModalManager.close('flex-popup');
- return App.ajax.send({
- name: 'flexApp',
- sender: this,
- data: {
- id: model.get('id'),
- data: {
- id: model.get('id'),
- name: model.get('name'),
- components: components
- }
- }
- });
- },
-
- /**
- * Close flex-popup
- * @method closeFlex
- */
- closeFlex: function() {
- this.get('groupedComponents').clear();
- this.set('groupedComponentsHaveErrors', false);
- },
-
- /**
- * Handler for "Yes" click in modal popup
- * @returns {*}
- * @method modalConfirmed
- */
- modalConfirmed: function() {
- this.tryDoAction();
- this.set('confirmChecked', false);
- return Bootstrap.ModalManager.close('confirm-modal');
- },
-
- /**
- * Handler for "No" click in modal popup
- * @returns {*}
- * @method modalCanceled
- */
- modalCanceled: function() {
- this.set('confirmChecked', false);
- return Bootstrap.ModalManager.close('confirm-modal');
- },
-
- /**
- * Handler for Actions menu elements click
- * @param {{title: string, action: string, confirm: bool}} option
- * @method openModal
- */
- openModal: function(option) {
- if (!option.action) return false;
- this.set('currentAction', option.action);
- if (!Em.isNone(option.customConfirm) && Ember.typeOf(this.get(option.customConfirm)) === 'function') {
- this[option.customConfirm]();
- }
- else {
- if (option.confirm) {
- Bootstrap.ModalManager.open(
- "confirm-modal",
- Ember.I18n.t('common.confirmation'),
- Ember.View.extend({
- template: Ember.Handlebars.compile('{{t question.sure}}')
- }),
- [
- Ember.Object.create({title: Em.I18n.t('common.cancel'), clicked:"modalCanceled", dismiss: 'modal'}),
- Ember.Object.create({title: Em.I18n.t('ok'), clicked:"modalConfirmed", type:'success'})
- ],
- this
- );
- }
- else {
- this.tryDoAction();
- }
- }
- }
- },
-
- setStartAction: function() {
- this.get('model').set('isActionPerformed' , true);
- this.get('model').set('statusBeforeAction' , this.get('model.status'));
- }
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
deleted file mode 100644
index 923e9f6..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_apps_controller.js
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * 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.
- */
-
-App.SliderAppsController = Ember.ArrayController.extend({
- /**
- * show modal popup that says apps currently unavailable
- */
- showUnavailableAppsPopup: function(message) {
- this.set('errorMessage', message || Em.I18n.t('slider.apps.undefined.issue'));
- Bootstrap.ModalManager.open(
- "apps-warning-modal",
- Em.I18n.t('common.warning'),
- 'unavailable_apps',
- [
- Ember.Object.create({title: Em.I18n.t('ok'), dismiss: 'modal'})
- ],
- this
- );
- }
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
deleted file mode 100644
index 6e2590d..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/slider_controller.js
+++ /dev/null
@@ -1,138 +0,0 @@
-/**
- * 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.
- */
-
-/**
- * Load Slider-properties.
- * After this set <code>App.sliderConfig</code>-models and enable/disable Slider
- * @type {Ember.Controller}
- */
-App.SliderController = Ember.Controller.extend(App.RunPeriodically, {
-
- /**
- * Load resources on controller initialization
- * @method initResources
- */
- initResources: function () {
- this.getParametersFromViewProperties();
- },
-
- /**
- * Load Slider display information
- * @returns {$.ajax}
- * @method getViewDisplayParameters
- */
- getViewDisplayParameters: function() {
- return App.ajax.send({
- name: 'slider.getViewParams',
- sender: this,
- success: 'getViewDisplayParametersSuccessCallback'
- });
- },
-
- /**
- * Accessing /resources/status initializes the view internals
- * with the latest configs. This will help the view in staying
- * updated and recover from previous config issues.
- */
- touchViewStatus: function() {
- return App.ajax.send({
- name: 'slider.getViewParams.v2',
- sender: this
- });
- },
-
- /**
- * Set Slider label and description to <code>App</code> properties
- * @param {object} data
- * @method getViewDisplayParametersSuccessCallback
- */
- getViewDisplayParametersSuccessCallback: function(data) {
- App.set('description', Em.get(data, 'ViewInstanceInfo.description'));
- App.set('label', Em.get(data, 'ViewInstanceInfo.label'));
- App.set('javaHome', Em.get(data, 'ViewInstanceInfo.instance_data') && Em.get(data, 'ViewInstanceInfo.instance_data')['java.home']);
- App.set('sliderUser', Em.get(data, 'ViewInstanceInfo.instance_data') && Em.get(data, 'ViewInstanceInfo.instance_data')['slider.user']);
- },
-
- /**
- * Get Slider properties from View-parameters (set in the Ambari Admin View)
- * If parameters can't be found, use Ambari-configs to populate Slider properties
- * @returns {$.ajax}
- * @method getParametersFromViewProperties
- */
- getParametersFromViewProperties: function () {
- return App.ajax.send({
- name: 'slider.getViewParams.v2',
- sender: this,
- success: 'getParametersFromViewPropertiesSuccessCallback'
- });
- },
-
- /**
- * Check if Slider-properties exist
- * If exist - set Slider properties using view-configs
- * If not - get Ambari configs to populate Slider properties
- * @param {object} data
- * @method getParametersFromViewPropertiesSuccessCallback
- */
- getParametersFromViewPropertiesSuccessCallback: function (data) {
- var properties = Em.get(data, 'parameters'),
- sliderConfigs = App.SliderApp.store.all('sliderConfig');
- sliderConfigs.forEach(function (model) {
- var key = model.get('viewConfigName');
- model.set('value', properties[key]);
- });
- if (properties['view.slider.user'] != null
- && properties['view.slider.user'] != App.get('sliderUser')) {
- App.set('sliderUser', properties['view.slider.user']);
- }
- if (properties['java.home'] != null
- && properties['java.home'] != App.get('javaHome')) {
- App.set('javaHome', properties['java.home']);
- }
- this.initMetricsServerProperties();
- this.finishSliderConfiguration(data);
- },
-
- /**
- * initialize properties of Metrics Server that are required by Slider View
- * @method initMetricsServerProperties
- */
- initMetricsServerProperties: function () {
- var sliderConfigs = App.SliderApp.store.all('sliderConfig'),
- metricsPort = sliderConfigs.findBy('viewConfigName', 'site.global.metric_collector_port'),
- metricsHost = sliderConfigs.findBy('viewConfigName', 'site.global.metric_collector_host'),
- metricsLibPath = sliderConfigs.findBy('viewConfigName', 'site.global.metric_collector_lib');
- App.set('metricsHost', metricsHost.get('value'));
- App.set('metricsPort', metricsPort.get('value'));
- App.set('metricsLibPath', metricsLibPath.get('value'));
- },
-
- /**
- * After all Slider-configs are loaded, application should check self status
- * @param {object} data - received from server information about current Slider-status
- * @method finishSliderConfiguration
- */
- finishSliderConfiguration: function (data) {
- App.setProperties({
- viewErrors: data.validations,
- viewEnabled: data.validations.length === 0,
- mapperTime: new Date().getTime()
- });
- }
-
-});
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/controllers/tooltip_controller.js
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/controllers/tooltip_controller.js b/contrib/views/slider/src/main/resources/ui/app/controllers/tooltip_controller.js
deleted file mode 100644
index fb85a88..0000000
--- a/contrib/views/slider/src/main/resources/ui/app/controllers/tooltip_controller.js
+++ /dev/null
@@ -1,19 +0,0 @@
-/**
- * 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.
- */
-
-App.TooltipBoxController = Bootstrap.TooltipBoxController;
\ No newline at end of file
http://git-wip-us.apache.org/repos/asf/ambari/blob/ec8deeba/contrib/views/slider/src/main/resources/ui/app/helpers/.gitkeep
----------------------------------------------------------------------
diff --git a/contrib/views/slider/src/main/resources/ui/app/helpers/.gitkeep b/contrib/views/slider/src/main/resources/ui/app/helpers/.gitkeep
deleted file mode 100755
index e69de29..0000000