feat(server): add box create/upload endpoints and improve UI

- Add `/box` endpoint to create an upload box and return its URL
- Add `/box/:id/upload` endpoint for uploading a single file to an existing box
- Refactor upload saving into a shared helper and validate box IDs/filenames
- Ensure unique filenames by checking existing files on disk to avoid collisions
- Update upload panel CSS to use flex layout for better resizing/scroll behaviorfeat(server): add box create/upload endpoints and improve UI

- Add `/box` endpoint to create an upload box and return its URL
- Add `/box/:id/upload` endpoint for uploading a single file to an existing box
- Refactor upload saving into a shared helper and validate box IDs/filenames
- Ensure unique filenames by checking existing files on disk to avoid collisions
- Update upload panel CSS to use flex layout for better resizing/scroll behavior
This commit is contained in:
2026-04-25 18:57:08 +03:00
parent fb7e378b3a
commit f06a2c544f
3 changed files with 305 additions and 60 deletions

View File

@@ -169,6 +169,8 @@ main {
}
.upload-panel {
display: flex;
flex-direction: column;
flex: 1;
min-height: 0;
margin: 0 8px 8px;
@@ -182,6 +184,7 @@ main {
}
.upload-dropzone {
flex: 0 0 auto;
height: 118px;
box-sizing: border-box;
display: flex;
@@ -244,6 +247,7 @@ main {
}
.upload-details {
flex: 0 0 auto;
display: flex;
align-items: center;
height: 28px;
@@ -270,7 +274,8 @@ main {
}
.upload-file-list {
height: 132px;
flex: 1 1 auto;
min-height: 0;
margin-top: 8px;
overflow-y: auto;
background: #ffffff;
@@ -291,10 +296,11 @@ main {
.upload-file-row {
display: grid;
grid-template-columns: 22px minmax(0, 1fr) 82px;
grid-template-rows: 20px 8px;
align-items: center;
height: 26px;
height: 36px;
box-sizing: border-box;
padding: 0 8px;
padding: 4px 8px;
border-bottom: 1px solid #dfdfdf;
font-size: 13px;
line-height: 13px;
@@ -305,6 +311,7 @@ main {
}
.upload-file-icon {
grid-row: 1 / 3;
width: 16px;
height: 18px;
position: relative;
@@ -338,6 +345,36 @@ main {
text-align: right;
}
.upload-progress {
grid-column: 2 / 4;
grid-row: 2;
display: block;
height: 8px;
box-sizing: border-box;
overflow: hidden;
background: #ffffff;
border-top: 1px solid #808080;
border-left: 1px solid #808080;
border-right: 1px solid #dfdfdf;
border-bottom: 1px solid #dfdfdf;
}
.upload-progress-bar {
display: block;
width: 0%;
height: 100%;
background: #000078;
}
.upload-file-row.is-uploaded .upload-progress-bar {
background: #008000;
}
.upload-file-row.is-failed .upload-progress-bar {
width: 100%;
background: #800000;
}
.upload-actions {
display: flex;
justify-content: flex-end;
@@ -447,7 +484,6 @@ main {
}
.upload-file-list {
height: calc(100dvh - 284px);
min-height: 160px;
}
}