admin: check for preview generator

Signed-off-by: Varun Patil <radialapps@gmail.com>
pull/767/head
Varun Patil 2023-08-03 10:11:39 -07:00
parent 28634a3f30
commit 2f6e80c4de
6 changed files with 22 additions and 3 deletions

View File

@ -87,6 +87,7 @@ class OtherController extends GenericApiController
'albums_enabled' => Util::albumsIsEnabled(),
'facerecognition_installed' => Util::facerecognitionIsInstalled(),
'facerecognition_enabled' => Util::facerecognitionIsEnabled(),
'preview_generator_enabled' => Util::previewGeneratorIsEnabled(),
'timeline_path' => $getAppConfig('timelinePath', 'EMPTY'),
'folders_path' => $getAppConfig('foldersPath', '/'),

View File

@ -137,6 +137,16 @@ class Util
return version_compare($v, '0.9.10-beta.2', '>=');
}
/**
* Check if preview generator is installed.
*/
public static function previewGeneratorIsEnabled(): bool
{
$appManager = \OC::$server->get(IAppManager::class);
return $appManager->isEnabledForUser('previewgenerator');
}
/**
* Check if link sharing is allowed.
*/

View File

@ -1,5 +1,5 @@
<template>
<div class="outer" v-if="loaded">
<div class="outer" v-if="config && sconfig">
<XLoadingIcon class="loading-icon" v-show="loading" />
<component
@ -41,7 +41,6 @@ export default defineComponent({
name: 'Admin',
data: () => ({
loaded: false,
loading: 0,
status: null as ISystemStatus | null,
@ -63,7 +62,6 @@ export default defineComponent({
this.loading++;
const res = await axios.get<ISystemConfig>(API.SYSTEM_CONFIG(null));
this.config = res.data;
this.loaded = true;
} catch (e) {
showError(JSON.stringify(e));
} finally {

View File

@ -23,6 +23,14 @@
<NcNoteCard v-if="sconfig.facerecognition_installed" type="success">
{{ t('memories', 'Face Recognition is installed and enabled') }}
</NcNoteCard>
<NcNoteCard :type="sconfig.preview_generator_enabled ? 'success' : 'error'">
{{
sconfig.preview_generator_enabled
? t('memories', 'Preview generator is installed and enabled. Additional configuration may still be required.')
: t('memories', 'Preview generator is not installed and configured. This may make Memories very slow.')
}}
</NcNoteCard>
</div>
</template>

View File

@ -107,6 +107,7 @@ class StaticConfig {
albums_enabled: false,
facerecognition_installed: false,
facerecognition_enabled: false,
preview_generator_enabled: false,
timeline_path: '',
folders_path: '',

View File

@ -241,6 +241,7 @@ export type IConfig = {
albums_enabled: boolean;
facerecognition_installed: boolean;
facerecognition_enabled: boolean;
preview_generator_enabled: boolean;
timeline_path: string;
folders_path: string;