Compare commits
2 Commits
2f8b8aa59f
...
784fe58c3e
| Author | SHA1 | Date | |
|---|---|---|---|
| 784fe58c3e | |||
| 5857892a4b |
@@ -42,6 +42,11 @@ pub fn delete_update(platform: OTAPlatform, version: &semver::Version) -> anyhow
|
|||||||
pub fn get_ota_updates_for_platform(platform: OTAPlatform) -> anyhow::Result<Vec<OTAUpdate>> {
|
pub fn get_ota_updates_for_platform(platform: OTAPlatform) -> anyhow::Result<Vec<OTAUpdate>> {
|
||||||
let ota_path = AppConfig::get().ota_platform_dir(platform);
|
let ota_path = AppConfig::get().ota_platform_dir(platform);
|
||||||
|
|
||||||
|
// Check if the directory dedicated to the updates of the platform exists
|
||||||
|
if !ota_path.is_dir() {
|
||||||
|
return Ok(Vec::new());
|
||||||
|
}
|
||||||
|
|
||||||
let mut out = Vec::new();
|
let mut out = Vec::new();
|
||||||
|
|
||||||
for e in std::fs::read_dir(ota_path)? {
|
for e in std::fs::read_dir(ota_path)? {
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ import {
|
|||||||
TableHead,
|
TableHead,
|
||||||
TableRow,
|
TableRow,
|
||||||
Tooltip,
|
Tooltip,
|
||||||
|
Typography,
|
||||||
} from "@mui/material";
|
} from "@mui/material";
|
||||||
import { filesize } from "filesize";
|
import { filesize } from "filesize";
|
||||||
import React from "react";
|
import React from "react";
|
||||||
@@ -141,6 +142,14 @@ function _OTAList(p: {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (p.list.length === 0) {
|
||||||
|
return (
|
||||||
|
<Typography>
|
||||||
|
There is no OTA update uploaded on the platform yet.
|
||||||
|
</Typography>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{deployUpdate && (
|
{deployUpdate && (
|
||||||
@@ -150,7 +159,7 @@ function _OTAList(p: {
|
|||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<TableContainer component={Paper}>
|
<TableContainer component={Paper}>
|
||||||
<Table sx={{ minWidth: 650 }} aria-label="simple table">
|
<Table sx={{ minWidth: 650 }} aria-label="list of updates">
|
||||||
<TableHead>
|
<TableHead>
|
||||||
<TableRow>
|
<TableRow>
|
||||||
<TableCell align="center">Platform</TableCell>
|
<TableCell align="center">Platform</TableCell>
|
||||||
|
|||||||
Reference in New Issue
Block a user