index.html 2.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  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. document.title = jsonResponse.appName;
  33. });
  34. </script>
  35. <style>
  36. @font-face {
  37. font-family: 'Inter';
  38. src: url('<%= PUBLIC_PATH %>/fonts/Inter-Medium.ttf') format('truetype');
  39. font-weight: 500;
  40. font-display: swap;
  41. }
  42. @font-face {
  43. font-family: 'Inter';
  44. src: url('<%= PUBLIC_PATH %>/fonts/Inter-Regular.ttf') format('truetype');
  45. font-weight: 400;
  46. font-display: swap;
  47. }
  48. @font-face {
  49. font-family: 'Roboto Mono';
  50. src: url('<%= PUBLIC_PATH %>/fonts/RobotoMono-Medium.ttf') format('truetype');
  51. font-weight: 500;
  52. font-display: swap;
  53. }
  54. @font-face {
  55. font-family: 'Roboto Mono';
  56. src: url('<%= PUBLIC_PATH %>/fonts/RobotoMono-Regular.ttf') format('truetype');
  57. font-weight: 400;
  58. font-display: swap;
  59. }
  60. </style>
  61. </head>
  62. <body>
  63. <noscript>You need to enable JavaScript to run this app.</noscript>
  64. <div id="root"></div>
  65. <script type="module" src="/src/index.tsx"></script>
  66. </body>
  67. </html>