mirror of
https://github.com/docmost/docmost.git
synced 2025-11-20 20:31:09 +10:00
add env variable (#513)
This commit is contained in:
@ -57,6 +57,14 @@ export function getFileUrl(src: string) {
|
||||
}
|
||||
|
||||
export function getFileUploadSizeLimit() {
|
||||
const limit = window.CONFIG?.FILE_UPLOAD_SIZE_LIMIT || process?.env.FILE_UPLOAD_SIZE_LIMIT || '50mb';
|
||||
const limit =getConfigValue("FILE_UPLOAD_SIZE_LIMIT", "50mb");
|
||||
return bytes(limit);
|
||||
}
|
||||
|
||||
export function getDrawioUrl() {
|
||||
return getConfigValue("DRAWIO_URL", "https://embed.diagrams.net");
|
||||
}
|
||||
|
||||
function getConfigValue(key: string, defaultValue: string = undefined) {
|
||||
return window.CONFIG?.[key] || process?.env?.[key] || defaultValue;
|
||||
}
|
||||
@ -74,4 +74,4 @@ export function decodeBase64ToSvgString(base64Data: string): string {
|
||||
|
||||
export function capitalizeFirstChar(string: string) {
|
||||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user