Skip to content

Commit b5c3d86

Browse files
committed
feat: add dynamic open graph metadata for enterprise whitelabeling
1 parent 7fb02ab commit b5c3d86

8 files changed

Lines changed: 9223 additions & 36 deletions

File tree

‎apps/dokploy/components/proprietary/whitelabeling/whitelabeling-settings.tsx‎

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -47,8 +47,8 @@ const formSchema = z.object({
4747
docsUrl: safeUrlField,
4848
errorPageTitle: z.string(),
4949
errorPageDescription: z.string(),
50-
metaTitle: z.string(),
5150
footerText: z.string(),
51+
ogImageUrl: safeUrlField,
5252
});
5353

5454
type FormSchema = z.infer<typeof formSchema>;
@@ -193,8 +193,8 @@ export function WhitelabelingSettings() {
193193
docsUrl: "",
194194
errorPageTitle: "",
195195
errorPageDescription: "",
196-
metaTitle: "",
197196
footerText: "",
197+
ogImageUrl: "",
198198
},
199199
resolver: zodResolver(formSchema),
200200
});
@@ -212,8 +212,8 @@ export function WhitelabelingSettings() {
212212
docsUrl: data.docsUrl ?? "",
213213
errorPageTitle: data.errorPageTitle ?? "",
214214
errorPageDescription: data.errorPageDescription ?? "",
215-
metaTitle: data.metaTitle ?? "",
216215
footerText: data.footerText ?? "",
216+
ogImageUrl: data.ogImageUrl ?? "",
217217
});
218218
}
219219
}, [data, form]);
@@ -242,8 +242,8 @@ export function WhitelabelingSettings() {
242242
docsUrl: values.docsUrl || null,
243243
errorPageTitle: values.errorPageTitle || null,
244244
errorPageDescription: values.errorPageDescription || null,
245-
metaTitle: values.metaTitle || null,
246245
footerText: values.footerText || null,
246+
ogImageUrl: values.ogImageUrl || null,
247247
},
248248
})
249249
.then(async () => {
@@ -388,6 +388,26 @@ export function WhitelabelingSettings() {
388388
</FormItem>
389389
)}
390390
/>
391+
392+
<FormField
393+
control={form.control}
394+
name="ogImageUrl"
395+
render={({ field }) => (
396+
<FormItem>
397+
<FormLabel>OG Image URL</FormLabel>
398+
<FormControl>
399+
<Input
400+
placeholder="https://example.com/og.png"
401+
{...field}
402+
/>
403+
</FormControl>
404+
<FormDescription>
405+
Open Graph image used for link previews on social media and messaging platforms. Recommended size: 1200x630px.
406+
</FormDescription>
407+
<FormMessage />
408+
</FormItem>
409+
)}
410+
/>
391411
</CardContent>
392412
</Card>
393413

@@ -441,31 +461,16 @@ export function WhitelabelingSettings() {
441461
</CardContent>
442462
</Card>
443463

444-
{/* Metadata & Links Section */}
464+
{/* Links Section */}
445465
<Card className="bg-transparent">
446466
<CardHeader>
447-
<CardTitle>Metadata & Links</CardTitle>
467+
<CardTitle>Links</CardTitle>
448468
<CardDescription>
449-
Customize the page title, footer text, and sidebar links.
469+
Customize the footer text and sidebar links.
450470
</CardDescription>
451471
</CardHeader>
452472
<CardContent className="flex flex-col gap-4">
453-
<FormField
454-
control={form.control}
455-
name="metaTitle"
456-
render={({ field }) => (
457-
<FormItem>
458-
<FormLabel>Page Title</FormLabel>
459-
<FormControl>
460-
<Input placeholder="Dokploy" {...field} />
461-
</FormControl>
462-
<FormDescription>
463-
Browser tab title. Defaults to "Dokploy" if empty.
464-
</FormDescription>
465-
<FormMessage />
466-
</FormItem>
467-
)}
468-
/>
473+
469474

470475
<FormField
471476
control={form.control}
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
ALTER TABLE "webServerSettings" ALTER COLUMN "whitelabelingConfig" SET DEFAULT '{"appName":null,"appDescription":null,"logoUrl":null,"faviconUrl":null,"customCss":null,"loginLogoUrl":null,"supportUrl":null,"docsUrl":null,"errorPageTitle":null,"errorPageDescription":null,"footerText":null,"ogImageUrl":null}'::jsonb;

0 commit comments

Comments
 (0)