Openstatus www.openstatus.dev
6
fork

Configure Feed

Select the types of activity you want to include in your feed.

🧹 bandwith (#1090)

* 🧹 bandwith

* 🧹 bandwith

* ci: apply automated fixes

---------

Co-authored-by: autofix-ci[bot] <114827586+autofix-ci[bot]@users.noreply.github.com>

authored by

Thibault Le Ouay
autofix-ci[bot]
and committed by
GitHub
89ee9ab0 f7e4b00e

+22 -8
+8 -1
apps/checker/handlers/checker.go
··· 309 309 310 310 } 311 311 312 - c.JSON(http.StatusOK, result) 312 + returnData := c.Query("data") 313 + if returnData == "true" { 314 + c.JSON(http.StatusOK, result) 315 + 316 + return 317 + } 318 + 319 + c.JSON(http.StatusOK, nil) 313 320 }
+9 -2
apps/checker/handlers/tcp.go
··· 210 210 } 211 211 } 212 212 213 - c.JSON(http.StatusOK, response) 213 + returnData := c.Query("data") 214 + if returnData == "true" { 215 + c.JSON(http.StatusOK, response) 216 + 217 + return 218 + } 219 + 220 + c.JSON(http.StatusOK, nil) 214 221 } 215 222 216 223 func (h Handler) TCPHandlerRegion(c *gin.Context) { 217 224 ctx := c.Request.Context() 218 - dataSourceName := "check_tcp_response__v1" 225 + dataSourceName := "check_tcp_respo…nse__v1" 219 226 220 227 region := c.Param("region") 221 228 if region == "" {
+3 -3
apps/server/src/v1/monitors/run/post.ts
··· 42 42 200: { 43 43 content: { 44 44 "application/json": { 45 - schema: z.array(HTTPTriggerResult).or(z.array(TCPTriggerResult)), 45 + schema: z.array(TriggerResult), 46 46 }, 47 47 }, 48 48 description: "All the historical metrics", ··· 218 218 function generateUrl({ row }: { row: z.infer<typeof selectMonitorSchema> }) { 219 219 switch (row.jobType) { 220 220 case "http": 221 - return `https://openstatus-checker.fly.dev/checker/http?monitor_id=${row.id}&trigger=api`; 221 + return `https://openstatus-checker.fly.dev/checker/http?monitor_id=${row.id}&trigger=api&data=true`; 222 222 case "tcp": 223 - return `https://openstatus-checker.fly.dev/checker/tcp?monitor_id=${row.id}&trigger=api`; 223 + return `https://openstatus-checker.fly.dev/checker/tcp?monitor_id=${row.id}&trigger=api&data=true`; 224 224 default: 225 225 throw new Error("Invalid jobType"); 226 226 }
+2 -2
apps/server/src/v1/monitors/trigger/post.ts
··· 186 186 function generateUrl({ row }: { row: z.infer<typeof selectMonitorSchema> }) { 187 187 switch (row.jobType) { 188 188 case "http": 189 - return `https://openstatus-checker.fly.dev/checker/http?monitor_id=${row.id}&trigger=api`; 189 + return `https://openstatus-checker.fly.dev/checker/http?monitor_id=${row.id}&trigger=api&data=true`; 190 190 case "tcp": 191 - return `https://openstatus-checker.fly.dev/checker/tcp?monitor_id=${row.id}&trigger=api`; 191 + return `https://openstatus-checker.fly.dev/checker/tcp?monitor_id=${row.id}&trigger=api&data=true`; 192 192 default: 193 193 throw new Error("Invalid jobType"); 194 194 }