test
This commit is contained in:
parent
9e209384b2
commit
367b7d0853
@ -424,14 +424,7 @@ export const SERVER_ACTIONS: ActionInfo[] = [
|
||||
default: []
|
||||
},
|
||||
command: {
|
||||
anyOf: [
|
||||
{
|
||||
type: "string"
|
||||
},
|
||||
{
|
||||
type: "null"
|
||||
}
|
||||
],
|
||||
type: "string",
|
||||
title: "Command"
|
||||
}
|
||||
},
|
||||
|
@ -130,28 +130,16 @@ export const actionIdentifierContext: Context<string> = createContext('')
|
||||
|
||||
function convertNumber(permissions: number): number[]{
|
||||
var arr: number[] = []
|
||||
if (permissions&Permission.Start){
|
||||
arr.push(Permission.Start)
|
||||
}
|
||||
if (permissions&Permission.Stop){
|
||||
arr.push(Permission.Stop)
|
||||
}
|
||||
if (permissions&Permission.Browse){
|
||||
arr.push(Permission.Browse)
|
||||
}
|
||||
if (permissions&Permission.RunCommand){
|
||||
arr.push(Permission.RunCommand)
|
||||
}
|
||||
if (permissions&Permission.Create){
|
||||
arr.push(Permission.Create)
|
||||
}
|
||||
if (permissions&Permission.Delete){
|
||||
arr.push(Permission.Delete)
|
||||
}
|
||||
if (permissions&Permission.Admin){
|
||||
arr.push(Permission.Admin)
|
||||
}
|
||||
return arr
|
||||
|
||||
Object.entries(Permission).forEach(
|
||||
([key, value]) => {
|
||||
if (permissions&value){
|
||||
arr.push(value)
|
||||
}
|
||||
}
|
||||
);
|
||||
|
||||
return arr
|
||||
}
|
||||
|
||||
function CustomField(props: WidgetProps){
|
||||
@ -370,7 +358,7 @@ export function ActionGroup(p: { actions: ActionInfo[], identifierSubstring?: st
|
||||
return <MenuItem
|
||||
key={option.props.action.name}
|
||||
selected={index === selectedIndex}
|
||||
onClick={(event) => handleMenuItemClick(event, index)}
|
||||
// onClick={(event) => handleMenuItemClick(event, index)}
|
||||
disabled={!isUserAllowed(user, option.props.action)}
|
||||
>
|
||||
{option.props.action.name}
|
||||
|
@ -75,6 +75,7 @@ function ServerItem(props: { server_info: ServerInfo }) {
|
||||
|
||||
export default function ServersBoard() {
|
||||
const [servers, setServers]: [ServerInfo[], Dispatch<ServerInfo[]>] = useState([] as ServerInfo[]);
|
||||
servers.sort()
|
||||
const [apiAuthenticated, setApiAuthenticated] = useContext(apiAuthenticatedContext)
|
||||
|
||||
function handleServers() {
|
||||
|
@ -51,6 +51,7 @@ function UserItem(p: { user: User }) {
|
||||
export function UsersPage(p: {}) {
|
||||
const [apiAuthenticated, setApiAuthenticated] = useContext(apiAuthenticatedContext)
|
||||
const [users, setUsers]: [User[], Dispatch<User[]>] = useState([] as User[])
|
||||
users.sort()
|
||||
|
||||
const action: ActionInfo|undefined = INVITE_USER_ACTION
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user