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:
@@ -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);
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user