Import always replaced everything - brands, packages, services, FAQs,
gallery - in one irreversible sweep, even if you only wanted to bring in
one part (e.g. restoring just the gallery from an old backup while
leaving today's live catalog alone).
Backend: importData() now accepts a "sections" field (JSON array of
catalog/services/faqs/gallery) and only DELETE+INSERTs the tables that
belong to selected sections; anything not selected is left completely
untouched. Tables stay grouped the way their foreign keys require
(brands -> car_models -> packages -> package_products/upgrades as one
unit, gallery_brands -> gallery_projects -> gallery_photos as another) -
importing "packages" without its models would either orphan rows or
silently rewrite unrelated ones, so the groups aren't splittable further.
Restored images are filtered to just the ones referenced by the tables
actually being imported, so deselecting the gallery means its images
aren't written to /uploads either. No sections field (older callers)
still imports everything, matching prior behavior.
Frontend: picking a file parses it client-side (file.text() + JSON.parse)
to show each section with live counts pulled straight from the file
("4 Marken, 15 Modelle, 17 Pakete"), all checked by default. The
confirmation checkbox's warning text names only what's actually
selected. If parsing fails client-side the picker just doesn't render -
the import still goes through server-side with the (safe) default of
importing everything.
Verified end-to-end against a real ~54MB export: importing only "faqs"
reverted a changed FAQ while a newly added test brand survived
untouched; importing only "catalog" right after removed that test brand
while the FAQ stayed as already restored - confirming sections are
fully independent both ways.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
53 lines
2.8 KiB
HTML
53 lines
2.8 KiB
HTML
<!doctype html>
|
||
<html lang="de">
|
||
<head>
|
||
<meta charset="UTF-8" />
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||
<!-- Nur fuer die Paket-Kacheln auf der Modell-Seite (Name/Preis-Typografie im
|
||
Kunden-Referenzdesign) - der Rest der Seite bleibt beim Standard-Font. -->
|
||
<link rel="preconnect" href="https://fonts.googleapis.com" />
|
||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
|
||
<link href="https://fonts.googleapis.com/css2?family=Barlow:wght@400;500;600;700&family=Barlow+Condensed:wght@500;600&family=Michroma&display=swap" rel="stylesheet" />
|
||
<title>HifiPlanet | Car-Hifi Umbauten nach Maß</title>
|
||
<meta name="description" content="HifiPlanet – dein Car-Hifi Spezialist. Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen." />
|
||
<link rel="canonical" href="https://hifi-planet.de/" />
|
||
|
||
<meta property="og:type" content="website" />
|
||
<meta property="og:site_name" content="HifiPlanet" />
|
||
<meta property="og:title" content="HifiPlanet | Car-Hifi Umbauten nach Maß" />
|
||
<meta property="og:description" content="Dein Car-Hifi Spezialist: Marke und Modell wählen, passende Sound-Pakete entdecken und unverbindlich anfragen." />
|
||
<meta property="og:locale" content="de_DE" />
|
||
<meta name="twitter:card" content="summary" />
|
||
|
||
<script type="application/ld+json">
|
||
{
|
||
"@context": "https://schema.org",
|
||
"@type": "AutoRepair",
|
||
"name": "HifiPlanet",
|
||
"description": "Car-Hifi Spezialist für individuelle Sound-Umbauten – vom unauffälligen Upgrade bis zum Komplettumbau.",
|
||
"url": "https://hifi-planet.de/",
|
||
"telephone": "+4993732062390",
|
||
"email": "info@hifi-planet-amorbach.de",
|
||
"address": {
|
||
"@type": "PostalAddress",
|
||
"streetAddress": "Boxbrunner Str. 20a",
|
||
"postalCode": "63916",
|
||
"addressLocality": "Amorbach",
|
||
"addressCountry": "DE"
|
||
},
|
||
"openingHoursSpecification": [
|
||
{ "@type": "OpeningHoursSpecification", "dayOfWeek": ["Monday", "Tuesday", "Wednesday", "Thursday", "Friday"], "opens": "09:00", "closes": "18:00" },
|
||
{ "@type": "OpeningHoursSpecification", "dayOfWeek": ["Saturday"], "opens": "10:00", "closes": "13:00" }
|
||
],
|
||
"sameAs": ["https://www.youtube.com/@hifiplanet2812"]
|
||
}
|
||
</script>
|
||
<script type="module" crossorigin src="/assets/index-KOjZhXM_.js"></script>
|
||
<link rel="modulepreload" crossorigin href="/assets/lucide-icons-66ioQXWI.js">
|
||
<link rel="stylesheet" crossorigin href="/assets/index-C78wIVRz.css">
|
||
</head>
|
||
<body class="bg-white text-slate-900 dark:bg-slate-950 dark:text-slate-100">
|
||
<div id="root"></div>
|
||
</body>
|
||
</html>
|