Add new REST API routes to token rights editor
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
Pierre HUBERT 2025-05-30 11:30:27 +02:00
parent ea98aaf856
commit fa03ae885f

View File

@ -1,6 +1,7 @@
import {
Checkbox,
FormControlLabel,
Grid,
Paper,
Table,
TableBody,
@ -59,6 +60,7 @@ export function TokenRightsEditor(p: {
<TableCell align="center">Get XML definition</TableCell>
<TableCell align="center">Get autostart</TableCell>
<TableCell align="center">Set autostart</TableCell>
<TableCell align="center">Backup disk</TableCell>
</TableRow>
</TableHead>
<TableBody>
@ -82,6 +84,10 @@ export function TokenRightsEditor(p: {
{...p}
right={{ verb: "PUT", path: "/api/vm/*/autostart" }}
/>
<CellRight
{...p}
right={{ verb: "POST", path: "/api/vm/*/disk/*/backup" }}
/>
</TableRow>
{/* Per VM operations */}
@ -117,6 +123,14 @@ export function TokenRightsEditor(p: {
{...p}
right={{ verb: "PUT", path: `/api/vm/${v.uuid}/autostart` }}
parent={{ verb: "PUT", path: "/api/vm/*/autostart" }}
/>{" "}
<CellRight
{...p}
right={{
verb: "POST",
path: `/api/vm/${v.uuid}/disk/*/backup`,
}}
parent={{ verb: "POST", path: "/api/vm/*/disk/*/backup" }}
/>
</TableRow>
))}
@ -669,34 +683,68 @@ export function TokenRightsEditor(p: {
</Table>
</RightsSection>
{/* ISO files */}
<RightsSection label="ISO files">
<RouteRight
{...p}
right={{ verb: "POST", path: "/api/iso/upload" }}
label="Upload a new ISO file"
/>
<RouteRight
{...p}
right={{ verb: "POST", path: "/api/iso/upload_from_url" }}
label="Upload a new ISO file from a given URL"
/>
<RouteRight
{...p}
right={{ verb: "GET", path: "/api/iso/list" }}
label="Get the list of ISO files"
/>
<RouteRight
{...p}
right={{ verb: "GET", path: "/api/iso/*" }}
label="Download ISO files"
/>
<RouteRight
{...p}
right={{ verb: "DELETE", path: "/api/iso/*" }}
label="Delete ISO files"
/>
</RightsSection>
<Grid container>
<Grid size={{ md: 6 }}>
{/* Disk images */}
<RightsSection label="Disk images">
<RouteRight
{...p}
right={{ verb: "POST", path: "/api/disk_images/upload" }}
label="Upload a new disk image"
/>
<RouteRight
{...p}
right={{ verb: "GET", path: "/api/disk_images/list" }}
label="Get the list of disk images"
/>
<RouteRight
{...p}
right={{ verb: "GET", path: "/api/disk_images/*" }}
label="Download disk images"
/>
<RouteRight
{...p}
right={{ verb: "POST", path: "/api/disk_images/*/convert" }}
label="Convert disk images"
/>
<RouteRight
{...p}
right={{ verb: "DELETE", path: "/api/disk_images/*" }}
label="Delete disk images"
/>
</RightsSection>
</Grid>
<Grid size={{ md: 6 }}>
{/* ISO files */}
<RightsSection label="ISO files">
<RouteRight
{...p}
right={{ verb: "POST", path: "/api/iso/upload" }}
label="Upload a new ISO file"
/>
<RouteRight
{...p}
right={{ verb: "POST", path: "/api/iso/upload_from_url" }}
label="Upload a new ISO file from a given URL"
/>
<RouteRight
{...p}
right={{ verb: "GET", path: "/api/iso/list" }}
label="Get the list of ISO files"
/>
<RouteRight
{...p}
right={{ verb: "GET", path: "/api/iso/*" }}
label="Download ISO files"
/>
<RouteRight
{...p}
right={{ verb: "DELETE", path: "/api/iso/*" }}
label="Delete ISO files"
/>
</RightsSection>
</Grid>
</Grid>
{/* Server general information */}
<RightsSection label="Server">