Customer feedback round (4 items):
- Packages: one-click "Sichtbar/Ausgeblendet" toggle per package (saved
immediately). Hidden packages disappear from the model page; the tier
look of the remaining cards is ranked across all packages so it stays
stable.
- Packages: badge per card (Empfohlen, Am beliebtesten, Tipp, Coming soon
or custom text) plus an optional video link shown as "Zum Video". Legacy
is_featured maps to "Empfohlen".
- New download area (/downloads + Admin -> Downloads): upload with
progress, inline audio player, allow-listed file types, optional access
password, new permission downloads.manage. Files live in
api/uploads/downloads/ (gitignored, created at runtime).
- Performance:
- SetupGate no longer refetches and remounts the whole app on every
navigation.
- Page loader waits only for pending API calls and above-the-fold images
(fixes an 8 s hang on /leistungen caused by lazy images inside the
hidden container).
- Admin pages lazy-loaded; icon library moved out of the main bundle
(initial JS 2.2 MB -> 0.48 MB).
- Background video loads only near the viewport and was re-encoded to
720p (32 MB -> 8.5 MB).
- Visitors without a session cookie get no PHP session, so their parallel
API requests no longer queue on the session lock.
- index.html is served with Cache-Control: no-cache so browsers don't
keep a stale build after deploys.
- Fonts (Barlow, Barlow Condensed, Michroma) are self-hosted instead of
loaded from Google Fonts; the default privacy policy mentions this, lists
all local storage uses and uses the new TDDDG name.
- A code update that adds a table no longer sends the site into the setup
wizard while an admin exists.
Run "Datenbankstruktur aktualisieren" after deploying (new package
columns, downloads table, app_settings.downloads_password).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
1 line
4.5 KiB
JavaScript
1 line
4.5 KiB
JavaScript
import{e as j,r as a,j as e,L as N,a as l}from"./index-CA8nTsDv.js";const y=t=>t==null?"–":new Intl.NumberFormat("de-DE",{style:"currency",currency:"EUR"}).format(t),w={ok:"bg-green-100 text-green-700 dark:bg-green-900/40 dark:text-green-300",pending:"bg-amber-100 text-amber-700 dark:bg-amber-900/40 dark:text-amber-300",error:"bg-red-100 text-red-700 dark:bg-red-900/40 dark:text-red-300"};function _(){const{packageId:t}=j(),[n,p]=a.useState([]),[c,i]=a.useState(""),[u,o]=a.useState(""),[x,m]=a.useState(""),[h,s]=a.useState(!1),d=()=>l.get(`/packages/${t}/products`).then(p);a.useEffect(()=>{d()},[t]);const b=async r=>{r.preventDefault(),m(""),s(!0);try{await l.post("/products",{package_id:Number(t),source_url:c,name_override:u||null}),i(""),o(""),d()}catch(f){m(f.message)}finally{s(!1)}},k=async r=>{s(!0);try{await l.post(`/products/${r}/refresh-price`,{}),d()}finally{s(!1)}},g=async r=>{confirm("Produkt wirklich entfernen?")&&(await l.delete(`/products/${r}`),d())};return e.jsxs("div",{children:[e.jsx("p",{className:"mb-2 text-sm",children:e.jsx(N,{to:"/admin/packages",className:"text-brand-600 hover:underline",children:"← Zurück zu den Paketen"})}),e.jsx("h1",{className:"mb-4 text-xl font-bold text-neutral-900 dark:text-white",children:"Produkte im Paket"}),e.jsxs("form",{onSubmit:b,className:"mb-6 flex flex-wrap items-end gap-3 rounded-xl border border-neutral-200 bg-white p-4 dark:border-neutral-800 dark:bg-neutral-900",children:[e.jsxs("div",{className:"flex-1 min-w-[240px]",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"audio4cars.de Produkt-URL *"}),e.jsx("input",{required:!0,type:"url",placeholder:"https://www.audio4cars.de/produkt/...",value:c,onChange:r=>i(r.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsxs("div",{className:"w-56",children:[e.jsx("label",{className:"mb-1 block text-sm font-medium text-neutral-700 dark:text-neutral-300",children:"Name überschreiben (optional)"}),e.jsx("input",{value:u,onChange:r=>o(r.target.value),className:"w-full rounded-md border border-neutral-300 bg-white px-3 py-2 text-sm dark:border-neutral-700 dark:bg-neutral-900"})]}),e.jsx("button",{disabled:h,type:"submit",className:"rounded-md bg-brand-500 px-4 py-2 text-sm font-semibold text-white hover:bg-brand-600 disabled:opacity-60",children:"Hinzufügen"})]}),x&&e.jsx("p",{className:"mb-4 text-sm text-red-600",children:x}),e.jsx("div",{className:"overflow-hidden rounded-xl border border-neutral-200 dark:border-neutral-800",children:e.jsxs("table",{className:"w-full text-left text-sm",children:[e.jsx("thead",{className:"bg-neutral-50 text-neutral-500 dark:bg-neutral-900 dark:text-neutral-400",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-2",children:"Produkt"}),e.jsx("th",{className:"px-4 py-2",children:"Preis"}),e.jsx("th",{className:"px-4 py-2",children:"Status"}),e.jsx("th",{className:"px-4 py-2",children:"Zuletzt aktualisiert"}),e.jsx("th",{className:"px-4 py-2 text-right",children:"Aktionen"})]})}),e.jsxs("tbody",{className:"divide-y divide-neutral-100 dark:divide-neutral-800",children:[n.map(r=>e.jsxs("tr",{className:"bg-white dark:bg-neutral-950",children:[e.jsxs("td",{className:"px-4 py-2",children:[e.jsx("a",{href:r.source_url,target:"_blank",rel:"noreferrer",className:"font-medium text-neutral-800 hover:underline dark:text-neutral-100",children:r.name_override||r.scraped_name||r.source_url}),r.scrape_status==="error"&&e.jsx("p",{className:"text-xs text-red-500",children:r.scrape_error})]}),e.jsx("td",{className:"px-4 py-2",children:y(r.scraped_price)}),e.jsx("td",{className:"px-4 py-2",children:e.jsx("span",{className:`rounded-full px-2 py-0.5 text-xs font-medium ${w[r.scrape_status]}`,children:r.scrape_status})}),e.jsx("td",{className:"px-4 py-2 text-neutral-500 dark:text-neutral-400",children:r.price_updated_at?new Date(r.price_updated_at.replace(" ","T")).toLocaleString("de-DE"):"–"}),e.jsxs("td",{className:"px-4 py-2 text-right",children:[e.jsx("button",{disabled:h,onClick:()=>k(r.id),className:"mr-3 text-brand-600 hover:underline disabled:opacity-60",children:"Preis aktualisieren"}),e.jsx("button",{onClick:()=>g(r.id),className:"text-red-600 hover:underline",children:"Entfernen"})]})]},r.id)),n.length===0&&e.jsx("tr",{children:e.jsx("td",{colSpan:5,className:"px-4 py-6 text-center text-neutral-400",children:"Noch keine Produkte im Paket."})})]})]})})]})}export{_ as default};
|