mirror of
https://github.com/mollersuite/monofile.git
synced 2024-11-24 22:56:26 -08:00
Few quick patches
This commit is contained in:
parent
490098f33b
commit
8f1b1ada84
|
@ -85,6 +85,23 @@ const apiRouter = new APIRouter(files)
|
|||
apiRouter.loadAPIMethods().then(() => {
|
||||
app.route("/", apiRouter.root)
|
||||
console.log("API OK!")
|
||||
|
||||
// listen on 3000 or MONOFILE_PORT
|
||||
// moved here to prevent a crash if someone manages to access monofile before api routes are mounted
|
||||
|
||||
serve(
|
||||
{
|
||||
fetch: app.fetch,
|
||||
port: Number(process.env.MONOFILE_PORT || 3000),
|
||||
serverOptions: {
|
||||
//@ts-ignore
|
||||
requestTimeout: config.requestTimeout
|
||||
}
|
||||
},
|
||||
(info) => {
|
||||
console.log("Web OK!", info.port, info.address)
|
||||
}
|
||||
)
|
||||
})
|
||||
|
||||
// index, clone
|
||||
|
@ -104,20 +121,4 @@ app.get("/", async (ctx) =>
|
|||
file serving
|
||||
*/
|
||||
|
||||
// listen on 3000 or MONOFILE_PORT
|
||||
|
||||
serve(
|
||||
{
|
||||
fetch: app.fetch,
|
||||
port: Number(process.env.MONOFILE_PORT || 3000),
|
||||
serverOptions: {
|
||||
//@ts-ignore
|
||||
requestTimeout: config.requestTimeout
|
||||
}
|
||||
},
|
||||
(info) => {
|
||||
console.log("Web OK!", info.port, info.address)
|
||||
}
|
||||
)
|
||||
|
||||
export default app
|
|
@ -107,9 +107,7 @@ export default function (files: Files) {
|
|||
: `@${fileOwner?.username || "Deleted User"}`
|
||||
)
|
||||
)
|
||||
} else {
|
||||
ServeError(ctx, 404, "file not found")
|
||||
}
|
||||
} else return ServeError(ctx, 404, "file not found")
|
||||
})
|
||||
|
||||
return router
|
||||
|
|
|
@ -4,6 +4,7 @@
|
|||
import { fade } from "svelte/transition"
|
||||
import { circIn, circOut } from "svelte/easing"
|
||||
import { serverStats, refresh_stats, account } from "./stores.mjs"
|
||||
import bytes from "bytes"
|
||||
|
||||
import AttachmentZone from "./uploader/AttachmentZone.svelte"
|
||||
|
||||
|
@ -213,9 +214,7 @@
|
|||
{upload[1].name}
|
||||
<span style:color="#999999" style:font-weight="400"
|
||||
>{upload[1].type}{@html upload[1].type == "upload"
|
||||
? ` (${Math.round(
|
||||
upload[1].file.size / 1048576
|
||||
)}MiB)`
|
||||
? ` (${bytes(upload[1].file.size)})`
|
||||
: ""}</span
|
||||
>
|
||||
</h2>
|
||||
|
@ -372,11 +371,12 @@
|
|||
>{$serverStats.files || "•••"}</span
|
||||
>
|
||||
files — Maximum filesize is
|
||||
<span class="number" style:font-weight="600"
|
||||
>{(($serverStats.maxDiscordFileSize || 0) *
|
||||
($serverStats.maxDiscordFiles || 0)) /
|
||||
1048576 || "•••"}MiB</span
|
||||
>
|
||||
<span class="number" style:font-weight="600">
|
||||
{
|
||||
$serverStats.maxDiscordFiles
|
||||
? bytes($serverStats.maxDiscordFileSize * $serverStats.maxDiscordFiles)
|
||||
: "•••"
|
||||
}</span>
|
||||
<br />
|
||||
</p>
|
||||
<p style:color="#999999" style:text-align="center" style:font-size="12px">
|
||||
|
|
Loading…
Reference in a new issue