13 namespace Fossology\UI\Api\Controllers;
17 use Psr\Http\Message\ServerRequestInterface;
28 public function getDatabaseContents($request, $response, $args)
32 $dashboardPlugin = $this->restHelper->getPlugin(
'dashboard');
35 $dashboardPlugin->DatabaseContentsRow(
"users", _(
"Users"),
true),
37 $dashboardPlugin->DatabaseContentsRow(
"upload", _(
"Uploads"),
true),
39 $dashboardPlugin->DatabaseContentsRow(
"pfile", _(
"Unique files referenced in repository"),
true),
41 $dashboardPlugin->DatabaseContentsRow(
"uploadtree_%", _(
"Individual Files"),
true),
43 $dashboardPlugin->DatabaseContentsRow(
"license_file", _(
"Discovered Licenses"),
true),
45 $dashboardPlugin->DatabaseContentsRow(
"copyright", _(
"Copyrights/URLs/Emails"),
true)
47 return $response->withJson($res, 200);
59 public function getDiskSpaceUsage($request, $response, $args)
63 $dashboardPlugin = $this->restHelper->getPlugin(
'dashboard');
64 $res = $dashboardPlugin->DiskFree(
true);
65 return $response->withJson($res, 200);
77 public function getPhpInfo($request, $response, $args)
81 $dashboardPlugin = $this->restHelper->getPlugin(
'dashboard');
82 $res = $dashboardPlugin->GetPHPInfoTable(
true);
83 return $response->withJson($res, 200);
95 public function getDatabaseMetrics($request, $response, $args)
99 $dashboardPlugin = $this->restHelper->getPlugin(
'dashboard');
100 $res = $dashboardPlugin->DatabaseMetrics(
true);
101 return $response->withJson($res, 200);
113 public function getActiveQueries($request, $response, $args)
117 $dashboardPlugin = $this->restHelper->getPlugin(
'dashboard');
119 $dashboardPlugin->pgVersion = pg_version(
$PG_CONN);
120 $res = $dashboardPlugin->DatabaseQueries(
true);
122 foreach ($res as &$value) {
123 $value[
'pid'] = intval($value[
'pid']);
125 return $response->withJson($res, 200);
Controller for OverviewController model.
Base controller for REST calls.
Override Slim response for withJson function.
foreach($Options as $Option=> $OptVal) if(0==$reference_flag &&0==$nomos_flag) $PG_CONN