修复无法查询的BUG
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user