()
| 638 | } |
| 639 | |
| 640 | function refreshSystem() { |
| 641 | return $http.get(urlbase + '/system/status').success(function (data) { |
| 642 | $scope.myID = data.myID; |
| 643 | $scope.system = data; |
| 644 | |
| 645 | if ($scope.reportDataPreviewVersion === '') { |
| 646 | $scope.reportDataPreviewVersion = $scope.system.urVersionMax; |
| 647 | } |
| 648 | |
| 649 | var listenersFailed = []; |
| 650 | var listenersRunning = []; |
| 651 | for (var address in data.connectionServiceStatus) { |
| 652 | if (data.connectionServiceStatus[address].error) { |
| 653 | listenersFailed.push(address + ": " + data.connectionServiceStatus[address].error); |
| 654 | } else { |
| 655 | listenersRunning.push(address); |
| 656 | } |
| 657 | } |
| 658 | $scope.listenersFailed = listenersFailed; |
| 659 | $scope.listenersRunning = listenersRunning; |
| 660 | $scope.listenersTotal = $scope.sizeOf(data.connectionServiceStatus); |
| 661 | |
| 662 | var discoveryFailed = []; |
| 663 | var discoveryRunning = []; |
| 664 | for (var disco in data.discoveryStatus) { |
| 665 | if (data.discoveryStatus[disco] && data.discoveryStatus[disco].error) { |
| 666 | discoveryFailed.push(disco + ": " + data.discoveryStatus[disco].error); |
| 667 | } else { |
| 668 | discoveryRunning.push(disco); |
| 669 | } |
| 670 | } |
| 671 | $scope.discoveryFailed = discoveryFailed; |
| 672 | $scope.discoveryRunning = discoveryRunning; |
| 673 | $scope.discoveryTotal = $scope.sizeOf(data.discoveryStatus); |
| 674 | |
| 675 | refreshNoAuthWarning(); |
| 676 | |
| 677 | console.log("refreshSystem", data); |
| 678 | }).error($scope.emitHTTPError); |
| 679 | } |
| 680 | |
| 681 | $scope.isAuthEnabled = function () { |
| 682 | // This function should match IsAuthEnabled() in guiconfiguration.go |
no test coverage detected