[Task 3] Fixes, formatting, layout updates

This commit is contained in:
2025-11-17 10:38:31 +01:00
parent 157603d3d7
commit fd8ec668b4
6 changed files with 6492 additions and 47 deletions

View File

@@ -28,6 +28,7 @@ const FileCard = ( props: {
<header> <header>
<h2>Select a File</h2> <h2>Select a File</h2>
</header> </header>
<div className="table-scroll-wrapper">
<table id="table-content"> <table id="table-content">
<thead> <thead>
<tr> <tr>
@@ -46,6 +47,7 @@ const FileCard = ( props: {
} }
</tbody> </tbody>
</table> </table>
</div>
</article> </article>
); );
}; };
@@ -80,4 +82,3 @@ const FileRow = ( props: {
}; };
export default FileCard; export default FileCard;

View File

@@ -1,6 +1,6 @@
/*some style for app component*/ /*some style for app component*/
:root { :root {
--spacing: 0.25rem; --spacing: 0.5rem;
--border-color: #a0a0a0; --border-color: #a0a0a0;
} }
@@ -37,7 +37,11 @@ article {
} }
article.wide { article.wide {
width: 800px width: 800px;
.table-scroll-wrapper {
max-height: 40vh;
}
} }
.action-icons { .action-icons {

View File

@@ -21,7 +21,8 @@ body main {
& article { & article {
margin: 0; margin: 0;
padding: var(--spacing); padding: var(--spacing);
& > header {
&>header {
margin: calc(var(--spacing) * -1) calc(var(--spacing) * -1) var(--spacing); margin: calc(var(--spacing) * -1) calc(var(--spacing) * -1) var(--spacing);
padding: var(--spacing); padding: var(--spacing);
} }

View File

@@ -8,13 +8,16 @@ dl {
margin-top: 0; margin-top: 0;
margin-bottom: 20px; margin-bottom: 20px;
} }
dt, dt,
dd { dd {
line-height: 1.42857143; line-height: 1.42857143;
} }
dt { dt {
font-weight: 700; font-weight: 700;
} }
dd { dd {
margin-left: 0; margin-left: 0;
} }

View File

@@ -66,6 +66,21 @@ app.post(
} }
); );
const zeroExtend = ( num: number ) => {
if ( num < 10 ) {
return '0' + num;
} else {
return '' + num;
}
};
const formatDate = ( date: Date ) => {
return `${ date.getFullYear() }-${ zeroExtend( date.getMonth() ) }-${ zeroExtend( date.getDay() ) }`
+ ' at '
+ `${ zeroExtend( date.getHours() ) }:${ zeroExtend( date.getMinutes() ) }:${ zeroExtend( date.getSeconds() ) }`;
};
// Endpoint to send back file names/upload times // Endpoint to send back file names/upload times
app.get( '/status', async ( _req, res ) => { app.get( '/status', async ( _req, res ) => {
const resObject: responseObject = { const resObject: responseObject = {
@@ -78,7 +93,7 @@ app.get( '/status', async ( _req, res ) => {
resObject.names.push( file.name ); resObject.names.push( file.name );
const stats = await fs.stat( `./src/server/uploads/${ file.name }` ); const stats = await fs.stat( `./src/server/uploads/${ file.name }` );
resObject.uploadTimes.push( stats.birthtime.toString() ); resObject.uploadTimes.push( formatDate( stats.birthtime ) );
} }
res.status( 200 ).json( resObject ); res.status( 200 ).json( resObject );

File diff suppressed because it is too large Load Diff