|
|
@@ -325,6 +325,17 @@ const BAMBU_COLOR_CODE_FALLBACK: Record<string, string> = {
|
|
|
'T1': 'Gilded Rose', 'T2': 'Midnight Blaze', 'T3': 'Neon City', 'T4': 'Blue Hawaii', 'T5': 'Velvet Eclipse',
|
|
|
};
|
|
|
|
|
|
+// Extract plate number from gcode_file path and append to print name
|
|
|
+function formatPrintName(name: string | null, gcodeFile: string | null | undefined, t: (key: string, fallback: string, opts?: Record<string, unknown>) => string): string {
|
|
|
+ if (!name) return '';
|
|
|
+ if (!gcodeFile) return name;
|
|
|
+ const match = gcodeFile.match(/plate_(\d+)\.gcode/);
|
|
|
+ if (match && parseInt(match[1], 10) > 1) {
|
|
|
+ return `${name} — ${t('printers.plateNumber', 'Plate {{number}}', { number: match[1] })}`;
|
|
|
+ }
|
|
|
+ return name;
|
|
|
+}
|
|
|
+
|
|
|
// Get color name from Bambu Lab tray_id_name (e.g., "A00-Y2" -> "Sunflower Yellow")
|
|
|
function getBambuColorName(trayIdName: string | null | undefined): string | null {
|
|
|
if (!trayIdName) return null;
|
|
|
@@ -2783,7 +2794,7 @@ function PrinterCard({
|
|
|
{/* Cover Image */}
|
|
|
<CoverImage
|
|
|
url={(status.state === 'RUNNING' || status.state === 'PAUSE') ? status.cover_url : null}
|
|
|
- printName={(status.state === 'RUNNING' || status.state === 'PAUSE') ? (status.subtask_name || status.current_print || undefined) : undefined}
|
|
|
+ printName={(status.state === 'RUNNING' || status.state === 'PAUSE') ? (formatPrintName(status.subtask_name || status.current_print || null, status.gcode_file, t) || undefined) : undefined}
|
|
|
/>
|
|
|
{/* Print Info */}
|
|
|
<div className="flex-1 min-w-0">
|
|
|
@@ -2791,7 +2802,7 @@ function PrinterCard({
|
|
|
<>
|
|
|
<p className="text-sm text-bambu-gray mb-1">{getStatusDisplay(status.state, status.stg_cur_name)}</p>
|
|
|
<p className="text-white text-sm mb-2 truncate">
|
|
|
- {status.subtask_name || status.current_print}
|
|
|
+ {formatPrintName(status.subtask_name || status.current_print || null, status.gcode_file, t)}
|
|
|
</p>
|
|
|
<div className="flex items-center justify-between text-sm">
|
|
|
<div className="flex-1 bg-bambu-dark-tertiary rounded-full h-2 mr-3">
|