Skip to content

Commit ab886e2

Browse files
committed
Revert "492: Remove unused newFile code"
This reverts commit 84aa28c.
1 parent 3ecfa9d commit ab886e2

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/client/src/pages/Admin.js

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,38 @@ export default function Admin(props) {
154154

155155
<Grid container item spacing={5} direction="row" style={{padding: 20}}>
156156
<Grid container item direction="column" spacing={3} sm={6}>
157+
<Grid item>
158+
<Typography variant="h5">Latest Files</Typography>
159+
</Grid>
160+
<Grid item>
161+
{_.isEmpty(fileListHtml) !== true &&
162+
<TableContainer component={Paper}>
163+
<Table aria-label="simple table">
164+
<TableHead>
165+
<TableRow>
166+
<TableCell><b>File Type</b></TableCell>
167+
<TableCell><b>Last Updated</b></TableCell>
168+
</TableRow>
169+
</TableHead>
170+
<TableBody>
171+
{_.map(fileListHtml, (file, index) => {
172+
const fileName = file.split("-")[0];
173+
let fileDate = file.split("-").slice(1).join().split(".")[0];
174+
let fileDateOnlyNumbers = fileDate.replaceAll(",", "");
175+
let fileDateFormatted = moment(fileDateOnlyNumbers, "YYYYMMDDhmmss").local().format("MMMM Do YYYY, h:mm:ss a");
176+
177+
return (
178+
<TableRow key={index}>
179+
<TableCell>{fileName}</TableCell>
180+
<TableCell>{fileDateFormatted}</TableCell>
181+
</TableRow>
182+
)
183+
})
184+
}
185+
</TableBody>
186+
</Table>
187+
</TableContainer>}
188+
</Grid>
157189
<Grid item>
158190
<Paper>
159191
<CardContent>

0 commit comments

Comments
 (0)