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