Added default template

This commit is contained in:
Donkie
2024-06-19 21:18:48 +02:00
parent 20923deebd
commit 052bdb453d
2 changed files with 13 additions and 3 deletions

View File

@@ -31,9 +31,9 @@ const QRCodePrintingDialog: React.FC<QRCodePrintingDialogProps> = ({
}) => { }) => {
const t = useTranslate(); const t = useTranslate();
const showContent = printSettings?.showContent; const showContent = printSettings?.showContent === undefined ? true : printSettings?.showContent;
const textSize = printSettings?.textSize || 5; const textSize = printSettings?.textSize || 5;
const showSpoolmanIcon = printSettings?.showSpoolmanIcon; const showSpoolmanIcon = printSettings?.showSpoolmanIcon === undefined ? true : printSettings?.showSpoolmanIcon;
const elements = items.map((item) => { const elements = items.map((item) => {
return ( return (

View File

@@ -131,7 +131,17 @@ const SpoolQRCodePrintingDialog: React.FC<SpoolQRCodePrintingDialog> = ({ visibl
} }
const [templateHelpOpen, setTemplateHelpOpen] = useState(false); const [templateHelpOpen, setTemplateHelpOpen] = useState(false);
const template = selectedPrintSetting.template ?? ""; const template =
selectedPrintSetting.template ??
`**{filament.vendor.name} - {filament.name}
#{id} - {filament.material}**
Spool Weight: {filament.spool_weight} g
ET: {filament.settings_extruder_temp} °C
BT: {filament.settings_bed_temp} °C
Lot Nr: {lot_nr}
{comment}
{filament.comment}
{filament.vendor.comment}`;
const spoolTags = [ const spoolTags = [
{ tag: "id" }, { tag: "id" },