[PROMOTE] 晉升 dev 變更至 demo 分支

1. [FIX] 修正下位機 Discord 告警發送條件與層級對等(過濾 info 層級日誌,僅發送 warning/error;且 error 顯示 🚨,warning 顯示 ⚠️)。
This commit is contained in:
sky121113 2026-05-28 14:55:02 +08:00
commit d1a14ebee6
2 changed files with 6 additions and 2 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;