webapp: Only mark values in Pininfo as red if they are different and enabled.

This commit is contained in:
Thomas Basler 2023-03-18 12:24:03 +01:00
parent 88a6e48773
commit 4b7087f0f9

View File

@ -80,14 +80,25 @@ export default defineComponent({
return Array.from(new Set(total)).sort(); return Array.from(new Set(total)).sort();
}, },
isEqual(category: string, prop: string): boolean { isEqual(category: string, prop: string): boolean {
if (!((this.selectedPinAssignment as Device)[category as keyof Device])) { let comSel = 999999;
return false; let comCur = 999999;
if ((this.selectedPinAssignment as Device)[category as keyof Device]) {
comSel = (this.selectedPinAssignment as any)[category][prop];
} }
if (!((this.currentPinAssignment as Device)[category as keyof Device])) { if ((this.currentPinAssignment as Device)[category as keyof Device]) {
return false; comCur = (this.currentPinAssignment as any)[category][prop];
} }
return (this.selectedPinAssignment as any)[category][prop] == (this.currentPinAssignment as any)[category][prop]; if (comSel == -1 || comSel == 255 || comSel == undefined) {
comSel = 999999;
}
if (comCur == -1 || comCur == 255 || comSel == undefined) {
comCur = 999999;
}
return comSel == comCur;
}, },
capitalizeFirstLetter(value: string): string { capitalizeFirstLetter(value: string): string {
return value.charAt(0).toUpperCase() + value.slice(1); return value.charAt(0).toUpperCase() + value.slice(1);