diff --git a/src/Types.ts b/src/Types.ts
index d3ccb87..7e457db 100644
--- a/src/Types.ts
+++ b/src/Types.ts
@@ -12,11 +12,15 @@ export interface Template {
command?: string;
interactive?: boolean;
logo: string;
- image: string;
+ image?: string;
restart_policy?: 'always' | 'unless-stopped' | 'on-failure' | 'no';
ports?: string[];
volumes?: Volume[];
- environment?: Environment[];
+ env?: Environment[];
+ repository?: {
+ stackfile: string;
+ url: string;
+ };
}
export interface Volume {
@@ -27,4 +31,20 @@ export interface Volume {
export interface Environment {
name: string;
label?: string;
+ set?: string;
}
+
+export interface Service {
+ name: string;
+ image?: string;
+ entrypoint?: string;
+ restart_policy?: 'always' | 'unless-stopped' | 'on-failure' | 'no';
+ volumes?: Volume[];
+ command?: string;
+ ports?: string[];
+ build?: string;
+ interactive?: boolean;
+ environment?: Environment[];
+}
+
+export interface TemplateOrService extends Template, Service {}
diff --git a/src/lib/ServiceStats.svelte b/src/lib/ServiceStats.svelte
new file mode 100644
index 0000000..1944dae
--- /dev/null
+++ b/src/lib/ServiceStats.svelte
@@ -0,0 +1,129 @@
+
+
+
+
+ {#if template.type}
+
+ Type
+ {#if template.type === 1}
+ Container
+ {:else if template.type === 2}
+ Swarm
+ {:else if template.type === 3}
+ Kubernetes
+ {:else}
+ Unknown
+ {/if}
+
+ {/if}
+ {#if template.platform}
+
+ Platform
+ {template.platform}
+
+ {/if}
+ {#if template.image}
+
+ Image
+ {template.image}
+
+ {/if}
+ {#if template.command}
+
+ Command
+ {template.command}
+
+ {/if}
+ {#if typeof template.interactive === 'boolean'}
+
+ Interactive
+ {template.interactive ? 'Yes' : 'No'}
+
+ {/if}
+ {#if template.ports}
+
+
Ports
+
+ {#each template.ports as port}{port}{/each}
+
+
+ {/if}
+ {#if template.volumes}
+
+
Volumes
+
+ {#each template.volumes as volume}{volume.container || volume}{/each}
+
+
+ {/if}
+ {#if template.restart_policy}
+
+ Restart Policy
+ {template.restart_policy}
+
+ {/if}
+ {#if template.repository}
+
+ {/if}
+ {#if template.entrypoint}
+
+ Entrypoint
+ {template.entrypoint}
+
+ {/if}
+ {#if template.build}
+
+ Build
+ {template.build}
+
+ {/if}
+ {#if template.env}
+
+
Env Vars
+
+ {#each template.env as env}{env.name}={env.set || env.value || env.default}{/each}
+
+
+ {/if}
+
+
+
diff --git a/src/routes/[slug]/+page.server.ts b/src/routes/[slug]/+page.server.ts
index 1679860..c772f88 100644
--- a/src/routes/[slug]/+page.server.ts
+++ b/src/routes/[slug]/+page.server.ts
@@ -10,10 +10,9 @@ export const load = async () => {
}
} else {
const data = await fetch(templatesUrl).then((res) => res.json());
- templates.set(data.templates);
-
+ templates.set(data.templates);
return {
templates: data.templates,
}
}
-};
\ No newline at end of file
+};
diff --git a/src/routes/[slug]/+page.svelte b/src/routes/[slug]/+page.svelte
index cd61842..346bc5a 100644
--- a/src/routes/[slug]/+page.svelte
+++ b/src/routes/[slug]/+page.svelte
@@ -1,8 +1,11 @@