clean: suppression complète PrestaShop

This commit is contained in:
EduBox Dev
2026-06-20 13:57:37 +00:00
parent 20baf3878f
commit dd49993157
25 changed files with 496 additions and 249 deletions
+7 -5
View File
@@ -42,9 +42,13 @@ export async function GET(req: NextRequest) {
const publicUrl = domain
? `https://${inst.id}.${domain}`
: null;
const localUrl = inst.node.tailscaleIp
? `http://${inst.node.tailscaleIp}:${inst.port}`
: null;
return {
...inst,
publicUrl,
localUrl,
};
});
@@ -70,7 +74,6 @@ export async function POST(req: NextRequest) {
const domain = node?.student?.class.establishment?.domain;
const publicDomain = domain ? `${instance.id}.${domain}` : "localhost";
const publicUrl = domain ? `https://${publicDomain}` : null;
const sent = sendToNode(nodeId, {
action: "start",
instanceId: instance.id,
@@ -80,7 +83,7 @@ export async function POST(req: NextRequest) {
.replace(/{PORT}/g, String(instance.port))
.replace(/{INSTANCE_ID}/g, instance.id)
.replace(/{PUBLIC_URL}/g, publicUrl || `http://localhost:${instance.port}`)
.replace(/{PUBLIC_DOMAIN}/g, publicDomain),
.replace(/{PUBLIC_DOMAIN}/g, "localhost"),
});
if (!sent) {
@@ -99,7 +102,6 @@ export async function PATCH(req: NextRequest) {
const domain = instance.node.student?.class.establishment?.domain;
const publicDomain = domain ? `${instance.id}.${domain}` : "localhost";
const publicUrl = domain ? `https://${publicDomain}` : null;
if (action === "stop") {
sendToNode(instance.nodeId, { action: "delete", instanceId: instance.id });
await prisma.instance.update({ where: { id }, data: { status: "stopped" } });
@@ -113,7 +115,7 @@ export async function PATCH(req: NextRequest) {
.replace(/{PORT}/g, String(instance.port))
.replace(/{INSTANCE_ID}/g, instance.id)
.replace(/{PUBLIC_URL}/g, publicUrl || `http://localhost:${instance.port}`)
.replace(/{PUBLIC_DOMAIN}/g, publicDomain),
.replace(/{PUBLIC_DOMAIN}/g, "localhost"),
});
if (!sent) await prisma.instance.update({ where: { id }, data: { status: "error" } });
} else if (action === "reset") {
@@ -126,7 +128,7 @@ export async function PATCH(req: NextRequest) {
.replace(/{PORT}/g, String(instance.port))
.replace(/{INSTANCE_ID}/g, instance.id)
.replace(/{PUBLIC_URL}/g, publicUrl || `http://localhost:${instance.port}`)
.replace(/{PUBLIC_DOMAIN}/g, publicDomain),
.replace(/{PUBLIC_DOMAIN}/g, "localhost"),
});
if (!sent) await prisma.instance.update({ where: { id }, data: { status: "error" } });
}