Can manually download an OTA update
This commit is contained in:
@ -37,6 +37,13 @@ export class OTAAPI {
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the link to download an OTA update
|
||||
*/
|
||||
static DownloadOTAUpdateURL(platform: string, version: string): string {
|
||||
return APIClient.backendURL() + `/ota/${platform}/${version}`;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the list of OTA updates
|
||||
*/
|
||||
|
@ -1,3 +1,5 @@
|
||||
import DownloadIcon from "@mui/icons-material/Download";
|
||||
import FileUploadIcon from "@mui/icons-material/FileUpload";
|
||||
import {
|
||||
IconButton,
|
||||
Paper,
|
||||
@ -9,13 +11,13 @@ import {
|
||||
TableRow,
|
||||
Tooltip,
|
||||
} from "@mui/material";
|
||||
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
|
||||
import FileUploadIcon from "@mui/icons-material/FileUpload";
|
||||
import { UploadUpdateDialog } from "../dialogs/UploadUpdateDialog";
|
||||
import { filesize } from "filesize";
|
||||
import React from "react";
|
||||
import { OTAAPI, OTAUpdate } from "../api/OTAApi";
|
||||
import { UploadUpdateDialog } from "../dialogs/UploadUpdateDialog";
|
||||
import { AsyncWidget } from "../widgets/AsyncWidget";
|
||||
import { filesize } from "filesize";
|
||||
import { RouterLink } from "../widgets/RouterLink";
|
||||
import { SolarEnergyRouteContainer } from "../widgets/SolarEnergyRouteContainer";
|
||||
|
||||
export function OTARoute(): React.ReactElement {
|
||||
const [list, setList] = React.useState<string[] | undefined>();
|
||||
@ -97,6 +99,7 @@ function _OTAList(p: { list: OTAUpdate[] }): React.ReactElement {
|
||||
<TableCell align="center">Platform</TableCell>
|
||||
<TableCell align="center">Version</TableCell>
|
||||
<TableCell align="center">File size</TableCell>
|
||||
<TableCell align="center"></TableCell>
|
||||
</TableRow>
|
||||
</TableHead>
|
||||
<TableBody>
|
||||
@ -105,6 +108,17 @@ function _OTAList(p: { list: OTAUpdate[] }): React.ReactElement {
|
||||
<TableCell align="center">{row.platform}</TableCell>
|
||||
<TableCell align="center">{row.version}</TableCell>
|
||||
<TableCell align="center">{filesize(row.file_size)}</TableCell>
|
||||
<TableCell align="center">
|
||||
<Tooltip title="Download a copy of the firmware">
|
||||
<RouterLink
|
||||
to={OTAAPI.DownloadOTAUpdateURL(row.platform, row.version)}
|
||||
>
|
||||
<IconButton>
|
||||
<DownloadIcon />
|
||||
</IconButton>
|
||||
</RouterLink>
|
||||
</Tooltip>
|
||||
</TableCell>
|
||||
</TableRow>
|
||||
))}
|
||||
</TableBody>
|
||||
|
Reference in New Issue
Block a user