Skip to content

Commit 5a0b028

Browse files
committed
Provides
1 parent f02a292 commit 5a0b028

6 files changed

Lines changed: 8599 additions & 2316 deletions

File tree

web/src/components/app.tsx

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ interface AppProps {
1212
repo: string;
1313
}
1414

15-
type FieldType = "link" | "version" | "size" | "date" | "hash" | "files" | "number" | "metric" | "category" | "default" | "links" | "tags" | "repology";
15+
type FieldType = "link" | "version" | "size" | "date" | "hash" | "files" | "number" | "metric" | "category" | "default" | "links" | "tags" | "repology" | "provides";
1616

1717
interface ResolverField {
1818
label: string;
@@ -46,7 +46,7 @@ const resolver: { [key: string]: ResolverField } = {
4646
build_gha: { label: "Build CI", type: "link" },
4747
category: { label: "Category", type: "category" },
4848
icon: { label: "Icon", type: "link" },
49-
provides: { label: "Provides", type: "tags" },
49+
provides: { label: "Provides", type: "provides" },
5050
description: { label: "Description", type: "default" },
5151
host: { label: "Host", type: "default" },
5252
pkg_type: { label: "Package Type", type: "default" },
@@ -186,6 +186,30 @@ function Show({ value, Key, props }: { value: any, props: AppProps, Key?: string
186186
</div>
187187
);
188188

189+
case "provides":
190+
const data = URL.parse(props.data.pkg_webpage as string)!!.toString().split("/");
191+
data.pop();
192+
193+
const uri = data.join("/");
194+
195+
const provides = value as string[];
196+
return (
197+
<div className="flex flex-wrap gap-1">
198+
{provides.map((s) => {
199+
return (
200+
<div key={s} className="flex">
201+
<a href={`${uri}/${s}`} target="_blank" rel="noreferrer"
202+
className="underline underline-offset-4">
203+
<Badge className="bg-blue-100 dark:bg-teal-900 text-teal-800 dark:text-blue-100">
204+
{s}
205+
</Badge>
206+
</a>
207+
</div>
208+
);
209+
})}
210+
</div>
211+
);
212+
189213
case "links":
190214
const links = Array.isArray(value) ? value : [value];
191215
return (

web/src/metadata_bincache_aarch64-linux.json

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

0 commit comments

Comments
 (0)