mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-25 00:23:12 +09:00
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:
1 parent
f318f8826b
commit
2382f4bbdc
17 files changed
+1795
No files matched your search
@@ -0,0 +1,43 @@
|
||||
import React, { Component } from "react"
|
||||
import { Card, Table } 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>
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user