Changes missing from the license removal code
This commit is contained in:
parent
6f0b2f9a90
commit
111ba8f7ee
3 changed files with 1 additions and 135 deletions
|
@ -450,41 +450,6 @@ a:focus {
|
|||
margin-right: 4px;
|
||||
}
|
||||
|
||||
.config-license-field-element .required {
|
||||
background-color: #f5f5f5;
|
||||
color: #333;
|
||||
}
|
||||
|
||||
.config-license-field-element textarea {
|
||||
padding: 10px;
|
||||
margin-bottom: 10px;
|
||||
height: 250px;
|
||||
}
|
||||
|
||||
.config-license-field-element .license-status {
|
||||
margin-bottom: 26px;
|
||||
}
|
||||
|
||||
.config-license-field-element table {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.config-license-field-element .fa {
|
||||
margin-right: 6px;
|
||||
}
|
||||
|
||||
.config-license-field-element .license-valid h4 {
|
||||
color: #2FC98E;
|
||||
}
|
||||
|
||||
.config-license-field-element .license-invalid h4 {
|
||||
color: #D64456;
|
||||
}
|
||||
|
||||
.config-license-field-element li {
|
||||
padding: 4px;
|
||||
}
|
||||
|
||||
.co-checkbox {
|
||||
position: relative;
|
||||
}
|
||||
|
|
|
@ -19,8 +19,6 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
$scope.GITHOST_REGEX = '^https?://([a-zA-Z0-9]+\.?\/?)+$';
|
||||
|
||||
$scope.SERVICES = [
|
||||
{'id': 'license', 'title': 'License'},
|
||||
|
||||
{'id': 'redis', 'title': 'Redis'},
|
||||
|
||||
{'id': 'registry-storage', 'title': 'Registry Storage'},
|
||||
|
@ -1435,95 +1433,4 @@ angular.module("core-config-setup", ['angularFileUpload'])
|
|||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
})
|
||||
|
||||
.directive('configLicenseField', function () {
|
||||
var directiveDefinitionObject = {
|
||||
priority: 0,
|
||||
templateUrl: '/static/directives/config/config-license-field.html',
|
||||
replace: false,
|
||||
transclude: false,
|
||||
restrict: 'C',
|
||||
scope: {
|
||||
'isValid': '=?isValid',
|
||||
'forSetup': '@forSetup'
|
||||
},
|
||||
controller: function($scope, $element, ApiService, UserService) {
|
||||
$scope.LicenseStates = {
|
||||
none: 'no-license',
|
||||
loading: 'license-loading',
|
||||
valid: 'license-valid',
|
||||
invalid: 'license-error',
|
||||
validating: 'validating-license'
|
||||
};
|
||||
|
||||
$scope.state = $scope.forSetup == 'true' ? $scope.LicenseStates.none : $scope.LicenseStates.loading;
|
||||
$scope.showingEditor = $scope.forSetup == 'true';
|
||||
$scope.requiredBox = '';
|
||||
|
||||
$scope.requirementTitles = {
|
||||
'software.quay': 'Quay Enterprise',
|
||||
'software.quay.deployments': 'Quay Enterprise Deployments'
|
||||
};
|
||||
|
||||
var handleLicenseSuccess = function(resp) {
|
||||
$scope.state = resp['success'] ? $scope.LicenseStates.valid : $scope.LicenseStates.invalid;
|
||||
$scope.requiredBox = resp['success'] ? 'filled' : '';
|
||||
$scope.showingEditor = !resp['success'];
|
||||
$scope.licenseStatus = resp['status'];
|
||||
$scope.licenseError = null;
|
||||
$scope.isValid = resp['success'];
|
||||
};
|
||||
|
||||
var handleLicenseError = function(resp) {
|
||||
$scope.licenseError = ApiService.getErrorMessage(resp);
|
||||
$scope.licenseStatus = null;
|
||||
$scope.state = 'license-error';
|
||||
$scope.showingEditor = true;
|
||||
$scope.requiredBox = '';
|
||||
$scope.isValid = false;
|
||||
};
|
||||
|
||||
var loadLicense = function() {
|
||||
if ($scope.forSetup == 'true') {
|
||||
$scope.state = $scope.LicenseStates.none;
|
||||
return;
|
||||
}
|
||||
|
||||
ApiService.getLicense().then(handleLicenseSuccess, handleLicenseError);
|
||||
};
|
||||
|
||||
UserService.updateUserIn($scope, function(user) {
|
||||
if (!user.anonymous) {
|
||||
loadLicense();
|
||||
}
|
||||
});
|
||||
|
||||
$scope.showEditor = function($event) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
|
||||
$scope.showingEditor = true;
|
||||
};
|
||||
|
||||
$scope.validateAndUpdate = function($event) {
|
||||
$event.preventDefault();
|
||||
$event.stopPropagation();
|
||||
|
||||
$scope.state = $scope.LicenseStates.validating;
|
||||
|
||||
var data = {
|
||||
'license': $scope.licenseContents
|
||||
};
|
||||
|
||||
if ($scope.forSetup == 'true') {
|
||||
ApiService.suSetAndValidateLicense(data).then(handleLicenseSuccess, handleLicenseError);
|
||||
} else {
|
||||
ApiService.updateLicense(data).then(handleLicenseSuccess, handleLicenseError);
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
return directiveDefinitionObject;
|
||||
});
|
||||
|
||||
});
|
||||
|
|
|
@ -66,12 +66,6 @@ function($rootScope, $interval, UserService, ApiService, StringBuilderService, P
|
|||
}
|
||||
}
|
||||
},
|
||||
'expiring_license': {
|
||||
'level': 'error',
|
||||
'message': 'Your license will expire at: {expires_at} ' +
|
||||
'<br><br>Please contact support to purchase a new license.',
|
||||
'page': '/contact/'
|
||||
},
|
||||
'maintenance': {
|
||||
'level': 'warning',
|
||||
'message': 'We will be down for schedule maintenance from {from_date} to {to_date} ' +
|
||||
|
|
Reference in a new issue