mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-18 21:47:39 +02:00
fix: remove incorrect ethernet badge on printer cards
home_flag bit 18 was incorrectly interpreted as "wired/ethernet connection", causing the ethernet badge to always show — even on printers without an ethernet port (e.g. A1, P1S). This hid the WiFi signal indicator entirely. Removed the wired_network field and ethernet badge UI. The WiFi signal badge now shows correctly whenever the printer reports signal strength.
This commit is contained in:
@@ -212,7 +212,6 @@ export interface PrinterStatus {
|
||||
timelapse: boolean; // Timelapse recording active
|
||||
ipcam: boolean; // Live view enabled
|
||||
wifi_signal: number | null; // WiFi signal strength in dBm
|
||||
wired_network: boolean; // Ethernet connection detected
|
||||
nozzles: NozzleInfo[]; // Nozzle hardware info (index 0=left/primary, 1=right)
|
||||
nozzle_rack: NozzleRackSlot[]; // H2C 6-nozzle tool-changer rack
|
||||
print_options: PrintOptions | null; // AI detection and print options
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { useState, useEffect } from 'react';
|
||||
import { useTranslation } from 'react-i18next';
|
||||
import { X, Copy, Check, Signal, Cable } from 'lucide-react';
|
||||
import { X, Copy, Check, Signal } from 'lucide-react';
|
||||
import { Card, CardContent } from './Card';
|
||||
import { formatDateOnly } from '../utils/date';
|
||||
import { getPrinterImage, getWifiStrength } from '../utils/printer';
|
||||
@@ -109,18 +109,8 @@ export function PrinterInfoModal({ printer, status, totalPrintHours, onClose }:
|
||||
),
|
||||
});
|
||||
|
||||
// Network connection
|
||||
if (status?.wired_network) {
|
||||
rows.push({
|
||||
label: t('printers.networkLabel', 'Network'),
|
||||
value: (
|
||||
<span className="flex items-center gap-2">
|
||||
<Cable className="w-4 h-4 text-bambu-green" />
|
||||
<span className="text-bambu-green">{t('printers.connection.ethernet', 'Ethernet')}</span>
|
||||
</span>
|
||||
),
|
||||
});
|
||||
} else if (status?.wifi_signal != null) {
|
||||
// WiFi signal
|
||||
if (status?.wifi_signal != null) {
|
||||
const wifi = getWifiStrength(status.wifi_signal);
|
||||
rows.push({
|
||||
label: t('printers.wifiSignalLabel'),
|
||||
|
||||
@@ -44,7 +44,6 @@ import {
|
||||
Home,
|
||||
Printer as PrinterIcon,
|
||||
Info,
|
||||
Cable,
|
||||
} from 'lucide-react';
|
||||
|
||||
import { useNavigate } from 'react-router-dom';
|
||||
@@ -2438,17 +2437,8 @@ function PrinterCard({
|
||||
)}
|
||||
{status?.connected ? t('printers.connection.connected') : t('printers.connection.offline')}
|
||||
</span>
|
||||
{/* Network connection indicator */}
|
||||
{status?.connected && status?.wired_network && (
|
||||
<span
|
||||
className="flex items-center gap-1 px-2 py-1 rounded-full text-xs bg-status-ok/20 text-status-ok"
|
||||
title={t('printers.connection.ethernet', 'Ethernet')}
|
||||
>
|
||||
<Cable className="w-3 h-3" />
|
||||
{t('printers.connection.ethernet', 'Ethernet')}
|
||||
</span>
|
||||
)}
|
||||
{status?.connected && !status?.wired_network && wifiSignal != null && (
|
||||
{/* WiFi signal indicator */}
|
||||
{status?.connected && wifiSignal != null && (
|
||||
<span
|
||||
className={`flex items-center gap-1 px-2 py-1 rounded-full text-xs ${
|
||||
wifiSignal >= -50
|
||||
|
||||
Reference in New Issue
Block a user