From 42a3d61db8566aa2f392ef1e7490e2d83afa1250 Mon Sep 17 00:00:00 2001 From: neri Date: Mon, 13 Jul 2020 15:59:16 +0200 Subject: [PATCH] configurable logging, mobile friendliness --- Cargo.toml | 2 +- src/main.rs | 5 ++++- static/index.css | 3 +++ template/index.html | 1 + template/upload.html | 5 +++-- template/view.html | 1 + 6 files changed, 13 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index a8a3a92..ae1beac 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -8,7 +8,7 @@ edition = "2018" [dependencies] actix-web = { version = "2.0.0", default-features = false, features = [ "compress" ] } -sqlx = { version = "0.3.5", default-features = false, features = [ "runtime-async-std", "macros", "postgres", "chrono" ] } +sqlx = { version = "0.3.5", default-features = false, features = [ "runtime-async-std", "postgres", "chrono" ] } actix-rt = "1.1.1" env_logger = "0.7.1" log = "0.4.8" diff --git a/src/main.rs b/src/main.rs index a43bbeb..84037f1 100644 --- a/src/main.rs +++ b/src/main.rs @@ -155,7 +155,10 @@ struct Config { #[actix_rt::main] async fn main() -> std::io::Result<()> { - std::env::set_var("RUST_LOG", "warn,datatrash=info,actix_web=info"); + env::set_var( + "RUST_LOG", + env::var("RUST_LOG").unwrap_or_else(|_| "info".to_string()), + ); env_logger::init(); let pool: PgPool = setup_db().await; diff --git a/static/index.css b/static/index.css index f47a2ad..d639a79 100644 --- a/static/index.css +++ b/static/index.css @@ -1,5 +1,6 @@ body { background-color: #222222; + margin: 0; } main { @@ -7,6 +8,7 @@ main { font-family: sans; max-width: 1200px; margin: 0 auto; + padding: 1rem; } h1 > a, @@ -35,6 +37,7 @@ textarea { border: 2px solid #dddddd; border-radius: 5px; margin-bottom: 1rem; + max-width: calc(100vw - 3rem - 4px); } input[type="submit"] { diff --git a/template/index.html b/template/index.html index 0d08b09..b5a9fc0 100644 --- a/template/index.html +++ b/template/index.html @@ -3,6 +3,7 @@ datatrash + diff --git a/template/upload.html b/template/upload.html index 1ea3a20..7ac8f06 100644 --- a/template/upload.html +++ b/template/upload.html @@ -3,15 +3,16 @@ datatrash +

datatrash

- Datei ist verfügbar unter + Datei-Link: - {server}/files/{id} + {server}/files/{id}

diff --git a/template/view.html b/template/view.html index 4cd0d3e..18e26b8 100644 --- a/template/view.html +++ b/template/view.html @@ -3,6 +3,7 @@ datatrash +