239239 @error =" vendorLogo = 'HappyHare'"
240240 />
241241 </div >
242- <div class =" unit-name" >
243- {{ unitDisplayName }}
242+ <div class =" unit-info" >
243+ <div class =" unit-name" >
244+ <span v-if =" showName" >{{ unitDisplayName }}</span >
245+ </div >
246+ <div
247+ v-if =" unitClimateInfo"
248+ class =" unit-climate"
249+ >
250+ {{ unitClimateInfo }}
251+ </div >
244252 </div >
245253 </div >
246254 </v-container >
@@ -252,6 +260,7 @@ import BrowserMixin from '@/mixins/browser'
252260import StateMixin from ' @/mixins/state'
253261import MmuMixin from ' @/mixins/mmu'
254262import type { MmuGateDetails } from ' @/types'
263+ import type { Sensor } from ' @/store/printer/types'
255264import MmuSpool from ' @/components/widgets/mmu/MmuSpool.vue'
256265import MmuGateStatus from ' @/components/widgets/mmu/MmuGateStatus.vue'
257266
@@ -287,6 +296,33 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
287296 return ` #${this .unitIndex + 1 } ${name } `
288297 }
289298
299+ get printerSensors (): Sensor [] {
300+ return this .$typedGetters [' printer/getSensors' ]
301+ }
302+
303+ get unitClimateInfo (): string {
304+ const unit = this .unitDetails (this .unitIndex )
305+
306+ // Handle missing or quoted sensor name
307+ const sensorName = unit .environmentSensor ?.replace (/ ^ "(. * )"$ / , ' $1' )
308+ if (! sensorName ) return ' '
309+
310+ const sensor = this .printerSensors .find (s => s .key === sensorName )
311+ if (! sensor ) return ' '
312+
313+ const parts: string [] = []
314+
315+ if (sensor .temperature != null ) {
316+ parts .push (` ${sensor .temperature .toFixed (0 )}°C ` )
317+ }
318+
319+ if (sensor .humidity != null ) {
320+ parts .push (` ${sensor .humidity .toFixed (0 )}% ` )
321+ }
322+
323+ return parts .join (' / ' )
324+ }
325+
290326 get unitGateRange (): number [] {
291327 const unitDetails = this .unitDetails (this .unitIndex )
292328 return Array .from ({ length: unitDetails .numGates }, (v , k ) => k + unitDetails .firstGate )
@@ -321,6 +357,10 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
321357 return this .spoolWidth - 8
322358 }
323359
360+ get showName (): boolean {
361+ return this .$typedState .config .uiSettings .mmu .showName
362+ }
363+
324364 get showLogos (): boolean {
325365 return this .$typedState .config .uiSettings .mmu .showLogos
326366 }
@@ -364,16 +404,12 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
364404 const firstGate = gate === 0
365405 const lastGate = (gate === this .unitGateRange .length - 1 && ! this .showBypass ) || gate === this .TOOL_GATE_BYPASS
366406 const classes = [' gate-status-row' ]
367- if (firstGate ) classes .push (' first-gate' + ( this . isFirefox () ? ' -firefox ' : ' ' ) )
368- if (lastGate ) classes .push (' last-gate' + ( this . isFirefox () ? ' -firefox ' : ' ' ) )
407+ if (firstGate ) classes .push (' first-gate' )
408+ if (lastGate ) classes .push (' last-gate' )
369409 classes .push (this .$vuetify .theme .dark ? ' gate-status-row-dark-theme' : ' gate-status-row-light-theme' )
370410 return classes
371411 }
372412
373- isFirefox (): boolean {
374- return navigator .userAgent .indexOf (' Firefox' ) !== - 1
375- }
376-
377413 spoolClass (gate : number ): string [] {
378414 const classes = []
379415 if ((this .editGateMap && this .editGateSelected === gate ) || (! this .editGateMap && this .gate === gate )) {
@@ -469,14 +505,29 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
469505 opacity : 0.7 ;
470506}
471507
508+ .unit-info {
509+ display : flex ;
510+ flex-direction : column ;
511+ justify-content : space-between ;
512+ width : 100% ;
513+ }
514+
472515.unit-name {
473516 display : flex ;
474- align-items : center ;
517+ align-items : flex-end ;
475518 font-size : 12px ;
476519 white-space : nowrap ;
477- margin-right : -12px ;
478520 overflow : hidden ;
479- padding : 0px 0px 4px 0px ;
521+ padding : 4px 0 0 0 ;
522+ }
523+
524+ .unit-climate {
525+ font-size : 10px ;
526+ white-space : nowrap ;
527+ overflow : hidden ;
528+ text-align : right ;
529+ padding : 0px ;
530+ opacity : 0.8 ;
480531}
481532
482533.gate-status-row-dark-theme {
@@ -505,22 +556,6 @@ export default class MmuUnit extends Mixins(BrowserMixin, StateMixin, MmuMixin)
505556 border-radius : 8px 8px 10px 10px ;
506557}
507558
508- .last-gate-firefox {
509- border-radius : 0 8px 10px 0px ;
510- padding-right : 16px ;
511- }
512-
513- .first-gate-firefox {
514- border-radius : 8px 0 0px 10px ;
515- margin-left : -16px ;
516- padding-left : 16px ;
517- margin-right : 16px ;
518- }
519-
520- .first-gate-firefox.last-gate-firefox {
521- border-radius : 8px 8px 10px 10px ;
522- }
523-
524559.clip-spool {
525560 position : relative ;
526561 margin-top : 8px ;
0 commit comments