Add SlaveViewPage

Add slave overview page displaying instances assigned and some basic
properties.
This commit is contained in:
Hornwitser committed 2021-10-31 10:41:25 +01:00
1 parent a2a5cf6d4c
commit 7769c1f89e
6 files changed
+131 -43

No files matched your search

@@ -1,4 +1,5 @@
import React, { useContext, useRef, useState } from "react";
import { useHistory } from "react-router-dom";
import { Button, Form, Input, Modal, PageHeader, Table } from "antd";
import { libLink } from "@clusterio/lib";
@@ -75,6 +76,7 @@ function GenerateSlaveTokenButton(props) {
export default function SlavesPage() {
let account = useAccount();
let history = useHistory();
let [slaveList] = useSlaveList();
return <PageLayout nav={[{ name: "Slaves" }]}>
@@ -112,6 +114,11 @@ export default function SlavesPage() {
dataSource={slaveList}
rowKey={slave => slave["id"]}
pagination={false}
onRow={(record, rowIndex) => ({
onClick: event => {
history.push(`/slaves/${record.id}/view`);
},
})}
/>
</PageLayout>;
};