Import web interface from clusterio/clusterioWeb

Import the source files in use for the web interface, excluding the
copied and modified lib/link files.
This commit is contained in:
Danielv123 authored and Hornwitser committed 2020-09-28 04:19:00 +02:00
1 parent f318f8826b
commit 2382f4bbdc
17 files changed
+1795

No files matched your search

@@ -0,0 +1,40 @@
import React, { Component } from "react"
import { Card, Table } from "antd"
import { listSlaves, listInstances, listUsers, createUser } from "../../util/wslink"
import DataTable from "../../components/data-table"
export class UsersTable extends Component {
constructor(props) {
super(props)
}
navigate(url) {
this.props.history.push(url);
}
render() {
return <Card>
<h2>Slaves</h2>
<DataTable
AddRecord={{
fields: [{
dataIndex: "name",
title: "Name"
}],
insert: async args => {
let response = await createUser({name: args.name})
console.log("Created user",response)
}
}}
DataFunction={listUsers}
TableProps={{
onRow: (record, rowIndex) => {
return {
onClick: event => {
this.navigate(`/users/${record.name}/view`)
}
}
}
}}
/>
</Card>
}
}