From d7b5a09cb88d92b5a59d56d6dc1cd33f9c93d9b2 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 22 Nov 2022 13:23:22 +0100 Subject: [PATCH 1/8] Chec in test_wasmtensorflow.js Signed-off-by: Marcel Klehr --- src/test_wasmtensorflow.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test_wasmtensorflow.js b/src/test_wasmtensorflow.js index a78151ff..e9351adf 100644 --- a/src/test_wasmtensorflow.js +++ b/src/test_wasmtensorflow.js @@ -1,4 +1,4 @@ -let tf = require('@tensorflow/tfjs') +const tf = require('@tensorflow/tfjs') require('@tensorflow/tfjs-backend-wasm') tf.setBackend('wasm') From 89cfdfa3ecc8f64b0a996f78a2ab243f00942a1e Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Tue, 22 Nov 2022 13:38:49 +0100 Subject: [PATCH 2/8] Add bg job mode status in admin settings see #510 Signed-off-by: Marcel Klehr --- appinfo/routes.php | 1 + lib/Controller/AdminController.php | 10 +++++++++- src/components/ViewAdmin.vue | 26 +++++++++++++++++++------- 3 files changed, 29 insertions(+), 8 deletions(-) diff --git a/appinfo/routes.php b/appinfo/routes.php index be7efa0f..c9cdbcf4 100644 --- a/appinfo/routes.php +++ b/appinfo/routes.php @@ -33,6 +33,7 @@ ['name' => 'admin#nodejs', 'url' => '/admin/nodejs', 'verb' => 'GET'], ['name' => 'admin#libtensorflow', 'url' => '/admin/libtensorflow', 'verb' => 'GET'], ['name' => 'admin#wasmtensorflow', 'url' => '/admin/wasmtensorflow', 'verb' => 'GET'], + ['name' => 'admin#cron', 'url' => '/admin/cron', 'verb' => 'GET'], ['name' => 'admin#get_setting', 'url' => '/admin/settings/{setting}', 'verb' => 'GET'], ['name' => 'admin#set_setting', 'url' => '/admin/settings/{setting}', 'verb' => 'PUT'], ], diff --git a/lib/Controller/AdminController.php b/lib/Controller/AdminController.php index c4855077..c9d23335 100644 --- a/lib/Controller/AdminController.php +++ b/lib/Controller/AdminController.php @@ -13,6 +13,7 @@ use OCP\AppFramework\Http\JSONResponse; use OCP\BackgroundJob\IJobList; use OCP\DB\Exception; +use OCP\IConfig; use OCP\IRequest; class AdminController extends Controller { @@ -22,8 +23,9 @@ class AdminController extends Controller { private QueueService $queue; private FaceClusterMapper $clusterMapper; private FaceDetectionMapper $detectionMapper; + private IConfig $config; - public function __construct(string $appName, IRequest $request, TagManager $tagManager, IJobList $jobList, SettingsService $settingsService, QueueService $queue, FaceClusterMapper $clusterMapper, FaceDetectionMapper $detectionMapper) { + public function __construct(string $appName, IRequest $request, TagManager $tagManager, IJobList $jobList, SettingsService $settingsService, QueueService $queue, FaceClusterMapper $clusterMapper, FaceDetectionMapper $detectionMapper, IConfig $config) { parent::__construct($appName, $request); $this->tagManager = $tagManager; $this->jobList = $jobList; @@ -31,6 +33,7 @@ public function __construct(string $appName, IRequest $request, TagManager $tagM $this->queue = $queue; $this->clusterMapper = $clusterMapper; $this->detectionMapper = $detectionMapper; + $this->config = $config; } public function reset(): JSONResponse { @@ -160,6 +163,11 @@ public function wasmtensorflow(): JSONResponse { return new JSONResponse(['wasmtensorflow' => true]); } + public function cron(): JSONResponse { + $cron = $this->config->getAppValue('core', 'backgroundjobs_mode', ''); + return new JSONResponse(['cron' => $cron]); + } + public function setSetting(string $setting, $value): JSONResponse { try { $this->settingsService->setSetting($setting, $value); diff --git a/src/components/ViewAdmin.vue b/src/components/ViewAdmin.vue index 072f50ca..a60a904f 100644 --- a/src/components/ViewAdmin.vue +++ b/src/components/ViewAdmin.vue @@ -18,14 +18,19 @@ {{ t('recognize', 'Could not execute the Node.js binary. You may need to set the path to a working binary manually.') }} -