AMBARI-22695 - Implement download configuration options and custom (i.e. local) repo support (Jason Golieb via jonathanhurley)
Project: http://git-wip-us.apache.org/repos/asf/ambari/repo Commit: http://git-wip-us.apache.org/repos/asf/ambari/commit/50e28dff Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/50e28dff Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/50e28dff Branch: refs/heads/branch-feature-AMBARI-14714-ui Commit: 50e28dff0c6aeec817d1168c270e1a92ac5a7d54 Parents: c72a3bf Author: Jonathan Hurley <[email protected]> Authored: Tue Jan 2 09:55:29 2018 -0500 Committer: Jonathan Hurley <[email protected]> Committed: Tue Jan 2 09:55:29 2018 -0500 ---------------------------------------------------------------------- ambari-web/app/controllers.js | 8 +- ambari-web/app/controllers/installer.js | 98 +++- ambari-web/app/controllers/wizard.js | 38 ++ .../wizard/configureDownload_controller.js | 5 +- .../wizard/customMpackRepos_controller.js | 48 ++ .../wizard/customProductRepos_controller.js | 283 +++++++++ .../wizard/downloadMpacks_controller.js | 128 ++++ .../wizard/downloadProducts_controller.js | 122 ---- .../wizard/selectMpacks_controller.js | 35 +- .../app/controllers/wizard/step0_controller.js | 5 +- .../app/controllers/wizard/step10_controller.js | 7 +- .../app/controllers/wizard/step1_controller.js | 5 +- .../app/controllers/wizard/step2_controller.js | 5 +- .../app/controllers/wizard/step3_controller.js | 5 +- .../app/controllers/wizard/step4_controller.js | 3 + .../app/controllers/wizard/step5_controller.js | 3 +- .../app/controllers/wizard/step6_controller.js | 5 +- .../app/controllers/wizard/step7_controller.js | 5 +- .../app/controllers/wizard/step8_controller.js | 10 +- .../app/controllers/wizard/step9_controller.js | 5 +- .../wizard/verifyProducts_controller.js | 153 +++++ .../controllers/wizard/wizardStep_controller.js | 42 ++ ambari-web/app/mappers/stack_mapper.js | 5 +- ambari-web/app/messages.js | 579 ++++++++++--------- .../app/mixins/wizard/wizard_menu_view.js | 10 +- ambari-web/app/models/repository.js | 1 + ambari-web/app/router.js | 10 +- ambari-web/app/routes/installer.js | 340 +++++++---- .../app/styles/theme/bootstrap-ambari.css | 28 +- ambari-web/app/styles/wizard.less | 14 + ambari-web/app/templates/installer.hbs | 31 +- .../app/templates/wizard/customMpackRepos.hbs | 78 +++ .../app/templates/wizard/customProductRepos.hbs | 120 ++++ .../app/templates/wizard/downloadMpacks.hbs | 97 ++++ .../app/templates/wizard/downloadProducts.hbs | 97 ---- .../app/templates/wizard/selectMpacks.hbs | 2 +- .../app/templates/wizard/verifyProducts.hbs | 117 ++++ ambari-web/app/views.js | 7 +- .../app/views/wizard/configureDownload_view.js | 11 +- .../app/views/wizard/customMpackRepos_view.js | 35 ++ .../app/views/wizard/customProductRepos_view.js | 73 +++ .../app/views/wizard/downloadMpacks_view.js | 35 ++ .../app/views/wizard/downloadProducts_view.js | 35 -- .../app/views/wizard/verifyProducts_view.js | 33 ++ ambari-web/test/controllers/installer_test.js | 42 +- .../controllers/wizard/selectMpacks_test.js | 8 +- 46 files changed, 2113 insertions(+), 713 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers.js b/ambari-web/app/controllers.js index 5af0937..74f06c0 100644 --- a/ambari-web/app/controllers.js +++ b/ambari-web/app/controllers.js @@ -145,12 +145,17 @@ require('controllers/main/service/info/heatmap'); require('controllers/main/service/info/metric'); require('controllers/main/views_controller'); require('controllers/main/views/details_controller'); +require('controllers/wizard/wizardStep_controller'); 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/downloadProducts_controller'); +require('controllers/wizard/selectMpacks_controller'); +require('controllers/wizard/customMpackRepos_controller'); +require('controllers/wizard/downloadMpacks_controller'); +require('controllers/wizard/customProductRepos_controller'); +require('controllers/wizard/verifyProducts_controller'); require('controllers/wizard/step4_controller'); require('controllers/wizard/step5_controller'); require('controllers/wizard/step6_controller'); @@ -160,7 +165,6 @@ require('controllers/wizard/step7/pre_install_checks_controller'); require('controllers/wizard/step8_controller'); require('controllers/wizard/step9_controller'); require('controllers/wizard/step10_controller'); -require('controllers/wizard/selectMpacks_controller'); require('controllers/global/cluster_controller'); require('controllers/global/update_controller'); require('controllers/global/configuration_controller'); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/installer.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/installer.js b/ambari-web/app/controllers/installer.js index 59571e7..e5d09cb 100644 --- a/ambari-web/app/controllers/installer.js +++ b/ambari-web/app/controllers/installer.js @@ -43,7 +43,10 @@ App.InstallerController = App.WizardController.extend(App.Persist, { "step3", "configureDownload", "selectMpacks", - "downloadProducts", + "customMpackRepos", + "downloadMpacks", + "customProductRepos", + "verifyProducts", //"step1", //"step4", "step5", @@ -54,6 +57,17 @@ App.InstallerController = App.WizardController.extend(App.Persist, { "step10" ], + getStepController: function (stepName) { + if (typeof (stepName) === "number") { + stepName = this.get('steps')[stepName]; + } + + stepName = stepName.charAt(0).toUpperCase() + stepName.slice(1); + const stepController = App.router.get('wizard' + stepName + 'Controller'); + + return stepController; + }, + content: Em.Object.create({ cluster: null, installOptions: null, @@ -934,11 +948,15 @@ App.InstallerController = App.WizardController.extend(App.Persist, { os.get('repositories').forEach(function (repository) { repoVersion.operating_systems[k].repositories.push({ "Repositories": { + "public_url": repository.get('baseUrlInit'), "base_url": repository.get('baseUrl'), "repo_id": repository.get('repoId'), "repo_name": repository.get('repoName'), - "components": repository.get('components'), - "distribution": repository.get('distribution') + "unique": repository.get('unique') + //removed the following properties because they were not present on the server + //and are therefore undefined on the client, so there is no need to pass them back + // "components": repository.get('components'), + // "distribution": repository.get('distribution') } }); }); @@ -1076,6 +1094,14 @@ App.InstallerController = App.WizardController.extend(App.Persist, { } } ], + 'customProductRepos': [ + { + type: 'async', + callback: function () { + return this.finishRegisteringMpacks(this.getStepSavedState('customProductRepos')); + } + }, + ], 'step3': [ { type: 'sync', @@ -1086,12 +1112,6 @@ App.InstallerController = App.WizardController.extend(App.Persist, { ], 'step5': [ { - type: 'async', - callback: function () { - return this.finishRegisteringMpacks(this.getStepSavedState('step5')); - } - }, - { type: 'sync', callback: function () { this.setSkipSlavesStep(App.StackService.find().filterProperty('isSelected'), this.getStepIndex('step7')); @@ -1203,13 +1223,25 @@ App.InstallerController = App.WizardController.extend(App.Persist, { gotoConfigureDownload: function () { this.gotoStep('configureDownload'); }, + + gotoSelectMpacks: function () { + this.gotoStep('selectMpacks'); + }, - gotoDownloadProducts: function () { - this.gotoStep('downloadProducts'); + gotoCustomMpackRepos: function () { + this.gotoStep('customMpackRepos'); }, - gotoSelectMpacks: function () { - this.gotoStep('selectMpacks'); + gotoDownloadMpacks: function () { + this.gotoStep('downloadMpacks'); + }, + + gotoCustomProductRepos: function () { + this.gotoStep('customProductRepos'); + }, + + gotoVerifyProducts: function () { + this.gotoStep('verifyProducts'); }, isStep0: function () { @@ -1260,8 +1292,24 @@ App.InstallerController = App.WizardController.extend(App.Persist, { return this.get('currentStep') == this.getStepIndex('configureDownload'); }.property('currentStep'), - isDownloadProducts: function () { - return this.get('currentStep') == this.getStepIndex('downloadProducts'); + isSelectMpacks: function () { + return this.get('currentStep') == this.getStepIndex('selectMpacks'); + }.property('currentStep'), + + isCustomMpackRepos: function () { + return this.get('currentStep') == this.getStepIndex('customMpackRepos'); + }.property('currentStep'), + + isDownloadMpacks: function () { + return this.get('currentStep') == this.getStepIndex('downloadMpacks'); + }.property('currentStep'), + + isCustomProductRepos: function () { + return this.get('currentStep') == this.getStepIndex('customProductRepos'); + }.property('currentStep'), + + isVerifyProducts: function () { + return this.get('currentStep') == this.getStepIndex('verifyProducts'); }.property('currentStep'), clearConfigActionComponents: function() { @@ -1305,10 +1353,18 @@ App.InstallerController = App.WizardController.extend(App.Persist, { setStepsEnable: function () { const steps = this.get('steps'); for (let i = 0, length = steps.length; i < length; i++) { + let stepDisabled = true; + + const stepController = this.getStepController(steps[i]); + if (stepController) { + stepController.set('wizardController', this); + stepDisabled = stepController.isStepDisabled(); + } + const stepIndex = this.getStepIndex(steps[i]); - this.get('isStepDisabled').findProperty('step', stepIndex).set('value', stepIndex > this.get('currentStep')); + this.get('isStepDisabled').findProperty('step', stepIndex).set('value', stepDisabled); } - }.observes('currentStep'), + }, /** * Compare jdk versions used for ambari and selected stack. @@ -1404,11 +1460,14 @@ App.InstallerController = App.WizardController.extend(App.Persist, { }, /** - * This runs when Step5 loads and completes the mpack registration process that was begun in the Download Mpacks step. + * This runs when the step after Download Mpacks loads and completes the mpack registration process that was begun in the Download Mpacks step. * It populates the StackService model from the stack version definitions. * Then, it persists info about the selected services and the selected stack. * - * @return {object} a promise + * @param {Boolean} keepStackServices If true, previously loaded stack services are retained. + * This is to support back/forward navigation in the wizard + * and should correspond to the saved state of the step after Download Mpacks. + * @return {object} a promise */ finishRegisteringMpacks: function (keepStackServices) { return this.getMpackStackVersions().then(data => { @@ -1440,6 +1499,7 @@ App.InstallerController = App.WizardController.extend(App.Persist, { this.set('content.clients', clients); this.save('clients'); + //TODO: mpacks // - for now, pull the stack from the single mpack that we can install // - when we can support multiple mpacks, make this an array of selectedStacks (or just use the selectedServices array?) and add the repo data to it const selectedService = selectedServices[0]; http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard.js b/ambari-web/app/controllers/wizard.js index c5a07ff..7ef227c 100644 --- a/ambari-web/app/controllers/wizard.js +++ b/ambari-web/app/controllers/wizard.js @@ -228,6 +228,44 @@ App.WizardController = Em.Controller.extend(App.LocalStorage, App.ThemesMappingM this.set('currentStep', index); }, + getPreviousStepName: function () { + const index = this.get('currentStep'); + + if (index > 0) { + const steps = this.get('steps'); + + if (steps) { + return steps[index - 1]; + } else { + //legacy support + return 'step' + (index - 1); + } + } else { + return null; + } + }, + + getNextStepName: function () { + const index = this.get('currentStep'); + + const steps = this.get('steps'); + if (steps) { + if (index < steps.length - 1) { + return steps[index + 1]; + } else { + return null + } + } + + //legacy support + const totalSteps = this.get('totalSteps'); + if (index < totalSteps - 1) { + return 'step' + (index + 1); + } else { + return null; + } + }, + clusters: null, isStep0: function () { http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/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 index 08af960..603b2e5 100644 --- a/ambari-web/app/controllers/wizard/configureDownload_controller.js +++ b/ambari-web/app/controllers/wizard/configureDownload_controller.js @@ -17,11 +17,14 @@ */ var App = require('app'); +require('./wizardStep_controller'); -App.WizardConfigureDownloadController = Em.Controller.extend({ +App.WizardConfigureDownloadController = App.WizardStepController.extend({ name: 'wizardConfigureDownloadController', + stepName: 'configureDownload', + loadStep: function () { let downloadConfig = this.get('content.downloadConfig'); if (!downloadConfig) { http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/customMpackRepos_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/customMpackRepos_controller.js b/ambari-web/app/controllers/wizard/customMpackRepos_controller.js new file mode 100644 index 0000000..ec0461b --- /dev/null +++ b/ambari-web/app/controllers/wizard/customMpackRepos_controller.js @@ -0,0 +1,48 @@ +/** + * 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('./wizardStep_controller'); + +App.WizardCustomMpackReposController = App.WizardStepController.extend({ + + name: 'wizardCustomMpackReposController', + + stepName: 'customMpackRepos', + + mpacks: Em.computed.alias('content.selectedMpacks'), + + isStepDisabled: function (stepIndex, currentIndex) { + const normallyDisabled = this._super(stepIndex, currentIndex); + const useCustomRepo = this.get('wizardController.content.downloadConfig.useCustomRepo'); + + return normallyDisabled || !useCustomRepo; + }, + + isSubmitDisabled: function () { + const mpacks = this.get('mpacks'); + return mpacks.filterProperty('downloadUrl', '').length > 0 || App.get('router.btnClickInProgress'); + }.property('[email protected]', 'App.router.btnClickInProgress'), + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + + App.router.send('next'); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/customProductRepos_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/customProductRepos_controller.js b/ambari-web/app/controllers/wizard/customProductRepos_controller.js new file mode 100644 index 0000000..506747b --- /dev/null +++ b/ambari-web/app/controllers/wizard/customProductRepos_controller.js @@ -0,0 +1,283 @@ +/** + * 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('./wizardStep_controller'); + +App.WizardCustomProductReposController = App.WizardStepController.extend({ + + name: 'wizardCustomProductReposController', + + stepName: 'customProductRepos', + + stacks: [], + + mpacks: [], + + repos: [], + + operatingSystems: [], + + isOsSelected: function (type) { + const operatingSystems = this.get('operatingSystems'); + + if (operatingSystems && operatingSystems.length > 0) { + const os = operatingSystems.findProperty('type', type); + + if (os && os.get('selected')) { + return true; + } + } + + return false; + }, + + /** + * Pulls os and repo info from App.Stack and matches it up with selected mpacks. + * Adds the built up object to the mpacks array. + * Populates repos array. + * Populates operatingSystems array. + */ + loadStep: function () { + const selectedMpacks = this.get('content.selectedMpacks'); + const stacks = []; + + App.Stack.find().forEach(stack => { + const mpack = selectedMpacks.find(mpack => mpack.name === stack.get('stackName') && mpack.version === stack.get('stackVersion')); + + if (mpack) { + stacks.push(Em.Object.create({ + id: stack.get('id'), + name: mpack.name, + version: mpack.version, + operatingSystems: stack.get('operatingSystems').get('content').map((item, index) => { + const os = stack.get('operatingSystems').objectAtContent(index); + let selectedOs; + if (mpack.operatingSystems) { + selectedOs = mpack.operatingSystems.find(mpackOs => mpackOs.type === os.get('osType')); + } + + return Em.Object.create({ + type: os.get('osType'), + selected: selectedOs ? true : false, + isFirstSelected: false, + isLastSelected: false, + repos: os.get('repositories').get('content').map((item, index, repos) => { + const repo = os.get('repositories').objectAtContent(index); + let downloadUrl; + + if (selectedOs) { + const selectedRepo = selectedOs.repos.find(mpackRepo => mpackRepo.id === repo.get('repoId')); + if (selectedRepo) { + downloadUrl = selectedRepo.downloadUrl; + } + } + + return Em.Object.create({ + id: `${mpack.name}-${mpack.version}-${os.get('osType')}-${repo.get('repoId')}`, //this is a unique ID used in client logic + repoId: repo.get('repoId'), //this is the repo ID used by the server and displayed in the UI + name: repo.get('repoName'), + publicUrl: repo.get('baseUrlInit'), + downloadUrl: downloadUrl || repo.get('baseUrl'), + unique: repo.get('unique'), //this is a value that is only used by the server, but we need to preserve it + isFirst: index === 0, + isLast: index === repos.length - 1 + }); + }) + }); + }) + })); + } + }); + this.set('stacks', stacks); + + const mpacks = []; + selectedMpacks.forEach(mpack => { + const stack = stacks.find(stack => stack.get('name') === mpack.name && stack.get('version') === mpack.version); + mpacks.pushObject(Em.Object.create({ + id: stack.get('id'), //this is actually the stack id from App.Stack, which is actually the repository_version id in the database, which is an integer + name: mpack.name, + displayName: mpack.displayName, + publicUrl: mpack.publicUrl, + downloadUrl: mpack.downloadUrl, + version: mpack.version, + operatingSystems: stack ? stack.operatingSystems : [] + })); + }); + this.set('mpacks', mpacks); + + const repos = this.get('mpacks').reduce( + (repos, mpack) => repos.concat( + mpack.get('operatingSystems').reduce( + (repos, os) => repos.concat( + os.get('repos') + ), + []) + ), + [] + ); + this.set('repos', repos); + + const uniqueOperatingSystems = {}; + mpacks.forEach(mpack => { + mpack.get('operatingSystems').forEach(os => { + const osType = os.get('type'); + uniqueOperatingSystems[osType] + ? uniqueOperatingSystems[osType].mpacks.pushObject(mpack) + : uniqueOperatingSystems[osType] = { + selected: os.get('selected'), + mpacks: [mpack] + }; + }) + }); + + const operatingSystems = []; + for (let osType in uniqueOperatingSystems) { + operatingSystems.pushObject(Em.Object.create({ + type: osType, + selected: uniqueOperatingSystems[osType].selected, + mpacks: uniqueOperatingSystems[osType].mpacks + })) + } + operatingSystems.sort((a, b) => a.get('type').localeCompare(b.get('type'))); + this.set('operatingSystems', operatingSystems); + }, + + /** + * Returns the repo matching the given id. + * + * @param {string} repoId consisting of mpackName-mpackVersion-osType-repoId + */ + findRepoById: function (repoId) { + const mpacks = this.get('mpacks'); + + for (let mpack of mpacks) { + for (let os of mpack.operatingSystems) { + for (let repo of os.get('repos')) { + if (repo.get('id') === repoId) { + return repo; + } + } + } + } + }, + + toggleOs: function (osType) { + const os = this.get('operatingSystems').findProperty('type', osType); + + if (os) { + const mpacks = os.get('mpacks'); + const selected = os.get('selected'); + mpacks.forEach(mpack => { + const os = mpack.operatingSystems.findProperty('type', osType); + if (os) { + os.set('selected', selected); + } + }); + } + }, + + isStepDisabled: function (stepIndex, currentIndex) { + const normallyDisabled = this._super(stepIndex, currentIndex); + const useCustomRepo = this.get('wizardController.content.downloadConfig.useCustomRepo'); + + return normallyDisabled || !useCustomRepo; + }, + + anySelectedOs: function () { + const selectedOperatingSystems = this.get('operatingSystems').filterProperty('selected'); + return selectedOperatingSystems.length > 0; + }.property('[email protected]'), + + isSubmitDisabled: function () { + if (this.get('anySelectedOs')) { + const repos = this.get('repos'); + return repos.filterProperty('downloadUrl', '').length > 0 || App.get('router.btnClickInProgress'); + } + + return true; + }.property('anySelectedOs', '[email protected]', 'App.router.btnClickInProgress'), + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + + const mpacks = this.get('mpacks'); + + const selectedMpacks = mpacks.map(selectedMpack => + ({ + name: selectedMpack.name, + displayName: selectedMpack.displayName, + publicUrl: selectedMpack.publicUrl, + downloadUrl: selectedMpack.downloadUrl, + version: selectedMpack.version, + operatingSystems: selectedMpack.get('operatingSystems').filterProperty('selected').map(os => + ({ + type: os.get('type'), + selected: os.get('selected'), + isFirstSelected: os.get('isFirstSelected'), + isLastSelected: os.get('isLastSelected'), + repos: os.get('repos').map(repo => + ({ + id: repo.get('id'), + repoId: repo.get('repoId'), + downloadUrl: repo.get('downloadUrl'), + isFirst: repo.get('isFirst'), + isLast: repo.get('isLast') + }) + ) + }) + ) + }) + ); + this.set('content.selectedMpacks', selectedMpacks); + + const useRedHatSatellite = this.get('content.downloadConfig.useRedHatSatellite') + const updateRepoPromises = mpacks.map(mpack => { + const repoToUpdate = { + id: mpack.id, //this is actually the stack id from App.Stack, which is actually the repository_version id in the database, which is an integer + stackName: mpack.name, + stackVersion: mpack.version + } + + const repo = Em.Object.create({ + useRedhatSatellite: useRedHatSatellite, + operatingSystems: mpack.get('operatingSystems').map(os => + Em.Object.create({ + osType: os.type, + repositories: os.get('repos').map(repo => + Em.Object.create({ + baseUrlInit: repo.get('publicUrl'), + baseUrl: repo.get('downloadUrl'), + repoId: repo.get('repoId'), + repoName: repo.get('name'), + unique: repo.get('unique') //this is a value that is only used by the server, but we need to preserve it + }) + ) + }) + ) + }); + + this.get('wizardController').updateRepoOSInfo(repoToUpdate, repo) + }); + + $.when(...updateRepoPromises).then(() => { + App.router.send('next'); + }); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/downloadMpacks_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/downloadMpacks_controller.js b/ambari-web/app/controllers/wizard/downloadMpacks_controller.js new file mode 100644 index 0000000..5755060 --- /dev/null +++ b/ambari-web/app/controllers/wizard/downloadMpacks_controller.js @@ -0,0 +1,128 @@ +/** + * 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('./wizardStep_controller'); + +App.WizardDownloadMpacksController = App.WizardStepController.extend({ + + name: 'wizardDownloadMpacksController', + + stepName: 'downloadMpacks', + + mpacks: [], + + addMpacks: function () { + const selectedMpacks = this.get('content.selectedMpacks'); + + selectedMpacks.forEach(mpack => { + this.get('mpacks').pushObject(Em.Object.create({ + name: mpack.name, + displayName: mpack.displayName, + url: mpack.downloadUrl, + inProgress: true, + failed: false, + succeeded: false + })); + }, this); + }, + + registerMpacks: function () { + var mpacks = this.get('mpacks'); + var self = this; + mpacks.forEach(function (mpack) { + self.downloadMpack(mpack); + }); + }, + + downloadMpack: function (mpack) { + console.log("downloading mpacks"); + App.ajax.send({ + name: 'mpack.download_by_url', + sender: this, + data: { + name: mpack.name, + url: mpack.url + }, + success: 'downloadMpackSuccess', + error: 'downloadMpackError', + }); + }, + + downloadMpackSuccess: function (data, opt, params) { + console.dir("Mpack " + params.name + " download completed with success code " + data.status); + this.get('mpacks').findProperty('name', params.name).set('succeeded', true); + this.get('mpacks').findProperty('name', params.name).set('failed', false); + this.get('mpacks').findProperty('name', params.name).set('inProgress', false); + }, + + downloadMpackError: function (request, ajaxOptions, error, opt, params) { + if(request.status == 409) { + this.downloadMpackSuccess(request, opt, params); + } else { + console.dir("Mpack " + params.name + " download failed with error code " + request.status); + this.get('mpacks').findProperty('name', params.name).set('succeeded', false); + this.get('mpacks').findProperty('name', params.name).set('failed', true); + this.get('mpacks').findProperty('name', params.name).set('inProgress', false); + } + }, + + retryDownload: function (event) { + var mpack = event.context; + mpack.set('inProgress', true); + mpack.set('succeeded', false); + mpack.set('failed', false); + this.downloadMpack(mpack); + }, + + getRegisteredMpacks: function () { + return App.ajax.send({ + name: 'mpack.get_registered_mpacks', + sender: this + }); + }, + + isSubmitDisabled: function () { + const mpacks = this.get('mpacks'); + return mpacks.filterProperty('success', false).length > 0 || App.get('router.btnClickInProgress'); + }.property('[email protected]', 'App.router.btnClickInProgress'), + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + + if (!this.get('isSubmitDisabled')) { + //get info about stacks from version definitions and save to Stack model + this.getRegisteredMpacks().then(mpacks => { + const stackVersionsRegistered = mpacks.items.map(mpack => this.get('wizardController').createMpackStackVersion + ( + mpack.version[0].Versions.stack_name, + mpack.version[0].Versions.stack_version + ) + ); + + //TODO: mpacks + //var versionData = installerController.getSelectedRepoVersionData(); //This would be used to post a VDF xml for a local repo (I think), but do we still need to do this when we will just be using mpacks? + $.when(...stackVersionsRegistered).always(() => { //this uses always() because the api call made by createMpackStackVersion will return a 500 error + //if the stack version has already been registered, but we want to proceed anyway + App.router.send('next'); + }); + }); + } + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/downloadProducts_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/downloadProducts_controller.js b/ambari-web/app/controllers/wizard/downloadProducts_controller.js deleted file mode 100644 index d12ae11..0000000 --- a/ambari-web/app/controllers/wizard/downloadProducts_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. - */ - -var App = require('app'); - -App.WizardDownloadProductsController = Em.Controller.extend({ - - name: 'wizardDownloadProductsController', - - mpacks: [], - - addMpacks: function () { - const selectedMpacks = this.get('content.selectedMpacks'); - - selectedMpacks.forEach(mpack => { - this.get('mpacks').pushObject(Em.Object.create({ - name: mpack.name, - displayName: mpack.displayName, - url: mpack.url, - inProgress: true, - failed: false, - success: false - })); - }, this); - }, - - registerMpacks: function () { - var mpacks = this.get('mpacks'); - var self = this; - mpacks.forEach(function (mpack) { - self.downloadMpack(mpack); - }); - }, - - downloadMpack: function (mpack) { - console.log("downloading mpacks"); - App.ajax.send({ - name: 'mpack.download_by_url', - sender: this, - data: { - name: mpack.name, - url: mpack.url - }, - success: 'downloadMpackSuccess', - error: 'downloadMpackError', - }); - }, - - downloadMpackSuccess: function (data, opt, params) { - console.dir("Mpack " + params.name + " download completed with success code " + data.status); - this.get('mpacks').findProperty('name', params.name).set('inProgress', false); - this.get('mpacks').findProperty('name', params.name).set('success', true); - }, - - downloadMpackError: function (request, ajaxOptions, error, opt, params) { - if(request.status == 409) { - this.downloadMpackSuccess(request, opt, params); - } else { - console.dir("Mpack " + params.name + " download failed with error code " + request.status); - this.get('mpacks').findProperty('name', params.name).set('inProgress', false); - this.get('mpacks').findProperty('name', params.name).set('failed', true); - } - }, - - retryDownload: function (event) { - var mpack = event.context; - mpack.set('inProgress', true); - mpack.set('failed', false); - this.downloadMpack(mpack); - }, - - getRegisteredMpacks: function () { - return App.ajax.send({ - name: 'mpack.get_registered_mpacks', - sender: this - }); - }, - - isSubmitDisabled: function () { - const mpacks = this.get('mpacks'); - return mpacks.filterProperty('success', false).length > 0 || App.get('router.btnClickInProgress'); - }.property('[email protected]', 'App.router.btnClickInProgress'), - - submit: function () { - if (App.get('router.nextBtnClickInProgress')) { - return; - } - - if (!this.get('isSubmitDisabled')) { - //get info about stacks from version definitions and save to Stack model - this.getRegisteredMpacks().then(mpacks => { - const stackVersionsRegistered = mpacks.items.map(mpack => this.get('wizardController').createMpackStackVersion - ( - mpack.version[0].Versions.stack_name, - mpack.version[0].Versions.stack_version - ) - ); - - //TODO: mpacks - //var versionData = installerController.getSelectedRepoVersionData(); //This would be used to post a VDF xml for a local repo (I think), but do we still need to do this when we will just be using mpacks? - $.when(...stackVersionsRegistered).always(() => { //this uses always() because the api call made by createMpackStackVersion will return a 500 error - //if the stack version has already been registered, but we want to proceed anyway - App.router.send('next'); - }); - }); - } - } -}); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/selectMpacks_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/selectMpacks_controller.js b/ambari-web/app/controllers/wizard/selectMpacks_controller.js index 7951d15..2029e0e 100644 --- a/ambari-web/app/controllers/wizard/selectMpacks_controller.js +++ b/ambari-web/app/controllers/wizard/selectMpacks_controller.js @@ -17,11 +17,14 @@ */ var App = require('app'); +require('./wizardStep_controller'); -App.WizardSelectMpacksController = Em.Controller.extend({ +App.WizardSelectMpacksController = App.WizardStepController.extend({ name: 'wizardSelectMpacksController', + stepName: 'selectMpacks', + noRecommendationAvailable: false, loadRegistry: function () { @@ -75,7 +78,8 @@ App.WizardSelectMpacksController = Em.Controller.extend({ return version; }) ), - []); + [] + ); const mpackServiceVersions = mpackVersions.reduce( (services, mpackVersion) => services.concat( @@ -84,7 +88,8 @@ App.WizardSelectMpacksController = Em.Controller.extend({ return service; }) ), - []); + [] + ); const uniqueServices = {}; mpackServiceVersions.forEach(service => { @@ -510,14 +515,28 @@ App.WizardSelectMpacksController = Em.Controller.extend({ const selectedServiceNames = selectedServices.map(service => service.name); this.set('content.selectedServiceNames', selectedServiceNames); - const selectedMpacks = this.get('selectedMpackVersions').map(mpackVersion => - ({ + const selectedMpacks = this.get('selectedMpackVersions').map(mpackVersion => { + const selectedMpack = { + id: `${mpackVersion.mpack.name}-${mpackVersion.version}`, name: mpackVersion.mpack.name, displayName: mpackVersion.mpack.displayName, - url: mpackVersion.mpackUrl, + publicUrl: mpackVersion.mpackUrl, + downloadUrl: mpackVersion.mpackUrl, version: mpackVersion.version - }) - ); + }; + + const oldSelectedMpacks = this.get('content.selectedMpacks'); + let oldSelectedMpack; + if (oldSelectedMpacks) { + oldSelectedMpack = oldSelectedMpacks.find(mpack => mpack.name === mpackVersion.mpack.name && mpack.version === mpackVersion.version); + } + if (oldSelectedMpack) { + selectedMpack.downloadUrl = oldSelectedMpack.downloadUrl; + selectedMpack.operatingSystems = oldSelectedMpack.operatingSystems; + } + + return selectedMpack; + }); this.set('content.selectedMpacks', selectedMpacks); App.router.send('next'); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step0_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step0_controller.js b/ambari-web/app/controllers/wizard/step0_controller.js index 270c7a4..618b2b6 100644 --- a/ambari-web/app/controllers/wizard/step0_controller.js +++ b/ambari-web/app/controllers/wizard/step0_controller.js @@ -17,11 +17,14 @@ */ var App = require('app'); +require('./wizardStep_controller'); -App.WizardStep0Controller = Em.Controller.extend({ +App.WizardStep0Controller = App.WizardStepController.extend({ name: 'wizardStep0Controller', + stepName: 'step0', + /** * Is step submitted * @type {bool} http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step10_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step10_controller.js b/ambari-web/app/controllers/wizard/step10_controller.js index 6840c13..ba8d257 100644 --- a/ambari-web/app/controllers/wizard/step10_controller.js +++ b/ambari-web/app/controllers/wizard/step10_controller.js @@ -17,8 +17,13 @@ */ var App = require('app'); +require('./wizardStep_controller'); -App.WizardStep10Controller = Em.Controller.extend({ +App.WizardStep10Controller = App.WizardStepController.extend({ + + name: 'wizardStep10Controller', + + stepName: 'step10', /** * List of data about installed cluster components (hosts, services etc) http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step1_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step1_controller.js b/ambari-web/app/controllers/wizard/step1_controller.js index c137d96..7e01f3f 100644 --- a/ambari-web/app/controllers/wizard/step1_controller.js +++ b/ambari-web/app/controllers/wizard/step1_controller.js @@ -18,6 +18,7 @@ var App = require('app'); var arrayUtils = require('utils/array_utils'); +require('./wizardStep_controller'); /** * @typedef {Em.Object} StackType @@ -35,10 +36,12 @@ var StackType = Em.Object.extend({ isSelected: Em.computed.someBy('stacks', 'isSelected', true) }); -App.WizardStep1Controller = Em.Controller.extend({ +App.WizardStep1Controller = App.WizardStepController.extend({ name: 'wizardStep1Controller', + stepName: 'step1', + /** * Skip repo-validation * http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step2_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step2_controller.js b/ambari-web/app/controllers/wizard/step2_controller.js index dffc17e..c6da054 100644 --- a/ambari-web/app/controllers/wizard/step2_controller.js +++ b/ambari-web/app/controllers/wizard/step2_controller.js @@ -19,11 +19,14 @@ var App = require('app'); var validator = require('utils/validator'); var lazyloading = require('utils/lazy_loading'); +require('./wizardStep_controller'); -App.WizardStep2Controller = Em.Controller.extend({ +App.WizardStep2Controller = App.WizardStepController.extend({ name: 'wizardStep2Controller', + stepName: 'step2', + /** * List of not installed hostnames * @type {string[]} http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step3_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step3_controller.js b/ambari-web/app/controllers/wizard/step3_controller.js index 36bf05a..9a11e29 100644 --- a/ambari-web/app/controllers/wizard/step3_controller.js +++ b/ambari-web/app/controllers/wizard/step3_controller.js @@ -19,11 +19,14 @@ var App = require('app'); var lazyloading = require('utils/lazy_loading'); var numberUtils = require('utils/number_utils'); +require('./wizardStep_controller'); -App.WizardStep3Controller = Em.Controller.extend(App.ReloadPopupMixin, App.CheckHostMixin, { +App.WizardStep3Controller = App.WizardStepController.extend(App.ReloadPopupMixin, App.CheckHostMixin, { name: 'wizardStep3Controller', + stepName: 'step3', + hosts: [], content: [], http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step4_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step4_controller.js b/ambari-web/app/controllers/wizard/step4_controller.js index d82bf34..407cf51 100644 --- a/ambari-web/app/controllers/wizard/step4_controller.js +++ b/ambari-web/app/controllers/wizard/step4_controller.js @@ -17,11 +17,14 @@ */ var App = require('app'); +require('./wizardStep_controller'); App.WizardStep4Controller = Em.ArrayController.extend({ name: 'wizardStep4Controller', + stepName: 'step4', + /** * List of Services * @type {Object[]} http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step5_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step5_controller.js b/ambari-web/app/controllers/wizard/step5_controller.js index 3ca4165..089251e 100644 --- a/ambari-web/app/controllers/wizard/step5_controller.js +++ b/ambari-web/app/controllers/wizard/step5_controller.js @@ -17,8 +17,9 @@ */ var App = require('app'); +require('./wizardStep_controller'); -App.WizardStep5Controller = Em.Controller.extend(App.BlueprintMixin, App.AssignMasterComponents, { +App.WizardStep5Controller = App.WizardStepController.extend(App.BlueprintMixin, App.AssignMasterComponents, { name: "wizardStep5Controller", http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step6_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step6_controller.js b/ambari-web/app/controllers/wizard/step6_controller.js index b1941f0..4823347 100644 --- a/ambari-web/app/controllers/wizard/step6_controller.js +++ b/ambari-web/app/controllers/wizard/step6_controller.js @@ -19,6 +19,7 @@ var App = require('app'); var blueprintUtils = require('utils/blueprint'); var validationUtils = require('utils/validator'); +require('./wizardStep_controller'); /** * By Step 6, we have the following information stored in App.db and set on this @@ -32,10 +33,12 @@ var validationUtils = require('utils/validator'); * slaveComponentHosts: App.db.slaveComponentHosts (slave-components-to-hosts mapping the user selected in Step 6) * */ -App.WizardStep6Controller = Em.Controller.extend(App.HostComponentValidationMixin, App.HostComponentRecommendationMixin, { +App.WizardStep6Controller = App.WizardStepController.extend(App.HostComponentValidationMixin, App.HostComponentRecommendationMixin, { name: 'wizardStep6Controller', + stepName: 'step6', + /** * List of hosts * @type {object[]} http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step7_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step7_controller.js b/ambari-web/app/controllers/wizard/step7_controller.js index 4b1eacb..be05a6c 100644 --- a/ambari-web/app/controllers/wizard/step7_controller.js +++ b/ambari-web/app/controllers/wizard/step7_controller.js @@ -17,6 +17,7 @@ */ var App = require('app'); +require('./wizardStep_controller'); /** * By Step 7, we have the following information stored in App.db and set on this @@ -42,10 +43,12 @@ var App = require('app'); * @property {?object[]} slaveComponentHosts */ -App.WizardStep7Controller = Em.Controller.extend(App.ServerValidatorMixin, App.EnhancedConfigsMixin, App.ToggleIsRequiredMixin, App.GroupsMappingMixin, App.AddSecurityConfigs, App.KDCCredentialsControllerMixin, { +App.WizardStep7Controller = App.WizardStepController.extend(App.ServerValidatorMixin, App.EnhancedConfigsMixin, App.ToggleIsRequiredMixin, App.GroupsMappingMixin, App.AddSecurityConfigs, App.KDCCredentialsControllerMixin, { name: 'wizardStep7Controller', + stepName: 'step7', + /** * Contains all field properties that are viewed in this step * @type {object[]} http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step8_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step8_controller.js b/ambari-web/app/controllers/wizard/step8_controller.js index 3ad65f1..45a47e4 100644 --- a/ambari-web/app/controllers/wizard/step8_controller.js +++ b/ambari-web/app/controllers/wizard/step8_controller.js @@ -19,11 +19,14 @@ var App = require('app'); var stringUtils = require('utils/string_utils'); var fileUtils = require('utils/file_utils'); +require('./wizardStep_controller'); -App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wizardDeployProgressControllerMixin, App.ConfigOverridable, App.ConfigsSaverMixin, { +App.WizardStep8Controller = App.WizardStepController.extend(App.AddSecurityConfigs, App.wizardDeployProgressControllerMixin, App.ConfigOverridable, App.ConfigsSaverMixin, { name: 'wizardStep8Controller', + stepName: 'step8', + /** * @type {boolean} */ @@ -923,9 +926,10 @@ App.WizardStep8Controller = Em.Controller.extend(App.AddSecurityConfigs, App.wiz this._startDeploy(); } else { const selectedStack = this.getSelectedStack(); - this.get('wizardController').updateRepoOSInfo({ id: selectedStack.get('id'), stackName: selectedStack.get('stackName'), stackVersion: selectedStack.get('stackVersion') }, selectedStack).done(function() { + //skip this because we already updated the repo URLs if they were customized in the customProductRepos step's submit action + //this.get('wizardController').updateRepoOSInfo({ id: selectedStack.get('id'), stackName: selectedStack.get('stackName'), stackVersion: selectedStack.get('stackVersion') }, selectedStack).done(function() { self._startDeploy(); - }); + //}); } }, http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/step9_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/step9_controller.js b/ambari-web/app/controllers/wizard/step9_controller.js index 9f27f65..07152a1 100644 --- a/ambari-web/app/controllers/wizard/step9_controller.js +++ b/ambari-web/app/controllers/wizard/step9_controller.js @@ -17,11 +17,14 @@ */ var App = require('app'); var stringUtils = require('utils/string_utils'); +require('./wizardStep_controller'); -App.WizardStep9Controller = Em.Controller.extend(App.ReloadPopupMixin, { +App.WizardStep9Controller = App.WizardStepController.extend(App.ReloadPopupMixin, { name: 'wizardStep9Controller', + stepName: 'step9', + /** * Array of host Objects that are successfully registered on "Confirm Host Options" page * <code> http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/verifyProducts_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/verifyProducts_controller.js b/ambari-web/app/controllers/wizard/verifyProducts_controller.js new file mode 100644 index 0000000..5fd991f --- /dev/null +++ b/ambari-web/app/controllers/wizard/verifyProducts_controller.js @@ -0,0 +1,153 @@ +/** + * 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('./wizardStep_controller'); + +App.WizardVerifyProductsController = App.WizardStepController.extend({ + + VERIFYREPO_INPROGRESS: 0, + VERIFYREPO_SUCCEEDED: 1, + VERIFYREPO_FAILED: 2, + + name: 'wizardVerifyProductsController', + + stepName: 'verifyProducts', + + mpacks: [], + + repos: [], + + loadStep: function () { + const selectedMpacks = this.get('content.selectedMpacks'); + + const mpacks = []; + selectedMpacks.forEach(mpack => { + mpacks.pushObject(Em.Object.create({ + name: mpack.name, + displayName: mpack.displayName, + publicUrl: mpack.publicUrl, + downloadUrl: mpack.downloadUrl, + version: mpack.version, + operatingSystems: mpack.operatingSystems.map(os => + Em.Object.create({ + type: os.type, + selected: os.selected, + isFirstSelected: os.isFirstSelected, + isLastSelected: os.isLastSelected, + repos: os.repos.map(repo => + Em.Object.create({ + id: repo.id, //this one is globally unique + repoId: repo.repoId, //this is the one displayed in the UI + downloadUrl: repo.downloadUrl, + isFirst: repo.isFirst, + isLast: repo.isLast, + inProgress: true, + succeeded: false, + failed: false + }) + ) + }) + ) + })); + }); + this.set('mpacks', mpacks); + + const repos = this.get('mpacks').reduce( + (repos, mpack) => repos.concat( + mpack.get('operatingSystems').reduce( + (repos, os) => repos.concat( + os.get('repos') + ), + [] + ) + ), + [] + ); + this.set('repos', repos); + + repos.forEach(repo => this.verifyRepo(repo).then(this.verifyRepoSucceeded.bind(this), this.verifyRepoFailed.bind(this))); + }, + + /** + * Ensures that repo state flags remain in sync. + * + * @param {any} repo to change state of + * @param {any} state to change to + */ + setRepoState: function (repo, state) { + switch (state) { + case this.get('VERIFYREPO_INPROGRESS:'): + repo.set('succeeded', false); + repo.set('failed', false); + repo.set('inProgress', true); + break; + case this.get('VERIFYREPO_SUCCEEDED'): + repo.set('succeeded', true); + repo.set('failed', false); + repo.set('inProgress', false); + break; + case this.get('VERIFYREPO_FAILED'): + repo.set('succeeded', false); + repo.set('failed', true); + repo.set('inProgress', false); + break; + } + }, + + /** + * This will be a no-op until the server actually has some way of verifying repos. + * + * @param {any} repo + */ + verifyRepo: function (repo) { + const dfd = $.Deferred(); + + const self = this; + setTimeout(function () { + self.setRepoState(repo, self.get('VERIFYREPO_INPROGRESS')); + dfd.resolve(repo); + }); + + return dfd.promise(); + }, + + verifyRepoSucceeded: function (repo) { + this.setRepoState(repo, this.get('VERIFYREPO_SUCCEEDED')); + }, + + verifyRepoFailed: function (repo) { + this.setRepoState(repo, this.get('VERIFYREPO_FAILED')); + }, + + retryVerifyRepo: function (repo) { + this.verifyRepo(repo).then(this.verifyRepoSucceeded.bind(this), this.verifyRepoFailed.bind(this)); + }, + + isSubmitDisabled: function () { + const repos = this.get('repos'); + return repos.filterProperty('succeeded', false).length > 0 || App.get('router.btnClickInProgress'); + }.property('[email protected]', 'App.router.btnClickInProgress'), + + submit: function () { + if (App.get('router.nextBtnClickInProgress')) { + return; + } + + App.router.send('next'); + } +}); http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/controllers/wizard/wizardStep_controller.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/controllers/wizard/wizardStep_controller.js b/ambari-web/app/controllers/wizard/wizardStep_controller.js new file mode 100644 index 0000000..a8c2803 --- /dev/null +++ b/ambari-web/app/controllers/wizard/wizardStep_controller.js @@ -0,0 +1,42 @@ +/** + * 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'); + +/* + A base class for wizard step controllers. +*/ +App.WizardStepController = Em.Controller.extend({ + /** + * Determines whether the step should be disabled. + * This is a base implementation that should be extended + * in derived classes to provide special case logic. + * The base implementation returns true if the step being checked + * is after the current step. + * + * @returns true if the step should be disabled + */ + isStepDisabled: function () { + const wizardController = this.get('wizardController'); + const currentIndex = wizardController.get('currentStep'); + const stepName = this.get('stepName'); + const stepIndex = wizardController.getStepIndex(stepName); + + return stepIndex > currentIndex; + } +}); \ No newline at end of file http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/mappers/stack_mapper.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/mappers/stack_mapper.js b/ambari-web/app/mappers/stack_mapper.js index 415845e..2febe0e 100644 --- a/ambari-web/app/mappers/stack_mapper.js +++ b/ambari-web/app/mappers/stack_mapper.js @@ -76,7 +76,7 @@ App.stackMapper = App.QuickDataMapper.create({ configRepository: { id: 'id', base_url: 'base_url', - base_url_init: 'base_url', + base_url_init: 'public_url', default_base_url: 'default_base_url', latest_base_url: 'latest_base_url', mirrors_list: 'mirrors_list', @@ -87,7 +87,8 @@ App.stackMapper = App.QuickDataMapper.create({ stack_version: 'stack_version', operating_system_id: 'os_id', components: 'components', - distribution: 'distribution' + distribution: 'distribution', + unique: 'unique' }, map: function(json) { http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/ambari-web/app/messages.js ---------------------------------------------------------------------- diff --git a/ambari-web/app/messages.js b/ambari-web/app/messages.js index 2efc023..11be27d 100644 --- a/ambari-web/app/messages.js +++ b/ambari-web/app/messages.js @@ -61,304 +61,306 @@ Em.I18n.translations = { 'app.aboutAmbari.version': 'Version', 'app.aboutAmbari.licensed': 'Licensed under the Apache License, Version 2.0', - 'apply':'apply', - 'and':'and', - 'none':'none', + 'add': 'Add', 'all':'all', - 'minimum':'minimum', - 'from':'From', - 'to':'To', - 'ok':'OK', + 'and':'and', + 'any': 'Any', + 'apply':'apply', 'as':'as', - 'on':'on', + 'from':'From', 'in':'in', - 'any': 'Any', + 'it': 'it', + 'minimum':'minimum', 'more':'more', - 'yes':'Yes', 'no':'No', - 'add': 'Add', + 'none':'none', + 'ok':'OK', + 'on':'on', 'op': 'op', 'ops': 'ops', 'or': 'or', 'then': 'then', - 'it': 'it', - + 'to':'To', + 'yes':'Yes', + 'common.abort': 'Abort', + 'common.aborted': 'Aborted', + 'common.aboutAmbari': 'About', 'common.access':'Access', - 'common.learnMore':'Learn more', - 'common.showDetails':'Show Details', - 'common.back':'Back', - 'common.prev':'Prev', - 'common.next':'Next', - 'common.host':'Host', - 'common.hosts':'Hosts', - 'common.services':'Services', - 'common.group':'Group', - 'common.groups':'Groups', - 'common.progress':'Progress', - 'common.status':'Status', 'common.action':'Action', - 'common.refresh':'Refresh', - 'common.remove':'Remove', - 'common.retry':'Retry', - 'common.skip':'Skip', - 'common.filter': 'Filter', - 'common.rollBack':'Rollback', - 'common.show':'Show', - 'common.hide':'Hide', - 'common.cancel':'Cancel', + 'common.actions': 'Actions', + 'common.add': 'Add', + 'common.additional': 'Additional', + 'common.advanced': 'Advanced', + 'common.alertDefinition': "Alert Definition", + 'common.all.clients':'All Clients', + 'common.all':'All', + 'common.allServices':'All Services', 'common.apply':'Apply', - 'common.done':'Done', - 'common.failed':'Failed', - 'common.service': 'Service', - 'common.version':'Version', - 'common.downgrade':'Downgrade', - 'common.description':'Description', - 'common.default':'Default', + 'common.author': 'Author', + 'common.back':'Back', + 'common.backgroundOperations': 'Background Operations', + 'common.cancel':'Cancel', + 'common.change': 'Change', 'common.client':'Client', - 'common.zookeeper':'ZooKeeper', - 'common.hbase':'HBase', - 'common.regionServer':'RegionServer', - 'common.taskTracker':'TaskTracker', - 'common.dataNode':'DataNode', - 'common.more': 'More...', - 'common.print':'Print', - 'common.deploy':'Deploy', - 'common.generate.blueprint':'Generate Blueprint', - 'common.message':'Message', - 'common.tasks':'Tasks', - 'common.taskLog':'Task Log', - 'common.open':'Open', - 'common.copy':'Copy', + 'common.clients':'Clients', + 'common.clone': 'Clone', + 'common.close': 'Close', + 'common.cluster':'Cluster', + 'common.compare': 'Compare', 'common.complete':'Complete', 'common.completed':'Completed', - 'common.metrics':'Metrics', - 'common.timeRange':'Time Range', - 'common.name':'Name', - 'common.key':'Key', - 'common.value':'Value', - 'common.ipAddress':'IP Address', - 'common.rack':'Rack', - 'common.cpu':'CPU', - 'common.cores': 'Cores', + 'common.component':'Component', + 'common.components':'Components', + 'common.conf.group': 'Configuration Group', + 'common.configGroup': 'Config Group', + 'common.configs': "Configs", + 'common.configuration': "Configuration", + 'common.confirm': 'Confirm', + 'common.continueAnyway': 'Continue Anyway', + 'common.copy':'Copy', 'common.cores.cpu': 'Cores (CPU)', - 'common.ram':'RAM', - 'common.disabled':'Disabled', - 'common.enabled':'Enabled', - 'common.enableAll':'Enable All', + 'common.cores': 'Cores', + 'common.cpu':'CPU', + 'common.critical': 'Critical', + 'common.csv': 'Save as CSV', + 'common.current': 'Current', + 'common.custom': 'Custom', + 'common.dataNode':'DataNode', + 'common.dataSet': 'Data Set', + 'common.days': "Days", + 'common.decommission':'Decommission', + 'common.default':'Default', + 'common.delete': 'Delete', + 'common.deploy':'Deploy', + 'common.description':'Description', + 'common.details':'Details', + 'common.direction': 'Direction', + 'common.disable': 'Disable', 'common.disableAll':'Disable All', + 'common.disabled':'Disabled', + 'common.discard': 'Discard', 'common.disk':'Disk', 'common.diskUsage':'Disk Usage', - 'common.last':'Last', - 'common.loadAvg':'Load Avg', - 'common.components':'Components', - 'common.component':'Component', - 'common.quickLinks':'Quick Links', - 'common.save':'Save', - 'common.saveAnyway':'Save Anyway', - 'common.servers':'Servers', - 'common.clients':'Clients', - 'common.all.clients':'All Clients', - 'common.user': 'User', - 'common.users': 'Users', - 'common.issues': 'Issues', - 'common.os':'OS', - 'common.oss':'OSs', - 'common.memory':'Memory', - 'common.maximum':'Maximum', - 'common.started':'Started', - 'common.start':'Start', - 'common.stop':'Stop', - 'common.pause':'Pause', + 'common.dismiss': "Dismiss", + 'common.done':'Done', + 'common.downgrade':'Downgrade', + 'common.download': 'Download', + 'common.duplicate': 'Duplicate', + 'common.duration': 'Duration', + 'common.edit': 'Edit', + 'common.empty': 'Empty', + 'common.enable': 'Enable', + 'common.enableAll':'Enable All', + 'common.enabled':'Enabled', + 'common.end.time': 'End Time', 'common.end':'End', - 'common.decommission':'Decommission', - 'common.recommission':'Recommission', + 'common.enter': 'Enter', + 'common.error': 'Error', + 'common.errorPopup.header': 'An error has been encountered', + 'common.exclude.short': 'Excl', + 'common.exclude': 'Exclude', + 'common.exitAnyway': 'Exit Anyway', + 'common.export': 'Export', + 'common.express.downgrade': 'Express Downgrade', + 'common.express': 'Express', + 'common.expression': 'Expression', + 'common.extension': 'Extension', + 'common.fail':'Fail', + 'common.failed':'Failed', 'common.failure': 'Failure', - 'common.type': 'Type', - 'common.direction': 'Direction', - 'common.close': 'Close', - 'common.warning': 'Warning', - 'common.critical': 'Critical', + 'common.file': 'File', + 'common.fileName': 'File Name', + 'common.filter': 'Filter', + 'common.filters': 'Filters', + 'common.finalize': "Finalize", + 'common.free': 'free', + 'common.from.version': 'From Version', + 'common.fullLogPopup.clickToCopy': 'Click to Copy', + 'common.generate.blueprint':'Generate Blueprint', + 'common.group':'Group', + 'common.groups':'Groups', + 'common.hbase':'HBase', + 'common.hide':'Hide', + 'common.host':'Host', + 'common.hostLog.popup.errorLog.value': 'errors-{0}.txt', + 'common.hostLog.popup.logDir.path':'/var/lib/ambari-agent/data/', // TODO, this hardcoded path needs to be removed. + 'common.hostLog.popup.outputLog.value': 'output-{0}.txt', + 'common.hostOrdered': 'Host Ordered', + 'common.hosts':'Hosts', + 'common.hours': "Hours", + 'common.ignore': 'Ignore', + 'common.important.strong': '<strong>Important:</strong>', + 'common.important': 'Important', + 'common.include.short': 'Incl', + 'common.include': 'Include', 'common.information': 'Information', - 'common.all':'All', - 'common.success': 'Success', - 'common.fail':'Fail', - 'common.error': 'Error', - 'common.loading': 'Loading', - 'common.search': 'Search', - 'common.confirm': 'Confirm', - 'common.upgrade': 'Upgrade', - 'common.reUpgrade': 'Retry Upgrade', - 'common.reDowngrade': 'Retry Downgrade', - 'common.security':'Security', + 'common.install': "Install", + 'common.installed': 'Installed', + 'common.installRepo.task': ' Install Packages', + 'common.ipAddress':'IP Address', + 'common.issues': 'Issues', + 'common.json': 'Save as JSON', 'common.kerberos':'Kerberos', - 'common.cluster':'Cluster', - 'common.repositories':'Repositories', - 'common.stack.versions':'Stack Versions', - 'common.versions':'Versions', - 'common.upgrade.history':'Upgrade History', - 'common.serviceAccounts': 'Service Accounts', - 'common.add': 'Add', - 'common.edit': 'Edit', - 'common.delete': 'Delete', - 'common.duplicate': 'Duplicate', - 'common.disable': 'Disable', - 'common.enable': 'Enable', - 'common.empty': 'Empty', - 'common.override':'Override', - 'common.undo':'Undo', - 'common.details':'Details', - 'common.stats':'Stats', - 'common.abort': 'Abort', - 'common.aborted': 'Aborted', + 'common.key':'Key', + 'common.keywords': 'Keywods', + 'common.label': 'Label', + 'common.last':'Last', + 'common.latest': 'Latest', + 'common.learnMore':'Learn more', + 'common.levels': 'Levels', + 'common.link': 'Link', + 'common.live': 'Live', + 'common.loadAvg':'Load Avg', + 'common.loading.eclipses': 'Loading...', + 'common.loading': 'Loading', + 'common.logs': 'Logs', + 'common.maint': 'Maint', + 'common.maintenance.task': ' Toggle Maintenance Mode', + 'common.maintenance': 'Maintenance', + 'common.maximum':'Maximum', + 'common.memory':'Memory', + 'common.message':'Message', + 'common.metrics':'Metrics', + 'common.milliseconds': "Milliseconds", + 'common.minutes': "Minutes", 'common.misc': 'Misc', - 'common.userSettings': 'User Settings', - 'common.aboutAmbari': 'About', - 'common.notAvailable': 'Not Available', + 'common.more': 'More...', + 'common.move':'Move', + 'common.mpack': 'Management Pack', 'common.na': 'n/a', + 'common.name':'Name', + 'common.next':'Next', + 'common.noData': 'No Data', + 'common.noLink': 'No Links', + 'common.notAvailable': 'Not Available', + 'common.notes': 'Notes', + 'common.nothingToDelete': 'Nothing to delete', + 'common.open':'Open', + 'common.openNewWindow': 'Open in New Window', + 'common.operatingSystem': 'Operating System', 'common.operations': 'Operations', - 'common.backgroundOperations': 'Background Operations', - 'common.startTime': 'Start Time', - 'common.duration': 'Duration', - 'common.reinstall': 'Re-Install', - 'common.revert': 'Revert', - 'common.errorPopup.header': 'An error has been encountered', - 'common.use': 'Use', - 'common.stacks': 'Stacks', - 'common.stack': 'Stack', - 'common.reset': 'Reset', - 'common.reset.default': 'Reset to default', - 'common.resume': 'Resume', - 'common.path': 'Path', - 'common.patch': 'Patch', - 'common.maint': 'Maint', + 'common.optional': 'Optional', + 'common.options': 'Options', + 'common.os': 'OS', + 'common.oss':'OSs', + 'common.override':'Override', + 'common.overrides': 'Overrides', 'common.package': 'Package', + 'common.passive_state': 'Maintenance Mode', + 'common.password': 'Password', + 'common.patch': 'Patch', + 'common.path': 'Path', + 'common.pause':'Pause', + 'common.persist.error' : 'Error in persisting web client state at ambari server. Server respond with following error message:', + 'common.prerequisites': 'Prerequisites', + 'common.prev':'Prev', + 'common.preview': 'Preview', + 'common.print':'Print', 'common.proceed': 'Proceed', 'common.proceedAnyway': 'Proceed Anyway', - 'common.exitAnyway': 'Exit Anyway', 'common.process': 'Process', - 'common.property': 'Property', - 'common.installed': 'Installed', - 'common.persist.error' : 'Error in persisting web client state at ambari server. Server respond with following error message:', - 'common.update.error' : 'Error in retrieving web client state from ambari server', - 'common.tags': 'Tags', - 'common.important': 'Important', - 'common.important.strong': '<strong>Important:</strong>', - 'common.allServices':'All Services', - 'common.move':'Move', - 'common.change': 'Change', - 'common.overrides': 'Overrides', + 'common.progress':'Progress', 'common.properties': 'properties', - 'common.conf.group': 'Configuration Group', - 'common.ignore': 'Ignore', + 'common.property.undefined': "Undefined", + 'common.property': 'Property', + 'common.propertyType': 'Property Type', + 'common.public': 'Public', + 'common.quickLinks':'Quick Links', + 'common.rack':'Rack', + 'common.ram':'RAM', + 'common.recommission':'Recommission', + 'common.reDowngrade': 'Retry Downgrade', + 'common.refresh':'Refresh', + 'common.regionServer':'RegionServer', + 'common.reinstall': 'Re-Install', + 'common.remove':'Remove', + 'common.removed': 'Removed', + 'common.repositories':'Repositories', + 'common.repository': 'Repository', + 'common.repositoryType': 'Repository Type', + 'common.reset.default': 'Reset to default', + 'common.reset': 'Reset', 'common.restart': 'Restart', - 'common.discard': 'Discard', - 'common.actions': 'Actions', - 'common.maintenance': 'Maintenance', - 'common.passive_state': 'Maintenance Mode', + 'common.resume': 'Resume', + 'common.retry':'Retry', + 'common.reUpgrade': 'Retry Upgrade', + 'common.revert': 'Revert', + 'common.rollBack':'Rollback', + 'common.rolling.downgrade': 'Rolling Downgrade', + 'common.rolling': 'Rolling', + 'common.running': 'Running', + 'common.save':'Save', + 'common.saveAnyway':'Save Anyway', + 'common.scope': 'Scope', + 'common.search': 'Search', + 'common.seconds': "Seconds", + 'common.security':'Security', 'common.select': 'Select', 'common.selected': 'Selected', - 'common.password': 'Password', - 'common.url': 'URL', - 'common.advanced': 'Advanced', - 'common.download': 'Download', - 'common.current': 'Current', - 'common.additional': 'Additional', - 'common.time.start': 'Start Time', - 'common.time.end': 'End Time', - 'common.hostLog.popup.logDir.path':'/var/lib/ambari-agent/data/', // TODO, this hardcoded path needs to be removed. - 'common.hostLog.popup.outputLog.value': 'output-{0}.txt', - 'common.hostLog.popup.errorLog.value': 'errors-{0}.txt', - 'common.maintenance.task': ' Toggle Maintenance Mode', - 'common.installRepo.task': ' Install Packages', - 'common.used': 'used', - 'common.free': 'free', - 'common.type.string': 'string', - 'common.type.number': 'number', - 'common.author': 'Author', - 'common.notes': 'Notes', - 'common.view': 'View', - 'common.compare': 'Compare', - 'common.latest': 'Latest', - 'common.custom': 'Custom', - 'common.continueAnyway': 'Continue Anyway', - 'common.property.undefined': "Undefined", - 'common.summary': "Summary", - 'common.configs': "Configs", - 'common.configuration': "Configuration", - 'common.unknown': "Unknown", - 'common.install': "Install", - 'common.alertDefinition': "Alert Definition", - 'common.prerequisites': 'Prerequisites', - 'common.finalize': "Finalize", + 'common.servers':'Servers', + 'common.service': 'Service', + 'common.serviceAccounts': 'Service Accounts', + 'common.services':'Services', 'common.severity': "Severity", - 'common.dismiss': "Dismiss", - 'common.stdout': "stdout", + 'common.show':'Show', + 'common.showDetails':'Show Details', + 'common.skip':'Skip', + 'common.stack.versions':'Stack Versions', + 'common.stack': 'Stack', + 'common.stacks': 'Stacks', + 'common.start.time': 'Start Time', + 'common.start':'Start', + 'common.started':'Started', + 'common.startTime': 'Start Time', + 'common.stats':'Stats', + 'common.status':'Status', 'common.stderr': "stderr", + 'common.stdout': "stdout", + 'common.stop':'Stop', + 'common.stopped': 'Stopped', 'common.structuredOut': "structured_out", - 'common.fileName': 'File Name', - 'common.file': 'File', - 'common.days': "Days", - 'common.hours': "Hours", - 'common.minutes': "Minutes", - 'common.seconds': "Seconds", - 'common.milliseconds': "Milliseconds", - 'common.configGroup': 'Config Group', - 'common.expression': 'Expression', - 'common.dataSet': 'Data Set', - 'common.label': 'Label', - 'common.preview': 'Preview', - 'common.options': 'Options', - 'common.scope': 'Scope', - 'common.clone': 'Clone', - 'common.removed': 'Removed', + 'common.success': 'Success', + 'common.summary': "Summary", + 'common.tags': 'Tags', + 'common.taskLog':'Task Log', + 'common.tasks':'Tasks', + 'common.taskTracker':'TaskTracker', 'common.testing': 'Testing', - 'common.noData': 'No Data', - 'common.export': 'Export', - 'common.csv': 'Save as CSV', - 'common.json': 'Save as JSON', - 'common.timestamp': 'Timestamp', - 'common.timezone': 'Timezone', - 'common.loading.eclipses': 'Loading...', - 'common.optional': 'Optional', - 'common.propertyType': 'Property Type', - 'common.running': 'Running', - 'common.stopped': 'Stopped', - 'common.enter': 'Enter', - 'common.timeout.warning.popup.header': 'Automatic Logout', - 'common.timeout.warning.popup.body.before': 'You will be automatically logged out in ', + 'common.time.end': 'End Time', + 'common.time.start': 'Start Time', 'common.timeout.warning.popup.body.after': ' seconds due to inactivity', + 'common.timeout.warning.popup.body.before': 'You will be automatically logged out in ', + 'common.timeout.warning.popup.header': 'Automatic Logout', 'common.timeout.warning.popup.primary': 'Remain Logged In', 'common.timeout.warning.popup.secondary': 'Log Out Now', - 'common.openNewWindow': 'Open in New Window', - 'common.fullLogPopup.clickToCopy': 'Click to Copy', - 'common.nothingToDelete': 'Nothing to delete', - 'common.exclude': 'Exclude', - 'common.include': 'Include', - 'common.exclude.short': 'Excl', - 'common.include.short': 'Incl', - 'common.filters': 'Filters', - 'common.keywords': 'Keywods', - 'common.levels': 'Levels', - 'common.extension': 'Extension', - 'common.logs': 'Logs', - 'common.warn.message': '<div class="alert alert-warning">{0}</div>', - 'common.link': 'Link', - 'common.noLink': 'No Links', - 'common.live': 'Live', - 'common.from.version': 'From Version', + 'common.timeRange':'Time Range', + 'common.timestamp': 'Timestamp', + 'common.timezone': 'Timezone', 'common.to.version': 'To Version', - 'common.start.time': 'Start Time', - 'common.end.time': 'End Time', - 'common.rolling': 'Rolling', - 'common.express': 'Express', - 'common.hostOrdered': 'Host Ordered', - 'common.repository': 'Repository', - 'common.repositoryType': 'Repository Type', - 'common.rolling.downgrade': 'Rolling Downgrade', - 'common.express.downgrade': 'Express Downgrade', + 'common.type.number': 'number', + 'common.type.string': 'string', + 'common.type': 'Type', + 'common.undo':'Undo', + 'common.unknown': "Unknown", + 'common.update.error' : 'Error in retrieving web client state from ambari server', + 'common.upgrade.history':'Upgrade History', + 'common.upgrade': 'Upgrade', + 'common.url': 'URL', + 'common.use': 'Use', + 'common.used': 'used', + 'common.user': 'User', + 'common.users': 'Users', + 'common.userSettings': 'User Settings', + 'common.value': 'Value', + 'common.verification': 'Verification', + 'common.version':'Version', + 'common.versions':'Versions', + 'common.view': 'View', 'common.views': 'Views', - 'common.mpack': 'Management Pack', + 'common.warn.message': '<div class="alert alert-warning">{0}</div>', + 'common.warning': 'Warning', + 'common.zookeeper':'ZooKeeper', 'models.alert_instance.tiggered.verbose': "Occurred on {0} <br> Checked on {1}", 'models.alert_definition.triggered.verbose': "Occurred on {0}", @@ -602,51 +604,70 @@ Em.I18n.translations = { 'installer.controls.serviceConfigMasterHosts.header':'{0} Hosts', 'installer.controls.slaveComponentChangeGroupName.error':'group with this name already exist', - 'installer.selectMpacks.loadRegistryFailed': 'Could not load available management packs. The software registry may not be available.', + 'installer.step0.header':'Get Started', + 'installer.step0.body.header':'Name cluster', + 'installer.step0.body':'This wizard will walk you through the cluster installation process. First, name your new cluster.', + 'installer.step0.clusterName':'Name your cluster', + 'installer.step0.clusterName.tooltip.title':'Cluster Name', + 'installer.step0.clusterName.tooltip.content':'Enter a unique cluster name.', + 'installer.step0.clusterName.error.required':'Cluster Name is required', + 'installer.step0.clusterName.error.tooLong':'Cluster Name is too long', + 'installer.step0.clusterName.error.whitespace':'Cluster Name cannot contain whitespace', + 'installer.step0.clusterName.error.specialChar':'Cluster Name cannot contain special characters', + 'installer.selectMpacks.header': 'Select Management Packs', 'installer.selectMpacks.body.header': 'Select Management Packs', + 'installer.selectMpacks.body.header.useCases': 'Use Cases', + 'installer.selectMpacks.body.header.mpacks': 'Management Packs', + 'installer.selectMpacks.body.header.services': 'Services', + 'installer.selectMpacks.body.selected.header': 'Selected Management Packs', + 'installer.selectMpacks.loadRegistryFailed': 'Could not load available management packs. The software registry may not be available.', 'installer.selectMpacks.noUsecasesAvailable': 'No use cases are available.', 'installer.selectMpacks.noMpacksAvailable': 'No management packs are available.', 'installer.selectMpacks.noServicesAvailable': 'No services are available.', 'installer.selectMpacks.noMpacksSelected': 'No management packs selected.', 'installer.selectMpacks.noRecommendationAvailable': 'No management packs support the selected use cases. Please change your selection.', 'installer.selectMpacks.getRecommendationFailed': 'Could not load management macks supporting the selected use cases. The software registry may not be available.', - 'installer.selectMpacks.body.header.useCases': 'Use Cases', - 'installer.selectMpacks.body.header.mpacks': 'Management Packs', - 'installer.selectMpacks.body.header.services': 'Services', - 'installer.selectMpacks.body.selected.header': 'Selected Management Packs', 'installer.selectMpacks.basicMode': 'Basic Mode', 'installer.selectMpacks.advancedMode': 'Advanced Mode', 'installer.selectMpacks.changeMode': 'Change Selection Mode', 'installer.selectMpacks.basicModeMessage': 'Advanced Mode allows you to directly select individual management packs and services. If you proceed to Advanced Mode, you will not be able to return to Basic Mode without losing all of your selections. Choose a selection mode.', 'installer.selectMpacks.advancedModeMessage': 'Basic Mode provides common use cases you can choose from that will automatically select appropriate management packs and services. You cannot change these selections directly. If you proceed to Basic Mode, you will lose all current selections. Choose a selection mode.', - 'installer.step0.header':'Get Started', - 'installer.step0.body.header':'Get Started', - 'installer.step0.body':'This wizard will walk you through the cluster installation process. First, start by naming your new cluster.', - 'installer.step0.clusterName':'Name your cluster', - 'installer.step0.clusterName.tooltip.title':'Cluster Name', - 'installer.step0.clusterName.tooltip.content':'Enter a unique cluster name.', - 'installer.step0.clusterName.error.required':'Cluster Name is required', - 'installer.step0.clusterName.error.tooLong':'Cluster Name is too long', - '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.customRepo': 'Local Repository', - 'installer.configureDownload.publicRepo.description': 'Management Packs will be downloaded using the internet', - 'installer.configureDownload.customRepo.description': 'Management Packs will be downloaded from the specified local repository', + 'installer.configureDownload.body.title': 'Choose download method', + 'installer.configureDownload.body.description': 'Using Public Repositories requires an internet connection. Choose Local Repositories to change the download locations to something other than the public repositories, such as a repositories on your network.', + 'installer.configureDownload.publicRepo': 'Public Repositories', + 'installer.configureDownload.customRepo': 'Local Repositories', + 'installer.configureDownload.publicRepo.description': 'Software will be downloaded from public repositories.', + 'installer.configureDownload.customRepo.description': 'Software will be downloaded from locations you specify.', 'installer.configureDownload.useProxy': 'Use Proxy', 'installer.configureDownload.proxyUrl': 'Proxy URL', 'installer.configureDownload.proxyUrl.placeholder': 'http://server:port', 'installer.configureDownload.proxyAuth': 'Authentication', 'installer.configureDownload.useRedHatSatellite': 'Use Red Hat Satellite/Spacewalk', - 'installer.downloadProducts.header': 'Download Products', - 'installer.downloadProducts.body.title': 'Downloading and validating Management Packs', - 'installer.downloadProducts.body.description': 'Ambari is downloading the Management Packs and validating its contents', + + 'installer.customMpackRepos.header': 'Set Management Pack Locations', + 'installer.customMpackRepos.body.title': 'Customize management pack locations', + 'installer.customMpackRepos.body.description': 'Get the management packs from their public repos and add them to your local repo, then update the download URLs below.', + 'installer.customMpackRepos.publicRepo': 'Public Link', + 'installer.customMpackRepos.customRepo': 'Download URL', + + 'installer.downloadMpacks.header': 'Download Management Packs', + 'installer.downloadMpacks.body.title': 'Download and validate management packs', + 'installer.downloadMpacks.body.description': 'Ambari is downloading the management packs and validating their contents.', + + 'installer.customProductRepos.header': 'Set Product Locations', + 'installer.customProductRepos.body.title': 'Customize product locations', + 'installer.customProductRepos.body.description': 'Get the products from their public repos and add them to your local repo, then update the download URLs below.', + 'installer.customProductRepos.publicRepo': 'Public Link', + 'installer.customProductRepos.customRepo': 'Download URL', + 'installer.customProductRepos.addRemoveOs': 'Add/Remove OS', + 'installer.customProductRepos.noSelectedOs': 'Please select an operating system.', + + 'installer.verifyProducts.header': 'Verify Products', + 'installer.verifyProducts.body.title': 'Verify products', + 'installer.verifyProducts.body.description': 'Ambari is verifying the product repositories.', 'installer.step1.header':'Select Version', 'installer.step1.body':'Select the software version and method of delivery for your cluster.', http://git-wip-us.apache.org/repos/asf/ambari/blob/50e28dff/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 6dd7394..e4f4645 100644 --- a/ambari-web/app/mixins/wizard/wizard_menu_view.js +++ b/ambari-web/app/mixins/wizard/wizard_menu_view.js @@ -53,8 +53,11 @@ App.WizardMenuMixin = Em.Mixin.create({ isStep2Disabled: isStepDisabled("step2"), isStep3Disabled: isStepDisabled("step3"), isConfigureDownloadDisabled: isStepDisabled("configureDownload"), - isDownloadProductsDisabled: isStepDisabled("downloadProducts"), isSelectMpacksDisabled: isStepDisabled("selectMpacks"), + isCustomMpackReposDisabled: isStepDisabled("customMpackRepos"), + isDownloadMpacksDisabled: isStepDisabled("downloadMpacks"), + isCustomProductReposDisabled: isStepDisabled("customProductRepos"), + isVerifyProductsDisabled: isStepDisabled("verifyProducts"), isStep4Disabled: isStepDisabled("step4"), isStep5Disabled: isStepDisabled("step5"), isStep6Disabled: isStepDisabled("step6"), @@ -68,8 +71,11 @@ App.WizardMenuMixin = Em.Mixin.create({ isStep2Completed: isStepCompleted("step2"), isStep3Completed: isStepCompleted("step3"), isConfigureDownloadCompleted: isStepCompleted("configureDownload"), - isDownloadProductsCompleted: isStepCompleted("downloadProducts"), isSelectMpacksCompleted: isStepCompleted("selectMpacks"), + isCustomMpackReposCompleted: isStepCompleted("customMpackRepos"), + isDownloadMpacksCompleted: isStepCompleted("downloadMpacks"), + isCustomProductReposCompleted: isStepCompleted("customProductRepos"), + isVerifyProductsCompleted: isStepCompleted("verifyProducts"), isStep4Completed: isStepCompleted("step4"), isStep5Completed: isStepCompleted("step5"), isStep6Completed: isStepCompleted("step6"),
