Add support for statistics routes

This commit is contained in:
2025-05-02 08:56:51 +02:00
parent 7c0d758839
commit 16ef1147fe
9 changed files with 33 additions and 2 deletions

View File

@ -14,6 +14,7 @@ export interface Token {
right_inbox: boolean;
right_file: boolean;
right_auth: boolean;
right_stats: boolean;
}
export interface TokenWithSecret extends Token {
@ -30,6 +31,7 @@ export interface NewToken {
right_inbox: boolean;
right_file: boolean;
right_auth: boolean;
right_stats: boolean;
}
export class TokensApi {

View File

@ -36,6 +36,7 @@ export function CreateTokenDialog(p: {
right_auth: false,
right_inbox: false,
right_movement: false,
right_stats: false,
};
const clearForm = () => {
@ -77,6 +78,7 @@ export function CreateTokenDialog(p: {
right_file: true,
right_auth: true,
right_inbox: true,
right_stats: false,
});
};
@ -202,6 +204,18 @@ export function CreateTokenDialog(p: {
});
}}
/>
<br />
<CheckboxInput
editable
label="Right: statistics routes"
checked={newToken.right_stats}
onValueChange={(v) => {
setNewToken({
...newToken,
right_stats: v,
});
}}
/>
</DialogContent>
<DialogActions>
<Button onClick={cancel}>Cancel</Button>

View File

@ -191,6 +191,12 @@ function TokensRouteInner(p: {
flex: 2,
type: "boolean",
},
{
field: "right_stats",
headerName: "Stats",
flex: 2,
type: "boolean",
},
{
field: "actions",
type: "actions",