From f1a13c4ee5ef38440673e87d1a40cde9662cf446 Mon Sep 17 00:00:00 2001 From: Siteshwar Vashisht Date: Sat, 12 Oct 2013 17:47:43 +0530 Subject: [PATCH] Updated functions tab --- share/tools/web_config/index.html | 2 +- .../tools/web_config/partials/functions.html | 12 ++++---- share/tools/web_config/webconfig.js | 28 +++++++++++++++++-- 3 files changed, 32 insertions(+), 10 deletions(-) diff --git a/share/tools/web_config/index.html b/share/tools/web_config/index.html index 888122cf2..e927ef204 100644 --- a/share/tools/web_config/index.html +++ b/share/tools/web_config/index.html @@ -133,7 +133,7 @@ function interpret_color(str) {
- fish

+ fish

colors
diff --git a/share/tools/web_config/partials/functions.html b/share/tools/web_config/partials/functions.html index 365b6f6cf..8fd2f0365 100644 --- a/share/tools/web_config/partials/functions.html +++ b/share/tools/web_config/partials/functions.html @@ -1,17 +1,15 @@ -
-
-
+
+
{{ func }}
-
-
-
+
+
+
{{ functionDefinition }}
-
diff --git a/share/tools/web_config/webconfig.js b/share/tools/web_config/webconfig.js index c3d232e1a..59d9bffd2 100644 --- a/share/tools/web_config/webconfig.js +++ b/share/tools/web_config/webconfig.js @@ -577,10 +577,34 @@ webconfig.controller("variablesController", function($scope, $http) { $scope.fetchVariables(); }); -webconfig.controller("historyController", function($scope, $http) { +webconfig.controller("historyController", function($scope, $http, $timeout) { + $scope.historyItems = []; + $scope.historySize = 0; + // Stores items which are yet to be added in history items + $scope.remainingItems = []; + + // Populate history items in parts + $scope.loadHistory = function() { + if ($scope.remainingItems.length <= 0) { + $scope.loadingText = ""; + return; + } + + var to_load = $scope.remainingItems.splice(0, 100); + for (i in to_load) { + $scope.historyItems.push(to_load[i]); + } + + $scope.loadingText = "Loading " + $scope.historyItems.length + "/" + $scope.historySize; + $timeout($scope.loadHistory, 100); + } + + // Get history from server $scope.fetchHistory = function() { $http.get("/history/").success(function(data, status, headers, config) { - $scope.historyItems = data; + $scope.historySize = data.length; + $scope.remainingItems = data; + $timeout($scope.loadHistory, 100); })}; $scope.deleteHistoryItem = function(item) {