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