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

pierrejeambrun 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 7e2dda04f0f Add Plugins list page (#46823)
7e2dda04f0f is described below

commit 7e2dda04f0f0cbc1ce7ef04398ca700434760915
Author: Vincent Kling <[email protected]>
AuthorDate: Mon Feb 17 15:29:27 2025 +0100

    Add Plugins list page (#46823)
---
 airflow/ui/src/layouts/Nav/AdminButton.tsx |  4 +++
 airflow/ui/src/pages/Plugins.tsx           | 54 ++++++++++++++++++++++++++++++
 airflow/ui/src/router.tsx                  |  5 +++
 3 files changed, 63 insertions(+)

diff --git a/airflow/ui/src/layouts/Nav/AdminButton.tsx 
b/airflow/ui/src/layouts/Nav/AdminButton.tsx
index 53ad5c9d4d7..a6a71795dc0 100644
--- a/airflow/ui/src/layouts/Nav/AdminButton.tsx
+++ b/airflow/ui/src/layouts/Nav/AdminButton.tsx
@@ -36,6 +36,10 @@ const links = [
     href: "/providers",
     title: "Providers",
   },
+  {
+    href: "/plugins",
+    title: "Plugins",
+  },
 ];
 
 export const AdminButton = () => (
diff --git a/airflow/ui/src/pages/Plugins.tsx b/airflow/ui/src/pages/Plugins.tsx
new file mode 100644
index 00000000000..db20ac12d1b
--- /dev/null
+++ b/airflow/ui/src/pages/Plugins.tsx
@@ -0,0 +1,54 @@
+/*!
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+import { Box, Heading } from "@chakra-ui/react";
+import type { ColumnDef } from "@tanstack/react-table";
+
+import { usePluginServiceGetPlugins } from "openapi/queries";
+import type { PluginResponse } from "openapi/requests/types.gen";
+import { DataTable } from "src/components/DataTable";
+import { ErrorAlert } from "src/components/ErrorAlert";
+
+const columns: Array<ColumnDef<PluginResponse>> = [
+  {
+    accessorKey: "name",
+    enableSorting: false,
+    header: "Name",
+  },
+  {
+    accessorKey: "source",
+    enableSorting: false,
+    header: "Source",
+  },
+];
+
+export const Plugins = () => {
+  const { data, error } = usePluginServiceGetPlugins();
+
+  return (
+    <Box p={2}>
+      <Heading>Plugins</Heading>
+      <DataTable
+        columns={columns}
+        data={data?.plugins ?? []}
+        errorMessage={<ErrorAlert error={error} />}
+        total={data?.total_entries}
+      />
+    </Box>
+  );
+};
diff --git a/airflow/ui/src/router.tsx b/airflow/ui/src/router.tsx
index 645596a0504..d1ddc12470c 100644
--- a/airflow/ui/src/router.tsx
+++ b/airflow/ui/src/router.tsx
@@ -33,6 +33,7 @@ import { DagsList } from "src/pages/DagsList";
 import { Dashboard } from "src/pages/Dashboard";
 import { ErrorPage } from "src/pages/Error";
 import { Events } from "src/pages/Events";
+import { Plugins } from "src/pages/Plugins";
 import { Pools } from "src/pages/Pools";
 import { Providers } from "src/pages/Providers";
 import { Run } from "src/pages/Run";
@@ -99,6 +100,10 @@ export const routerConfig = [
         element: <Providers />,
         path: "providers",
       },
+      {
+        element: <Plugins />,
+        path: "plugins",
+      },
       {
         children: [
           { element: <Overview />, index: true },

Reply via email to