ianbuss commented on code in PR #46900:
URL: https://github.com/apache/airflow/pull/46900#discussion_r1962083315


##########
airflow/ui/src/main.tsx:
##########
@@ -58,6 +59,9 @@ axios.interceptors.request.use((config) => {
   return config;
 });
 
+// Dynamically set the base URL for XHR requests based on the meta tag.
+OpenAPI.BASE = 
document.querySelector("meta[name='backend-server-base-url']")?.getAttribute("content")
 ?? "";

Review Comment:
   Could we use Jinja templating here for index.html, at least for the "prod" 
build? Something like this would allow fastapi to serve up the right html 
dynamically based on a config variable:
   ```
   <!doctype html>
   <html lang="en" style="height: 100%">
     <head>
       <meta charset="UTF-8" />
       <link rel="icon" type="image/png" href="/webapp/pin_32.png" />
       <meta name="backend-server-base-url" content="{{ base_url }}">
       <meta name="viewport" content="width=device-width, initial-scale=1.0" />
       <title>Airflow 3.0</title>
       <script type="module" crossorigin 
src="/static/assets/index-DtWM-pqV.js"></script>
     </head>
     <body style="height: 100%">
       <div id="root" style="height: 100%"></div>
     </body>
   </html>
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to