修复无法查询的BUG

This commit is contained in:
CN-JS-HuiBai
2026-04-05 23:46:29 +08:00
parent 322621a97b
commit 90c7bd80b1
2 changed files with 3 additions and 3 deletions

View File

@@ -460,8 +460,8 @@
</div>
</div>
<div class="form-group" style="margin-top: 15px;">
<label for="latencyTargetInput">Blackbox 探测目标 (在Prometheus中的instance标签值)</label>
<input type="text" id="latencyTargetInput" placeholder="例:8.8.8.8">
<label for="latencyTargetInput">Blackbox 探测目标 (在Prometheus中的instance_name标签值)</label>
<input type="text" id="latencyTargetInput" placeholder="例:China-USA-Latency">
</div>
<div class="form-actions" style="margin-top: 25px; display: flex; justify-content: flex-end;">
<button class="btn btn-add" id="btnSaveSiteSettings">保存设置</button>

View File

@@ -805,7 +805,7 @@ module.exports = {
if (!blackboxUrl || !target) return null;
try {
const normalized = blackboxUrl.trim().replace(/\/+$/, '');
const params = new URLSearchParams({ query: `probe_duration_seconds{instance="${target}"}` });
const params = new URLSearchParams({ query: `probe_duration_seconds{instance_name="${target}"}` });
const res = await fetch(`${normalized}/api/v1/query?${params.toString()}`);
if (!res.ok) return null;
const data = await res.json();