fix: add /ui prefix to alarm API calls — chart trending data was 404

This commit is contained in:
tian 2026-07-17 18:06:50 +08:00
parent a58c99a2f3
commit 139baeef5f
2 changed files with 3 additions and 3 deletions

View File

@ -142,7 +142,7 @@
}
try {
var es = new EventSource("/api/alarms/stream");
var es = new EventSource("/ui/api/alarms/stream");
es.onmessage = function(e) {
try {
var alarm = JSON.parse(e.data);
@ -165,7 +165,7 @@
var ctx = canvas.getContext("2d");
var dpr = window.devicePixelRatio || 1;
fetch("/api/alarms/daily-count?days=7", {credentials:"same-origin"})
fetch("/ui/api/alarms/daily-count?days=7", {credentials:"same-origin"})
.then(function(r){return r.json()})
.then(function(data){
if (!data || data.length === 0) return;

View File

@ -382,7 +382,7 @@
}
function pollAlarmCount() {
fetch("/api/alarms/unacknowledged-count", {credentials:"same-origin"})
fetch("/ui/api/alarms/unacknowledged-count", {credentials:"same-origin"})
.then(function(r){return r.json()})
.then(function(data){updateAlarmBadge(data.count||0)})
.catch(function(){});