diff --git a/app/scripts/controllers/settings.js b/app/scripts/controllers/settings.js deleted file mode 100644 index cc0623878b..0000000000 --- a/app/scripts/controllers/settings.js +++ /dev/null @@ -1,139 +0,0 @@ -'use strict'; -/* jshint unused: false */ - -/** - * @ngdoc function - * @name openshiftConsole.controller:SettingsController - * @description - * # ProjectController - * Controller of the openshiftConsole - */ -angular.module('openshiftConsole') - .controller('SettingsController', function ($routeParams, $scope, DataService, ProjectsService, AlertMessageService, $filter, $location, LabelFilter, $timeout, Logger, annotationFilter, annotationNameFilter) { - $scope.projectName = $routeParams.project; - $scope.limitRanges = {}; - $scope.limitsByType = {}; - $scope.labelSuggestions = {}; - $scope.alerts = $scope.alerts || {}; - $scope.quotaHelp = "Limits resource usage within this project."; - $scope.emptyMessageLimitRanges = "Loading..."; - $scope.limitRangeHelp = "Defines minimum and maximum constraints for runtime resources such as memory and CPU."; - $scope.renderOptions = $scope.renderOptions || {}; - $scope.renderOptions.hideFilterWidget = true; - - var watches = []; - - ProjectsService - .get($routeParams.project) - .then(_.spread(function(project, context) { - - var editableFields = function(resource) { - return { - description: annotationFilter(resource, 'description'), - displayName: annotationFilter(resource, 'displayName') - }; - }; - - var mergeEditable = function(resource, editable) { - var toSubmit = angular.copy(resource); - toSubmit.metadata.annotations[annotationNameFilter('description')] = editable.description; - toSubmit.metadata.annotations[annotationNameFilter('displayName')] = editable.displayName; - return toSubmit; - }; - - angular.extend($scope, { - project: project, - editableFields: editableFields(project), - show: { - editing: false - }, - actions: { - canSubmit: false - }, - canSubmit: function(bool) { - $scope.actions.canSubmit = bool; - }, - setEditing: function(bool) { - $scope.show.editing = bool; - }, - cancel: function() { - $scope.setEditing(false); - $scope.editableFields = editableFields(project); - }, - update: function() { - $scope.setEditing(false); - ProjectsService - .update($routeParams.project, mergeEditable(project, $scope.editableFields)) - .then(function(updated) { - project = $scope.project = updated; - $scope.editableFields = editableFields(updated); - $scope.$emit('project.settings.update', updated); - }, function(result) { - $scope.editableFields = editableFields(project); - $scope.alerts["update"] = { - type: "error", - message: "An error occurred while updating the project", - details: $filter('getErrorDetails')(result) - }; - }); - } - }); - - DataService.list("resourcequotas", context, function(quotas) { - $scope.quotas = quotas.by("metadata.name"); - Logger.log("quotas", $scope.quotas); - }); - - DataService.list("appliedclusterresourcequotas", context, function(quotas) { - $scope.clusterQuotas = quotas.by("metadata.name"); - $scope.namespaceUsageByClusterQuota = {}; - _.each($scope.clusterQuotas, function(quota, quotaName) { - if (quota.status) { - var namespaceUsage = _.find(quota.status.namespaces, { namespace: $routeParams.project }); - $scope.namespaceUsageByClusterQuota[quotaName] = namespaceUsage.status; - } - }); - Logger.log("cluster quotas", $scope.clusterQuotas); - }); - - DataService.list("limitranges", context, function(limitRanges) { - $scope.limitRanges = limitRanges.by("metadata.name"); - $scope.emptyMessageLimitRanges = "There are no limit ranges set on this project."; - // Convert to a sane format for a view to a build a table with rows per resource type - angular.forEach($scope.limitRanges, function(limitRange, name){ - $scope.limitsByType[name] = {}; - - angular.forEach(limitRange.spec.limits, function(limit) { - // We have nested types, top level type is something like "Container" - var typeLimits = $scope.limitsByType[name][limit.type] = {}; - angular.forEach(limit.max, function(value, type) { - typeLimits[type] = typeLimits[type] || {}; - typeLimits[type].max = value; - }); - angular.forEach(limit.min, function(value, type) { - typeLimits[type] = typeLimits[type] || {}; - typeLimits[type].min = value; - }); - angular.forEach(limit["default"], function(value, type) { - typeLimits[type] = typeLimits[type] || {}; - typeLimits[type]["default"] = value; - }); - angular.forEach(limit.defaultRequest, function(value, type) { - typeLimits[type] = typeLimits[type] || {}; - typeLimits[type].defaultRequest = value; - }); - angular.forEach(limit.maxLimitRequestRatio, function(value, type) { - typeLimits[type] = typeLimits[type] || {}; - typeLimits[type].maxLimitRequestRatio = value; - }); - }); - }); - Logger.log("limitRanges", $scope.limitRanges); - }); - - $scope.$on('$destroy', function(){ - DataService.unwatchAll(watches); - }); - - })); - }); diff --git a/app/views/_settings-general-info.html b/app/views/_settings-general-info.html deleted file mode 100644 index edb9041954..0000000000 --- a/app/views/_settings-general-info.html +++ /dev/null @@ -1,120 +0,0 @@ -

General information

- - -
- -
-
- Name: -
-
- {{projectName}} -
-
- -
-
- Display Name: -
-
-
- {{project | displayName: true}} -
-
- No display name -
-
-
- -
-
Description:
-
-
- -
-
- No description -
-
-
-
- - - -
- -
-
- -
-
{{projectName}}
-
- -
-
- -
- -
- -
-
-
- -
-
- -
-
- -
-
-
- -
-
-
- - -
-
-
-
diff --git a/app/views/settings.html b/app/views/settings.html deleted file mode 100644 index 5a539031cb..0000000000 --- a/app/views/settings.html +++ /dev/null @@ -1,310 +0,0 @@ - - - - -
-
-
-
- - -

- - Project Settings -

-
-
-
-
-
-
-
-
-
- -
-
-
- - -
-

- Quota -

-
{{quotaHelp}}
-

Loading...There are no resource quotas set on this project.

-
- -
-

- Cluster Quota {{quota.metadata.name}} -

-
Limits resource usage across a set of projects.
-
-
Scopes:
-
-
- {{scope | startCase}} - — {{scope | scopeDetails}} -
-
-
-
-
-
-

CPU Request

- -
-
-

Memory Request

- -
-
-

CPU Request

- -
-
-

Memory Request

- -
-
-

CPU Limit

- -
-
-

Memory Limit

- -
-
-
- -
- - - - - - - - - - - - - - - - - - - -
Resource typeUsed (this project)Used (all projects)Max
- - Status has not been reported on this quota usage record. Any resources limited by this quota record can not be allocated. -
- {{resourceType | humanizeQuotaResource : true}} - - - - {{namespaceUsageByClusterQuota[quota.metadata.name].used[resourceType] | usageWithUnits : resourceType}} - - - {{quota.status.total.used[resourceType] | usageWithUnits : resourceType}} - - {{specMax | usageWithUnits : resourceType}} - {{quota.status.total.hard[resourceType] | usageWithUnits : resourceType}} -
-
-
- -
-

- Project Quota {{quota.metadata.name}} -

-
{{quotaHelp}}
-
-
Scopes:
-
-
- {{scope | startCase}} - — {{scope | scopeDetails}} -
-
-
-
-
-
-

CPU Request

- -
-
-

Memory Request

- -
-
-

CPU Request

- -
-
-

Memory Request

- -
-
-

CPU Limit

- -
-
-

Memory Limit

- -
-
-
- -
- - - - - - - - - - - - - - - - - -
Resource typeUsedMax
- - Status has not been reported on this quota usage record. Any resources limited by this quota record can not be allocated. -
- {{resourceType | humanizeQuotaResource : true}} - - - - {{quota.status.used[resourceType] | usageWithUnits : resourceType}} - - {{specMax | usageWithUnits : resourceType}} - {{quota.status.hard[resourceType] | usageWithUnits : resourceType}} -
-
-
- - -
-

Limit Range

-
{{limitRangeHelp}}
-

{{emptyMessageLimitRanges}}

-
- -
-

- Limit Range {{limitRangeName}} -

-
{{limitRangeHelp}}
-
- - - - - - - - - - - - - - - - - - - - - -
Resource type - - Min - - - - - Max - - - - Default - - Request - - - - Default - - Limit - - - - Max Limit/Request - - Ratio - - -
{{limit.type}} {{type | computeResourceLabel : true}}{{(typeLimits.min | usageWithUnits : type) || "—"}}{{(typeLimits.max | usageWithUnits : type) || "—"}}{{(typeLimits.defaultRequest | usageWithUnits : type) || "—"}}{{(typeLimits["default"] | usageWithUnits : type) || "—"}}{{typeLimits.maxLimitRequestRatio || "—"}}
-
-
-
-
-
-
-
-
-
diff --git a/dist/scripts/templates.js b/dist/scripts/templates.js index 4e3e8a979b..b74e3b1f8e 100644 --- a/dist/scripts/templates.js +++ b/dist/scripts/templates.js @@ -557,85 +557,6 @@ angular.module('openshiftConsoleTemplates', []).run(['$templateCache', function( ); - $templateCache.put('views/_settings-general-info.html', - "

General information

\n" + - "
\n" + - "
\n" + - "
\n" + - "Name:\n" + - "
\n" + - "
\n" + - "{{projectName}}\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "Display Name:\n" + - "
\n" + - "
\n" + - "
\n" + - "{{project | displayName: true}}\n" + - "
\n" + - "
\n" + - "No display name\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
Description:
\n" + - "
\n" + - "
\n" + - "\n" + - "
\n" + - "
\n" + - "No description\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "\n" + - "
\n" + - "
{{projectName}}
\n" + - "
\n" + - "
\n" + - "
\n" + - "\n" + - "
\n" + - "
\n" + - "\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "\n" + - "
\n" + - "
\n" + - "\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "
\n" + - "\n" + - "\n" + - "
\n" + - "
\n" + - "
\n" + - "
" - ); - - $templateCache.put('views/_sidebar.html', "