Skip to content

Commit b4d27a9

Browse files
h0tak88rclaude
andcommitted
fix(monitor): wire pause/resume to correct handlers; default interval 86400
- Pause/Resume on monitor targets returned 'domain is required' because all four /monitor/{url,subdomain}-targets/:id/{pause,resume} routes were wired to the ADD-target handler (which requires a domain in the body) instead of the dedicated pause/resume handlers (apiPause/ResumeMonitor*Target) that read :id and just flip is_running. Point the routes at the correct handlers. - Default subdomain-monitor interval is now 86400s (24h) instead of 3600s — updated the form value, the JS fallback, and the backend default. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent 158bb6b commit b4d27a9

4 files changed

Lines changed: 7 additions & 7 deletions

File tree

internal/api/api.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -570,12 +570,12 @@ func SetupAPI() *gin.Engine {
570570
apiGroup.POST("/monitor/url-targets", apiPostMonitorURLTarget)
571571
apiGroup.POST("/monitor/suggest-from-domain", apiPostMonitorSuggestFromDomain)
572572
apiGroup.DELETE("/monitor/url-targets/:id", apiDeleteMonitorURLTarget)
573-
apiGroup.POST("/monitor/url-targets/:id/pause", apiPostMonitorURLTarget)
574-
apiGroup.POST("/monitor/url-targets/:id/resume", apiPostMonitorURLTarget)
573+
apiGroup.POST("/monitor/url-targets/:id/pause", apiPauseMonitorURLTarget)
574+
apiGroup.POST("/monitor/url-targets/:id/resume", apiResumeMonitorURLTarget)
575575
apiGroup.POST("/monitor/subdomain-targets", apiPostMonitorSubdomainTarget)
576576
apiGroup.DELETE("/monitor/subdomain-targets/:id", apiDeleteMonitorSubdomainTarget)
577-
apiGroup.POST("/monitor/subdomain-targets/:id/pause", apiPostMonitorSubdomainTarget)
578-
apiGroup.POST("/monitor/subdomain-targets/:id/resume", apiPostMonitorSubdomainTarget)
577+
apiGroup.POST("/monitor/subdomain-targets/:id/pause", apiPauseMonitorSubdomainTarget)
578+
apiGroup.POST("/monitor/subdomain-targets/:id/resume", apiResumeMonitorSubdomainTarget)
579579
apiGroup.GET("/r2/files", apiR2Files)
580580
apiGroup.POST("/r2/delete", apiR2Delete)
581581
// Bug bounty scope / target fetch endpoints

internal/api/ui/index.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -587,7 +587,7 @@ <h1 class="view-title">Monitor</h1>
587587
</div>
588588
<div style="width:100px">
589589
<label for="monitor-sub-interval" style="display:block;font-size:11px;color:var(--text-muted);margin-bottom:4px">Interval (s)</label>
590-
<input class="search-input" id="monitor-sub-interval" type="number" min="60" step="60" value="3600" style="width:100%;box-sizing:border-box" />
590+
<input class="search-input" id="monitor-sub-interval" type="number" min="60" step="60" value="86400" style="width:100%;box-sizing:border-box" />
591591
</div>
592592
<div style="width:88px">
593593
<label for="monitor-sub-threads" style="display:block;font-size:11px;color:var(--text-muted);margin-bottom:4px">Threads</label>

internal/api/ui/pages/monitor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@
6767
window.showToast('error', 'Domain required', 'Enter a root domain (e.g. example.com).');
6868
return;
6969
}
70-
const interval_seconds = intEl ? Math.max(60, parseInt(intEl.value, 10) || 3600) : 3600;
70+
const interval_seconds = intEl ? Math.max(60, parseInt(intEl.value, 10) || 86400) : 86400;
7171
const threads = thEl ? Math.min(500, Math.max(1, parseInt(thEl.value, 10) || 100)) : 100;
7272
const check_new = cnEl ? cnEl.checked : true;
7373
const monitor_js = jsEl ? jsEl.checked : false;

internal/api/ui_api.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1742,7 +1742,7 @@ func apiPostMonitorSubdomainTarget(c *gin.Context) {
17421742

17431743
interval := body.IntervalSeconds
17441744
if interval <= 0 {
1745-
interval = 3600
1745+
interval = 86400
17461746
}
17471747
threads := body.Threads
17481748
if threads <= 0 {

0 commit comments

Comments
 (0)