Add new REST API routes to token rights editor
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		@@ -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,6 +683,38 @@ export function TokenRightsEditor(p: {
 | 
			
		||||
        </Table>
 | 
			
		||||
      </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
 | 
			
		||||
@@ -697,6 +743,8 @@ export function TokenRightsEditor(p: {
 | 
			
		||||
              label="Delete ISO files"
 | 
			
		||||
            />
 | 
			
		||||
          </RightsSection>
 | 
			
		||||
        </Grid>
 | 
			
		||||
      </Grid>
 | 
			
		||||
 | 
			
		||||
      {/* Server general information */}
 | 
			
		||||
      <RightsSection label="Server">
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user