Skip to content
Snippets Groups Projects
Commit 834c7869 authored by Leonardo Menezes's avatar Leonardo Menezes
Browse files

call data service disconnect on navbar disconnect

parent 9653cb52
No related branches found
No related tags found
No related merge requests found
...@@ -703,6 +703,14 @@ angular.module('cerebro').controller('NavbarController', ['$scope', '$http', ...@@ -703,6 +703,14 @@ angular.module('cerebro').controller('NavbarController', ['$scope', '$http',
$scope.refreshInterval = interval; $scope.refreshInterval = interval;
}; };
$scope.disconnect = function() {
$scope.status = undefined;
$scope.cluster_name = undefined;
$scope.host = undefined;
$scope.username = undefined;
DataService.disconnect();
};
$scope.$watch( $scope.$watch(
function() { function() {
return RefreshService.lastUpdate(); return RefreshService.lastUpdate();
......
<nav class="navbar navbar-default navbar-fixed-top navbar-{{status}}" ng-controller="NavbarController"> <nav class="navbar navbar-default navbar-fixed-top navbar-{{status}}" ng-controller="NavbarController" ng-show="host">
<div class="container-fluid"> <div class="container-fluid">
<div class="navbar-header"> <div class="navbar-header">
<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar">
...@@ -81,7 +81,9 @@ ...@@ -81,7 +81,9 @@
</a> </a>
</li> </li>
<li> <li>
<a href="#connect" class="nav-item nav-link hidden-xs"><i class="fa fa-plug"></i></a> <a href="#connect" class="nav-item nav-link hidden-xs" ng-click="disconnect()">
<i class="fa fa-plug"></i>
</a>
</li> </li>
<li> <li>
<form action="auth/logout" method="POST" ng-show="username"> <form action="auth/logout" method="POST" ng-show="username">
......
...@@ -13,6 +13,14 @@ angular.module('cerebro').controller('NavbarController', ['$scope', '$http', ...@@ -13,6 +13,14 @@ angular.module('cerebro').controller('NavbarController', ['$scope', '$http',
$scope.refreshInterval = interval; $scope.refreshInterval = interval;
}; };
$scope.disconnect = function() {
$scope.status = undefined;
$scope.cluster_name = undefined;
$scope.host = undefined;
$scope.username = undefined;
DataService.disconnect();
};
$scope.$watch( $scope.$watch(
function() { function() {
return RefreshService.lastUpdate(); return RefreshService.lastUpdate();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment