
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
41 lines
1.2 KiB
JavaScript
41 lines
1.2 KiB
JavaScript
/**=========================================================
|
|
* Module: Services
|
|
* Visualizer for services
|
|
=========================================================*/
|
|
|
|
function ServiceController() {
|
|
}
|
|
|
|
ServiceController.prototype.getData = function(dataId) {
|
|
this.scope.loading = true;
|
|
this.k8sApi.getServices(dataId).success(angular.bind(this, function(data) {
|
|
this.scope.service = data;
|
|
this.scope.loading = false;
|
|
})).error(angular.bind(this, this.handleError));
|
|
};
|
|
|
|
ServiceController.prototype.handleError = function(data, status, headers, config) {
|
|
console.log("Error (" + status + "): " + data);
|
|
this.scope.loading = false;
|
|
};
|
|
|
|
app.controller('ServiceCtrl', [
|
|
'$scope',
|
|
'$routeParams',
|
|
'k8sApi',
|
|
'$location',
|
|
function($scope, $routeParams, k8sApi, $location) {
|
|
$scope.controller = new ServiceController();
|
|
$scope.controller.k8sApi = k8sApi;
|
|
$scope.controller.scope = $scope;
|
|
$scope.controller.getData($routeParams.serviceId);
|
|
|
|
$scope.go = function(d) { $location.path('/dashboard/services/' + d.id); }
|
|
|
|
$scope.moreClick = function(d, e) {
|
|
$location.path('/dashboard/services/' + d.id);
|
|
e.stopPropagation();
|
|
}
|
|
}
|
|
]);
|