star-cloud/resources/views/admin/remote/partials
sky121113 63219a31fb [FIX] 遠端管理歷史紀錄套用機台授權過濾,修復租戶帳號 500
1. RemoteController index() 與 stock() 的歷史查詢加上 whereHas('machine'),透過 Machine 的 machine_access 全域作用域,使租戶僅能看到自己被授權機台的指令/補貨紀錄;系統管理員不受限制仍可看全部,符合 RBAC 機台以帳號授權原則。
2. 修復根因:先前重構將 Blade 改為對 machine 關聯直接呼叫 only(),租戶遇到未授權機台時 machine 為 null 導致整頁 500。
3. tab-history 與 tab-history-index 三處 $item->machine->only() 改為 null-safe(?->...?? null)作為防禦,避免未來其他查詢路徑漏過濾再次崩潰。

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-06-17 11:15:05 +08:00
..
tab-history-index.blade.php [FIX] 遠端管理歷史紀錄套用機台授權過濾,修復租戶帳號 500 2026-06-17 11:15:05 +08:00
tab-history.blade.php [FIX] 遠端管理歷史紀錄套用機台授權過濾,修復租戶帳號 500 2026-06-17 11:15:05 +08:00
tab-machines-index.blade.php refactor: optimize command center and stock management performance with lightweight JSON and DB indexes 2026-05-16 20:38:05 +08:00
tab-machines.blade.php refactor: optimize command center and stock management performance with lightweight JSON and DB indexes 2026-05-16 20:38:05 +08:00