提交 a13b64d3 编写于 作者: F Floran Brutel

Use event system to alert on disconnection

上级 fb805606
...@@ -10,7 +10,6 @@ function GlancesController($scope, $timeout, GlancesStats, REFRESH_TIME, Hotkeys ...@@ -10,7 +10,6 @@ function GlancesController($scope, $timeout, GlancesStats, REFRESH_TIME, Hotkeys
data.isLinux = data.stats['system']['os_name'] === 'Linux'; data.isLinux = data.stats['system']['os_name'] === 'Linux';
data.isMac = data.stats['system']['os_name'] === 'Darwin'; data.isMac = data.stats['system']['os_name'] === 'Darwin';
data.isWindows = data.stats['system']['os_name'] === 'Windows'; data.isWindows = data.stats['system']['os_name'] === 'Windows';
vm.is_disconnected = false;
$scope.$broadcast('data_refreshed', data); $scope.$broadcast('data_refreshed', data);
vm.dataLoaded = true; vm.dataLoaded = true;
...@@ -19,7 +18,7 @@ function GlancesController($scope, $timeout, GlancesStats, REFRESH_TIME, Hotkeys ...@@ -19,7 +18,7 @@ function GlancesController($scope, $timeout, GlancesStats, REFRESH_TIME, Hotkeys
}; };
var refreshDataError = function() { var refreshDataError = function() {
vm.is_disconnected = true; $scope.$broadcast('is_disconnected');
nextLoad(); nextLoad();
}; };
......
...@@ -19,5 +19,10 @@ function GlancesPluginSystemController($scope) { ...@@ -19,5 +19,10 @@ function GlancesPluginSystemController($scope) {
vm.os.name = stats['os_name']; vm.os.name = stats['os_name'];
vm.os.version = stats['os_version']; vm.os.version = stats['os_version'];
vm.humanReadableName = stats['hr_name']; vm.humanReadableName = stats['hr_name'];
vm.isDisconnected = false;
});
$scope.$on('is_disconnected', function() {
vm.isDisconnected = true;
}); });
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册