mirror of
https://github.com/Dokploy/dokploy
synced 2025-06-26 18:27:59 +00:00
feat(templates): add custom base URL support for template management
- Implement dynamic base URL configuration for template fetching - Add localStorage persistence for base URL - Update template rendering to use dynamic base URL - Modify API routes to support optional base URL parameter - Enhance template browsing flexibility
This commit is contained in:
@@ -54,7 +54,7 @@ interface TemplateMetadata {
|
||||
*/
|
||||
export async function fetchTemplatesList(
|
||||
baseUrl = "https://dokploy.github.io/templates",
|
||||
): Promise<CompleteTemplate[]> {
|
||||
): Promise<TemplateMetadata[]> {
|
||||
try {
|
||||
const response = await fetch(`${baseUrl}/meta.json`);
|
||||
if (!response.ok) {
|
||||
@@ -62,22 +62,13 @@ export async function fetchTemplatesList(
|
||||
}
|
||||
const templates = (await response.json()) as TemplateMetadata[];
|
||||
return templates.map((template) => ({
|
||||
metadata: {
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
description: template.description,
|
||||
version: template.version,
|
||||
logo: template.logo,
|
||||
links: template.links,
|
||||
tags: template.tags,
|
||||
},
|
||||
// These will be populated when fetching individual templates
|
||||
variables: {},
|
||||
config: {
|
||||
domains: [],
|
||||
env: {},
|
||||
mounts: [],
|
||||
},
|
||||
id: template.id,
|
||||
name: template.name,
|
||||
description: template.description,
|
||||
version: template.version,
|
||||
logo: template.logo,
|
||||
links: template.links,
|
||||
tags: template.tags,
|
||||
}));
|
||||
} catch (error) {
|
||||
console.error("Error fetching templates list:", error);
|
||||
|
||||
Reference in New Issue
Block a user