index.html 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. <!doctype html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8" />
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0, viewport-fit=cover" />
  6. <!-- Favicons - will be updated dynamically if custom logo exists -->
  7. <link rel="icon" type="image/x-icon" href="/static/favicon.ico" id="favicon-ico" />
  8. <link rel="icon" type="image/png" sizes="32x32" href="/static/favicon-32x32.png" id="favicon-32" />
  9. <link rel="icon" type="image/png" sizes="16x16" href="/static/favicon-16x16.png" id="favicon-16" />
  10. <link rel="apple-touch-icon" sizes="180x180" href="/static/apple-touch-icon.png" id="apple-touch-icon" />
  11. <link rel="manifest" href="/static/site.webmanifest" />
  12. <title>Dune Weaver</title>
  13. <!-- Check for custom favicon -->
  14. <script>
  15. // Get base URL for active table (supports multi-table connections)
  16. (function() {
  17. var baseUrl = '';
  18. try {
  19. var stored = localStorage.getItem('duneweaver_tables');
  20. var activeId = localStorage.getItem('duneweaver_active_table');
  21. if (stored && activeId) {
  22. var data = JSON.parse(stored);
  23. var active = (data.tables || []).find(function(t) { return t.id === activeId; });
  24. if (active && !active.isCurrent && active.url && active.url !== window.location.origin) {
  25. baseUrl = active.url.replace(/\/$/, '');
  26. }
  27. }
  28. } catch (e) {}
  29. fetch(baseUrl + '/api/settings')
  30. .then(function(r) { return r.json(); })
  31. .then(function(settings) {
  32. if (settings.app && settings.app.custom_logo) {
  33. document.getElementById('favicon-ico').href = baseUrl + '/static/custom/favicon.ico';
  34. document.getElementById('apple-touch-icon').href = baseUrl + '/static/custom/' + settings.app.custom_logo;
  35. }
  36. if (settings.app && settings.app.name) {
  37. document.title = settings.app.name;
  38. }
  39. })
  40. .catch(function() {});
  41. })();
  42. </script>
  43. </head>
  44. <body>
  45. <div id="root"></div>
  46. <script type="module" src="/src/main.tsx"></script>
  47. </body>
  48. </html>