[PROMOTE] 晉升 dev 變更至 demo 分支
1. [FIX] 修正下位機 Discord 告警發送條件與層級對等(過濾 info 層級日誌,僅發送 warning/error;且 error 顯示 🚨,warning 顯示 ⚠️)。
This commit is contained in:
commit
d1a14ebee6
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user