PageSourceSearch

https://wechselpilot.com/assets/SitemapPage-CoKSm2vJ.js

js wechselpilot.com collected 2026-10-02 16:22:07 UTC 3,703 bytes, 1 lines download raw bytes

1import{r as s,j as e}from"./vendor-react-DGSJREdp.js";import{W as w}from"./WpLoader-CBDFQU7c.js";import{c as S}from"./vendor-query-DPjj6zqo.js";import{s as p,aa as v,y as b}from"./index-BXFTndD8.js";import{B as k}from"./RechnerWidget-D-NdYgUS.js";import{I as y}from"./IconClock-b8MiIQL-.js";import{I as D}from"./IconCircleCheckFilled--dAD9oJw.js";import{I as C}from"./IconExternalLink-COSgvhQ7.js";import"./vendor-router-B0yek_TD.js";import"./vendor-supabase-C6T5JIOu.js";function R(){const[i,o]=s.useState(null),[c,l]=s.useState(null),[m,d]=s.useState(null),[u,x]=s.useState(null);s.useEffect(()=>{let t=!1;return(async()=>{const{data:r}=p.storage.from("publicmedia").getPublicUrl("sitemap.xml"),N=`${r.publicUrl}?t=${Date.now()}`;try{const n=await fetch(N,{cache:"no-store"});if(!n.ok||t)return;const g=await n.text(),h=n.headers.get("last-modified"),f=g.match(/<url>/g);if(t)return;o(g),l(`${window.location.origin}/sitemap.xml`),d(f?f.length:null),x(h?new Date(h).toISOString():null)}catch{}})(),()=>{t=!0}},[]);const a=S({mutationFn:async()=>{const{data:t,error:r}=await p.functions.invoke("generate-sitemap",{body:{},headers:{}});if(r)throw r;return t},onSuccess:t=>{o(t.xml),l(t.url),d(t.pages_count),x(t.generated_at),b.success(`Sitemap generiert (${t.pages_count} Seiten)`)},onError:t=>{console.error(t),b.error("Fehler beim Generieren der Sitemap")}}),j=t=>new Date(t).toLocaleString("de-DE",{day:"2-digit",month:"2-digit",year:"numeric",hour:"2-digit",minute:"2-digit"});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h1",{className:"text-2xl font-bold text-foreground",children:"Sitemap"}),e.jsxs(k,{onClick:()=>a.mutate(),disabled:a.isPending,className:"bg-[#00A0DC] hover:bg-[#008bbf] text-white",children:[a.isPending?e.jsx(w,{size:16,className:"mr-2"}):e.jsx(v,{className:"mr-2 h-4 w-4"}),"Sitemap generieren"]})]}),e.jsxs("div",{className:"grid grid-cols-3 gap-4",children:[e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-1",children:[e.jsx(y,{className:"h-4 w-4"}),"Letzte Aktualisierung"]}),e.jsx("div",{className:"text-sm font-medium text-foreground",children:u?j(u):"Noch nicht generiert"})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-1",children:[e.jsx(D,{className:"h-4 w-4"}),"Seiten in Sitemap"]}),e.jsx("div",{className:"text-sm font-medium text-foreground",children:m!==null?m:"–"})]}),e.jsxs("div",{className:"rounded-lg border bg-card p-4",children:[e.jsxs("div",{className:"flex items-center gap-2 text-sm text-muted-foreground mb-1",children:[e.jsx(C,{className:"h-4 w-4"}),"Sitemap-URL"]}),c?e.jsx("a",{href:c,target:"_blank",rel:"noopener noreferrer",className:"text-sm font-medium text-[#00A0DC] hover:underline truncate block",children:"sitemap.xml öffnen"}):e.jsx("div",{className:"text-sm text-muted-foreground",children:"–"})]})]}),e.jsxs("div",{className:"rounded-lg border bg-accent/5 border-accent/20 p-4 text-sm text-foreground/80",children:[e.jsx("strong",{className:"text-foreground",children:"Hinweis:"})," Die Sitemap wird automatisch nach jeder Veröffentlichung eines Artikels neu generiert. Du kannst sie hier auch manuell aktualisieren."]}),i&&e.jsxs("div",{className:"space-y-2",children:[e.jsx("h2",{className:"text-sm font-semibold text-foreground",children:"Vorschau"}),e.jsx("pre",{className:"rounded-lg border bg-card p-4 text-xs text-muted-foreground overflow-auto max-h-[400px] whitespace-pre-wrap font-mono",children:i})]})]})}export{R as default};

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.