{
index(media).on(["path"], true).on(["reference"]);
})
);
-
- this.setBuilt();
} catch (e) {
console.error(e);
throw new Error(
diff --git a/app/src/media/media-schema.ts b/app/src/media/media-schema.ts
index f196c79..229b108 100644
--- a/app/src/media/media-schema.ts
+++ b/app/src/media/media-schema.ts
@@ -16,8 +16,8 @@ export function buildMediaSchema() {
config: adapter.schema
},
{
- title: adapter.schema.title ?? name,
- description: adapter.schema.description,
+ title: adapter.schema?.title ?? name,
+ description: adapter.schema?.description,
additionalProperties: false
}
);
diff --git a/app/src/ui/routes/media/media.settings.tsx b/app/src/ui/routes/media/media.settings.tsx
index 68b9b04..f6eb4e8 100644
--- a/app/src/ui/routes/media/media.settings.tsx
+++ b/app/src/ui/routes/media/media.settings.tsx
@@ -1,4 +1,4 @@
-import { IconBrandAws, IconCloud, IconServer } from "@tabler/icons-react";
+import { IconBrandAws, IconBrandCloudflare, IconCloud, IconServer } from "@tabler/icons-react";
import { isDebug } from "core";
import { autoFormatString } from "core/utils";
import { twMerge } from "tailwind-merge";
@@ -113,10 +113,15 @@ const RootFormError = () => {
);
};
-const Icons = [IconBrandAws, IconCloud, IconServer];
+const Icons = {
+ s3: IconBrandAws,
+ cloudinary: IconCloud,
+ local: IconServer,
+ r2: IconBrandCloudflare
+};
-const AdapterIcon = ({ index }: { index: number }) => {
- const Icon = Icons[index];
+const AdapterIcon = ({ type }: { type: string }) => {
+ const Icon = Icons[type];
if (!Icon) return null;
return ;
};
@@ -142,7 +147,7 @@ function Adapters() {
)}
>
{autoFormatString(schema.title)}
diff --git a/examples/cloudflare-worker/src/index.ts b/examples/cloudflare-worker/src/index.ts
index 5d28a61..c2114d3 100644
--- a/examples/cloudflare-worker/src/index.ts
+++ b/examples/cloudflare-worker/src/index.ts
@@ -2,4 +2,8 @@
import { serve } from "bknd/adapter/cloudflare";
-export default serve();
+export default serve({
+ onBuilt: async (app) => {
+ app.modules.server.get("/custom", (c) => c.json({ hello: "world" }));
+ }
+});
diff --git a/examples/cloudflare-worker/wrangler.toml b/examples/cloudflare-worker/wrangler.toml
index 7f049ef..993970a 100644
--- a/examples/cloudflare-worker/wrangler.toml
+++ b/examples/cloudflare-worker/wrangler.toml
@@ -13,4 +13,8 @@ enabled = true
[[d1_databases]]
binding = "DB"
database_name = "bknd-cf-example"
-database_id = "7ad67953-2bbf-47fc-8696-f4517dbfe674"
\ No newline at end of file
+database_id = "7ad67953-2bbf-47fc-8696-f4517dbfe674"
+
+[[r2_buckets]]
+binding = "BUCKET"
+bucket_name = "bknd-cf-example"
\ No newline at end of file