0xfurai / 0xfurai/peekaping

Feature request: Push endpoint should honor status parameter to change monitor state

未关闭
#214 0 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看
主要语言
Go
星标
1.2k
派生
69
PR 合并指标
30 天内没有已合并 PR

描述

**Description:**
First of all — great work on Peekaping! I really like the UI and overall usability.
While testing the Push monitor, I noticed that the `status` and `msg` query parameters are accepted but not applied to the monitor’s state.

- The `msg` value appears in the logs.
- The `status` value (`up`, `down`, `start`) seems to be ignored.
- The check remains green as long as pings arrive within the allowed interval.

Is this the intended behavior or something still in progress?

**Expected behavior:**
Sending:
```bash
curl "https://demo.peekaping.com/api/v1/push/?status=down&msg=Manual fail"
```
should immediately mark the monitor as failed, while
```bash
curl "https://demo.peekaping.com/api/v1/push/?status=up&msg=OK"
```
should mark it as healthy again.

**Actual behavior:**
The API always returns a success response but does not modify the check state.

**API response:**
```json
{
"ok": "true"
}
```
This response is returned regardless of the `status` value. The monitor remains green until no further pings arrive and the interval times out.

**Steps to reproduce:**
1. Create a Push monitor.
2. Send one `status=up` request.
3. Send `status=down` — returns `"ok": "true"`, but the check state does not change.

**Suggestion:**
Evaluate the `status` parameter to allow explicit state changes (`up` → healthy, `down` → failed, `start` → pending).
This would make the Push endpoint compatible with heartbeat-based tools such as Healthchecks.io.

贡献指南

这个仓库没有索引到贡献指南

调研方向

在 API 路由中找到推送端点处理程序,可能在类似 `api/v1/push.go` 的文件中。检查它如何处理 `status` 和 `msg` 查询参数。需要添加基于 `status` 参数更新监视器状态的逻辑。查找现有的监视器状态管理函数以理解数据模型。通过创建推送监视器并发送 curl 请求来验证状态变化进行测试。

由索引模型根据 Issue 内容生成。

评估

技术栈
go
领域
api, backend
Issue 类型
功能
难度
3/5
预计耗时
1-2 天
活跃度
停滞
描述清晰度
描述清楚
新手友好度
55/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。