Auto reload the current page when the database has changed and when idling (closes #59)

This commit is contained in:
Bernd Bestel
2018-09-24 13:53:18 +02:00
parent 8540fc44f3
commit 2a0ec30bb0
6 changed files with 114 additions and 0 deletions

View File

@@ -0,0 +1,23 @@
<?php
namespace Grocy\Controllers;
use \Grocy\Services\DatabaseService;
class SystemApiController extends BaseApiController
{
public function __construct(\Slim\Container $container)
{
parent::__construct($container);
$this->DatabaseService = new DatabaseService();
}
protected $DatabaseService;
public function GetDbChangedTime(\Slim\Http\Request $request, \Slim\Http\Response $response, array $args)
{
return $this->ApiResponse(array(
'changed_time' => $this->DatabaseService->GetDbChangedTime()
));
}
}