Repository: ambari Updated Branches: refs/heads/branch-feature-AMBARI-14714-ui 5ddb07cdb -> fe57de61f
AMBARI-22180. [Modular Deployment][MVP] Download Configuration. (Ishan via Jaimin) Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/fe57de61 Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/fe57de61 Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/fe57de61 Branch: refs/heads/branch-feature-AMBARI-14714-ui Commit: fe57de61fd35ad2e06bca22bcecaeb718afe2941 Parents: 5ddb07c Author: Jaimin Jetly <jai...@hortonworks.com> Authored: Thu Oct 12 10:58:32 2017 -0700 Committer: Jaimin Jetly <jai...@hortonworks.com> Committed: Thu Oct 12 10:58:32 2017 -0700 ---------------------------------------------------------------------- ambari-web/app/controllers.js | 1 + ambari-web/app/controllers/installer.js | 44 +++++++ ambari-web/app/controllers/wizard.js | 6 +- .../wizard/configureDownload_controller.js | 129 +++++++++++++++++++ ambari-web/app/messages.js | 8 ++ .../app/mixins/wizard/wizard_menu_view.js | 46 +++---- ambari-web/app/router.js | 2 + ambari-web/app/routes/installer.js | 64 ++++++++- ambari-web/app/styles/wizard.less | 66 ++++++++++ ambari-web/app/templates/installer.hbs | 21 +-- .../app/templates/wizard/configureDownload.hbs | 77 +++++++++++ ambari-web/app/views.js | 1 + .../app/views/wizard/configureDownload_view.js | 51 ++++++++ 13 files changed, 481 insertions(+), 35 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/controllers.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js index f7d77be..8e7e267 100644 --- a/ambari-web/app/controllers.js +++ b/ambari-web/app/controllers.js @@ -149,6 +149,7 @@ require('controllers/wizard/step0_controller'); require('controllers/wizard/step1_controller'); require('controllers/wizard/step2_controller'); require('controllers/wizard/step3_controller'); +require('controllers/wizard/configureDownload_controller'); require('controllers/wizard/step4_controller'); require('controllers/wizard/step5_controller'); require('controllers/wizard/step6_controller'); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/controllers/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js index 8aea887..7afaf87 100644 --- a/ambari-web/app/controllers/installer.js +++ b/ambari-web/app/controllers/installer.js @@ -41,6 +41,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, { "step0", "step2", "step3", + "configureDownload", "step1", "step4", "step5", @@ -987,6 +988,40 @@ App.InstallerController = App.WizardController.extend(App.Persist, { } } ], + 'configureDownload': [ + { + type: 'async', + callback: function () { + var dfd = $.Deferred(); + + this.loadStacks().always(function() { + App.router.get('clusterController').loadAmbariProperties().always(function() { + dfd.resolve(); + }); + }); + + return dfd.promise(); + } + }, + { + type: 'async', + callback: function (stacksLoaded) { + var dfd = $.Deferred(); + + if (!stacksLoaded) { + $.when.apply(this, this.loadStacksVersions()).done(function () { + Em.run.later('sync', function() { + dfd.resolve(stacksLoaded); + }, 1000); + }); + } else { + dfd.resolve(stacksLoaded); + } + + return dfd.promise(); + } + } + ], 'step3': [ { type: 'sync', @@ -995,6 +1030,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, { } } ], + 'step4': [ { type: 'async', @@ -1105,6 +1141,10 @@ App.InstallerController = App.WizardController.extend(App.Persist, { this.gotoStep('step10'); }, + gotoConfigureDownload: function () { + this.gotoStep('configureDownload'); + }, + isStep0: function () { return this.get('currentStep') == this.getStepIndex('step0'); }.property('currentStep'), @@ -1149,6 +1189,10 @@ App.InstallerController = App.WizardController.extend(App.Persist, { return this.get('currentStep') == this.getStepIndex('step10'); }.property('currentStep'), + isConfigureDownload: function () { + return this.get('currentStep') == this.getStepIndex('configureDownload'); + }.property('currentStep'), + clearConfigActionComponents: function() { var masterComponentHosts = this.get('content.masterComponentHosts'); var componentsAddedFromConfigAction = this.get('content.componentsFromConfigs'); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/controllers/wizard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js index bc92ccf..711ad7b 100644 --- a/ambari-web/app/controllers/wizard.js +++ b/ambari-web/app/controllers/wizard.js @@ -329,7 +329,7 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM body: "If you proceed to go back to Step " + step + ", you will lose any changes you have made beyond this step" }); } else { - App.router.send('gotoStep' + step); + App.router.send('goto' + stepName.capitalize()); } return true; @@ -379,6 +379,10 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM this.gotoStep(10); }, + gotoConfigureDownload: function () { + this.gotoStep("configureDownload"); + }, + /** * Initialize host status info for step9 */ http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/controllers/wizard/configureDownload_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/configureDownload_controller.js b/ambari-web/app/controllers/wizard/configureDownload_controller.js new file mode 100644 index 0000000..a80cf25 --- /dev/null +++ b/ambari-web/app/controllers/wizard/configureDownload_controller.js @@ -0,0 +1,129 @@ +/** + * 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'); +var arrayUtils = require('utils/array_utils'); + +/** + * @typedef {Em.Object} StackType + * @property {string} stackName + * @property {App.Stack[]} stacks + * @property {boolean} isSelected + */ + +/** + * @type {Em.Object} + */ +var StackType = Em.Object.extend({ + stackName: '', + stacks: [], + isSelected: Em.computed.someBy('stacks', 'isSelected', true) +}); + +App.WizardConfigureDownloadController = Em.Controller.extend({ + + name: 'wizardConfigureDownloadController', + + /** + * @type {App.Stack} + */ + selectedStack: Em.computed.findBy('content.stacks', 'isSelected', true), + + /** + * @type {App.ServiceSimple[]} + */ + servicesForSelectedStack: Em.computed.filterBy('selectedStack.stackServices', 'isHidden', false), + + optionsToSelect: { + 'usePublicRepo': { + index: 0, + isSelected: true + }, + 'useLocalRepo': { + index: 1, + isSelected: false, + 'uploadFile': { + index: 0, + name: 'uploadFile', + file: '', + hasError: false, + isSelected: true + }, + 'enterUrl': { + index: 1, + name: 'enterUrl', + url: '', + placeholder: Em.I18n.t('installer.step1.useLocalRepo.enterUrl.placeholder'), + hasError: false, + isSelected: false + } + } + }, + + /** + * Restore base urls for selected stack when user select to use public repository + */ + usePublicRepo: function () { + var selectedStack = this.get('selectedStack'); + if (selectedStack) { + selectedStack.setProperties({ + useRedhatSatellite: false, + usePublicRepo: true, + useLocalRepo: false + }); + selectedStack.restoreReposBaseUrls(); + } + }, + + /** + * Clean base urls for selected stack when user select to use local repository + */ + useLocalRepo: function () { + var selectedStack = this.get('selectedStack'); + if (selectedStack) { + selectedStack.setProperties({ + usePublicRepo: false, + useLocalRepo: true + }); + selectedStack.cleanReposBaseUrls(); + } + }, + + /** + * List of stacks grouped by <code>stackNameVersion</code> + * + * @type {StackType[]} + */ + availableStackTypes: function () { + var stacks = this.get('content.stacks'); + return stacks ? stacks.mapProperty('stackNameVersion').uniq().sort().reverse().map(function (stackName) { + return StackType.create({ + stackName: stackName, + stacks: stacks.filterProperty('stackNameVersion', stackName).sort(arrayUtils.sortByIdAsVersion).reverse() + }) + }) : []; + }.property('content.stacks.@each.stackNameVersion'), + + /** + * @type {StackType} + */ + selectedStackType: Em.computed.findBy('availableStackTypes', 'isSelected', true), + + isLoadingComplete: Em.computed.equal('wizardController.loadStacksRequestsCounter', 0) + +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 3c4f038..46218b8 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -607,6 +607,14 @@ Em.I18n.translations = { 'installer.step0.clusterName.error.whitespace':'Cluster Name cannot contain whitespace', 'installer.step0.clusterName.error.specialChar':'Cluster Name cannot contain special characters', + 'installer.configureDownload.header': 'Configure Download', + 'installer.configureDownload.body.title': 'How do you want to download your products?', + 'installer.configureDownload.body.description': 'Using Public Repository requires an internet connection. Using local repository requires you have configured the software in a repository available on your network.', + 'installer.configureDownload.publicRepo': 'Public Repository', + 'installer.configureDownload.localRepo': 'Local Repository', + 'installer.configureDownload.publicRepo.hoverDesc': 'Management Packs will be downloaded using the internet', + 'installer.configureDownload.localRepo.hoverDesc': 'Management Packs will be downloaded from the specified local repository', + 'installer.step1.header':'Select Version', 'installer.step1.body':'Select the software version and method of delivery for your cluster.', 'installer.step1.repo.body':'Using a Public Repository requires Internet connectivity. Using a Local Repository requires you have configured the software in a repository available in your network.', http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/mixins/wizard/wizard_menu_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mixins/wizard/wizard_menu_view.js b/ambari-web/app/mixins/wizard/wizard_menu_view.js index 8efebee..644b265 100644 --- a/ambari-web/app/mixins/wizard/wizard_menu_view.js +++ b/ambari-web/app/mixins/wizard/wizard_menu_view.js @@ -42,28 +42,30 @@ App.WizardMenuMixin = Em.Mixin.create({ return this.get('controller.currentStep') > index; }, - isStep0Disabled: isStepDisabled(0), - isStep1Disabled: isStepDisabled(1), - isStep2Disabled: isStepDisabled(2), - isStep3Disabled: isStepDisabled(3), - isStep4Disabled: isStepDisabled(4), - isStep5Disabled: isStepDisabled(5), - isStep6Disabled: isStepDisabled(6), - isStep7Disabled: isStepDisabled(7), - isStep8Disabled: isStepDisabled(8), - isStep9Disabled: isStepDisabled(9), - isStep10Disabled: isStepDisabled(10), + isStep0Disabled: isStepDisabled("step0"), + isStep1Disabled: isStepDisabled("step1"), + isStep2Disabled: isStepDisabled("step2"), + isStep3Disabled: isStepDisabled("step3"), + isConfigureDownloadDisabled: isStepDisabled("configureDownload"), + isStep4Disabled: isStepDisabled("step4"), + isStep5Disabled: isStepDisabled("step5"), + isStep6Disabled: isStepDisabled("step6"), + isStep7Disabled: isStepDisabled("step7"), + isStep8Disabled: isStepDisabled("step8"), + isStep9Disabled: isStepDisabled("step9"), + isStep10Disabled: isStepDisabled("step10"), - isStep0Completed: isStepCompleted(0), - isStep1Completed: isStepCompleted(1), - isStep2Completed: isStepCompleted(2), - isStep3Completed: isStepCompleted(3), - isStep4Completed: isStepCompleted(4), - isStep5Completed: isStepCompleted(5), - isStep6Completed: isStepCompleted(6), - isStep7Completed: isStepCompleted(7), - isStep8Completed: isStepCompleted(8), - isStep9Completed: isStepCompleted(9), - isStep10Completed: isStepCompleted(10) + isStep0Completed: isStepCompleted("step0"), + isStep1Completed: isStepCompleted("step1"), + isStep2Completed: isStepCompleted("step2"), + isStep3Completed: isStepCompleted("step3"), + isConfigureDownloadCompleted: isStepCompleted("configureDownload"), + isStep4Completed: isStepCompleted("step4"), + isStep5Completed: isStepCompleted("step5"), + isStep6Completed: isStepCompleted("step6"), + isStep7Completed: isStepCompleted("step7"), + isStep8Completed: isStepCompleted("step8"), + isStep9Completed: isStepCompleted("step9"), + isStep10Completed: isStepCompleted("step10") }); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/router.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/router.js b/ambari-web/app/router.js index e104eff..9c466c7 100644 --- a/ambari-web/app/router.js +++ b/ambari-web/app/router.js @@ -43,6 +43,8 @@ App.WizardRoute = Em.Route.extend({ gotoStep10: Em.Router.transitionTo('step10'), + gotoStepConfigureDownload: Em.Router.transitionTo('configureDownload'), + isRoutable: function() { return typeof this.get('route') === 'string' && App.router.get('loggedIn'); }.property('App.router.loggedIn') http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/routes/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/routes/installer.js b/ambari-web/app/routes/installer.js index 08c278f..deb76e1 100644 --- a/ambari-web/app/routes/installer.js +++ b/ambari-web/app/routes/installer.js @@ -243,7 +243,7 @@ module.exports = Em.Route.extend(App.RouterRedirections, { selectedServiceNames: undefined, installedServiceNames: undefined }); - router.transitionTo('step1'); + router.transitionTo('configureDownload'); console.timeEnd('step3 next'); } }, @@ -262,6 +262,64 @@ module.exports = Em.Route.extend(App.RouterRedirections, { } }), + + configureDownload: Em.Route.extend({ + route: '/configureDownload', + connectOutlets: function (router) { + console.time('configureDownload connectOutlets'); + var self = this; + var controller = router.get('installerController'); + var configureDownloadController = router.get('wizardConfigureDownloadController'); + var newStepIndex = controller.getStepIndex('configureDownload'); + router.setNavigationFlow(newStepIndex); + configureDownloadController.set('optionsToSelect', { + 'usePublicRepo': { + index: 0, + isSelected: true + }, + 'useLocalRepo': { + index: 1, + isSelected: false, + 'uploadFile': { + index: 0, + name: 'uploadFile', + file: '', + hasError: false, + isSelected: true + }, + 'enterUrl': { + index: 1, + name: 'enterUrl', + url: '', + placeholder: Em.I18n.t('installer.step1.useLocalRepo.enterUrl.placeholder'), + hasError: false, + isSelected: false + } + } + }); + controller.setCurrentStep('configureDownload'); + controller.loadAllPriorSteps().done(function () { + configureDownloadController.set('wizardController', controller); + controller.connectOutlet('wizardConfigureDownload', controller.get('content')); + self.scrollTop(); + console.timeEnd('configureDownload connectOutlets'); + }); + }, + back: Em.Router.transitionTo('step3'), + next: function (router) { + console.time('configureDownload next'); + if(router.get('btnClickInProgress')) { + return; + } + var configureDownloadController = router.get('configureDownloadController'); + var installerController = router.get('installerController'); + App.set('router.nextBtnClickInProgress', true); + installerController.setDBProperty('service', undefined); + router.transitionTo('step1'); + console.timeEnd('configureDownload next'); + } + }), + step4: App.StepRoute.extend({ route: '/step4', connectOutlets: function (router, context) { @@ -605,6 +663,8 @@ module.exports = Em.Route.extend(App.RouterRedirections, { gotoStep9: Em.Router.transitionTo('step9'), - gotoStep10: Em.Router.transitionTo('step10') + gotoStep10: Em.Router.transitionTo('step10'), + + gotoConfigureDownload: Em.Router.transitionTo('configureDownload') }); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/styles/wizard.less ---------------------------------------------------------------------- diff --git a/ambari-web/app/styles/wizard.less b/ambari-web/app/styles/wizard.less index 5f60378..89ae562 100644 --- a/ambari-web/app/styles/wizard.less +++ b/ambari-web/app/styles/wizard.less @@ -629,6 +629,72 @@ .radio-group { padding-bottom: 10px; color: #666; + .local-radio { + cursor: not-allowed + } + .radio.big-radio { + height: 100px; + background-color: #dddddd; + width: 120px; + margin: 15px; + padding-left: 0; + padding-right: 0; + border-radius: 2px; + p { + display: none; + font-size: 11px; + text-align: center; + padding: 0 5px 10px 5px; + line-height: 1.2em; + } + input[type="radio"] + label, p, .repo-group, { + cursor: default; + } + input[type="radio"] + label:before { + border-color: #999; + background-color: #fff; + } + input[type="radio"]:checked + label:before { + background: #fff; + border-color: #5cb85c; + } + input[type="radio"]:checked + label:after { + background-color: #5cb85c; + } + .repo-checkbox { + padding: 0 10px; + } + .icon { + font-size: 36px; + text-align: center; + position: absolute; + top: 20px; + padding: 0 20px; + width: 100%; + color: #fff; + } + .repo-group { + bottom: 0px; + position: absolute; + background-color: #5cb85c; + color: white; + padding: 5px 10px; + width: 100%; + font-size: 12px; + text-align: center; + } + } + //for now only allow the public repo to show info on hover + //.radio:hover { + .public-radio:hover { + border: 2px solid #00cc99; + p { + display:block; + } + .icon, .repo-group { + opacity: 0.1; + } + } } } table > tbody > tr > td { http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/templates/installer.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/installer.hbs b/ambari-web/app/templates/installer.hbs index 451d6d8..fec466b 100644 --- a/ambari-web/app/templates/installer.hbs +++ b/ambari-web/app/templates/installer.hbs @@ -26,16 +26,17 @@ <div class="wizard-nav col-md-3"> <ul class="nav nav-pills nav-stacked" {{QAAttr "wizard-nav"}}> <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep0:active view.isStep0Disabled:disabled view.isStep0Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep0 target="controller"}}><i class="step-marker"><span class="step-index">0</span></i><p class="step-name">{{t installer.step0.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep2:active view.isStep1Disabled:disabled view.isStep1Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep2 target="controller"}}><i class="step-marker"><span class="step-index">1</span></i><p class="step-name">{{t installer.step2.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep3:active view.isStep2Disabled:disabled view.isStep2Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep3 target="controller"}}><i class="step-marker"><span class="step-index">2</span></i><p class="step-name">{{t installer.step3.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep1:active view.isStep3Disabled:disabled view.isStep3Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep1 target="controller"}}><i class="step-marker"><span class="step-index">3</span></i><p class="step-name">{{t installer.step1.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep4:active view.isStep4Disabled:disabled view.isStep4Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep4 target="controller"}}><i class="step-marker"><span class="step-index">4</span></i><p class="step-name">{{t installer.step4.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep5:active view.isStep5Disabled:disabled view.isStep5Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep5 target="controller"}}><i class="step-marker"><span class="step-index">5</span></i><p class="step-name">{{t installer.step5.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep6:active view.isStep6Disabled:disabled view.isStep6Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep6 target="controller"}}><i class="step-marker"><span class="step-index">6</span></i><p class="step-name">{{t installer.step6.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep7:active view.isStep7Disabled:disabled view.isStep7Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep7 target="controller"}}><i class="step-marker"><span class="step-index">7</span></i><p class="step-name">{{t installer.step7.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep8:active view.isStep8Disabled:disabled view.isStep8Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep8 target="controller"}}><i class="step-marker"><span class="step-index">8</span></i><p class="step-name">{{t installer.step8.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep9:active view.isStep9Disabled:disabled view.isStep9Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep9 target="controller"}}><i class="step-marker"><span class="step-index">9</span></i><p class="step-name">{{t installer.step9.header}}</p></a></li> - <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep10:active view.isStep10Disabled:disabled view.isStep10Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep10 target="controller"}}><i class="step-marker"><span class="step-index">10</span></i><p class="step-name">{{t installer.step10.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep2:active view.isStep2Disabled:disabled view.isStep2Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep2 target="controller"}}><i class="step-marker"><span class="step-index">1</span></i><p class="step-name">{{t installer.step2.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep3:active view.isStep3Disabled:disabled view.isStep3Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep3 target="controller"}}><i class="step-marker"><span class="step-index">2</span></i><p class="step-name">{{t installer.step3.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isConfigureDownload:active view.isConfigureDownloadDisabled:disabled view.isConfigureDownloadCompleted:completed"}}><a href="javascript:void(null);" {{action gotoConfigureDownload target="controller"}}><i class="step-marker"><span class="step-index">3</span></i><p class="step-name">{{t installer.configureDownload.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep1:active view.isStep1Disabled:disabled view.isStep1Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep1 target="controller"}}><i class="step-marker"><span class="step-index">4</span></i><p class="step-name">{{t installer.step1.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep4:active view.isStep4Disabled:disabled view.isStep4Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep4 target="controller"}}><i class="step-marker"><span class="step-index">5</span></i><p class="step-name">{{t installer.step4.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep5:active view.isStep5Disabled:disabled view.isStep5Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep5 target="controller"}}><i class="step-marker"><span class="step-index">6</span></i><p class="step-name">{{t installer.step5.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep6:active view.isStep6Disabled:disabled view.isStep6Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep6 target="controller"}}><i class="step-marker"><span class="step-index">7</span></i><p class="step-name">{{t installer.step6.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep7:active view.isStep7Disabled:disabled view.isStep7Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep7 target="controller"}}><i class="step-marker"><span class="step-index">8</span></i><p class="step-name">{{t installer.step7.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep8:active view.isStep8Disabled:disabled view.isStep8Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep8 target="controller"}}><i class="step-marker"><span class="step-index">9</span></i><p class="step-name">{{t installer.step8.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep9:active view.isStep9Disabled:disabled view.isStep9Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep9 target="controller"}}><i class="step-marker"><span class="step-index">10</span></i><p class="step-name">{{t installer.step9.header}}</p></a></li> + <li {{QAAttr "wizard-nav-step"}} {{bindAttr class="isStep10:active view.isStep10Disabled:disabled view.isStep10Completed:completed"}}><a href="javascript:void(null);" {{action gotoStep10 target="controller"}}><i class="step-marker"><span class="step-index">11</span></i><p class="step-name">{{t installer.step10.header}}</p></a></li> </ul> </div> {{! outlet includes body and footer }} http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/templates/wizard/configureDownload.hbs ---------------------------------------------------------------------- diff --git a/ambari-web/app/templates/wizard/configureDownload.hbs b/ambari-web/app/templates/wizard/configureDownload.hbs new file mode 100644 index 0000000..d178fcf --- /dev/null +++ b/ambari-web/app/templates/wizard/configureDownload.hbs @@ -0,0 +1,77 @@ +{{! +* 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 id="select-stack" class="wizard-content col-md-9" {{QAAttr "select-stack-page"}}> + <h4 class="step-title">{{t installer.configureDownload.header}}</h4> + + <div class="panel panel-default"> + <div class="panel-body"> + {{#if isLoadingComplete}} + {{! left tabs }} + + {{#if App.router.nextBtnClickInProgress}} + {{view App.SpinnerView}} + {{else}} + <form id="repoVersionInfoForm" class="form-horizontal" role="form" name="localVersionInfoForm" novalidate> + + <div class="panel panel-default repos-panel"> + <div class="step-title"> + <p>{{t installer.configureDownload.body.title}}</p> + </div> + <p class="step-description">{{t installer.configureDownload.body.description}}</p> + <div class="panel-body version-contents-body"> + <div class="row radio-group"> + {{! Public Repository radio }} + <div {{bindAttr class=":col-sm-4 :radio :big-radio :public-radio :wizard-plain-text"}} {{action usePublicRepo target="controller"}}> + {{view view.usePublicRepoRadioButton classNames="repo-checkbox" labelIdentifier="use-public-repo"}} + <p>{{t installer.configureDownload.publicRepo.hoverDesc}}</p> + <i class="icon icon-cloud-download"></i> + <div class="repo-group">{{t installer.configureDownload.publicRepo}}</div> + </div> + {{!--Local repo radio--}} + {{!--Not allowing any action on Local Repository for the first iteration. Will use action useLocalRepo later when this option is allowed--}} + <div {{bindAttr class=":col-sm-4 :radio :big-radio :local-radio :wizard-plain-text"}}> + {{view view.useLocalRepoRadioButton classNames="repo-checkbox" labelIdentifier="use-local-repo"}} + <p>{{t installer.configureDownload.localRepo.hoverDesc}}</p> + <i class="icon icon-tasks"></i> + <div class="repo-group">{{t installer.configureDownload.localRepo}}</div> + </div> + </div> + </div> + </div> + </form> + {{/if}} + {{else}} + {{view App.SpinnerView}} + {{/if}} + </div> + </div> +</div> +<div class="wizard-footer col-md-12"> + <button type="button" class="btn btn-default pull-left installer-back-btn" {{bindAttr disabled="App.router.btnClickInProgress"}} {{action back}} {{QAAttr "wizard-back"}}> + ← {{t common.back}} + {{#if App.router.backBtnClickInProgress}} + {{view App.SpinnerView tagName="span" classNames="service-button-spinner"}} + {{/if}} + </button> + <button type="button" class="btn btn-success pull-right" {{bindAttr disabled="view.isSubmitDisabled"}} {{action next}} {{QAAttr "wizard-next"}}> + {{#if App.router.nextBtnClickInProgress}} + {{view App.SpinnerView tagName="span" classNames="service-button-spinner"}} + {{/if}} + {{t common.next}} → + </button> +</div> http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/views.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views.js b/ambari-web/app/views.js index 50729a7..b8fd199 100644 --- a/ambari-web/app/views.js +++ b/ambari-web/app/views.js @@ -367,6 +367,7 @@ require('views/wizard/step3_view'); require('views/wizard/step3/hostLogPopupBody_view'); require('views/wizard/step3/hostWarningPopupBody_view'); require('views/wizard/step3/hostWarningPopupFooter_view'); +require('views/wizard/configureDownload_view'); require('views/wizard/step4_view'); require('views/wizard/step5_view'); require('views/wizard/step6_view'); http://git-wip-us.apache.org/repos/asf/ambari/blob/fe57de61/ambari-web/app/views/wizard/configureDownload_view.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/views/wizard/configureDownload_view.js b/ambari-web/app/views/wizard/configureDownload_view.js new file mode 100644 index 0000000..ce436e5 --- /dev/null +++ b/ambari-web/app/views/wizard/configureDownload_view.js @@ -0,0 +1,51 @@ +/** + * 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'); + +require('models/repository'); + +App.WizardConfigureDownloadView = Em.View.extend({ + + templateName: require('templates/wizard/configureDownload'), + + /** + * Radio button for use Public repo + * + * @type {App.RadioButtonView} + */ + usePublicRepoRadioButton: App.RadioButtonView.extend({ + checked: Em.computed.alias('controller.selectedStack.usePublicRepo'), + change: function () { + this.get('controller').usePublicRepo(); + } + }), + + /** + * Checkbox for use Public repo + * + * @type {App.RadioButtonView} + */ + useLocalRepoRadioButton: App.RadioButtonView.extend({ + checked: Em.computed.alias('controller.selectedStack.useLocalRepo'), + disabled: true, + change: function () { + this.get('controller').useLocalRepo(); + } + }) + +});