fix(ui): подтверждать операции рекурсивных маршрутов

This commit is contained in:
Denozordec committed 2026-09-30 21:08:01 +07:00
1 parent 79a8d95e7d
commit f5fc9282e2
11 files changed
+364 -138

No files matched your search

+5 -4
View File
@@ -197,7 +197,7 @@ const recursiveRoutesPlugin: FastifyPluginAsyncZod = async (app) => {
})
}
}
return reply.send({ gateways: [...map.values()] })
return reply.send({ serverId, gateways: [...map.values()] })
} catch (err) {
return reply.status(500).send({ error: String(err) })
}
@@ -226,10 +226,11 @@ const recursiveRoutesPlugin: FastifyPluginAsyncZod = async (app) => {
payload: canonicalRecursiveRoutes(live),
})
const stored = await mapDbRoutes(serverId)
return reply.send({ routes: stored, live: true, stale: false })
return reply.send({ serverId, routes: stored, live: true, stale: false })
} catch (err) {
app.log.warn({ serverId, err: String(err) }, "recursive live GET failed, serving cache")
return reply.send({
serverId,
routes: cached,
live: false,
stale: true,
@@ -256,7 +257,7 @@ const recursiveRoutesPlugin: FastifyPluginAsyncZod = async (app) => {
try {
const result = await applyRecursiveToServer(server, routes, source)
const stored = await mapDbRoutes(serverId)
return reply.send({ ok: true, routes: stored, pushedRoutes: result.pushed })
return reply.send({ ok: true, serverId, routes: stored, pushedRoutes: result.pushed })
} catch (err) {
return reply.status(500).send({ error: String(err) })
}
@@ -308,7 +309,7 @@ const recursiveRoutesPlugin: FastifyPluginAsyncZod = async (app) => {
try {
const result = await applyRecursiveToServer(server, routes, "rollback")
const stored = await mapDbRoutes(server.id)
return reply.send({ ok: true, routes: stored, pushedRoutes: result.pushed })
return reply.send({ ok: true, serverId: server.id, routes: stored, pushedRoutes: result.pushed })
} catch (err) {
return reply.status(500).send({ error: String(err) })
}