kubernetes/www/master/components/dashboard/js/modules/controllers/serviceController.js
Patrick Reilly 4c4e7b2dd5 Update dashboard breadcrumbs
- Update back buttons
- Ignore duplicated README.md
- Rename /minions to /nodes
- Deactivate more buttons
- Updates to list selection and node detail page
2015-05-15 20:38:15 -07:00

37 lines
1.0 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.doTheBack = function() { window.history.back(); };
}
]);