PageSourceSearch

https://hyscore.io/assets/admin.llms-ZwYjetGA.js

js hyscore.io collected 2026-09-24 09:25:59 UTC 15,553 bytes, 1 lines download raw bytes

1import{a0 as j,a1 as b,a2 as N,b as g,a3 as ee,e as z,ae as $,a4 as u,r as k,j as e,z as d,ao as _,af as se,bu as te,bv as K,D as h,I as C,T as W,ak as ae,aj as le,bw as re,bx as ne,as as E,aq as P}from"./index-B4mWWRqi.js";import{C as F,a as T,b as L,c as D}from"./card-Occ_qlEo.js";import{S as M}from"./switch-Cdt6Ywxb.js";import"./index-DMtyVvw3.js";const ie=j({method:"GET"}).middleware([b]).handler(N("9f696f19d3f56dc24c554271a82af8e8d389fbb6a3a614e0b4157ae5b05e5a76")),ce=j({method:"POST"}).middleware([b]).handler(N("9da221a7c3ff80fb45974b2322dd14f72c7c47498a2aeccb0f7ad139055e06ec")),de=j({method:"GET"}).middleware([b]).handler(N("4db4428c8cf4137837ae73af1631905652818206311fcce3540bcf1f1d17c9d9")),oe=j({method:"POST"}).middleware([b]).handler(N("c1b4eddddd281aec6b6bd03c722e2490b5a158aecb26c044d8f0c8ecaddce0e7")),me=j({method:"GET"}).middleware([b]).handler(N("0f5d1c7f0956cc7b4079a5d46d42c97a635e0d2c71a997b77ed24e0c2825eed1")),ue=j({method:"GET"}).middleware([b]).handler(N("de0eef7710012991259ba077879e8ee183cfde0b9537e7a471766108797c7cb2")),xe=j({method:"POST"}).middleware([b]).handler(N("0b22d018d19ee06fa4800c301000f1195a53da22a3a913b50a7dbf392365f2ae")),Z={title:"hyScore",summary:"",context:"",extra_links:[],include_news:!0,news_limit:10,include_docs:!0,full_enabled:!0};function he(n){return n?{title:n.title,summary:n.summary,context:n.context,extra_links:(n.extra_links??[]).map(x=>({label:x.label,url:x.url,description:x.description??""})),include_news:n.include_news,news_limit:n.news_limit,include_docs:n.include_docs,full_enabled:n.full_enabled}:{...Z}}const fe=new Intl.DateTimeFormat("de-DE",{dateStyle:"short",timeStyle:"medium",timeZone:"Europe/Berlin"});function q(n){if(!n)return"—";const x=new Date(n);return Number.isNaN(x.getTime())?"—":fe.format(x)}function Ne(){const n=g(ie),x=g(ce),B=g(de),V=g(xe),H=g(oe),J=g(ue),U=g(me),f=ee(),{data:A,isLoading:Y}=z({queryKey:["llms-admin"],queryFn:()=>n()}),v=z({queryKey:["llms-check"],queryFn:()=>J()}),m=z({queryKey:["llms-status"],queryFn:()=>U(),refetchInterval:6e4}),Q=$({mutationFn:()=>H(),onSuccess:async s=>{const t=s.results.filter(a=>!a.ok),r=s.results.filter(a=>a.ok).length;r>0&&u.success(`${r} Datei(en) neu erzeugt.`);for(const a of t)u.error(`${a.locale}/${a.variant}: ${a.error??"Fehler"}`);await f.invalidateQueries({queryKey:["llms-check"]}),await f.invalidateQueries({queryKey:["llms-status"]}),await f.invalidateQueries({queryKey:["llms-preview"]})},onError:s=>u.error(s instanceof Error?s.message:"Neu erzeugen fehlgeschlagen.")}),S=A?.locales??[],[o,X]=k.useState("de"),[l,i]=k.useState({...Z}),[w,I]=k.useState(!1),y=k.useMemo(()=>(A?.settings??[]).find(s=>s.locale===o),[A,o]);k.useEffect(()=>{i(he(y))},[y?.locale,y?.updated_at,o]);const p=z({queryKey:["llms-preview",o,w],queryFn:()=>B({data:{locale:o,full:w}}),enabled:!!o}),O=$({mutationFn:()=>x({data:{locale:o,title:l.title,summary:l.summary,context:l.context,extra_links:l.extra_links.filter(s=>s.label.trim()&&s.url.trim()),include_news:l.include_news,news_limit:l.news_limit,include_docs:l.include_docs,full_enabled:l.full_enabled}}),onSuccess:async()=>{u.success("Gespeichert."),await f.invalidateQueries({queryKey:["llms-admin"]}),await f.invalidateQueries({queryKey:["llms-preview"]})},onError:s=>u.error(s instanceof Error?s.message:"Speichern fehlgeschlagen.")}),R=$({mutationFn:s=>V({data:{overwrite:s}}),onSuccess:async s=>{const t=s.results.filter(a=>a.ok).map(a=>a.locale),r=s.results.filter(a=>!a.ok);t.length>0&&u.success(`Übersetzt: ${t.join(", ")}`),t.length===0&&r.length===0&&u.info("Alle Sprachen sind gepflegt.");for(const a of r)u.error(`${a.locale}: ${a.error??"Fehler"}`);await f.invalidateQueries({queryKey:["llms-admin"]}),await f.invalidateQueries({queryKey:["llms-preview"]})},onError:s=>u.error(s instanceof Error?s.message:"Übersetzen fehlgeschlagen.")}),G=`${o==="de"?"":`/${o}`}/${w?"llms-full.txt":"llms.txt"}`;return e.jsxs("div",{className:"w-full space-y-6",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold",children:"llms.txt"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"KI-freundliche Übersicht der Website je Sprache. Wird bei jedem Abruf mit den aktuell veröffentlichten Seiten, Artikeln und Doku-Inhalten erzeugt."})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs(d,{variant:"outline",onClick:()=>Q.mutate(),disabled:Q.isPending,children:[e.jsx(_,{className:"mr-2 h-4 w-4"}),"Jetzt neu erzeugen"]}),e.jsxs(d,{variant:"outline",onClick:()=>R.mutate(!1),disabled:R.isPending,children:[e.jsx(se,{className:"mr-2 h-4 w-4"}),"Fehlende Sprachen übersetzen"]}),e.jsxs(d,{onClick:()=>O.mutate(),disabled:O.isPending,children:[e.jsx(te,{className:"mr-2 h-4 w-4"}),"Speichern"]})]})]}),e.jsx("div",{className:"flex flex-wrap gap-1",children:S.map(s=>e.jsx("button",{type:"button",onClick:()=>X(s.code),className:`rounded-md px-3 py-1.5 text-sm transition ${o===s.code?"bg-primary text-primary-foreground":"bg-muted text-muted-foreground hover:bg-accent"}`,children:K(s.code,Object.fromEntries(S.map(t=>[t.code,t.label])))},s.code))}),Y?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Wird geladen …"}):e.jsxs("div",{className:"grid gap-6 lg:grid-cols-2",children:[e.jsxs(F,{children:[e.jsx(T,{children:e.jsxs(L,{className:"text-base",children:["Texte (",o.toUpperCase(),")"]})}),e.jsxs(D,{className:"space-y-4",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"llms-title",children:"Titel"}),e.jsx(C,{id:"llms-title",value:l.title,onChange:s=>i(t=>({...t,title:s.target.value}))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"llms-summary",children:"Zusammenfassung (ein bis zwei Sätze)"}),e.jsx(W,{id:"llms-summary",rows:4,value:l.summary,onChange:s=>i(t=>({...t,summary:s.target.value}))})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(h,{htmlFor:"llms-context",children:"Kontexttext"}),e.jsx(W,{id:"llms-context",rows:7,value:l.context,onChange:s=>i(t=>({...t,context:s.target.value}))})]}),e.jsxs("div",{className:"space-y-3 rounded-md border border-border p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(h,{htmlFor:"llms-news",children:"Aktuelles-Artikel einbeziehen"}),e.jsx(M,{id:"llms-news",checked:l.include_news,onCheckedChange:s=>i(t=>({...t,include_news:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(h,{htmlFor:"llms-news-limit",children:"Anzahl Artikel"}),e.jsx(C,{id:"llms-news-limit",type:"number",min:0,max:50,className:"w-24",value:l.news_limit,onChange:s=>i(t=>({...t,news_limit:Math.max(0,Math.min(50,Number(s.target.value)||0))}
1))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(h,{htmlFor:"llms-docs",children:"Developer Docs einbeziehen"}),e.jsx(M,{id:"llms-docs",checked:l.include_docs,onCheckedChange:s=>i(t=>({...t,include_docs:s}))})]}),e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsx(h,{htmlFor:"llms-full",children:"llms-full.txt bereitstellen"}),e.jsx(M,{id:"llms-full",checked:l.full_enabled,onCheckedChange:s=>i(t=>({...t,full_enabled:s}))})]})]}),e.jsxs("div",{className:"space-y-2",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx(h,{children:"Eigene Links"}),e.jsxs(d,{size:"sm",variant:"outline",onClick:()=>i(s=>({...s,extra_links:[...s.extra_links,{label:"",url:"",description:""}]})),children:[e.jsx(ae,{className:"mr-1 h-3.5 w-3.5"}),"Link"]})]}),l.extra_links.length===0&&e.jsx("p",{className:"text-xs text-muted-foreground",children:"Optional: zusätzliche Links, die nicht aus der Website kommen."}),l.extra_links.map((s,t)=>e.jsxs("div",{className:"grid gap-2 rounded-md border border-border p-2 sm:grid-cols-[1fr_1fr_auto]",children:[e.jsx(C,{placeholder:"Titel",value:s.label,onChange:r=>i(a=>{const c=[...a.extra_links];return c[t]={...c[t],label:r.target.value},{...a,extra_links:c}})}),e.jsx(C,{placeholder:"/pfad oder https://…",value:s.url,onChange:r=>i(a=>{const c=[...a.extra_links];return c[t]={...c[t],url:r.target.value},{...a,extra_links:c}})}),e.jsx(d,{variant:"ghost",size:"icon","aria-label":"Link entfernen",onClick:()=>i(r=>({...r,extra_links:r.extra_links.filter((a,c)=>c!==t)})),children:e.jsx(le,{className:"h-4 w-4"})}),e.jsx(C,{className:"sm:col-span-3",placeholder:"Kurzbeschreibung",value:s.description,onChange:r=>i(a=>{const c=[...a.extra_links];return c[t]={...c[t],description:r.target.value},{...a,extra_links:c}})})]},t))]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:y?.updated_at?`Zuletzt geändert: ${new Date(y.updated_at).toLocaleString("de-DE")}`:"Für diese Sprache sind noch keine eigenen Texte gepflegt – es gilt Deutsch."})]})]}),e.jsxs(F,{children:[e.jsxs(T,{className:"flex flex-row flex-wrap items-center justify-between gap-2",children:[e.jsxs(L,{className:"text-base",children:["Vorschau ",G]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(d,{size:"sm",variant:w?"outline":"secondary",onClick:()=>I(!1),children:"llms.txt"}),e.jsx(d,{size:"sm",variant:w?"secondary":"outline",onClick:()=>I(!0),children:"llms-full.txt"}),e.jsx(d,{size:"icon",variant:"ghost","aria-label":"Neu laden",onClick:()=>p.refetch(),children:e.jsx(_,{className:"h-4 w-4"})}),e.jsx(d,{size:"icon",variant:"ghost","aria-label":"Kopieren",onClick:()=>{navigator.clipboard.writeText(p.data?.body??""),u.success("Kopiert.")},children:e.jsx(re,{className:"h-4 w-4"})}),e.jsx(d,{size:"icon",variant:"ghost","aria-label":"Im neuen Tab öffnen",asChild:!0,children:e.jsx("a",{href:G,target:"_blank",rel:"noreferrer",children:e.jsx(ne,{className:"h-4 w-4"})})})]})]}),e.jsx(D,{children:e.jsx("pre",{className:"max-h-[70vh] overflow-auto whitespace-pre-wrap rounded-md bg-muted p-3 text-xs",children:p.isLoading?"Vorschau wird erzeugt …":p.error?`Fehler: ${p.error instanceof Error?p.error.message:"unbekannt"}`:p.data?.body})})]})]}),e.jsxs(F,{children:[e.jsxs(T,{className:"flex flex-row items-center justify-between gap-2",children:[e.jsx(L,{className:"text-base",children:"Regenerierungsstatus"}),e.jsx(d,{size:"icon",variant:"ghost","aria-label":"Status aktualisieren",onClick:()=>{m.refetch()},children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsx(D,{className:"space-y-4",children:m.isLoading?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Status wird geladen …"}):m.error?e.jsx("p",{className:"text-sm text-destructive",children:m.error instanceof Error?m.error.message:"Status konnte nicht geladen werden."}):e.jsxs(e.Fragment,{children:[e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Letzte Inhaltsänderung: ",q(m.data?.contentChangedAt??null)," · Inhaltsstand Nr. ",m.data?.contentVersion??"—"]}
1),e.jsx("div",{className:"overflow-x-auto",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{children:e.jsxs("tr",{className:"border-b border-border text-left text-xs text-muted-foreground",children:[e.jsx("th",{className:"py-1.5 pr-3 font-medium",children:"Sprachversion"}),e.jsx("th",{className:"py-1.5 pr-3 font-medium",children:"Datei"}),e.jsx("th",{className:"py-1.5 pr-3 font-medium",children:"Stand"}),e.jsx("th",{className:"py-1.5 pr-3 font-medium",children:"Zeitstempel"}),e.jsx("th",{className:"py-1.5 font-medium",children:"Fehler"})]})}),e.jsx("tbody",{children:(m.data?.files??[]).map(s=>e.jsxs("tr",{className:"border-b border-border/60",children:[e.jsx("td",{className:"py-1.5 pr-3",children:K(s.locale,Object.fromEntries(S.map(t=>[t.code,t.label])))}),e.jsx("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:s.variant==="full"?"llms-full.txt":"llms.txt"}),e.jsx("td",{className:"py-1.5 pr-3",children:s.lastError?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-destructive",children:[e.jsx(E,{className:"h-3.5 w-3.5"})," Fehler"]}):s.upToDate?e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-emerald-600 dark:text-emerald-400",children:[e.jsx(P,{className:"h-3.5 w-3.5"})," Aktuell"]}):e.jsxs("span",{className:"inline-flex items-center gap-1 text-xs text-amber-600 dark:text-amber-400",children:[e.jsx(_,{className:"h-3.5 w-3.5"})," Wird neu erzeugt"]})}),e.jsx("td",{className:"py-1.5 pr-3 text-xs text-muted-foreground",children:q(s.generatedAt)}),e.jsx("td",{className:"py-1.5 text-xs text-destructive",children:s.lastError?`${s.lastError} (${q(s.lastErrorAt)})`:"—"})]},`${s.locale}-${s.variant}`))})]})}),e.jsxs("div",{children:[e.jsx("p",{className:"mb-1 text-xs font-medium text-muted-foreground",children:"Letzte Läufe"}),(m.data?.runs??[]).length===0?e.jsx("p",{className:"text-xs text-muted-foreground",children:"Noch keine Neuerzeugung protokolliert."}):e.jsx("ul",{className:"space-y-1",children:(m.data?.runs??[]).slice(0,15).map(s=>e.jsxs("li",{className:"flex flex-wrap items-center gap-2 text-xs",children:[s.ok?e.jsx(P,{className:"h-3.5 w-3.5 text-emerald-500"}):e.jsx(E,{className:"h-3.5 w-3.5 text-destructive"}),e.jsx("span",{className:"text-muted-foreground",children:q(s.createdAt)}),e.jsxs("span",{className:"font-medium",children:[s.locale," · ",s.variant==="full"?"llms-full.txt":"llms.txt"]}),e.jsxs("span",{className:"text-muted-foreground",children:[s.trigger==="manual"?"manuell":"automatisch",s.durationMs!==null?` · ${new Intl.NumberFormat("de-DE").format(s.durationMs)} ms`:""]}),s.error&&e.jsx("span",{className:"text-destructive",children:s.error})]},s.id))})]})]})})]}),e.jsxs(F,{children:[e.jsxs(T,{className:"flex flex-row items-center justify-between gap-2",children:[e.jsx(L,{className:"text-base",children:"Prüfung je Sprache"}),e.jsx(d,{size:"icon",variant:"ghost","aria-label":"Prüfung aktualisieren",onClick:()=>{v.refetch()},children:e.jsx(_,{className:"h-4 w-4"})})]}),e.jsx(D,{className:"space-y-4",children:v.isLoading?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Prüfung läuft …"}):v.error?e.jsx("p",{className:"text-sm text-destructive",children:v.error instanceof Error?v.error.message:"Prüfung fehlgeschlagen."}):(v.data?.locales??[]).map(s=>e.jsxs("div",{className:"rounded-md border border-border p-3",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium",children:[s.issues.some(t=>t.severity==="error")?e.jsx(E,{className:"h-4 w-4 text-destructive"}):s.issues.length>0?e.jsx(E,{className:"h-4 w-4 text-amber-500"}):e.jsx(P,{className:"h-4 w-4 text-emerald-500"}),K(s.locale,Object.fromEntries(S.map(t=>[t.code,t.label]))),!s.hasOwnSettings&&e.jsx("span",{className:"text-xs font-normal text-muted-foreground",children:"(keine eigenen Texte)"})]}),e.jsxs("span",{className:"text-xs text-muted-foreground",children:[s.counts.pages," Seiten · ",s.counts.news," Artikel · ",s.counts.docs," Doku"]})]}),s.issues.length===0?e.jsx("p",{className:"mt-2 text-xs text-muted-foreground",children:"Keine fehlenden Übersetzungen oder Lücken gefunden."}):e.jsx("ul",{className:"mt-2 space-y-1.5",children:s.issues.map((t,r)=>e.jsxs("li",{className:"text-xs",children:[e.jsx("span",{className:t.
1severity==="error"?"font-medium text-destructive":"font-medium text-amber-600 dark:text-amber-400",children:t.message}),t.items.length>0&&e.jsxs("span",{className:"text-muted-foreground",children:[" — ",t.items.join(", ")]})]},r))})]},s.locale))})]})]})}export{Ne 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.