resolved most in browser errors and got maps stable. Next need to do some work on the save configuration stuff.
This commit is contained in:
@@ -6,6 +6,10 @@
|
||||
<meta name="description" content="Admin Panel - NocoDB Map Viewer">
|
||||
<title>Admin Panel - NocoDB Map Viewer</title>
|
||||
|
||||
<!-- Favicon -->
|
||||
<link rel="icon" type="image/x-icon" href="/favicon.ico">
|
||||
<link rel="shortcut icon" href="/favicon.ico">
|
||||
|
||||
<!-- Leaflet CSS -->
|
||||
<link rel="stylesheet" href="https://unpkg.com/leaflet@1.9.4/dist/leaflet.css"
|
||||
integrity="sha256-p4NxAoJBhIIN+hmNHrzRCf9tD/miZyoHS5obTRR9BMY="
|
||||
@@ -186,8 +190,58 @@
|
||||
integrity="sha256-20nQCchB9co0qIjJZRGuk2/Z9VM+kNiyxNV1lvTlZBo="
|
||||
crossorigin=""></script>
|
||||
|
||||
<!-- QR Code Library -->
|
||||
<script src="https://cdn.jsdelivr.net/npm/qrcode@1.5.3/build/qrcode.min.js"></script>
|
||||
<!-- Custom QR Code Implementation -->
|
||||
<script>
|
||||
// Simple QR Code implementation using our server
|
||||
window.QRCode = {
|
||||
toCanvas: function(canvas, text, options, callback) {
|
||||
if (typeof options === 'function') {
|
||||
callback = options;
|
||||
options = {};
|
||||
}
|
||||
|
||||
const size = options.width || 200;
|
||||
const qrUrl = `/api/qr?text=${encodeURIComponent(text)}&size=${size}`;
|
||||
|
||||
const img = new Image();
|
||||
img.crossOrigin = 'anonymous';
|
||||
|
||||
img.onload = function() {
|
||||
canvas.width = size;
|
||||
canvas.height = size;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.drawImage(img, 0, 0, size, size);
|
||||
|
||||
if (callback) callback(null);
|
||||
};
|
||||
|
||||
img.onerror = function() {
|
||||
console.error('Failed to load QR code from server');
|
||||
|
||||
// Fallback: draw a simple placeholder
|
||||
canvas.width = size;
|
||||
canvas.height = size;
|
||||
|
||||
const ctx = canvas.getContext('2d');
|
||||
ctx.fillStyle = '#ffffff';
|
||||
ctx.fillRect(0, 0, size, size);
|
||||
|
||||
ctx.fillStyle = '#000000';
|
||||
ctx.font = '12px Arial';
|
||||
ctx.textAlign = 'center';
|
||||
ctx.fillText('QR Code', size/2, size/2 - 10);
|
||||
ctx.fillText('(Failed)', size/2, size/2 + 10);
|
||||
|
||||
if (callback) callback(new Error('Failed to load QR code'));
|
||||
};
|
||||
|
||||
img.src = qrUrl;
|
||||
}
|
||||
};
|
||||
|
||||
console.log('Local QR Code implementation loaded');
|
||||
</script>
|
||||
|
||||
<!-- Admin JavaScript -->
|
||||
<script src="js/admin.js"></script>
|
||||
|
||||
Reference in New Issue
Block a user