Einzelstueck-QR ueber Custom-Scheme statt Universal Link
Universal Links (Associated Domains) sind an eine feste Domain gebunden - fuer einen selbstgehosteten Dienst untauglich (jede Instanz hat eine andere URL) und die Domain stand im offenen Quellcode (Leak). Jetzt tragen Einzelstueck-QRs das Custom-Scheme vorrania://i/<UID>: Die normale Kamera-App oeffnet die App weiterhin, aber ohne Domain-Bindung und ohne Server im Code. applinks-Eintrag entfernt. Web: itemDeepLink()-Helfer, genutzt in Einzelstuecke-Liste/-Etiketten und im P-touch-Export. Lagerort-QRs bleiben unveraendert (https). iOS: Router erkennt vorrania://i/<UID> und oeffnet das Einzelstueck am aktiven Server. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -6,6 +6,7 @@ import { useToast } from "../toast";
|
||||
import Icon from "./Icon";
|
||||
import { REASONS } from "./ObjektBestand";
|
||||
import { locationOptions, locationPathById } from "../locationPath";
|
||||
import { itemDeepLink } from "../qr";
|
||||
|
||||
const reasonLabel = (v) => REASONS.find((r) => r.value === v)?.label || v;
|
||||
|
||||
@@ -224,7 +225,7 @@ export default function Einzelstuecke({ product, locations, shops, isAdmin, onCh
|
||||
|
||||
async function druckeEtiketten() {
|
||||
const labels = await Promise.all(items.map(async (it) => {
|
||||
const url = await QRCode.toDataURL(`${origin}/i/${it.uid}`, { margin: 1, width: 260 });
|
||||
const url = await QRCode.toDataURL(itemDeepLink(it.uid), { margin: 1, width: 260 });
|
||||
const name = (product.name || "").replace(/[<>&]/g, "");
|
||||
return `<div class="label"><img src="${url}"/><div class="uid">${it.uid}</div><div class="name">${name}</div></div>`;
|
||||
}));
|
||||
@@ -270,7 +271,7 @@ export default function Einzelstuecke({ product, locations, shops, isAdmin, onCh
|
||||
{items.map((it) => (
|
||||
<Fragment key={it.id}>
|
||||
<tr className="einzel-mainrow">
|
||||
<td><QrImg text={`${origin}/i/${it.uid}`} size={56} /></td>
|
||||
<td><QrImg text={itemDeepLink(it.uid)} size={56} /></td>
|
||||
<td data-label="UID" className="strong nowrap">{it.uid}</td>
|
||||
<td data-label="Lagerort">
|
||||
{isAdmin ? (
|
||||
|
||||
Reference in New Issue
Block a user