Compare commits
5 Commits
f500a63e97
...
f40268992d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
f40268992d | ||
|
|
b72e16706e | ||
|
|
9078b5631a | ||
|
|
1c67cd46bb | ||
|
|
5b9a0c609d |
@@ -9,7 +9,7 @@ export default async function AdminCategoriesPage() {
|
|||||||
<div className="flex-1 space-y-8 p-8 pt-6">
|
<div className="flex-1 space-y-8 p-8 pt-6">
|
||||||
<div className="flex items-center justify-between space-y-2">
|
<div className="flex items-center justify-between space-y-2">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-3xl font-bold tracking-tight text-gradient flex items-center gap-3">
|
<h2 className="text-3xl font-bold tracking-tight text-white flex items-center gap-3">
|
||||||
<LayoutGrid className="w-8 h-8 text-primary" />
|
<LayoutGrid className="w-8 h-8 text-primary" />
|
||||||
Kategorien
|
Kategorien
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@@ -7,7 +7,7 @@ export default async function AdminOrdersPage() {
|
|||||||
<div className="p-8 space-y-6">
|
<div className="p-8 space-y-6">
|
||||||
<div className="flex justify-between items-center">
|
<div className="flex justify-between items-center">
|
||||||
<div>
|
<div>
|
||||||
<h1 className="text-3xl font-bold tracking-tight text-gradient">Bestellungen</h1>
|
<h1 className="text-3xl font-bold tracking-tight text-white">Bestellungen</h1>
|
||||||
<p className="text-slate-400">Verwalten Sie alle Kundenbestellungen und greifen Sie auf generierte Annfragesbestätigungen zu.</p>
|
<p className="text-slate-400">Verwalten Sie alle Kundenbestellungen und greifen Sie auf generierte Annfragesbestätigungen zu.</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -41,7 +41,7 @@ export default async function AdminDashboard() {
|
|||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="p-8 space-y-8">
|
<div className="p-8 space-y-8">
|
||||||
<h2 className="text-3xl font-bold tracking-tight text-gradient">Dashboard</h2>
|
<h2 className="text-3xl font-bold tracking-tight text-white">Dashboard</h2>
|
||||||
|
|
||||||
{/* KPI Cards – echte DB-Daten */}
|
{/* KPI Cards – echte DB-Daten */}
|
||||||
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
<div className="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default async function AdminProductsPage() {
|
|||||||
<div className="flex-1 space-y-8 p-8 pt-6">
|
<div className="flex-1 space-y-8 p-8 pt-6">
|
||||||
<div className="flex items-center justify-between space-y-2">
|
<div className="flex items-center justify-between space-y-2">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-3xl font-bold tracking-tight text-gradient flex items-center gap-3">
|
<h2 className="text-3xl font-bold tracking-tight text-white flex items-center gap-3">
|
||||||
<Package className="w-8 h-8 text-primary" />
|
<Package className="w-8 h-8 text-primary" />
|
||||||
Produkte & Module
|
Produkte & Module
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@@ -14,7 +14,7 @@ export default async function AdminUsersPage() {
|
|||||||
<div className="flex-1 space-y-8 p-8 pt-6">
|
<div className="flex-1 space-y-8 p-8 pt-6">
|
||||||
<div className="flex items-center justify-between space-y-2">
|
<div className="flex items-center justify-between space-y-2">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-3xl font-bold tracking-tight text-gradient flex items-center gap-3">
|
<h2 className="text-3xl font-bold tracking-tight text-white flex items-center gap-3">
|
||||||
<Users className="w-8 h-8 text-primary" />
|
<Users className="w-8 h-8 text-primary" />
|
||||||
Benutzerverwaltung
|
Benutzerverwaltung
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ export default async function WysiwygAdminPage() {
|
|||||||
<div className="flex-1 space-y-8 p-8 pt-6">
|
<div className="flex-1 space-y-8 p-8 pt-6">
|
||||||
<div className="flex items-center justify-between space-y-2">
|
<div className="flex items-center justify-between space-y-2">
|
||||||
<div>
|
<div>
|
||||||
<h2 className="text-3xl font-bold tracking-tight text-gradient flex items-center gap-3">
|
<h2 className="text-3xl font-bold tracking-tight text-white flex items-center gap-3">
|
||||||
<Edit className="w-8 h-8 text-primary" />
|
<Edit className="w-8 h-8 text-primary" />
|
||||||
WYSIWYG Live-Editor
|
WYSIWYG Live-Editor
|
||||||
</h2>
|
</h2>
|
||||||
|
|||||||
@@ -2,6 +2,7 @@
|
|||||||
@tailwind components;
|
@tailwind components;
|
||||||
@tailwind utilities;
|
@tailwind utilities;
|
||||||
|
|
||||||
|
|
||||||
html {
|
html {
|
||||||
color-scheme: dark;
|
color-scheme: dark;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -159,7 +159,7 @@ export default async function OrderSuccessPage({
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between text-base font-bold text-white">
|
<div className="flex justify-between text-base font-bold text-white">
|
||||||
<span>Brutto Gesamtbetrag:</span>
|
<span>Brutto Gesamtbetrag:</span>
|
||||||
<span className={monthlyNet > 0 ? "text-white" : "text-gradient"}>
|
<span className={monthlyNet > 0 ? "text-white" : "text-primary"}>
|
||||||
{new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)}
|
{new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(oneTimeGross)}
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
@@ -183,7 +183,7 @@ export default async function OrderSuccessPage({
|
|||||||
</div>
|
</div>
|
||||||
<div className="flex justify-between text-base font-bold text-white">
|
<div className="flex justify-between text-base font-bold text-white">
|
||||||
<span>Brutto Gesamtbetrag:</span>
|
<span>Brutto Gesamtbetrag:</span>
|
||||||
<span className="text-gradient">
|
<span className="text-primary">
|
||||||
{new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / Monat
|
{new Intl.NumberFormat('de-DE', { style: 'currency', currency: 'EUR' }).format(monthlyGross)} / Monat
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
|
|||||||
@@ -136,10 +136,13 @@ export function NavbarClient({ user, role = "partner" }: NavbarClientProps) {
|
|||||||
<div className="h-4 w-px bg-white/10 mx-2" />
|
<div className="h-4 w-px bg-white/10 mx-2" />
|
||||||
|
|
||||||
{currentUser ? (
|
{currentUser ? (
|
||||||
<div className="relative">
|
<div
|
||||||
|
className="relative"
|
||||||
|
onMouseEnter={() => setOpen(true)}
|
||||||
|
onMouseLeave={() => setOpen(false)}
|
||||||
|
>
|
||||||
<Button
|
<Button
|
||||||
variant="outline"
|
variant="outline"
|
||||||
onClick={() => setOpen(!open)}
|
|
||||||
className="border-white/10 hover:bg-white/5 gap-2 text-white"
|
className="border-white/10 hover:bg-white/5 gap-2 text-white"
|
||||||
>
|
>
|
||||||
<UserIcon className="w-4 h-4 text-primary" />
|
<UserIcon className="w-4 h-4 text-primary" />
|
||||||
|
|||||||
@@ -44,13 +44,14 @@ export function SetupWizard() {
|
|||||||
adminForm.firstName.trim().length > 0 &&
|
adminForm.firstName.trim().length > 0 &&
|
||||||
adminForm.lastName.trim().length > 0
|
adminForm.lastName.trim().length > 0
|
||||||
|
|
||||||
// Validation checks for SMTP form (optional step)
|
// Validation checks for SMTP form
|
||||||
const isSmtpFormValid =
|
const isSmtpFormValid =
|
||||||
smtpForm.host.trim().length === 0 ||
|
smtpForm.host.trim().length > 0 &&
|
||||||
(!isNaN(Number(smtpForm.port)) && smtpForm.user.trim().length > 0)
|
!isNaN(Number(smtpForm.port)) &&
|
||||||
|
smtpForm.user.trim().length > 0
|
||||||
|
|
||||||
const handleFinishSetup = async () => {
|
const handleFinishSetup = async () => {
|
||||||
if (!isAdminFormValid) return
|
if (!isAdminFormValid || !isSmtpFormValid) return
|
||||||
setLoading(true)
|
setLoading(true)
|
||||||
setErrorMsg('')
|
setErrorMsg('')
|
||||||
|
|
||||||
|
|||||||
@@ -7,70 +7,14 @@ import { Check } from 'lucide-react'
|
|||||||
interface ProgressStepperProps {
|
interface ProgressStepperProps {
|
||||||
step: number
|
step: number
|
||||||
basketItemsCount: number
|
basketItemsCount: number
|
||||||
orientation?: 'horizontal' | 'vertical'
|
|
||||||
}
|
}
|
||||||
|
|
||||||
const STEP_LABELS = ['Kunde', 'Modell', 'Software', 'Abschluss']
|
const STEP_LABELS = ['Kunde', 'Modell', 'Software', 'Abschluss']
|
||||||
|
|
||||||
export function ProgressStepper({ step, basketItemsCount, orientation = 'horizontal' }: ProgressStepperProps) {
|
export function ProgressStepper({ step, basketItemsCount }: ProgressStepperProps) {
|
||||||
|
// Calculate progress percentage for active line (Step 1: 0%, Step 2: 33.3%, Step 3: 66.6%, Step 4: 100%)
|
||||||
const progressPercent = ((step - 1) / 3) * 100
|
const progressPercent = ((step - 1) / 3) * 100
|
||||||
|
|
||||||
if (orientation === 'vertical') {
|
|
||||||
return (
|
|
||||||
<div className="flex flex-col gap-6 relative py-2 pl-2">
|
|
||||||
{/* Background Line */}
|
|
||||||
<div className="absolute left-[20px] top-[20px] bottom-[20px] w-[2px] bg-slate-800 z-0 rounded-full" />
|
|
||||||
|
|
||||||
{/* Animated Active Line */}
|
|
||||||
<motion.div
|
|
||||||
className="absolute left-[20px] top-[20px] w-[2px] bg-gradient-to-b from-blue-600 via-sky-400 to-cyan-400 z-0 rounded-full shadow-[0_0_12px_rgba(56,189,248,0.8)]"
|
|
||||||
initial={{ height: '0%' }}
|
|
||||||
animate={{ height: `${progressPercent}%` }}
|
|
||||||
transition={{ duration: 0.5, ease: [0.25, 0.1, 0.25, 1] }}
|
|
||||||
/>
|
|
||||||
|
|
||||||
{[1, 2, 3, 4].map(s => {
|
|
||||||
const isDone = step > s
|
|
||||||
const isActive = step === s
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div key={s} className="relative z-10 flex items-center gap-3">
|
|
||||||
<motion.div
|
|
||||||
initial={false}
|
|
||||||
animate={{
|
|
||||||
scale: isActive ? 1.1 : 1,
|
|
||||||
}}
|
|
||||||
transition={{ type: 'spring', stiffness: 300, damping: 20 }}
|
|
||||||
className={`w-9 h-9 rounded-full flex items-center justify-center font-bold text-xs shrink-0 transition-all duration-300 ${
|
|
||||||
isDone
|
|
||||||
? 'bg-sky-500 text-slate-950 shadow-[0_0_15px_rgba(56,189,248,0.6)] border-2 border-sky-400'
|
|
||||||
: isActive
|
|
||||||
? 'bg-slate-950 border-2 border-sky-400 text-sky-400 shadow-[0_0_20px_rgba(56,189,248,0.7)]'
|
|
||||||
: 'bg-slate-900 border-2 border-slate-800 text-slate-500'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{isDone ? <Check className="w-4 h-4 stroke-[3]" /> : s}
|
|
||||||
</motion.div>
|
|
||||||
|
|
||||||
<span
|
|
||||||
className={`text-xs font-semibold tracking-wide transition-colors duration-300 flex items-center gap-1.5 ${
|
|
||||||
isActive || isDone ? 'text-sky-300' : 'text-slate-500'
|
|
||||||
}`}
|
|
||||||
>
|
|
||||||
{STEP_LABELS[s - 1]}
|
|
||||||
{s === 3 && basketItemsCount > 0 && (
|
|
||||||
<span className="bg-sky-500 text-slate-950 text-[10px] w-4 h-4 rounded-full flex items-center justify-center font-extrabold shadow-sm">
|
|
||||||
{basketItemsCount}
|
|
||||||
</span>
|
|
||||||
)}
|
|
||||||
</span>
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
})}
|
|
||||||
</div>
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="max-w-xl mx-auto mb-10 px-4">
|
<div className="max-w-xl mx-auto mb-10 px-4">
|
||||||
<div className="flex justify-between relative">
|
<div className="flex justify-between relative">
|
||||||
|
|||||||
@@ -229,12 +229,12 @@ export function StepSoftware({
|
|||||||
|
|
||||||
{/* Modules */}
|
{/* Modules */}
|
||||||
{selectedProduct?.modules && selectedProduct.modules.length > 0 && (
|
{selectedProduct?.modules && selectedProduct.modules.length > 0 && (
|
||||||
<div className="mt-6 p-5 rounded-2xl bg-slate-900/60 border border-slate-800 space-y-4 shadow-lg">
|
<div className="mt-6 p-5 rounded-2xl bg-white/5 border border-white/10 space-y-4">
|
||||||
<p className="text-xs font-bold uppercase tracking-wider text-slate-400 flex items-center gap-2">
|
<p className="text-sm font-bold text-white flex items-center gap-2">
|
||||||
<span className="w-2 h-2 rounded-full bg-primary animate-pulse" />
|
<span className="w-1.5 h-1.5 rounded-full bg-primary" />
|
||||||
Zusatzmodule für {selectedProduct.name}
|
Zusatzmodule für {selectedProduct.name}
|
||||||
</p>
|
</p>
|
||||||
<div className="space-y-3">
|
<div className="space-y-2.5">
|
||||||
{selectedProduct.modules.map(module => {
|
{selectedProduct.modules.map(module => {
|
||||||
const isExistingLicense = existingModuleIds.includes(module.id)
|
const isExistingLicense = existingModuleIds.includes(module.id)
|
||||||
const disabled = isExistingLicense || isModuleDisabled(module, sel?.moduleIds ?? [])
|
const disabled = isExistingLicense || isModuleDisabled(module, sel?.moduleIds ?? [])
|
||||||
@@ -242,14 +242,14 @@ export function StepSoftware({
|
|||||||
return (
|
return (
|
||||||
<div
|
<div
|
||||||
key={module.id}
|
key={module.id}
|
||||||
className={`flex flex-col p-4 rounded-xl border transition-all duration-300 ${
|
className={`flex flex-col p-4 rounded-xl border transition-all duration-200 ${
|
||||||
isExistingLicense
|
isExistingLicense
|
||||||
? 'border-slate-800 bg-slate-900/30 opacity-60 cursor-not-allowed'
|
? 'border-primary/20 bg-primary/5 opacity-75'
|
||||||
: disabled
|
: disabled
|
||||||
? 'border-slate-800/40 bg-slate-900/20 opacity-40 cursor-not-allowed'
|
? 'border-white/5 bg-white/5 opacity-40'
|
||||||
: checked
|
: checked
|
||||||
? 'border-primary/40 bg-primary/10 shadow-[0_0_15px_rgba(59,130,246,0.1)]'
|
? 'border-primary/30 bg-primary/5'
|
||||||
: 'border-slate-800 bg-slate-900/50 hover:bg-slate-900 hover:border-slate-700'
|
: 'border-white/5 bg-white/5 hover:bg-white/10'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<div className="flex items-start space-x-3">
|
<div className="flex items-start space-x-3">
|
||||||
@@ -258,19 +258,19 @@ export function StepSoftware({
|
|||||||
checked={checked}
|
checked={checked}
|
||||||
onCheckedChange={() => !isExistingLicense && toggleModule(currentCategory.id, module.id)}
|
onCheckedChange={() => !isExistingLicense && toggleModule(currentCategory.id, module.id)}
|
||||||
disabled={disabled}
|
disabled={disabled}
|
||||||
className="rounded border-slate-700 data-[state=checked]:bg-primary data-[state=checked]:border-primary transition-colors"
|
className="rounded border-white/20 data-[state=checked]:bg-primary"
|
||||||
/>
|
/>
|
||||||
<div className="flex-1">
|
<div className="flex-1">
|
||||||
<Label
|
<Label
|
||||||
htmlFor={isExistingLicense ? undefined : `mod-${currentCategory.id}-${module.id}`}
|
htmlFor={isExistingLicense ? undefined : `mod-${currentCategory.id}-${module.id}`}
|
||||||
className={`font-semibold text-sm flex justify-between text-white ${
|
className={`font-semibold text-sm flex justify-between text-white ${
|
||||||
isExistingLicense ? 'cursor-not-allowed' : disabled ? 'cursor-not-allowed' : 'cursor-pointer'
|
isExistingLicense ? 'cursor-default' : disabled ? 'cursor-not-allowed' : 'cursor-pointer'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<span className="flex items-center gap-2 flex-wrap">
|
<span className="flex items-center gap-1.5 flex-wrap">
|
||||||
{module.name}
|
{module.name}
|
||||||
{isExistingLicense && (
|
{isExistingLicense && (
|
||||||
<span className="inline-flex items-center gap-1 text-[9px] px-2 py-0.5 rounded bg-slate-800 text-slate-400 border border-slate-700 font-semibold uppercase tracking-wider">
|
<span className="inline-flex items-center gap-1 text-[9px] px-1.5 py-0.5 rounded bg-primary/20 text-primary border border-primary/30 font-bold uppercase tracking-wider">
|
||||||
<Lock className="w-2.5 h-2.5" /> Bereits lizenziert
|
<Lock className="w-2.5 h-2.5" /> Bereits lizenziert
|
||||||
</span>
|
</span>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -70,7 +70,7 @@ export function StepSummary({
|
|||||||
<div className="lg:col-span-5 flex flex-col h-full overflow-hidden pr-4 space-y-6">
|
<div className="lg:col-span-5 flex flex-col h-full overflow-hidden pr-4 space-y-6">
|
||||||
<div className="flex-1 overflow-y-auto pr-1 space-y-6 pb-4 subpixel-antialiased scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent">
|
<div className="flex-1 overflow-y-auto pr-1 space-y-6 pb-4 subpixel-antialiased scrollbar-thin scrollbar-thumb-white/10 scrollbar-track-transparent">
|
||||||
|
|
||||||
{/* Header */}
|
{/* Header & Status Stepper */}
|
||||||
<div className="space-y-4">
|
<div className="space-y-4">
|
||||||
<div className="flex items-center gap-3">
|
<div className="flex items-center gap-3">
|
||||||
<div className="w-12 h-12 bg-primary/20 rounded-xl flex items-center justify-center border border-primary/50 shrink-0">
|
<div className="w-12 h-12 bg-primary/20 rounded-xl flex items-center justify-center border border-primary/50 shrink-0">
|
||||||
@@ -85,6 +85,39 @@ export function StepSummary({
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Vertikaler Status-Stepper */}
|
||||||
|
<div className="space-y-4 py-4 border-t border-b border-white/5">
|
||||||
|
<p className="text-[10px] font-bold uppercase tracking-wider text-slate-500">
|
||||||
|
Schritt 4 von 4 — Zusammenfassung & Abschluss
|
||||||
|
</p>
|
||||||
|
<div className="flex flex-col gap-3 pl-1">
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<div className="w-6 h-6 rounded-full bg-green-500/20 border border-green-500/35 flex items-center justify-center text-green-400 text-xs">
|
||||||
|
<Icons.Check className="w-3.5 h-3.5" />
|
||||||
|
</div>
|
||||||
|
<span className="text-sm text-slate-400 font-medium">Kunde</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<div className="w-6 h-6 rounded-full bg-green-500/20 border border-green-500/35 flex items-center justify-center text-green-400 text-xs">
|
||||||
|
<Icons.Check className="w-3.5 h-3.5" />
|
||||||
|
</div>
|
||||||
|
<span className="text-sm text-slate-400 font-medium">Modell</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<div className="w-6 h-6 rounded-full bg-green-500/20 border border-green-500/35 flex items-center justify-center text-green-400 text-xs">
|
||||||
|
<Icons.Check className="w-3.5 h-3.5" />
|
||||||
|
</div>
|
||||||
|
<span className="text-sm text-slate-400 font-medium">Software</span>
|
||||||
|
</div>
|
||||||
|
<div className="flex items-center gap-3">
|
||||||
|
<div className="w-6 h-6 rounded-full bg-primary/20 border border-primary text-primary flex items-center justify-center text-xs font-bold shadow-[0_0_10px_rgba(59,130,246,0.2)]">
|
||||||
|
4
|
||||||
|
</div>
|
||||||
|
<span className="text-sm text-white font-bold">Abschluss</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Kunden-Info Card */}
|
{/* Kunden-Info Card */}
|
||||||
|
|||||||
@@ -34,10 +34,10 @@ export async function isSetupNeeded(): Promise<boolean> {
|
|||||||
|
|
||||||
if (authError) {
|
if (authError) {
|
||||||
console.error('Error checking auth users list:', authError)
|
console.error('Error checking auth users list:', authError)
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
if (authData && authData.users && authData.users.length > 0) {
|
if (authData.users.length > 0) {
|
||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,13 +48,13 @@ export async function isSetupNeeded(): Promise<boolean> {
|
|||||||
|
|
||||||
if (dbError) {
|
if (dbError) {
|
||||||
console.error('Error checking users table status:', dbError)
|
console.error('Error checking users table status:', dbError)
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
return count === 0
|
return count === 0
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
console.error('Exception checking setup status:', e)
|
console.error('Exception checking setup status:', e)
|
||||||
return true
|
return false
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -113,23 +113,22 @@ export async function completeSetup(
|
|||||||
console.error('Error updating admin profile:', profileError)
|
console.error('Error updating admin profile:', profileError)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 5. Store SMTP configuration in public.settings (optional)
|
// 5. Store SMTP configuration in public.settings
|
||||||
if (smtpData.host && smtpData.host.trim().length > 0) {
|
const { error: smtpError } = await admin
|
||||||
const { error: smtpError } = await admin
|
.from('settings')
|
||||||
.from('settings')
|
.upsert({
|
||||||
.upsert({
|
id: 'smtp',
|
||||||
id: 'smtp',
|
host: smtpData.host,
|
||||||
host: smtpData.host,
|
port: smtpData.port,
|
||||||
port: smtpData.port,
|
secure: smtpData.secure,
|
||||||
secure: smtpData.secure,
|
user: smtpData.user,
|
||||||
user: smtpData.user,
|
pass: smtpData.pass,
|
||||||
pass: smtpData.pass,
|
updated_at: new Date().toISOString(),
|
||||||
updated_at: new Date().toISOString(),
|
})
|
||||||
})
|
|
||||||
|
|
||||||
if (smtpError) {
|
if (smtpError) {
|
||||||
console.error('Error saving SMTP settings:', smtpError)
|
console.error('Error saving SMTP settings:', smtpError)
|
||||||
}
|
return { success: false, error: `Fehler beim Speichern der SMTP-Einstellungen: ${smtpError.message}` }
|
||||||
}
|
}
|
||||||
|
|
||||||
revalidatePath('/')
|
revalidatePath('/')
|
||||||
|
|||||||
Reference in New Issue
Block a user