feat: admin log page
This commit is contained in:
32
routes/admin/cache/index.tsx
vendored
Normal file
32
routes/admin/cache/index.tsx
vendored
Normal file
@ -0,0 +1,32 @@
|
||||
import { MainLayout } from "@components/layouts/main.tsx";
|
||||
import { Handlers, PageProps } from "$fresh/server.ts";
|
||||
import { getCacheInfo } from "@lib/cache.ts";
|
||||
|
||||
export const handler: Handlers<
|
||||
{ cacheInfo: ReturnType<typeof getCacheInfo> }
|
||||
> = {
|
||||
GET(_, ctx) {
|
||||
return ctx.render({ cacheInfo: getCacheInfo() });
|
||||
},
|
||||
};
|
||||
|
||||
export default function Greet(
|
||||
props: PageProps<
|
||||
{ cacheInfo: ReturnType<typeof getCacheInfo> }
|
||||
>,
|
||||
) {
|
||||
const { cacheInfo } = props.data;
|
||||
return (
|
||||
<MainLayout
|
||||
url={props.url}
|
||||
title="Recipes"
|
||||
context={{ type: "recipe" }}
|
||||
>
|
||||
<code>
|
||||
<pre class="text-white">
|
||||
{JSON.stringify(cacheInfo, null, 2)}
|
||||
</pre>
|
||||
</code>
|
||||
</MainLayout>
|
||||
);
|
||||
}
|
Reference in New Issue
Block a user