Skip to content

Commit

Permalink
Remove unused v1beta2 references from web ui
Browse files Browse the repository at this point in the history
  • Loading branch information
bcbroussard committed Jun 4, 2015
1 parent 1590403 commit 0ec8b9b
Show file tree
Hide file tree
Showing 16 changed files with 76 additions and 218 deletions.
137 changes: 45 additions & 92 deletions pkg/ui/datafile.go

Large diffs are not rendered by default.

77 changes: 15 additions & 62 deletions www/app/assets/js/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,7 @@ angular.module("kubernetesApp.config", [])

.constant("ENV", {
"/": {
"k8sApiServer": "/api/v1beta2",
"k8sApiv1beta3Server": "/api/v1beta3",
"k8sApiServer": "/api/v1beta3",
"k8sDataServer": "/cluster",
"k8sDataPollMinIntervalSec": 10,
"k8sDataPollMaxIntervalSec": 120,
Expand Down Expand Up @@ -569,51 +568,6 @@ app.controller('TabCtrl', [
})();

app.provider('k8sApi',
function() {

var urlBase = '';

this.setUrlBase = function(value) { urlBase = value; };

var _get = function($http, baseUrl, query) {
var _fullUrl = baseUrl;
if (query !== undefined) {
_fullUrl += '/' + query;
}

return $http.get(_fullUrl);
};

this.$get = ["$http", "$q", function($http, $q) {
var api = {};

api.getUrlBase = function() { return urlBase; };

api.getPods = function(query) { return _get($http, urlBase + '/pods', query); };

api.getMinions = function(query) { return _get($http, urlBase + '/nodes', query); };

api.getNodes = api.getMinions;

api.getServices = function(query) { return _get($http, urlBase + '/services', query); };

api.getReplicationControllers = function(query) {
return _get($http, urlBase + '/replicationControllers', query)
};

api.getEvents = function(query) { return _get($http, urlBase + '/events', query); };

return api;
}];
})
.config(["k8sApiProvider", "ENV", function(k8sApiProvider, ENV) {
if (ENV && ENV['/'] && ENV['/']['k8sApiServer']) {
var proxy = ENV['/']['cAdvisorProxy'] || '';
k8sApiProvider.setUrlBase(proxy + ENV['/']['k8sApiServer']);
}
}]);

app.provider('k8sv1Beta3Api',
function() {

var urlBase = '';
Expand Down Expand Up @@ -656,10 +610,9 @@ app.provider('k8sv1Beta3Api',
return api;
}];
})
.config(["k8sv1Beta3ApiProvider", "ENV", function(k8sv1Beta3ApiProvider, ENV) {
if (ENV && ENV['/'] && ENV['/']['k8sApiv1beta3Server']) {
var proxy = ENV['/']['cAdvisorProxy'] || '';
k8sv1Beta3ApiProvider.setUrlBase(proxy + ENV['/']['k8sApiv1beta3Server']);
.config(["k8sApiProvider", "ENV", function(k8sApiProvider, ENV) {
if (ENV && ENV['/'] && ENV['/']['k8sApiServer']) {
k8sApiProvider.setUrlBase(ENV['/']['k8sApiServer']);
}
}]);

Expand Down Expand Up @@ -860,7 +813,7 @@ app.provider('k8sv1Beta3Api',
app.controller('cAdvisorController', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'lodash',
'cAdvisorService',
'$q',
Expand Down Expand Up @@ -1059,7 +1012,7 @@ app.controller('GroupCtrl', [
'$route',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
'$location',
'lodash',
Expand Down Expand Up @@ -1309,7 +1262,7 @@ angular.module('kubernetesApp.components.dashboard', [])
app.controller('ListEventsCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
'$filter',
function($scope, $routeParams, k8sApi, $location, $filter) {
Expand Down Expand Up @@ -1395,7 +1348,7 @@ app.controller('ListEventsCtrl', [
app.controller('ListMinionsCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
function($scope, $routeParams, k8sApi, $location) {
'use strict';
Expand Down Expand Up @@ -1465,7 +1418,7 @@ app.controller('ListMinionsCtrl', [
app.controller('ListPodsCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'lodash',
'$location',
function($scope, $routeParams, k8sApi, lodash, $location) {
Expand Down Expand Up @@ -1600,7 +1553,7 @@ app.controller('ListPodsCtrl', [
app.controller('ListReplicationControllersCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
function($scope, $routeParams, k8sApi, $location) {
'use strict';
Expand Down Expand Up @@ -1697,7 +1650,7 @@ app.controller('ListServicesCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
'$location',
function($scope, $interval, $routeParams, k8sApi, $rootScope, $location) {
Expand Down Expand Up @@ -1806,7 +1759,7 @@ app.controller('NodeCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
'use strict';
Expand Down Expand Up @@ -1840,7 +1793,7 @@ app.controller('PodCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
'use strict';
Expand Down Expand Up @@ -1889,7 +1842,7 @@ ReplicationController.prototype.handleError = function(data, status, headers, co
app.controller('ReplicationControllerCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
function($scope, $routeParams, k8sApi) {
$scope.controller = new ReplicationController();
$scope.controller.k8sApi = k8sApi;
Expand Down Expand Up @@ -1926,7 +1879,7 @@ ServiceController.prototype.handleError = function(data, status, headers, config
app.controller('ServiceCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
function($scope, $routeParams, k8sApi, $location) {
$scope.controller = new ServiceController();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
app.controller('cAdvisorController', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'lodash',
'cAdvisorService',
'$q',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ app.controller('GroupCtrl', [
'$route',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
'$location',
'lodash',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
app.controller('ListEventsCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
'$filter',
function($scope, $routeParams, k8sApi, $location, $filter) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
app.controller('ListMinionsCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
function($scope, $routeParams, k8sApi, $location) {
'use strict';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
app.controller('ListPodsCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'lodash',
'$location',
function($scope, $routeParams, k8sApi, lodash, $location) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
app.controller('ListReplicationControllersCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
function($scope, $routeParams, k8sApi, $location) {
'use strict';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ app.controller('ListServicesCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
'$location',
function($scope, $interval, $routeParams, k8sApi, $rootScope, $location) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ app.controller('NodeCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
'use strict';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ app.controller('PodCtrl', [
'$scope',
'$interval',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$rootScope',
function($scope, $interval, $routeParams, k8sApi, $rootScope) {
'use strict';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ReplicationController.prototype.handleError = function(data, status, headers, co
app.controller('ReplicationControllerCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
function($scope, $routeParams, k8sApi) {
$scope.controller = new ReplicationController();
$scope.controller.k8sApi = k8sApi;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ ServiceController.prototype.handleError = function(data, status, headers, config
app.controller('ServiceCtrl', [
'$scope',
'$routeParams',
'k8sv1Beta3Api',
'k8sApi',
'$location',
function($scope, $routeParams, k8sApi, $location) {
$scope.controller = new ServiceController();
Expand Down
3 changes: 1 addition & 2 deletions www/master/shared/config/development.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"k8sApiServer": "/api/v1beta2",
"k8sApiv1beta3Server": "/api/v1beta3",
"k8sApiServer": "/api/v1beta3",
"k8sDataServer": "/cluster",
"k8sDataPollMinIntervalSec": 10,
"k8sDataPollMaxIntervalSec": 120,
Expand Down
3 changes: 1 addition & 2 deletions www/master/shared/config/generated-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ angular.module("kubernetesApp.config", [])

.constant("ENV", {
"/": {
"k8sApiServer": "/api/v1beta2",
"k8sApiv1beta3Server": "/api/v1beta3",
"k8sApiServer": "/api/v1beta3",
"k8sDataServer": "/cluster",
"k8sDataPollMinIntervalSec": 10,
"k8sDataPollMaxIntervalSec": 120,
Expand Down
52 changes: 3 additions & 49 deletions www/master/shared/js/modules/services/k8sApiService.js
Original file line number Diff line number Diff line change
@@ -1,49 +1,4 @@
app.provider('k8sApi',
function() {

var urlBase = '';

this.setUrlBase = function(value) { urlBase = value; };

var _get = function($http, baseUrl, query) {
var _fullUrl = baseUrl;
if (query !== undefined) {
_fullUrl += '/' + query;
}

return $http.get(_fullUrl);
};

this.$get = function($http, $q) {
var api = {};

api.getUrlBase = function() { return urlBase; };

api.getPods = function(query) { return _get($http, urlBase + '/pods', query); };

api.getMinions = function(query) { return _get($http, urlBase + '/nodes', query); };

api.getNodes = api.getMinions;

api.getServices = function(query) { return _get($http, urlBase + '/services', query); };

api.getReplicationControllers = function(query) {
return _get($http, urlBase + '/replicationControllers', query)
};

api.getEvents = function(query) { return _get($http, urlBase + '/events', query); };

return api;
};
})
.config(function(k8sApiProvider, ENV) {
if (ENV && ENV['/'] && ENV['/']['k8sApiServer']) {
var proxy = ENV['/']['cAdvisorProxy'] || '';
k8sApiProvider.setUrlBase(proxy + ENV['/']['k8sApiServer']);
}
});

app.provider('k8sv1Beta3Api',
function() {

var urlBase = '';
Expand Down Expand Up @@ -86,9 +41,8 @@ app.provider('k8sv1Beta3Api',
return api;
};
})
.config(function(k8sv1Beta3ApiProvider, ENV) {
if (ENV && ENV['/'] && ENV['/']['k8sApiv1beta3Server']) {
var proxy = ENV['/']['cAdvisorProxy'] || '';
k8sv1Beta3ApiProvider.setUrlBase(proxy + ENV['/']['k8sApiv1beta3Server']);
.config(function(k8sApiProvider, ENV) {
if (ENV && ENV['/'] && ENV['/']['k8sApiServer']) {
k8sApiProvider.setUrlBase(ENV['/']['k8sApiServer']);
}
});

0 comments on commit 0ec8b9b

Please sign in to comment.