mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-19 23:33:13 +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.
44 lines
1.4 KiB
React
44 lines
1.4 KiB
React
import React, { Component } from "react"
|
|
import { Card } from "antd"
|
|
import { listSlaves, listInstances, listRoles, createRole } from "../../util/wslink"
|
|
import DataTable from "../../components/data-table"
|
|
|
|
export class RolesTable extends Component {
|
|
constructor(props) {
|
|
super(props)
|
|
}
|
|
navigate(url) {
|
|
this.props.history.push(url);
|
|
}
|
|
render() {
|
|
return <Card>
|
|
<h2>Roles</h2>
|
|
<DataTable
|
|
AddRecord={{
|
|
fields: [{
|
|
dataIndex: "name",
|
|
title: "Name"
|
|
},{
|
|
dataIndex: "description",
|
|
title: "Description"
|
|
}],
|
|
insert: async args => {
|
|
let response = await createRole({name: args.name, description: args.description})
|
|
console.log("Created role",response)
|
|
}
|
|
}}
|
|
DataFunction={listRoles}
|
|
TableProps={{
|
|
onRow: (record, rowIndex) => {
|
|
return {
|
|
onClick: event => {
|
|
this.navigate(`/roles/${record.id}/view`)
|
|
}
|
|
}
|
|
}
|
|
}}
|
|
/>
|
|
</Card>
|
|
}
|
|
}
|