mirror of
https://github.com/Litlyx/litlyx
synced 2025-12-11 08:18:37 +01:00
new selfhosted version
This commit is contained in:
15
dashboard/utils/isSelfhosted.ts
Normal file
15
dashboard/utils/isSelfhosted.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
|
||||
function truthy(value: any, ifNull: boolean) {
|
||||
if (value === undefined || value === null || value === '') return ifNull;
|
||||
return value === 'true' || value === true || value === '1' || value === 1;
|
||||
}
|
||||
|
||||
export function isSelfhosted() {
|
||||
const config = useRuntimeConfig();
|
||||
return truthy(config.public.SELFHOSTED, false);
|
||||
}
|
||||
|
||||
export function isAiEnabled() {
|
||||
const config = useRuntimeConfig();
|
||||
return truthy(config.public.AI_ENABLED, true);
|
||||
}
|
||||
Reference in New Issue
Block a user