index.html 2.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172
  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" />
  6. <!-- Favicons -->
  7. <link rel="icon" href="<%= PUBLIC_PATH %>/favicon/favicon.ico" sizes="any" />
  8. <link rel="icon" href="<%= PUBLIC_PATH %>/favicon/icon.svg" type="image/svg+xml" />
  9. <link rel="apple-touch-icon" href="<%= PUBLIC_PATH %>/favicon/apple-touch-icon.png" />
  10. <link rel="manifest" href="<%= PUBLIC_PATH %>/manifest.json" />
  11. <title>UI for Apache Kafka</title>
  12. <script type="text/javascript">
  13. window.basePath = '<%= PUBLIC_PATH %>';
  14. window.__assetsPathBuilder = function (importer) {
  15. return window.basePath+ "/" + importer;
  16. };
  17. fetch(window.basePath+'/api/preferences')
  18. .then(function(response) {
  19. return response.json();
  20. })
  21. .then(function(jsonResponse) {
  22. // do something with jsonResponse
  23. let $favicon = document.querySelector('link[rel*="icon"]')
  24. if ($favicon !== null) {
  25. $favicon.href = jsonResponse.favicon
  26. } else {
  27. $favicon = document.createElement('link')
  28. $favicon.rel = 'icon'
  29. $favicon.href = jsonResponse.favicon
  30. document.head.appendChild($favicon)
  31. }
  32. });
  33. </script>
  34. <style>
  35. @font-face {
  36. font-family: 'Inter';
  37. src: url('<%= PUBLIC_PATH %>/fonts/Inter-Medium.ttf') format('truetype');
  38. font-weight: 500;
  39. font-display: swap;
  40. }
  41. @font-face {
  42. font-family: 'Inter';
  43. src: url('<%= PUBLIC_PATH %>/fonts/Inter-Regular.ttf') format('truetype');
  44. font-weight: 400;
  45. font-display: swap;
  46. }
  47. @font-face {
  48. font-family: 'Roboto Mono';
  49. src: url('<%= PUBLIC_PATH %>/fonts/RobotoMono-Medium.ttf') format('truetype');
  50. font-weight: 500;
  51. font-display: swap;
  52. }
  53. @font-face {
  54. font-family: 'Roboto Mono';
  55. src: url('<%= PUBLIC_PATH %>/fonts/RobotoMono-Regular.ttf') format('truetype');
  56. font-weight: 400;
  57. font-display: swap;
  58. }
  59. </style>
  60. </head>
  61. <body>
  62. <noscript>You need to enable JavaScript to run this app.</noscript>
  63. <div id="root"></div>
  64. <script type="module" src="/src/index.tsx"></script>
  65. </body>
  66. </html>