From 6a0e1f0ee913717656f1be410aae8512b86eeb4f Mon Sep 17 00:00:00 2001 From: Pedro Lamas Date: Wed, 19 Nov 2025 19:49:12 +0000 Subject: [PATCH] fix(Outputs): static sort order Signed-off-by: Pedro Lamas --- src/components/widgets/outputs/Outputs.vue | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/src/components/widgets/outputs/Outputs.vue b/src/components/widgets/outputs/Outputs.vue index 0620a305fd..3f1cbf1ff1 100644 --- a/src/components/widgets/outputs/Outputs.vue +++ b/src/components/widgets/outputs/Outputs.vue @@ -56,10 +56,15 @@ import type { Fan, Led, OutputPin } from '@/store/printer/types' }) export default class Outputs extends Mixins(StateMixin) { get all () { + const fans: Fan[] = this.$typedGetters['printer/getAllFans'] + const pins: OutputPin[] = this.$typedGetters['printer/getAllPins'] + const leds: Led[] = this.$typedGetters['printer/getAllLeds'] + const items: Array = [ - ...this.$typedGetters['printer/getAllFans'], - ...this.$typedGetters['printer/getAllPins'].sort((pin: OutputPin) => pin.pwm ? 1 : -1), - ...this.$typedGetters['printer/getAllLeds'] + ...fans, + ...pins + .sort((a, b) => (+a.pwm - +b.pwm) || a.name.localeCompare(b.name)), + ...leds ] const [col1, col2] = items.length > 1