PageSourceSearch

https://prisbasker.dk/assets/admin.index-Bl2SQs71.js

js prisbasker.dk collected 2026-10-09 22:03:47 UTC 9,693 bytes, 1 lines download raw bytes

1import{K as w,M as y,N as C,a as p,j as e,L as u}from"./index-B0htQ7oi.js";import{g as L}from"./feeds.functions-BEuomgDh.js";import{f as N,a as r,b as S}from"./admin-format-DQ8hK-He.js";import{R as f}from"./rss-DcZQ0p0F.js";import{L as k}from"./loader-circle-xTHhwBhm.js";import{C as g}from"./clock-Pk51quV8.js";import{T as h}from"./triangle-alert-BdsagP4e.js";import{I as F}from"./inbox-CpjbiXei.js";import{S as I}from"./sparkles-D9cA3L8V.js";import{E as $}from"./external-link-D8ASyEMu.js";import{F as j}from"./file-text-D9CF1flZ.js";import{P as K}from"./package-DBRNvE_w.js";import{S as A}from"./store-Cf-wq9vC.js";import{A as q}from"./activity-DFfgufs-.js";import{D as R}from"./database-RNiW7mp4.js";import{Z as D}from"./zap-BEw30vXu.js";import{S as E}from"./shield-check-DVLha9_c.js";import{C as O}from"./circle-x-BvkO2Ia1.js";import{C as T}from"./circle-check-BrZe3f5j.js";const P=w({method:"GET"}).middleware([y]).handler(C("47959f2f865589d5046f9031c6a869ccbac1bf737171ce2015665fb75b5a63b8"));function le(){const t=p({queryKey:["ops","overview"],queryFn:()=>L(),refetchInterval:1e4}),a=p({queryKey:["dashboard-content-stats"],queryFn:()=>P(),refetchInterval:6e4}),s=t.data;return e.jsxs("div",{children:[e.jsxs("header",{className:"mb-8 flex items-end justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs uppercase tracking-[0.18em] text-muted-foreground",children:"Command Center"}),e.jsx("h1",{className:"mt-1 font-display text-3xl font-semibold",children:"Dashboard"})]}),e.jsx(_,{healthy:v(s),label:v(s)?"Alle systemer OK":"Kræver opmærksomhed"})]}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(n,{icon:f,label:"Aktive feeds",value:s?.feed_engine.active_feeds,loading:t.isLoading,href:"/admin/feeds"}),e.jsx(n,{icon:k,label:"Imports kører",value:s?.feed_engine.running,loading:t.isLoading,href:"/admin/imports"}),e.jsx(n,{icon:g,label:"I kø",value:s?.feed_engine.queued,loading:t.isLoading,href:"/admin/imports"}),e.jsx(n,{icon:h,label:"Fejl 24t",value:s?.feed_engine.failed_24h,loading:t.isLoading,alert:!0,href:"/admin/imports"})]}),e.jsxs("div",{className:"mt-3 grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(n,{icon:h,label:"Fastlåste",value:s?.feed_engine.stuck,loading:t.isLoading,alert:!0,href:"/admin/imports"}),e.jsx(n,{icon:F,label:"Review Queue",value:s?.review.pending,loading:t.isLoading,alert:(s?.review.pending??0)>0,href:"/admin/review"}),e.jsx(n,{icon:I,label:"AI-forbrug 24t",value:0,loading:!1,suffix:"kr",href:"/admin/logs"}),e.jsx(n,{icon:$,label:"Operations Center",value:void 0,loading:!1,href:"/admin/operations",hint:"Åbn kontrolrum"})]}),e.jsxs("div",{className:"mt-8 grid gap-6 lg:grid-cols-3",children:[e.jsx(M,{o:s,loading:t.isLoading}),e.jsx("div",{className:"lg:col-span-2",children:e.jsx(Q,{runs:s?.recent_runs??[],loading:t.isLoading})})]}),e.jsxs("div",{className:"mt-10",children:[e.jsx("h2",{className:"mb-3 text-xs uppercase tracking-[0.14em] text-muted-foreground",children:"Content"}),e.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 lg:grid-cols-4",children:[e.jsx(n,{icon:j,label:"Publicerede artikler",value:a.data?.publishedArticles,loading:a.isLoading,href:"/admin/articles"}),e.jsx(n,{icon:j,label:"Kladder",value:a.data?.draftArticles,loading:a.isLoading,href:"/admin/articles"}),e.jsx(n,{icon:K,label:"Produkter",value:a.data?.products,loading:a.isLoading,href:"/admin/products"}),e.jsx(n,{icon:A,label:"Merchants",value:void 0,loading:!1,href:"/admin/merchants"})]})]}),e.jsxs("section",{className:"mt-10 rounded-xl border border-border bg-background p-6",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(q,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h2",{className:"font-display text-lg font-semibold",children:"Systemstatus"})]}),e.jsxs("dl",{className:"mt-4 grid gap-3 sm:grid-cols-2 lg:grid-cols-4 text-sm",children:[e.jsx(x,{icon:R,label:"Database",healthy:s?.database.ok??!0}),e.jsx(x,{icon:D,label:"Inngest",healthy:s?.inngest.configured??!1,note:s?.inngest.configured?void 0:"Connector ikke konfigureret"}),e.jsx(x,{icon:f,label:"Feed Engine",healthy:(s?.feed_engine.stuck??0)===0,note:(s?.feed_engine.stuck??0)>0?`${s?.feed_engine.stuck} fastlåst`:`${s?.feed_engine.running??0} kører · ${s?.feed_engine.queued??0} i kø`}),e.jsx(x,{icon:E,label:"Watchdog",healthy:s?.watchdog.healthy??!1,note:s?.watchdog.last_tick_at?`Sidste tick ${N(s?.watchdog.last_tick_at)}`:"Ingen tick endnu"})]})]})]})}function v(t){return t?(t.feed_engine.stuck??0)===0&&t.watchdog.healthy&&t.inngest.configured&&t.database.ok:!0}
1function M({o:t,loading:a}){return e.jsxs("div",{className:"rounded-xl border border-border bg-background p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(f,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"font-display text-sm font-semibold",children:"Feed Engine"})]}),e.jsx(_,{healthy:t?(t.feed_engine.stuck??0)===0:!0,label:t&&(t.feed_engine.stuck??0)>0?"Fastlåste kørsler":"OK"})]}),a?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Indlæser…"}):e.jsxs("dl",{className:"space-y-1.5 text-sm",children:[e.jsx(d,{k:"Kører nu",v:r(t?.feed_engine.running??0)}),e.jsx(d,{k:"I kø",v:r(t?.feed_engine.queued??0)}),e.jsx(d,{k:"Fastlåste",v:r(t?.feed_engine.stuck??0),tone:(t?.feed_engine.stuck??0)>0?"err":void 0}),e.jsx(d,{k:"Færdige 24t",v:r(t?.feed_engine.completed_24h??0)}),e.jsx(d,{k:"Fejl 24t",v:r(t?.feed_engine.failed_24h??0),tone:(t?.feed_engine.failed_24h??0)>0?"err":void 0}),e.jsx(d,{k:"Annulleret 24t",v:r(t?.feed_engine.stopped_24h??0)}),e.jsx(d,{k:"Sidste import",v:t?.feed_engine.last_import_at?S(t?.feed_engine.last_import_at):"—"})]})]})}function d({k:t,v:a,tone:s}){return e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("dt",{className:"text-muted-foreground",children:t}),e.jsx("dd",{className:`font-mono tabular-nums ${s==="err"?"text-destructive":""}`,children:a})]})}function Q({runs:t,loading:a}){return e.jsxs("div",{className:"rounded-xl border border-border bg-background p-5",children:[e.jsxs("div",{className:"mb-3 flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(g,{className:"h-4 w-4 text-muted-foreground"}),e.jsx("h3",{className:"font-display text-sm font-semibold",children:"Seneste imports"})]}),e.jsx(u,{to:"/admin/imports",className:"text-xs text-muted-foreground hover:text-foreground",children:"Se alle →"})]}),a&&t.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Indlæser…"}):t.length===0?e.jsx("div",{className:"rounded-md border border-dashed border-border/60 p-6 text-center text-xs text-muted-foreground",children:"Ingen imports endnu."}):e.jsx("ul",{className:"divide-y divide-border text-sm",children:t.map(s=>{const i=s.status==="completed",l=s.status==="failed",o=s.status==="running"||s.status==="queued",c=Math.max(0,(s.items_fetched??0)-(s.items_ok??0)),m=i&&c>0&&(s.items_fetched??0)>0;return e.jsxs("li",{className:"flex items-center gap-3 py-2",children:[l?e.jsx(O,{className:"h-4 w-4 text-destructive"}):m?e.jsx(h,{className:"h-4 w-4 text-amber-500"}):i?e.jsx(T,{className:"h-4 w-4 text-emerald-500"}):o?e.jsx(k,{className:"h-4 w-4 animate-spin text-blue-500"}):e.jsx(g,{className:"h-4 w-4 text-muted-foreground"}),e.jsx(u,{to:"/admin/feeds/$id",params:{id:s.feed_id??""},className:"flex-1 truncate font-medium hover:underline",children:s.feed_name}),e.jsx("span",{className:"hidden truncate text-xs text-muted-foreground sm:inline",children:s.merchant_name}),e.jsx("span",{className:"tabular-nums text-xs text-muted-foreground",children:i||l?`${r(s.items_ok)} / ${r(s.items_fetched)}`:""}),e.jsx("span",{className:"w-20 text-right text-xs text-muted-foreground",children:N(s.finished_at??s.created_at)})]},s.id)})})]})}function n({icon:t,label:a,value:s,loading:i,alert:l,href:o,suffix:c,hint:m}){const b=e.jsxs("div",{className:`rounded-xl border p-5 transition-colors ${l&&(s??0)>0?"border-amber-200 bg-amber-50/50 dark:border-amber-950 dark:bg-amber-950/20":"border-border bg-background hover:bg-muted/40"}`,children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("span",{className:"text-xs uppercase tracking-wider text-muted-foreground",children:a}),e.jsx(t,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsxs("div",{className:"mt-2 font-display text-3xl font-semibold tabular-nums",children:[i?"–":s===void 0?"→":s.toLocaleString("da-DK"),c?e.jsx("span",{className:"ml-1 text-base font-normal text-muted-foreground",children:c}):null]}),m?e.jsx("div",{className:"mt-1 text-xs text-muted-foreground",children:m}):null]});return o?e.jsx(u,{to:o,children:b}):b}function x({label:t,healthy:a,note:s,icon:i}){return e.jsxs("div",{className:"flex items-center justify-between rounded-md border border-border/60 px-3 py-2",children:[e.jsxs("span",{className:"flex items-center gap-2 font-medium",children:[e.jsx(i,{className:"h-3.5 w-3.5 text-muted-foreground"}),t]}),e.jsxs("span",{className:`flex items-center gap-1.5 text-xs ${a?"text-emerald-600":"text-amber-600"}`,children:[e.jsx("span",{className:`inline-block h-1.5 w-1.5 rounded-full ${a?"bg-emerald-500":"bg-amber-500"}`}),a?s??"OK":s??"Fejl"]})]})}function _({healthy:t,label:a}){return e.jsxs("div",{className:"hidden items-center gap-1.5 text-xs md:flex",children:[e.jsx("span",{className:`inline-block h-2 w-2 rounded-full ${t?"bg-emerald-500":"bg-amber-500"}`}),e.jsx("span",{className:t?"text-muted-foreground":"text-amber-600",children:a})]})}export{le as component};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.