diff --git a/README.md b/README.md index d9a78eb..b64478c 100644 --- a/README.md +++ b/README.md @@ -21,9 +21,9 @@ TOKEN=KILL-YOURSELF.NOW - [X] 1.2.1 add file counter to main page - [X] 1.2.2 clean up this shitty code - [X] 1.2.3 bugfixes -- [ ] 1.3.0 new ui; accounts -- [ ] 1.3.1 add utility endpoints: `/embed/:fileId` for discord, `/:fileId` for quick access -- [ ] 1.3.2 disable cloning of local ips +- [ ] 1.3.0 new ui; accounts; utility endpoints +- [ ] 1.3.0 add utility endpoints: `/embed/:fileId` for discord, `/:fileId` for quick access +- [ ] 1.3.1 disable cloning of local ips - [ ] 1.4.0 admin panel - [ ] 2.0.0 rewrite using theUnfunny's code as a base/rewrite using monofile-core diff --git a/package.json b/package.json index 39bc237..669a248 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "monofile", - "version": "1.3.0", + "version": "1.3.0-pa", "description": "Discord-based file sharing", "main": "index.js", "scripts": { diff --git a/src/server/index.ts b/src/server/index.ts index 868e885..04735f8 100644 --- a/src/server/index.ts +++ b/src/server/index.ts @@ -119,7 +119,7 @@ app.get("/download/:fileId",(req,res) => { } }) -app.get("/file/:fileId",async (req,res) => { +let fgRQH = async (req:express.Request,res:express.Response) => { files.readFileStream(req.params.fileId).then(f => { res.setHeader("Content-Type",f.contentType) res.status(200) @@ -127,7 +127,7 @@ app.get("/file/:fileId",async (req,res) => { }).catch((err) => { ServeError(res,err.status,err.message) }) -}) +} app.get("/server",(req,res) => { res.send(JSON.stringify({ @@ -137,11 +137,17 @@ app.get("/server",(req,res) => { })) }) -app.get("*",(req,res) => { - ServeError(res,404,"page not found") -}) - +app.get("/file/:fileId",fgRQH) +app.get("/:fileId",fgRQH) +/* + routes should be in this order: + + index + api + dl pages + file serving +*/ // listen on 3000 or MONOFILE_PORT diff --git a/src/style/app.scss b/src/style/app.scss index fa1402d..b8226b8 100644 --- a/src/style/app.scss +++ b/src/style/app.scss @@ -29,4 +29,9 @@ top:40px; width:100%; height: calc( 100% - 40px ); + background-image: linear-gradient(#333,base.$Background); + + @media screen and (max-width:500px) { + background-image: linear-gradient(#303030,base.$Background); + } } \ No newline at end of file diff --git a/src/style/app/pulldown.scss b/src/style/app/pulldown.scss index 6df7347..cf9c199 100644 --- a/src/style/app/pulldown.scss +++ b/src/style/app/pulldown.scss @@ -21,7 +21,7 @@ left:50%; transform:translateX(-50%); - @media screen and (max-width: 400px) { + @media screen and (max-width: 500px) { width: 100%; height: 100%; } diff --git a/src/style/app/uploads.scss b/src/style/app/uploads.scss index 19c2e60..f73554a 100644 --- a/src/style/app/uploads.scss +++ b/src/style/app/uploads.scss @@ -4,7 +4,6 @@ top:50%; transform:translate(-50%,-50%); padding:10px; - border-radius:8px; background-color:#222222; color:#ddd; @@ -22,6 +21,67 @@ .number { font-family: "Inconsolata", monospace; } + + #add_new_files { + background-color:#191919; + border: 1px solid gray; + width:350px; + padding: 0px 0px 10px 0px; + + @media screen and (max-width: 500px) { + width:100%; + } + + p { + font-family: "Fira Code", monospace; + text-align: left; + margin: 0px 0px 0px 10px; + font-size: 30px; + + span { + font-size:16px; + position:relative; + top:-4px; + left:10px; + } + + @media screen and (max-width:500px) { + font-size: 40px; + + span { + font-size:20px; + position:relative; + top:-6px; + left:10px; + } + } + } + + #file_add_btns { + width:calc( 100% - 20px ); + margin:auto; + position:relative; + display:flex; + flex-direction:row; + column-gap:10px; + + button { + background-color:#444444; + color:white; + border:none; + border-radius: 8px; + padding:5px; + + flex-basis:50%; + flex-grow:1; + + @media screen and (max-width: 500px) { + font-size:16px; + padding:10px; + } + } + } + } @media screen and (max-width: 500px) { width: calc( 100% - 20px ); diff --git a/src/svelte/App.svelte b/src/svelte/App.svelte index cd213bc..87d1846 100644 --- a/src/svelte/App.svelte +++ b/src/svelte/App.svelte @@ -28,4 +28,6 @@ - \ No newline at end of file + + +

monofile

\ No newline at end of file diff --git a/src/svelte/elem/UploadWindow.svelte b/src/svelte/elem/UploadWindow.svelte index b538dc4..fee3d8a 100644 --- a/src/svelte/elem/UploadWindow.svelte +++ b/src/svelte/elem/UploadWindow.svelte @@ -8,6 +8,10 @@ ServerStats = await data.json() }) + // uploads + + let uploads = new Map() +
@@ -16,8 +20,25 @@ {ServerStats.version ? `v${ServerStats.version}` : "•••"}  —  Discord based file sharing

+
+ {#each Array.from(uploads.entries()) as upload (upload[0])} +
+ +
+ {/each} +
+ +
- +
+

+add files

+
+ +
+
+ +
+

Hosting {ServerStats.files || "•••"} files