Add a comprehensive Rocky Linux installation guide and streamline domain configuration
Add a detailed guide for installing the application on Rocky Linux, including systemd service setup and Nginx configuration. Streamline domain setting by introducing a script to update environment variables and rebuild the frontend, and remove the URL input from the flyer component. Replit-Commit-Author: Agent Replit-Commit-Session-Id: 923ae0e3-a363-4db8-b04a-e8baca2a1330 Replit-Commit-Checkpoint-Type: full_checkpoint Replit-Commit-Event-Id: 3d999b96-66af-4728-92b9-3a39ade05f44 Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/8af7d2ec-2cc3-4ece-8af3-9f071488d072/923ae0e3-a363-4db8-b04a-e8baca2a1330/qCk7LE3 Replit-Helium-Checkpoint-Created: true
This commit is contained in:
@@ -1,53 +1,27 @@
|
||||
import React, { useState } from "react";
|
||||
import React from "react";
|
||||
import { QRCodeSVG } from "qrcode.react";
|
||||
import { Printer, ExternalLink } from "lucide-react";
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { Input } from "@/components/ui/input";
|
||||
import { Link } from "wouter";
|
||||
|
||||
// ══════════════════════════════════════════════════════════
|
||||
// URL encodée dans le QR code — modifiez cette ligne
|
||||
const DEFAULT_QR_URL = "https://lavoixdupeuple.fr";
|
||||
// ══════════════════════════════════════════════════════════
|
||||
// URL du QR code — définie via VITE_APP_URL dans le fichier .env
|
||||
// Modifier .env puis exécuter : bash scripts/set-domain.sh https://votredomaine.fr
|
||||
const QR_URL = (new URLSearchParams(window.location.search).get("url"))
|
||||
|| import.meta.env.VITE_APP_URL
|
||||
|| "https://lavoixdupeuple.fr";
|
||||
|
||||
export default function Flyer() {
|
||||
const params = new URLSearchParams(window.location.search);
|
||||
const [qrUrl, setQrUrl] = useState(params.get("url") || DEFAULT_QR_URL);
|
||||
const [inputValue, setInputValue] = useState(qrUrl);
|
||||
|
||||
const applyUrl = () => {
|
||||
const trimmed = inputValue.trim();
|
||||
if (trimmed) setQrUrl(trimmed);
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-muted/20 flex flex-col items-center py-8 px-4 gap-6">
|
||||
|
||||
{/* Barre de contrôle — masquée à l'impression */}
|
||||
<div className="no-print w-full max-w-xl bg-white border border-border/50 p-4 rounded-sm space-y-3">
|
||||
<p className="text-xs font-mono text-muted-foreground uppercase tracking-widest">
|
||||
Destination du QR code
|
||||
</p>
|
||||
<div className="flex gap-2">
|
||||
<Input
|
||||
value={inputValue}
|
||||
onChange={(e) => setInputValue(e.target.value)}
|
||||
onKeyDown={(e) => e.key === "Enter" && applyUrl()}
|
||||
placeholder="https://lavoixdupeuple.fr"
|
||||
className="font-mono text-sm"
|
||||
/>
|
||||
<Button onClick={applyUrl} variant="outline" size="sm">
|
||||
Appliquer
|
||||
</Button>
|
||||
</div>
|
||||
<div className="flex gap-2">
|
||||
<Button onClick={() => window.print()} size="sm" className="gap-2">
|
||||
<Printer className="h-3.5 w-3.5" /> Imprimer / Exporter PDF
|
||||
</Button>
|
||||
<Link href="/">
|
||||
<Button variant="ghost" size="sm">← Retour</Button>
|
||||
</Link>
|
||||
</div>
|
||||
<div className="no-print w-full max-w-xl bg-white border border-border/50 p-4 rounded-sm flex gap-2">
|
||||
<Button onClick={() => window.print()} size="sm" className="gap-2">
|
||||
<Printer className="h-3.5 w-3.5" /> Imprimer / Exporter PDF
|
||||
</Button>
|
||||
<Link href="/">
|
||||
<Button variant="ghost" size="sm">← Retour</Button>
|
||||
</Link>
|
||||
</div>
|
||||
|
||||
{/* Flyer imprimable */}
|
||||
@@ -83,7 +57,7 @@ export default function Flyer() {
|
||||
<div className="flex flex-col items-center gap-4 my-4">
|
||||
<div className="p-4 border border-border/40 bg-white">
|
||||
<QRCodeSVG
|
||||
value={qrUrl}
|
||||
value={QR_URL}
|
||||
size={220}
|
||||
bgColor="#ffffff"
|
||||
fgColor="#1a1a2e"
|
||||
@@ -93,7 +67,7 @@ export default function Flyer() {
|
||||
</div>
|
||||
<div className="flex items-center gap-1.5 text-xs font-mono text-muted-foreground">
|
||||
<ExternalLink className="h-3 w-3" />
|
||||
<span>{qrUrl}</span>
|
||||
<span>{QR_URL}</span>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -106,7 +80,7 @@ export default function Flyer() {
|
||||
className="text-lg font-bold text-primary tracking-wide"
|
||||
style={{ fontFamily: "'Bahnschrift', 'DIN Alternate', sans-serif" }}
|
||||
>
|
||||
{qrUrl.replace(/^https?:\/\//, "")}
|
||||
{QR_URL.replace(/^https?:\/\//, "")}
|
||||
</p>
|
||||
</div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user