[RELEASE] 晉升 demo 變更至 main 生產環境

1. [FIX] 修正下位機 Discord 告警發送條件與層級對等(過濾 info 層級日誌如 0401, 0410,僅發送 warning/error;並依嚴重程度動態調整標題 Emoji)。
2. [FIX] 解決 HTTPS 環境下 AJAX 分頁請求 http 混合內容 (Mixed Content) 攔截 Bug。
This commit is contained in:
sky121113 2026-05-28 15:02:39 +08:00
commit 978faf004c
4 changed files with 15 additions and 3 deletions

View File

@ -58,7 +58,10 @@ class MachineLog extends Model
}
}
} elseif ($log->type === 'submachine') {
$shouldNotify = true;
// 下位機日誌僅在 warning 或 error 級別時發送 Discord 告警info 狀態日誌不發送
if (in_array($log->level, ['warning', 'error'])) {
$shouldNotify = true;
}
} elseif ($log->level === 'error') {
$shouldNotify = true;
}

View File

@ -151,7 +151,8 @@ class DiscordWebhookService
$translatedError = __($translatedError);
}
$title = '⚠️ ' . $this->cleanTranslation(__('Submachine Exception'), $companyLocale);
$icon = ($log->level === 'error') ? '🚨 ' : '⚠️ ';
$title = $icon . $this->cleanTranslation(__('Submachine Exception'), $companyLocale);
$description = $this->cleanTranslation(__('Vending machine reported a submachine hardware error.'), $companyLocale);
$color = ($log->level === 'error') ? 14753096 : 14251782;

View File

@ -875,6 +875,11 @@ $baseRoute = 'admin.data-config.advertisements';
async fetchPage(url) {
if (!url || url === window.location.href) return;
const urlObj = new URL(url, window.location.origin);
if (urlObj.host === window.location.host) {
urlObj.protocol = window.location.protocol;
}
url = urlObj.toString();
this.isLoading = true;
try {
@ -1481,4 +1486,4 @@ $baseRoute = 'admin.data-config.advertisements';
}));
});
</script>
@endsection
@endsection

View File

@ -1023,6 +1023,9 @@ hover:bg-slate-100 dark:hover:bg-white/5 rounded-lg flex items-center justify-be
} else {
// Ensure URL has tab and _ajax params
const urlObj = new URL(url, window.location.origin);
if (urlObj.host === window.location.host) {
urlObj.protocol = window.location.protocol;
}
urlObj.searchParams.set('tab', tab);
urlObj.searchParams.set('_ajax', '1');
url = urlObj.toString();