mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-17 07:30:41 +09:00
Set up webpack for the master server's web interface and fix the issues from the imported interface source files. The .jsx files in package/master/web are bundled together into package/master/static and served by the master server via express.
41 lines
1.2 KiB
React
41 lines
1.2 KiB
React
import React, { Component } from "react"
|
|
import { Card } 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>
|
|
}
|
|
}
|