Pārlūkot izejas kodu

no message

production
[email protected] pirms 5 stundām
vecāks
revīzija
98348433ff
2 mainītis faili ar 16 papildinājumiem un 2 dzēšanām
  1. +8
    -1
      src/components/ClientMonitor/LabelPrinterMonitorPanel.tsx
  2. +8
    -1
      src/components/ClientMonitor/PrinterMonitorTab.tsx

+ 8
- 1
src/components/ClientMonitor/LabelPrinterMonitorPanel.tsx Parādīt failu

@@ -189,6 +189,11 @@ export default function LabelPrinterMonitorPanel({
{ method: "POST" },
);
if (checkRes.status === 401 || checkRes.status === 403) return;
if (checkRes.status === 404) {
throw new Error(
"標籤印表機監控 API 未啟用,請重新啟動後端並確認已部署最新版本"
);
}
if (!checkRes.ok) {
throw new Error(`check HTTP ${checkRes.status}`);
}
@@ -197,7 +202,9 @@ export default function LabelPrinterMonitorPanel({
setSummary(checkData.summary ?? null);
} catch (e) {
console.error("label printer monitor check", e);
setError("無法檢查標籤印表機狀態");
setError(
e instanceof Error ? e.message : "無法檢查標籤印表機狀態"
);
} finally {
setLoading(false);
checkInFlightRef.current = false;


+ 8
- 1
src/components/ClientMonitor/PrinterMonitorTab.tsx Parādīt failu

@@ -85,6 +85,11 @@ export default function PrinterMonitorTab({ active, refreshAt = 0 }: Props) {
{ method: "POST" }
);
if (response.status === 401 || response.status === 403) return;
if (response.status === 404) {
throw new Error(
"印表機監控 API 未啟用,請重新啟動後端並確認已部署最新版本"
);
}
if (!response.ok) {
throw new Error(`HTTP ${response.status}`);
}
@@ -94,7 +99,9 @@ export default function PrinterMonitorTab({ active, refreshAt = 0 }: Props) {
setSummary(data.summary ?? null);
} catch (e) {
console.error("printer monitor check", e);
setError("無法檢查印表機連線");
setError(
e instanceof Error ? e.message : "無法檢查印表機連線"
);
} finally {
setLoading(false);
inFlightRef.current = false;


Notiek ielāde…
Atcelt
Saglabāt