mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-09-30 03:01:21 +02:00
Added total priner hours to printer card
This commit is contained in:
@@ -87,6 +87,7 @@ function CoverImage({ url, printName }: { url: string | null; printName?: string
|
||||
interface PrinterMaintenanceInfo {
|
||||
due_count: number;
|
||||
warning_count: number;
|
||||
total_print_hours: number;
|
||||
}
|
||||
|
||||
function PrinterCard({
|
||||
@@ -175,7 +176,15 @@ function PrinterCard({
|
||||
<div className="flex items-start justify-between mb-4">
|
||||
<div>
|
||||
<h3 className="text-lg font-semibold text-white">{printer.name}</h3>
|
||||
<p className="text-sm text-bambu-gray">{printer.model || 'Unknown Model'}</p>
|
||||
<p className="text-sm text-bambu-gray">
|
||||
{printer.model || 'Unknown Model'}
|
||||
{maintenanceInfo && maintenanceInfo.total_print_hours > 0 && (
|
||||
<span className="ml-2 text-bambu-gray">
|
||||
<Clock className="w-3 h-3 inline-block mr-1" />
|
||||
{Math.round(maintenanceInfo.total_print_hours)}h
|
||||
</span>
|
||||
)}
|
||||
</p>
|
||||
</div>
|
||||
<div className="flex items-center gap-2">
|
||||
<span
|
||||
@@ -726,6 +735,7 @@ export function PrintersPage() {
|
||||
acc[overview.printer_id] = {
|
||||
due_count: overview.due_count,
|
||||
warning_count: overview.warning_count,
|
||||
total_print_hours: overview.total_print_hours,
|
||||
};
|
||||
return acc;
|
||||
},
|
||||
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+2
-2
@@ -7,8 +7,8 @@
|
||||
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png" />
|
||||
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png" />
|
||||
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png" />
|
||||
<script type="module" crossorigin src="/assets/index-eHK2TMOH.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-BF_tKqob.css">
|
||||
<script type="module" crossorigin src="/assets/index-soeWpmRO.js"></script>
|
||||
<link rel="stylesheet" crossorigin href="/assets/index-4olH2ask.css">
|
||||
</head>
|
||||
<body>
|
||||
<div id="root"></div>
|
||||
|
||||
Reference in New Issue
Block a user