admin: check for preview generator
Signed-off-by: Varun Patil <radialapps@gmail.com>pull/767/head
parent
28634a3f30
commit
2f6e80c4de
|
@ -87,6 +87,7 @@ class OtherController extends GenericApiController
|
||||||
'albums_enabled' => Util::albumsIsEnabled(),
|
'albums_enabled' => Util::albumsIsEnabled(),
|
||||||
'facerecognition_installed' => Util::facerecognitionIsInstalled(),
|
'facerecognition_installed' => Util::facerecognitionIsInstalled(),
|
||||||
'facerecognition_enabled' => Util::facerecognitionIsEnabled(),
|
'facerecognition_enabled' => Util::facerecognitionIsEnabled(),
|
||||||
|
'preview_generator_enabled' => Util::previewGeneratorIsEnabled(),
|
||||||
|
|
||||||
'timeline_path' => $getAppConfig('timelinePath', 'EMPTY'),
|
'timeline_path' => $getAppConfig('timelinePath', 'EMPTY'),
|
||||||
'folders_path' => $getAppConfig('foldersPath', '/'),
|
'folders_path' => $getAppConfig('foldersPath', '/'),
|
||||||
|
|
10
lib/Util.php
10
lib/Util.php
|
@ -137,6 +137,16 @@ class Util
|
||||||
return version_compare($v, '0.9.10-beta.2', '>=');
|
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.
|
* Check if link sharing is allowed.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<template>
|
<template>
|
||||||
<div class="outer" v-if="loaded">
|
<div class="outer" v-if="config && sconfig">
|
||||||
<XLoadingIcon class="loading-icon" v-show="loading" />
|
<XLoadingIcon class="loading-icon" v-show="loading" />
|
||||||
|
|
||||||
<component
|
<component
|
||||||
|
@ -41,7 +41,6 @@ export default defineComponent({
|
||||||
name: 'Admin',
|
name: 'Admin',
|
||||||
|
|
||||||
data: () => ({
|
data: () => ({
|
||||||
loaded: false,
|
|
||||||
loading: 0,
|
loading: 0,
|
||||||
|
|
||||||
status: null as ISystemStatus | null,
|
status: null as ISystemStatus | null,
|
||||||
|
@ -63,7 +62,6 @@ export default defineComponent({
|
||||||
this.loading++;
|
this.loading++;
|
||||||
const res = await axios.get<ISystemConfig>(API.SYSTEM_CONFIG(null));
|
const res = await axios.get<ISystemConfig>(API.SYSTEM_CONFIG(null));
|
||||||
this.config = res.data;
|
this.config = res.data;
|
||||||
this.loaded = true;
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
showError(JSON.stringify(e));
|
showError(JSON.stringify(e));
|
||||||
} finally {
|
} finally {
|
||||||
|
|
|
@ -23,6 +23,14 @@
|
||||||
<NcNoteCard v-if="sconfig.facerecognition_installed" type="success">
|
<NcNoteCard v-if="sconfig.facerecognition_installed" type="success">
|
||||||
{{ t('memories', 'Face Recognition is installed and enabled') }}
|
{{ t('memories', 'Face Recognition is installed and enabled') }}
|
||||||
</NcNoteCard>
|
</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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
|
|
|
@ -107,6 +107,7 @@ class StaticConfig {
|
||||||
albums_enabled: false,
|
albums_enabled: false,
|
||||||
facerecognition_installed: false,
|
facerecognition_installed: false,
|
||||||
facerecognition_enabled: false,
|
facerecognition_enabled: false,
|
||||||
|
preview_generator_enabled: false,
|
||||||
|
|
||||||
timeline_path: '',
|
timeline_path: '',
|
||||||
folders_path: '',
|
folders_path: '',
|
||||||
|
|
|
@ -241,6 +241,7 @@ export type IConfig = {
|
||||||
albums_enabled: boolean;
|
albums_enabled: boolean;
|
||||||
facerecognition_installed: boolean;
|
facerecognition_installed: boolean;
|
||||||
facerecognition_enabled: boolean;
|
facerecognition_enabled: boolean;
|
||||||
|
preview_generator_enabled: boolean;
|
||||||
|
|
||||||
timeline_path: string;
|
timeline_path: string;
|
||||||
folders_path: string;
|
folders_path: string;
|
||||||
|
|
Loading…
Reference in New Issue