diff --git a/lib/Settings/AdminSettings.php b/lib/Settings/AdminSettings.php
index 0b9428232..cbb291818 100644
--- a/lib/Settings/AdminSettings.php
+++ b/lib/Settings/AdminSettings.php
@@ -8,6 +8,7 @@
namespace OCA\Recognize\Settings;
use OCA\Recognize\Service\SettingsService;
+use OCP\App\IAppManager;
use OCP\AppFramework\Http\TemplateResponse;
use OCP\AppFramework\Services\IInitialState;
use OCP\Settings\ISettings;
@@ -15,10 +16,12 @@
class AdminSettings implements ISettings {
private IInitialState $initialState;
private SettingsService $settingsService;
+ private IAppManager $appManager;
- public function __construct(IInitialState $initialState, SettingsService $settingsService) {
+ public function __construct(IInitialState $initialState, SettingsService $settingsService, IAppManager $appManager) {
$this->initialState = $initialState;
$this->settingsService = $settingsService;
+ $this->appManager = $appManager;
}
/**
@@ -32,6 +35,9 @@ public function getForm(): TemplateResponse {
$modelsDownloaded = file_exists($modelsPath);
$this->initialState->provideInitialState('modelsDownloaded', $modelsDownloaded);
+ $tagsEnabled = $this->appManager->isEnabledForUser('systemtags');
+ $this->initialState->provideInitialState('tagsEnabled', $tagsEnabled);
+
return new TemplateResponse('recognize', 'admin');
}
diff --git a/src/components/ViewAdmin.vue b/src/components/ViewAdmin.vue
index ffcb53c0e..4f335e421 100644
--- a/src/components/ViewAdmin.vue
+++ b/src/components/ViewAdmin.vue
@@ -15,6 +15,12 @@
{{ t('recognize', 'The machine learning models still need to be downloaded.') }}
+
+ {{ t('recognize', 'The systemtags app is enabled.') }}
+
+
+ {{ t('recognize', 'The systemtags app is currently disabled. Some features of this app will not work.') }}
+
{{ t('recognize', 'Could not execute the Node.js binary. You may need to set the path to a working binary manually.') }}
@@ -429,6 +435,7 @@ export default {
movinetJobs: null,
musicnnJobs: null,
clusterFacesJobs: null,
+ tagsEnabled: null,
}
},
@@ -456,6 +463,7 @@ export default {
},
async created() {
this.modelsDownloaded = loadState('recognize', 'modelsDownloaded')
+ this.tagsEnabled = loadState('recognize', 'tagsEnabled')
this.getCount()
this.getAVX()
this.getPlatform()
diff --git a/src/model-manager.js b/src/model-manager.js
index fe20c27ab..c96945e08 100644
--- a/src/model-manager.js
+++ b/src/model-manager.js
@@ -8,7 +8,7 @@ exports.downloadAll = async () => {
await download(
`https://github.com/nextcloud/recognize/archive/${ref}.tar.gz`,
path.resolve(__dirname, '..'),
- { filename: 'recognize.tar.gz' }
+ { filename: 'recognize.tar.gz' },
)
await new Promise(resolve =>
tar.x({
@@ -18,6 +18,6 @@ exports.downloadAll = async () => {
filter(path, entry) {
return path.includes('models')
},
- }, [], resolve)
+ }, [], resolve),
)
}