fixed more things

This commit is contained in:
ACoolName 2024-05-24 12:55:29 +03:00
parent ad01c9f0dd
commit fedcd9d6f9
3 changed files with 15 additions and 2 deletions

View File

@ -679,4 +679,16 @@ export const USERS_ACTIONS: ActionInfo[] = [
permissions: Permission.Admin,
response_action: "Ignore"
},
]
export const BROWSER_ACTIONS: ActionInfo[] = [
{
name: "Delete Browser",
requestType: "delete",
endpoint: "/browsers/{browser_id}",
args: {},
permissions: Permission.Browse,
response_action: "Ignore"
}
]

View File

@ -6,6 +6,7 @@ import validator from '@rjsf/validator-ajv8';
import { Browser, ServerInfo } from "./interfaces";
import { loadServers } from "./servers";
import { JSONSchema7TypeName } from "json-schema";
import { BROWSER_ACTIONS } from "./actions";
const browserContext: Context<Browser> = createContext({} as Browser)
const browserActionContext: Context<ActionInfo[]|null> = createContext(null as ActionInfo[]|null)
@ -85,7 +86,7 @@ export function BrowsersPage({ }) {
)
}
return <DataTable headers={['Browser Owner', 'Server Owner', 'Server Game', 'Game Version', 'Actions']}>
<browserActionContext.Provider value={[]}>
<browserActionContext.Provider value={BROWSER_ACTIONS}>
{browserComponents}
</browserActionContext.Provider>
</DataTable>

View File

@ -45,7 +45,7 @@ function UserItem(p: { user: User }) {
)
}
export function UsersPage({ }) {
export function UsersPage(p: {}) {
const [apiAuthenticated, setApiAuthenticated] = useContext(apiAuthenticatedContext)
const [users, setUsers]: [User[], Dispatch<User[]>] = useState([] as User[])