mirror of
https://github.com/clusterio/clusterio.git
synced 2026-11-23 00:13:13 +09:00
Hide unauthorized web interface controls
Hide or disable controls in the web interface that the user for the control connection it's connected as don't have the requisite permissions to use.
This commit is contained in:
1 parent
18e9fc8e7c
commit
0c74aef68e
15 files changed
+417
-489
No files matched your search
@@ -4,6 +4,7 @@ import { Button, Form, Input, Modal, PageHeader, Table } from "antd";
|
||||
|
||||
import { libConfig, libLink } from "@clusterio/lib";
|
||||
|
||||
import { useAccount } from "../model/account";
|
||||
import ControlContext from "./ControlContext";
|
||||
import PageLayout from "./PageLayout";
|
||||
import { useInstanceList } from "../model/instance";
|
||||
@@ -59,6 +60,7 @@ function CreateInstanceButton(props) {
|
||||
|
||||
export default function InstancesPage() {
|
||||
let history = useHistory();
|
||||
let account = useAccount();
|
||||
let [slaveList] = useSlaveList();
|
||||
let [instanceList] = useInstanceList();
|
||||
|
||||
@@ -66,7 +68,7 @@ export default function InstancesPage() {
|
||||
<PageHeader
|
||||
className="site-page-header"
|
||||
title="Instances"
|
||||
extra=<CreateInstanceButton />
|
||||
extra={account.hasPermission("core.instance.create") && <CreateInstanceButton />}
|
||||
/>
|
||||
|
||||
<Table
|
||||
|
||||
Reference in new issue
Block a user