mirror of
https://github.com/PR0M3TH3AN/TORCH.git
synced 2026-10-27 07:51:52 +00:00
fix(dashboard): normalize platform names for lock cards
- Update `platformStyle` in `dashboard/index.html` to be case-insensitive and handle aliases (e.g., 'Claude' -> 'claude-code'). - Update summary statistics to use the normalized label for consistency. - Ensure platforms like "Jules", "Codex", and "Claude" are displayed correctly instead of "Unknown". Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
3536c54d1b
commit
e03cb64f80
1 file changed
+5
-2
@@ -391,7 +391,9 @@
|
||||
};
|
||||
|
||||
function platformStyle(platform) {
|
||||
return PLATFORM_COLORS[platform] || PLATFORM_COLORS.unknown;
|
||||
const raw = String(platform || '').toLowerCase().trim();
|
||||
if (raw === 'claude' || raw.includes('claude')) return PLATFORM_COLORS['claude-code'];
|
||||
return PLATFORM_COLORS[raw] || PLATFORM_COLORS.unknown;
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------
|
||||
@@ -416,7 +418,8 @@
|
||||
const active = locks.filter((l) => !isExpired(l));
|
||||
const platforms = {};
|
||||
for (const l of active) {
|
||||
platforms[l.platform] = (platforms[l.platform] || 0) + 1;
|
||||
const label = platformStyle(l.platform).label;
|
||||
platforms[label] = (platforms[label] || 0) + 1;
|
||||
}
|
||||
|
||||
const cards = [
|
||||
|
||||
Reference in new issue
Block a user