feat(ui): metrikleri odaklanma ve gezinme durumunda yenile

Metriklerin güncel kalması için pencere odaklanıldığında ve sayfa
gezinildiğinde verilerin yeniden yüklenmesi eklendi. Backend deployment
servisinde tip tanımları güncellendi.
This commit is contained in:
2026-02-02 19:03:41 +00:00
parent 003ddfcbd1
commit a117275efe
4 changed files with 37 additions and 5 deletions

View File

@@ -88,6 +88,10 @@ router.get("/env-examples", async (req, res) => {
router.get("/metrics/summary", async (req, res) => {
authMiddleware(req, res, async () => {
const deploymentCount = await DeploymentProject.countDocuments();
if (deploymentCount === 0) {
await deploymentService.bootstrapFromFilesystem();
}
const since = new Date();
since.setDate(since.getDate() - 7);

View File

@@ -30,6 +30,10 @@ router.get("/", async (_req, res) => {
});
router.get("/metrics/summary", async (_req, res) => {
const jobCount = await Job.countDocuments();
if (jobCount === 0) {
await jobService.bootstrapFromFilesystem();
}
const since = new Date();
since.setDate(since.getDate() - 7);

View File

@@ -385,7 +385,7 @@ class DeploymentService {
this.io.except(`deployment:${deploymentId}`).emit("deployment:log", { deploymentId, line });
}
private emitRun(deploymentId: string, run: DeploymentRun) {
private emitRun(deploymentId: string, run: DeploymentRunDocument) {
if (!this.io) return;
this.io.to(`deployment:${deploymentId}`).emit("deployment:run", {
deploymentId,