Эх сурвалжийг харах

Panel - Logging: Add PineAP Logs loading indicator

DSR! 4 жил өмнө
parent
commit
9e5ead4145

+ 6 - 3
src/pineapple/modules/Logging/js/module.js

@@ -6,6 +6,7 @@ registerController('PineAPLogController', ['$api', '$scope', '$timeout', functio
     $scope.locationModified = false;
     $scope.orderByName = 'log_time';
     $scope.reverseSort = true;
+    $scope.loadingPineapLog = false;
 
     $scope.checkboxOptions = {
         probes: true,
@@ -16,10 +17,12 @@ registerController('PineAPLogController', ['$api', '$scope', '$timeout', functio
 
     $scope.refreshLog = (function() {
         $scope.log = [];
+        $scope.loadingPineapLog = true;
         $api.request({
             module: 'Logging',
             action: 'getPineapLog'
         }, function(response) {
+            $scope.loadingPineapLog = false;
             if (response.error === undefined) {
                 $scope.log = response.pineap_log;
                 $scope.applyFilter();
@@ -142,7 +145,7 @@ registerController('PineAPLogController', ['$api', '$scope', '$timeout', functio
 }]);
 
 registerController('SyslogController', ['$api', '$scope', function($api, $scope) {
-    $scope.syslog = 'Loading..';
+    $scope.syslog = 'Loading...';
 
     $scope.refreshLog = (function() {
         $api.request({
@@ -159,7 +162,7 @@ registerController('SyslogController', ['$api', '$scope', function($api, $scope)
 }]);
 
 registerController('DmesgController', ['$api', '$scope', function($api, $scope) {
-    $scope.dmesg = 'Loading..';
+    $scope.dmesg = 'Loading...';
 
     $scope.refreshLog = (function() {
         $api.request({
@@ -176,7 +179,7 @@ registerController('DmesgController', ['$api', '$scope', function($api, $scope)
 }]);
 
 registerController('ReportingLogController', ['$api', '$scope', function($api, $scope) {
-    $scope.reportingLog = "";
+    $scope.reportingLog = '';
 
     $scope.refreshLog = (function() {
         $api.request({

+ 4 - 0
src/pineapple/modules/Logging/module.html

@@ -43,6 +43,10 @@
                 <button class="btn btn-default" ng-click="clearLog()">Clear Log</button>
                 <button class="btn btn-default" ng-click="downloadLog()">Download Log</button>
             </div>
+            <div class="center-block" ng-show="loadingPineapLog">
+                <img class="center-block" src="img/throbber.gif">
+                <br>
+            </div>
             <div class="table-responsive">
                 <table class="table table-striped table-bordered table-hover" ng-hide="(log.length == 0)">
                     <thead>