
remove node modules make new data file for web ui initial commit of dashboard switch back to non SSL request move port splitting to common place; add to node resource location Signed-off-by: Patrick Reilly <patrick@kismatic.io> various path fixes make svg path relative work around missing mime type Signed-off-by: Patrick Reilly <patrick@kismatic.io> fix paths fix karma path remove bad protractor test
43 lines
1.4 KiB
JavaScript
43 lines
1.4 KiB
JavaScript
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 + '/minions', query); };
|
|
|
|
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']);
|
|
}
|
|
});
|