mirror of
https://github.com/janishutz/fundamentals-of-webengineering.git
synced 2025-11-25 05:44:24 +00:00
[Task 3] Fixes, formatting, layout updates
This commit is contained in:
@@ -28,6 +28,7 @@ const FileCard = ( props: {
|
||||
<header>
|
||||
<h2>Select a File</h2>
|
||||
</header>
|
||||
<div className="table-scroll-wrapper">
|
||||
<table id="table-content">
|
||||
<thead>
|
||||
<tr>
|
||||
@@ -46,6 +47,7 @@ const FileCard = ( props: {
|
||||
}
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</article>
|
||||
);
|
||||
};
|
||||
@@ -80,4 +82,3 @@ const FileRow = ( props: {
|
||||
};
|
||||
|
||||
export default FileCard;
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
/*some style for app component*/
|
||||
:root {
|
||||
--spacing: 0.25rem;
|
||||
--spacing: 0.5rem;
|
||||
--border-color: #a0a0a0;
|
||||
}
|
||||
|
||||
@@ -37,7 +37,11 @@ article {
|
||||
}
|
||||
|
||||
article.wide {
|
||||
width: 800px
|
||||
width: 800px;
|
||||
|
||||
.table-scroll-wrapper {
|
||||
max-height: 40vh;
|
||||
}
|
||||
}
|
||||
|
||||
.action-icons {
|
||||
|
||||
@@ -21,6 +21,7 @@ body main {
|
||||
& article {
|
||||
margin: 0;
|
||||
padding: var(--spacing);
|
||||
|
||||
&>header {
|
||||
margin: calc(var(--spacing) * -1) calc(var(--spacing) * -1) var(--spacing);
|
||||
padding: var(--spacing);
|
||||
|
||||
@@ -8,13 +8,16 @@ dl {
|
||||
margin-top: 0;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
|
||||
dt,
|
||||
dd {
|
||||
line-height: 1.42857143;
|
||||
}
|
||||
|
||||
dt {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
dd {
|
||||
margin-left: 0;
|
||||
}
|
||||
|
||||
@@ -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
|
||||
app.get( '/status', async ( _req, res ) => {
|
||||
const resObject: responseObject = {
|
||||
@@ -78,7 +93,7 @@ app.get( '/status', async ( _req, res ) => {
|
||||
resObject.names.push( 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 );
|
||||
|
||||
6421
task_3_react/src/server/uploads/KANTON_ZUERICH_418-1763371124710-469
Normal file
6421
task_3_react/src/server/uploads/KANTON_ZUERICH_418-1763371124710-469
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user