This commit is contained in:
May 2023-01-28 16:51:47 -08:00
parent 4089de0e2e
commit 9b04ac746d
5 changed files with 50 additions and 8 deletions

View file

@ -6,7 +6,7 @@ import bodyParser from "body-parser"
import multer, {memoryStorage} from "multer" import multer, {memoryStorage} from "multer"
import Discord, { IntentsBitField, Client } from "discord.js" import Discord, { IntentsBitField, Client } from "discord.js"
import express from "express" import express from "express"
import fs from "fs" import fs, { link } from "fs"
import axios, { AxiosResponse } from "axios" import axios, { AxiosResponse } from "axios"
import ServeError from "./lib/errors" import ServeError from "./lib/errors"
@ -129,18 +129,20 @@ app.get("/file/:fileId",async (req,res) => {
}) })
}) })
app.get("*",(req,res) => {
ServeError(res,404,"page not found")
})
app.get("/server",(req,res) => { app.get("/server",(req,res) => {
res.send(JSON.stringify({ res.send(JSON.stringify({
...config, ...config,
version:pkg.version, version:pkg.version,
files:files.files.length files:Object.keys(files.files).length
})) }))
}) })
app.get("*",(req,res) => {
ServeError(res,404,"page not found")
})
// listen on 3000 or MONOFILE_PORT // listen on 3000 or MONOFILE_PORT
app.listen(process.env.MONOFILE_PORT || 3000,function() { app.listen(process.env.MONOFILE_PORT || 3000,function() {

View file

@ -1,6 +1,7 @@
@use "base"; @use "base";
@use "app/topbar"; @use "app/topbar";
@use "app/pulldown"; @use "app/pulldown";
@use "app/uploads";
.menuBtn { .menuBtn {
text-decoration:none; text-decoration:none;

View file

@ -24,7 +24,6 @@
@media screen and (max-width: 400px) { @media screen and (max-width: 400px) {
width: 100%; width: 100%;
height: 100%; height: 100%;
height: 100%;
} }
z-index: 1001; z-index: 1001;

View file

@ -0,0 +1,37 @@
#uploadWindow {
position:absolute;
left:50%;
top:50%;
transform:translate(-50%,-50%);
padding:10px;
border-radius:8px;
background-color:#222222;
color:#ddd;
h1, p {
margin: 0px;
font-size: 14px;
}
h1 {
font-weight:600;
font-size: 25px;
}
.number {
font-family: "Inconsolata", monospace;
}
@media screen and (max-width: 500px) {
width: calc( 100% - 20px );
height: calc( 100% - 20px );
border-radius:0px;
background-color:#00000000;
transform:none;
left:10px;
top:10px;
padding:0px;
}
}

View file

@ -1,6 +1,7 @@
<script> <script>
import { onMount } from "svelte"; import { onMount } from "svelte";
import Topbar from "./elem/Topbar.svelte"; import Topbar from "./elem/Topbar.svelte";
import UploadWindow from "./elem/UploadWindow.svelte";
/** /**
* @type Topbar * @type Topbar
@ -22,7 +23,9 @@
<Topbar bind:this={topbar} /> <Topbar bind:this={topbar} />
<div id="appContent"> <div id="appContent">
<button id="overlay" bind:this={overlay} /> <button id="overlay" bind:this={overlay} />
<div class="pulldown"> <div class="pulldown" style:display="none">
</div> </div>
<UploadWindow/>
</div> </div>