diff --git a/public/js/mru-info.js b/public/js/mru-info.js index 8c46397..b25e7c5 100644 --- a/public/js/mru-info.js +++ b/public/js/mru-info.js @@ -71,11 +71,9 @@ function mruInfo() { }); }, populateFeatureGrid(grid) { - console.debug(grid); const features = Alpine.store('mru'); const featureCols = Object.getOwnPropertyNames(Alpine.store('mru')).filter(name => aliasMap.has(name)); const featureVals = featureCols.map(col => {return {feature: aliasMap.get(col), value: features[col]}}); - console.debug(featureVals); new gridjs.Grid({ data: featureVals }).render(grid); diff --git a/src/Controllers/StatsController.php b/src/Controllers/StatsController.php index 668b5c5..4fe4732 100644 --- a/src/Controllers/StatsController.php +++ b/src/Controllers/StatsController.php @@ -12,6 +12,13 @@ class StatsController { require __DIR__.'/../Data/users.php'; } + public function all() { + $sql = "SELECT * FROM webapp.stats_general"; + $result = PgSql::getJson($sql); + + echo $result; + } + public function countTypes() { $sql = "SELECT * FROM webapp.stats_count_per_type"; $result = PgSql::getJson($sql); diff --git a/src/Routing/controls.php b/src/Routing/controls.php index 69a63fc..b6518c1 100644 --- a/src/Routing/controls.php +++ b/src/Routing/controls.php @@ -14,3 +14,4 @@ $router->map('GET', '/actions/requests/[i:id]?', 'MSFD\Controllers\ActionControl // STATS $router->map('GET', '/interface/stats/typecount', 'MSFD\Controllers\StatsController@countTypes', 'stat_types'); $router->map('GET', '/interface/stats/totalrows', 'MSFD\Controllers\StatsController@countTotal', 'stat_total'); +$router->map('GET', '/interface/stats/general', 'MSFD\Controllers\StatsController@all', 'stat_all'); diff --git a/src/Routing/routes.php b/src/Routing/routes.php index ee66a13..02398ed 100644 --- a/src/Routing/routes.php +++ b/src/Routing/routes.php @@ -26,3 +26,5 @@ $router->map('GET', '/geonetwork/getrecords', 'MSFD\Controllers\GeonetworkContro // Admin panel routes $router->map('GET', '/cp/fetch_user_list', 'MSFD\Controllers\AdminController@fetchUsers', 'users'); + + diff --git a/src/Views/main-statistics.php b/src/Views/main-statistics.php index ae923e9..b4e8493 100644 --- a/src/Views/main-statistics.php +++ b/src/Views/main-statistics.php @@ -1,22 +1,33 @@
-
-
-

Total Raw data Rows in database:

+
+

+ General +

+
+
+
+
+
+

+ Timeline +

+
+
+
+