Skip to content

Commit 3e20bfe

Browse files
committed
added icons and href'ed bincache and pkgcache
1 parent edae221 commit 3e20bfe

16 files changed

Lines changed: 66920 additions & 29461 deletions

web/src/components/app.tsx

Lines changed: 58 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Table, TableBody, TableCell, TableRow } from "./ui/table";
22
import { Tooltip, TooltipContent, TooltipProvider, TooltipTrigger } from "./ui/tooltip";
33
import { Badge } from "./ui/badge";
4-
import { ExternalLink, LucideTerminalSquare, Package, ScrollText, Download, Bug } from "lucide-react";
4+
import { ExternalLink, LucideTerminalSquare, Package, ScrollText, Download, Bug, Image as ImageIcon } from "lucide-react";
55
import { buttonVariants } from "./ui/button";
66
import { useClipboard } from "../hooks/use-clipboard";
77
import FormulaLinks from "./formula-links";
@@ -13,14 +13,19 @@ interface AppProps {
1313
downloadable?: boolean;
1414
}
1515

16-
type FieldType = "link" | "version" | "size" | "date" | "hash" | "files" | "number" | "metric" | "category" | "default" | "links" | "tags" | "repology" | "provides" | "string[]" | "license" | "note" | "package_id";
16+
type FieldType = "link" | "version" | "size" | "date" | "hash" | "files" | "number" | "metric" | "category" | "default" | "links" | "tags" | "repology" | "provides" | "string[]" | "license" | "note" | "package_id" | "description";
1717

1818
interface ResolverField {
1919
label: string;
2020
type: FieldType;
2121
joinWith?: string;
2222
}
2323

24+
interface PackageDescription {
25+
_default: string;
26+
[key: string]: string;
27+
}
28+
2429
const resolver: { [key: string]: ResolverField } = {
2530
_disabled: { label: "Disabled", type: "default" },
2631
pkg: { label: "Package", type: "default" },
@@ -44,12 +49,14 @@ const resolver: { [key: string]: ResolverField } = {
4449
src_url: { label: "Source URL", type: "link" },
4550
homepage: { label: "Homepage", type: "links" },
4651
build_script: { label: "Build Script", type: "link" },
52+
pkgcache: { label: "Package Cache", type: "link" },
53+
bincache: { label: "Binary Cache", type: "link" },
4754
build_log: { label: "Build Log", type: "link" },
4855
build_gha: { label: "Build CI", type: "link" },
4956
category: { label: "Category", type: "category" },
5057
icon: { label: "Icon", type: "link" },
5158
provides: { label: "Provides", type: "provides" },
52-
description: { label: "Description", type: "default" },
59+
description: { label: "Description", type: "description" },
5360
pkg_type: { label: "Package Type", type: "default" },
5461
pkg_webpage: { label: "Package Webpage", type: "link" },
5562
maintainer: { label: "Maintainer", type: "string[]", joinWith: "\n" },
@@ -85,6 +92,14 @@ function Show({ value, Key, props }: { value: any, props: AppProps, Key?: string
8592
);
8693

8794
case "link":
95+
if (typeof value === "string" && !value.startsWith("http")) {
96+
return (
97+
<a href={`http://${value}`} target="_blank" rel="noreferrer"
98+
className="underline underline-offset-4">
99+
http://{value}
100+
</a>
101+
);
102+
}
88103
return (
89104
<a href={value} target="_blank" rel="noreferrer"
90105
className="text-blue-600 dark:text-blue-400 hover:underline underline-offset-4">
@@ -281,6 +296,28 @@ function Show({ value, Key, props }: { value: any, props: AppProps, Key?: string
281296
<span className="font-mono text-gray-600 dark:text-gray-400">{value}</span>
282297
);
283298

299+
case "description":
300+
if (typeof value === 'object') {
301+
const descriptions = value as PackageDescription;
302+
return (
303+
<div className="flex flex-col space-y-2">
304+
{Object.entries(descriptions).map(([key, desc]: [string, string]) => (
305+
<div key={key} className="flex flex-col">
306+
{key === "_default" ? (
307+
<span className="font-medium">{desc}</span>
308+
) : (
309+
<>
310+
<span className="font-medium text-blue-600 dark:text-blue-400">{key}</span>
311+
<span className="text-sm text-muted-foreground">{desc}</span>
312+
</>
313+
)}
314+
</div>
315+
))}
316+
</div>
317+
);
318+
}
319+
return <span>{value}</span>;
320+
284321
default:
285322
if (typeof value === "string" && value.startsWith("http")) {
286323
return (
@@ -432,6 +469,24 @@ export default function App({ data, logs: build, repo, downloadable = true }: Ap
432469
<ExternalLink className="h-4 w-4" />
433470
</a>
434471
</div>
472+
473+
{data.icon && (
474+
<div className="flex flex-col items-center space-y-2 p-3 rounded-lg border bg-card">
475+
<h2 className="text-lg font-semibold flex items-center space-x-2">
476+
<ImageIcon className="text-amber-600 dark:text-amber-400" />
477+
<span>Package Icon</span>
478+
</h2>
479+
<img src={data.icon} alt="Package Icon" className="w-16 h-16 rounded-lg" />
480+
<a href={data.icon} target="_blank" rel="noreferrer"
481+
className={buttonVariants({
482+
variant: "outline",
483+
className: "w-full flex items-center justify-center space-x-2"
484+
})}>
485+
<span>View Raw</span>
486+
<ExternalLink className="h-4 w-4" />
487+
</a>
488+
</div>
489+
)}
435490
</div>
436491
</div>
437492
</TooltipProvider>

web/src/metadata_bincache_aarch64-linux.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

web/src/metadata_bincache_x86_64-linux.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
[{"name":"86box","pkg":"86box.appimage","family":"86box","version":"v4.2.1","sha":"6d98eb41392380d6d7fd5c9f10f95aa080c8ba9517b96a8e34b5ad7e847ae1d3","type":"appimage","size":"52 MB","sizeNum":52000000,"category":["Emulator"],"id":"N/A","Build Date":"2025-01-11T13:13:14Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/86box/86box","familyUrl":"/pkgcache/aarch64-linux/86box"},{"name":"vesktop","pkg":"vesktop.appimage","family":"vesktop","version":"v1.5.4","sha":"64ab14119ffecd2b558eef42f14c866f99bbff46ffaac68d4ab6b06f6ee32072","type":"appimage","size":"88 MB","sizeNum":88000000,"category":["Network","InstantMessaging","Chat"],"id":"N/A","Build Date":"2025-01-11T13:14:09Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/vesktop/vesktop","familyUrl":"/pkgcache/aarch64-linux/vesktop"}]
1+
[{"name":"86box","pkg":"86box.appimage","family":"86box","version":"v4.2.1","sha":"6d98eb41392380d6d7fd5c9f10f95aa080c8ba9517b96a8e34b5ad7e847ae1d3","type":"appimage","size":"52 MB","sizeNum":52000000,"category":["Emulator"],"id":"N/A","Build Date":"2025-01-11T13:13:14Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/86box/86box","familyUrl":"/pkgcache/aarch64-linux/86box"},{"name":"brave","pkg":"brave.nixappimage","family":"brave","version":"1.73.104","sha":"e83c492e326f06b3f1e3d8e64301d697206d43ac9b11b1f56307d9ec1ecb3c8a","type":"nixappimage","size":"375 MB","sizeNum":375000000,"category":["WebBrowser"],"id":"N/A","Build Date":"2025-01-17T09:19:48Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/brave/brave","familyUrl":"/pkgcache/aarch64-linux/brave"},{"name":"chromium","pkg":"chromium.nixappimage","family":"nixpkgs-chromium","version":"132.0.6834.83","sha":"a3fc49ddd21eea1d947afffc5a13de3e4e3f0c8da57e0a55c1784e4ef7b314e4","type":"nixappimage","size":"352 MB","sizeNum":352000000,"category":["WebBrowser"],"id":"N/A","Build Date":"2025-01-17T09:30:43Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/nixpkgs-chromium/chromium","familyUrl":"/pkgcache/aarch64-linux/nixpkgs-chromium"},{"name":"chromium","pkg":"chromium.nixappimage","family":"nixpkgs-ungoogled-chromium","version":"131.0.6778.264","sha":"7529bac5802b35233705cb56a115fe9d4445783da6da7e556d619886e215b803","type":"nixappimage","size":"358 MB","sizeNum":358000000,"category":["WebBrowser"],"id":"N/A","Build Date":"2025-01-14T12:31:21Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/nixpkgs-ungoogled-chromium/chromium","familyUrl":"/pkgcache/aarch64-linux/nixpkgs-ungoogled-chromium"},{"name":"flameshot","pkg":"flameshot.nixappimage","family":"flameshot","version":"12.1.0-unstable-2024-12-03","sha":"84fbc1a33a5ff10ac0134bd1665a471340312221b974f4261ef978f1ca8bbcdb","type":"nixappimage","size":"97 MB","sizeNum":97000000,"category":["Utility"],"id":"N/A","Build Date":"2025-01-16T16:12:25Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/flameshot/flameshot","familyUrl":"/pkgcache/aarch64-linux/flameshot"},{"name":"gearlever","pkg":"gearlever.nixappimage","family":"gearlever","version":"2.3.2","sha":"aa390c7471a26487ee3dd3049a8bd0608f1a31e0657f8358c428abd6f9907461","type":"nixappimage","size":"304 MB","sizeNum":304000000,"category":["Utility"],"id":"N/A","Build Date":"2025-01-17T10:31:34Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/gearlever/gearlever","familyUrl":"/pkgcache/aarch64-linux/gearlever"},{"name":"ghostty","pkg":"ghostty.nixappimage","family":"ghostty","version":"1.0.1","sha":"e81ed5d832f775ef2d2b7ba5be55abe3ae86635b6b463bd8672a132729d70c30","type":"nixappimage","size":"226 MB","sizeNum":226000000,"category":["TerminalEmulator"],"id":"N/A","Build Date":"2025-01-14T13:52:45Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/ghostty/ghostty","familyUrl":"/pkgcache/aarch64-linux/ghostty"},{"name":"helix","pkg":"helix.nixappimage","family":"helix","version":"25.01","sha":"d328b9e22848278eef0da498ae61bbc30b42f4241c2324e10bc000fe88a62cd7","type":"nixappimage","size":"28 MB","sizeNum":28000000,"category":["TextEditor"],"id":"N/A","Build Date":"2025-01-14T13:59:45Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/helix/helix","familyUrl":"/pkgcache/aarch64-linux/helix"},{"name":"neovim","pkg":"neovim.nixappimage","family":"neovim","version":"0.10.3","sha":"a4b9348c9000b9b5c9897f32899847b7acf897cb003cd165281678b6e0132c9c","type":"nixappimage","size":"31 MB","sizeNum":31000000,"category":["TextEditor"],"id":"N/A","Build Date":"2025-01-14T14:18:06Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/neovim/neovim","familyUrl":"/pkgcache/aarch64-linux/neovim"},{"name":"simplex-desktop","pkg":"simplex-desktop.nixappimage","family":"simplex-desktop","version":"6.2.4","sha":"a383c53e2edadcd606e1442e42b16a89ccf6c2fe1399d03445fb6e6378d07af7","type":"nixappimage","size":"520 MB","sizeNum":520000000,"category":["Chat","InstantMessaging"],"id":"N/A","Build Date":"2025-01-17T12:37:36Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/simplex-desktop/simplex-desktop","familyUrl":"/pkgcache/aarch64-linux/simplex-desktop"},{"name":"telegram-desktop","pkg":"telegram-desktop.nixappimage","family":"telegram-desktop","version":"5.10.2","sha":"b3bb91df7af44826607ab61ba2a6f798fe60165e8c38b64371cdc5de8c477ee0","type":"nixappimage","size":"354 MB","sizeNum":354000000,"category":["Chat","IRCClient"],"id":"N/A","Build Date":"2025-01-17T12:49:17Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/telegram-desktop/telegram-desktop","familyUrl":"/pkgcache/aarch64-linux/telegram-desktop"},{"name":"vesktop","pkg":"vesktop.appimage","family":"vesktop","version":"v1.5.4","sha":"64ab14119ffecd2b558eef42f14c866f99bbff46ffaac68d4ab6b06f6ee32072","type":"appimage","size":"88 MB","sizeNum":88000000,"category":["Network","InstantMessaging","Chat"],"id":"N/A","Build Date":"2025-01-11T13:14:09Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/vesktop/vesktop","familyUrl":"/pkgcache/aarch64-linux/vesktop"},{"name":"zen-browser","pkg":"zen-browser.appimage","family":"github-com-zen-browser-desktop-twilight","version":"1.7t_2025-01-16","sha":"edd1e13fdaac91d9100a9d8563664068b9baafb64f3ac93f5146c7668b637aa0","type":"appimage","size":"96 MB","sizeNum":96000000,"category":["WebBrowser"],"id":"N/A","Build Date":"2025-01-17T12:49:57Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/github-com-zen-browser-desktop-twilight/zen-browser","familyUrl":"/pkgcache/aarch64-linux/github-com-zen-browser-desktop-twilight"},{"name":"zen-browser","pkg":"zen-browser.appimage","family":"github-com-zen-browser-desktop-beta","version":"1.0.2-b.5","sha":"98aafee82186fca80707294ec59044991749bfeac47c80ad7f58b5eb874a248c","type":"appimage","size":"95 MB","sizeNum":95000000,"category":["WebBrowser"],"id":"N/A","Build Date":"2025-01-16T18:18:20Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/github-com-zen-browser-desktop-beta/zen-browser","familyUrl":"/pkgcache/aarch64-linux/github-com-zen-browser-desktop-beta"},{"name":"zen-browser","pkg":"zen-browser.appimage","family":"github-com-zen-browser-desktop-stable","version":"1.7b","sha":"05e69cdacaa50fa324f0b02d30b93e7185df33b54b4d4464df5a07e42a1b6af0","type":"appimage","size":"96 MB","sizeNum":96000000,"category":["WebBrowser"],"id":"N/A","Build Date":"2025-01-16T18:18:44Z","url":"https://pkgs.pkgforge.dev/repo/pkgcache/aarch64-linux/github-com-zen-browser-desktop-stable/zen-browser","familyUrl":"/pkgcache/aarch64-linux/github-com-zen-browser-desktop-stable"}]

0 commit comments

Comments
 (0)