diff --git a/.env.example b/.env.example index 3c356d9..6d24e2b 100644 --- a/.env.example +++ b/.env.example @@ -40,3 +40,5 @@ SMTP_IGNORETLS=false # Postmark driver config POSTMARK_TOKEN= +# for custom drawio server +DRAWIO_URL= \ No newline at end of file diff --git a/apps/client/src/features/editor/components/drawio/drawio-view.tsx b/apps/client/src/features/editor/components/drawio/drawio-view.tsx index 3750594..b931781 100644 --- a/apps/client/src/features/editor/components/drawio/drawio-view.tsx +++ b/apps/client/src/features/editor/components/drawio/drawio-view.tsx @@ -3,7 +3,7 @@ import { ActionIcon, Card, Image, Modal, Text, useComputedColorScheme } from '@m import { useRef, useState } from 'react'; import { uploadFile } from '@/features/page/services/page-service.ts'; import { useDisclosure } from '@mantine/hooks'; -import { getFileUrl } from '@/lib/config.ts'; +import { getDrawioUrl, getFileUrl } from '@/lib/config.ts'; import { DrawIoEmbed, DrawIoEmbedRef, @@ -87,6 +87,7 @@ export default function DrawioView(props: NodeViewProps) { { - const { APP_URL, FILE_UPLOAD_SIZE_LIMIT } = loadEnv(mode, envPath, ""); + const { APP_URL, FILE_UPLOAD_SIZE_LIMIT, DRAWIO_URL } = loadEnv(mode, envPath, ""); return { define: { "process.env": { APP_URL, - FILE_UPLOAD_SIZE_LIMIT + FILE_UPLOAD_SIZE_LIMIT, + DRAWIO_URL }, 'APP_VERSION': JSON.stringify(process.env.npm_package_version), }, diff --git a/apps/server/src/integrations/environment/environment.service.ts b/apps/server/src/integrations/environment/environment.service.ts index 3daa822..c40ec91 100644 --- a/apps/server/src/integrations/environment/environment.service.ts +++ b/apps/server/src/integrations/environment/environment.service.ts @@ -122,6 +122,10 @@ export class EnvironmentService { return this.configService.get('POSTMARK_TOKEN'); } + getDrawioUrl(): string { + return this.configService.get('DRAWIO_URL'); + } + isCloud(): boolean { const cloudConfig = this.configService .get('CLOUD', 'false') diff --git a/apps/server/src/integrations/static/static.module.ts b/apps/server/src/integrations/static/static.module.ts index 1753605..13dce24 100644 --- a/apps/server/src/integrations/static/static.module.ts +++ b/apps/server/src/integrations/static/static.module.ts @@ -33,7 +33,8 @@ export class StaticModule implements OnModuleInit { ENV: this.environmentService.getNodeEnv(), APP_URL: this.environmentService.getAppUrl(), IS_CLOUD: this.environmentService.isCloud(), - FILE_UPLOAD_SIZE_LIMIT: this.environmentService.getFileUploadSizeLimit() + FILE_UPLOAD_SIZE_LIMIT: this.environmentService.getFileUploadSizeLimit(), + DRAWIO_URL: this.environmentService.getDrawioUrl() }; const windowScriptContent = ``;