jscheffl commented on code in PR #53563:
URL: https://github.com/apache/airflow/pull/53563#discussion_r2305155234


##########
providers/edge3/src/airflow/providers/edge3/plugins/www/src/pages/WorkerPage.tsx:
##########
@@ -0,0 +1,81 @@
+/*!
+ * 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, Table } from "@chakra-ui/react";
+
+import { useUiServiceWorker } from "openapi/queries";
+import { ErrorAlert } from "src/components/ErrorAlert";
+
+export const WorkerPage = () => {
+  const { data, error } = useUiServiceWorker();
+
+  // TODO to make it proper
+  // Beautification of state like in Airflow 2
+  // Use DataTable as component from Airflow-Core UI
+  // Add auto-refresh
+  // Add actions for maintenance / delete of orphan worker
+  // Add sorting
+  // Add filtering
+  // Add links to see jobs on worker
+  // Translation
+  if (data)
+    return (
+      <Box p={2}>
+        <Table.Root size="sm" interactive stickyHeader striped>
+          <Table.Header>
+            <Table.Row>
+              <Table.ColumnHeader>Worker Name</Table.ColumnHeader>
+              <Table.ColumnHeader>State</Table.ColumnHeader>
+              <Table.ColumnHeader>Queues</Table.ColumnHeader>
+              <Table.ColumnHeader>First Online</Table.ColumnHeader>
+              <Table.ColumnHeader>Last Heartbeat</Table.ColumnHeader>
+              <Table.ColumnHeader>Active Jobs</Table.ColumnHeader>
+              <Table.ColumnHeader>System Information</Table.ColumnHeader>
+              <Table.ColumnHeader>Operations</Table.ColumnHeader>
+            </Table.Row>
+          </Table.Header>
+          <Table.Body>
+            {data.workers.map((worker) => (
+              <Table.Row key={worker.worker_name}>
+                <Table.Cell>{worker.worker_name}</Table.Cell>
+                <Table.Cell>{worker.state}</Table.Cell>
+                <Table.Cell>{worker.queues}</Table.Cell>

Review Comment:
   Yes, this is a basic enablement. No beauty included in this PR. Also a lot 
of features missing compared to the 2.x plugins. Will add further PRs (or if 
you want to contribute also looking for helping hands).
   
   Targte tof this PR was to have a skeleton only to be able to cus smaller PRs 
following. Wanted to make the review here mainly on integration and base 
tooling. Not to have it functional complete. With 12kLoC this is already a 
killer to review as it is.



-- 
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