diff --git a/src/Views/Home/Inventory.cshtml b/src/Views/Home/Inventory.cshtml
index fc70218..0048497 100644
--- a/src/Views/Home/Inventory.cshtml
+++ b/src/Views/Home/Inventory.cshtml
@@ -13,8 +13,6 @@
-
-
@@ -174,7 +172,6 @@
const modal = new bootstrap.Modal(viewModal);
viewContent.innerHTML = '@T["Loading..."]
';
- modal.show();
try {
const response = await fetch(`/Assets/Get?cn=${decodedText}`);
@@ -182,9 +179,12 @@
const asset = json.assetsModel;
if (!asset) {
- viewContent.innerHTML = `@T["Asset not found."]
`;
+ const input = document.getElementById("barcodeInput");
+ input.classList.add("is-invalid");
+ showToast('@T["Asset not found."]', 'danger');
return;
}
+ modal.show();
const html = `
@@ -311,16 +311,6 @@
onScanSuccess,
onScanError
);
-
-
- document.getElementById('viewAssetModal').addEventListener('hidden.bs.modal', () => {
- html5QrCode.start(
- { facingMode: "environment" },
- { fps: 10, qrbox: { width: 300, height: 150 } },
- onScanSuccess,
- onScanError
- ).catch(err => console.error("Error restarting scanner:", err));
- });
});
}
@@ -378,6 +368,11 @@
}
});
}
+
+ document.getElementById("barcodeInput").addEventListener("input", e => {
+ e.target.classList.remove("is-invalid");
+ });
+
}