Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions apps/dokploy/components/dashboard/project/add-pack.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,16 +83,26 @@ const logoSlug = (name: string) => {
return LOGO_ALIASES[base] ?? base;
};

// Icon published by the registry: a brand (→ Simple Icons slug) or a colored
// monogram tile. Older/custom registries omit it — fall back to guessing a
// Simple Icons slug from the pack name, then a generic box.
// Icon published by the registry: a brand (→ Simple Icons slug), a custom
// inline logo (→ data-URI src), or a colored monogram tile. Older/custom
// registries omit it — fall back to guessing a Simple Icons slug from the pack
// name, then a generic box.
type PackIcon =
| { kind: "brand"; slug: string; hex?: string; title?: string }
| { kind: "custom"; src: string }
| { kind: "monogram"; text: string; color?: string };

const PackLogo = ({ name, icon }: { name: string; icon?: PackIcon | null }) => {
const [errored, setErrored] = useState(false);

// Custom: a self-contained logo the registry published as a data-URI.
if (icon?.kind === "custom" && icon.src) {
return (
// biome-ignore lint/performance/noImgElement: inline data-URI logo, no next/image
<img src={icon.src} alt={name} className="size-8 object-contain" />
);
}

// Monogram: a colored initial tile, no network fetch.
if (icon?.kind === "monogram") {
return (
Expand Down
6 changes: 4 additions & 2 deletions packages/server/src/setup/pack-registry.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,10 @@
// Store metadata published by a GitHub-Pages Nomad-Pack registry (packs.json).
// A brand icon maps to a Simple Icons slug; a monogram is a colored initial
// tile. Health is the smoke-test verdict (null = not boot-tested yet).
// A brand icon maps to a Simple Icons slug; a custom icon is a self-contained
// logo published as a data-URI; a monogram is a colored initial tile. Health is
// the smoke-test verdict (null = not boot-tested yet).
export type PackIcon =
| { kind: "brand"; slug: string; hex?: string; title?: string }
| { kind: "custom"; src: string }
| { kind: "monogram"; text: string; color?: string };

export type PackHealth = { ok?: boolean; checkedAt?: string } | null;
Expand Down
Loading