fix(agent): versionnage des fichiers agent pour éviter le cache navigateur

- build.sh génère désormais des fichiers versionnés (edubox-agent-vX.Y.Z)
- dashboard et /api/download pointent vers les fichiers versionnés
- affichage de la version actuelle sur la page de téléchargement
This commit is contained in:
root
2026-06-12 21:50:14 +00:00
parent 852171cc59
commit 2feea2d063
5 changed files with 18 additions and 7 deletions
+6 -3
View File
@@ -1,9 +1,12 @@
import { NextResponse } from "next/server";
const AGENT_VERSION = "0.2.3";
export async function GET() {
return NextResponse.json({
windows: "/agent/edubox-agent.exe",
linux: "/agent/edubox-agent",
mac: "/agent/edubox-agent-mac",
version: AGENT_VERSION,
windows: `/edubox-agent-v${AGENT_VERSION}.exe`,
linux: `/edubox-agent-v${AGENT_VERSION}`,
mac: `/edubox-agent-v${AGENT_VERSION}-mac`,
});
}
+6 -4
View File
@@ -1,5 +1,6 @@
import { Card, CardHeader, CardTitle, CardContent } from "@/components/ui/card";
import { Button } from "@/components/ui/button";
const AGENT_VERSION = "0.2.3";
export const dynamic = "force-dynamic";
@@ -7,6 +8,7 @@ export default function DownloadPage() {
return (
<div className="space-y-6">
<h1 className="text-3xl font-bold">Téléchargements Agent</h1>
<p className="text-sm text-muted-foreground">Version actuelle : <strong>{AGENT_VERSION}</strong></p>
<div className="grid grid-cols-1 md:grid-cols-3 gap-4">
<Card>
<CardHeader>
@@ -14,7 +16,7 @@ export default function DownloadPage() {
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground mb-4">Agent EduBox pour Windows (64 bits)</p>
<a href="/edubox-agent.exe" download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger (.exe)</a>
<a href={`/edubox-agent-v${AGENT_VERSION}.exe`} download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger (.exe)</a>
</CardContent>
</Card>
<Card>
@@ -23,7 +25,7 @@ export default function DownloadPage() {
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground mb-4">Agent EduBox pour Linux (64 bits)</p>
<a href="/edubox-agent" download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a>
<a href={`/edubox-agent-v${AGENT_VERSION}`} download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a>
</CardContent>
</Card>
<Card>
@@ -32,7 +34,7 @@ export default function DownloadPage() {
</CardHeader>
<CardContent>
<p className="text-sm text-muted-foreground mb-4">Agent EduBox pour macOS (Intel & Apple Silicon)</p>
<a href="/edubox-agent-mac" download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a>
<a href={`/edubox-agent-v${AGENT_VERSION}-mac`} download className="inline-flex items-center justify-center rounded-md text-sm font-medium bg-primary text-primary-foreground hover:bg-primary/90 h-10 px-4 py-2 w-full">Télécharger</a>
</CardContent>
</Card>
</div>