mirror of
https://github.com/grocy/grocy.git
synced 2025-08-18 03:25:50 +00:00
Auto reload the current page when the database has changed and when idling (closes #59)
This commit is contained in:
23
controllers/SystemApiController.php
Normal file
23
controllers/SystemApiController.php
Normal 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()
|
||||
));
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user