This is an automated email from the ASF dual-hosted git repository.

bbovenzi pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new 82e0157c7c2 Remove `/webapp` prefix from new UI (#44227)
82e0157c7c2 is described below

commit 82e0157c7c252ad298d2018990d378def07d0077
Author: Jed Cunningham <[email protected]>
AuthorDate: Thu Nov 21 07:12:16 2024 -0700

    Remove `/webapp` prefix from new UI (#44227)
---
 airflow/api_fastapi/core_api/app.py     | 2 +-
 airflow/ui/src/router.tsx               | 2 +-
 airflow/ui/vite.config.ts               | 4 +---
 airflow/www/templates/airflow/main.html | 2 +-
 4 files changed, 4 insertions(+), 6 deletions(-)

diff --git a/airflow/api_fastapi/core_api/app.py 
b/airflow/api_fastapi/core_api/app.py
index fc29e51f999..2773c796291 100644
--- a/airflow/api_fastapi/core_api/app.py
+++ b/airflow/api_fastapi/core_api/app.py
@@ -71,7 +71,7 @@ def init_views(app: FastAPI) -> None:
         name="webapp_static_folder",
     )
 
-    @app.get("/webapp/{rest_of_path:path}", response_class=HTMLResponse, 
include_in_schema=False)
+    @app.get("/{rest_of_path:path}", response_class=HTMLResponse, 
include_in_schema=False)
     def webapp(request: Request, rest_of_path: str):
         return templates.TemplateResponse("/index.html", {"request": request}, 
media_type="text/html")
 
diff --git a/airflow/ui/src/router.tsx b/airflow/ui/src/router.tsx
index ae33b021d21..45b38764679 100644
--- a/airflow/ui/src/router.tsx
+++ b/airflow/ui/src/router.tsx
@@ -66,6 +66,6 @@ export const router = createBrowserRouter(
     },
   ],
   {
-    basename: "/webapp",
+    basename: "/",
   },
 );
diff --git a/airflow/ui/vite.config.ts b/airflow/ui/vite.config.ts
index 7bc48d64041..46c929976c1 100644
--- a/airflow/ui/vite.config.ts
+++ b/airflow/ui/vite.config.ts
@@ -28,9 +28,7 @@ export default defineConfig({
     {
       name: "transform-url-src",
       transformIndexHtml: (html) =>
-        html
-          .replace(`src="/assets/`, `src="/static/assets/`)
-          .replace(`href="/`, `href="/webapp/`),
+        html.replace(`src="/assets/`, `src="/static/assets/`),
     },
   ],
   resolve: { alias: { openapi: "/openapi-gen", src: "/src" } },
diff --git a/airflow/www/templates/airflow/main.html 
b/airflow/www/templates/airflow/main.html
index 3842d3602dd..4e0aa09e628 100644
--- a/airflow/www/templates/airflow/main.html
+++ b/airflow/www/templates/airflow/main.html
@@ -100,7 +100,7 @@
   {% if auth_manager.is_logged_in() %}
     {% call show_message(category='info', dismissible=true) %}
       <span>We have a new UI for Airflow 3.0</span>
-      <a href="http://localhost:29091/webapp";>Check it out now!</a>
+      <a href="http://localhost:29091/";>Check it out now!</a>
     {% endcall %}
   {% endif %}
 {% endblock %}

Reply via email to