|
@@ -18,7 +18,7 @@
|
|
|
'use strict';
|
|
|
|
|
|
angular.module('ambariAdminConsole')
|
|
|
-.controller('StackVersionsCreateCtrl', ['$scope', 'Stack', '$routeParams', '$location', 'Alert', '$translate', 'Cluster', 'AddRepositoryModal', function($scope, Stack, $routeParams, $location, Alert, $translate, Cluster, AddRepositoryModal) {
|
|
|
+.controller('StackVersionsCreateCtrl', ['$scope', 'Stack', '$routeParams', '$location', 'Alert', '$translate', 'Cluster', 'AddRepositoryModal', 'ConfirmationModal', function($scope, Stack, $routeParams, $location, Alert, $translate, Cluster, AddRepositoryModal, ConfirmationModal) {
|
|
|
var $t = $translate.instant;
|
|
|
$scope.constants = {
|
|
|
os: $t('versions.os')
|
|
@@ -94,7 +94,7 @@ angular.module('ambariAdminConsole')
|
|
|
selectedCnt ++;
|
|
|
}
|
|
|
});
|
|
|
- return $scope.osList.length == selectedCnt;
|
|
|
+ return $scope.osList.length == selectedCnt || $scope.useRedhatSatellite;
|
|
|
};
|
|
|
|
|
|
$scope.allInfoCategoriesBlank = function () {
|
|
@@ -179,6 +179,9 @@ angular.module('ambariAdminConsole')
|
|
|
* On click handler for removing OS
|
|
|
*/
|
|
|
$scope.removeOS = function() {
|
|
|
+ if ($scope.useRedhatSatellite) {
|
|
|
+ return;
|
|
|
+ }
|
|
|
this.os.selected = false;
|
|
|
if (this.os.repositories) {
|
|
|
this.os.repositories.forEach(function(repo) {
|
|
@@ -237,7 +240,8 @@ angular.module('ambariAdminConsole')
|
|
|
}
|
|
|
});
|
|
|
if ($scope.isPublicVersion) {
|
|
|
- return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
|
|
|
+ var skip = $scope.skipValidation || $scope.useRedhatSatellite;
|
|
|
+ return Stack.validateBaseUrls(skip, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
|
|
|
if (invalidUrls.length === 0) {
|
|
|
var data = {
|
|
|
"VersionDefinition": {
|
|
@@ -274,7 +278,8 @@ angular.module('ambariAdminConsole')
|
|
|
};
|
|
|
|
|
|
$scope.updateRepoVersions = function () {
|
|
|
- return Stack.validateBaseUrls($scope.skipValidation, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
|
|
|
+ var skip = $scope.skipValidation || $scope.useRedhatSatellite;
|
|
|
+ return Stack.validateBaseUrls(skip, $scope.osList, $scope.upgradeStack).then(function (invalidUrls) {
|
|
|
if (invalidUrls.length === 0) {
|
|
|
Stack.updateRepo($scope.upgradeStack.stack_name, $scope.upgradeStack.stack_version, $scope.id, $scope.updateObj).then(function () {
|
|
|
Alert.success($t('versions.alerts.versionEdited', {
|
|
@@ -307,6 +312,16 @@ angular.module('ambariAdminConsole')
|
|
|
}
|
|
|
});
|
|
|
}
|
|
|
+ if ($scope.useRedhatSatellite) {
|
|
|
+ ConfirmationModal.show(
|
|
|
+ $t('common.important'),
|
|
|
+ {
|
|
|
+ "url": 'views/modals/BodyForUseRedhatSatellite.html'
|
|
|
+ }
|
|
|
+ ).catch(function () {
|
|
|
+ $scope.useRedhatSatellite = !$scope.useRedhatSatellite;
|
|
|
+ });
|
|
|
+ }
|
|
|
};
|
|
|
|
|
|
$scope.clearError = function() {
|
|
@@ -344,7 +359,10 @@ angular.module('ambariAdminConsole')
|
|
|
stack_version: response.stackVersion,
|
|
|
display_name: response.displayName || $t('common.NA')
|
|
|
};
|
|
|
- $scope.services = response.services || [];
|
|
|
+ $scope.services = response.services.filter(function (service) {
|
|
|
+ var skipServices = ['MAPREDUCE2', 'GANGLIA', 'KERBEROS'];
|
|
|
+ return skipServices.indexOf(service.name) === -1;
|
|
|
+ }) || [];
|
|
|
//save default values of repos to check if they were changed
|
|
|
$scope.defaulfOSRepos = {};
|
|
|
response.updateObj.operating_systems.forEach(function(os) {
|