mirror of
https://github.com/Dangoware/confetti-box.git
synced 2025-04-19 07:12:58 -05:00
Version 0.2.0, small tweaks to UI
This commit is contained in:
parent
3e2e49bb79
commit
dbb76a4062
5 changed files with 41 additions and 34 deletions
|
@ -1,6 +1,6 @@
|
|||
[package]
|
||||
name = "confetti_box"
|
||||
version = "0.1.3"
|
||||
version = "0.2.0"
|
||||
repository = "https://github.com/Dangoware/confetti-box"
|
||||
license = "AGPL-3.0-or-later"
|
||||
authors.workspace = true
|
||||
|
@ -10,19 +10,18 @@ edition = "2021"
|
|||
workspace = true
|
||||
|
||||
[dependencies]
|
||||
blake3 = { version = "1.5.4", features = ["mmap", "rayon", "serde"] }
|
||||
chrono = { version = "0.4.38", features = ["serde"] }
|
||||
ciborium = "0.2.2"
|
||||
blake3 = { version = "1.5", features = ["mmap", "rayon", "serde"] }
|
||||
chrono = { version = "0.4", features = ["serde"] }
|
||||
ciborium = "0.2"
|
||||
file-format = { version = "0.26", features = ["reader"] }
|
||||
log = "0.4"
|
||||
lz4_flex = "0.11.3"
|
||||
maud = { version = "0.26", features = ["rocket"] }
|
||||
rand = "0.8.5"
|
||||
rand = "0.8"
|
||||
rocket = { version = "0.5", features = ["json"] }
|
||||
rocket_ws = "0.1.1"
|
||||
serde = { version = "1.0.213", features = ["derive"] }
|
||||
serde_with = { version = "3.11.0", features = ["chrono_0_4"] }
|
||||
toml = "0.8.19"
|
||||
unidecode = "0.3.0"
|
||||
urlencoding = "2.1.3"
|
||||
uuid = { version = "1.11.0", features = ["serde", "v4"] }
|
||||
rocket_ws = "0.1"
|
||||
serde = { version = "1.0", features = ["derive"] }
|
||||
serde_with = { version = "3.11", features = ["chrono_0_4"] }
|
||||
toml = "0.8"
|
||||
unidecode = "0.3"
|
||||
urlencoding = "2.1"
|
||||
uuid = { version = "1.11", features = ["serde", "v4"] }
|
||||
|
|
|
@ -2,7 +2,7 @@ use std::{
|
|||
collections::{hash_map::Values, HashMap, HashSet},
|
||||
ffi::OsStr,
|
||||
fs::{self, File},
|
||||
io,
|
||||
io::{self, Write},
|
||||
path::{Path, PathBuf},
|
||||
sync::{Arc, RwLock},
|
||||
};
|
||||
|
@ -48,10 +48,9 @@ impl Mochibase {
|
|||
|
||||
/// Open the database from a path
|
||||
pub fn open<P: AsRef<Path>>(path: &P) -> Result<Self, io::Error> {
|
||||
let file = File::open(path)?;
|
||||
let mut lz4_file = lz4_flex::frame::FrameDecoder::new(file);
|
||||
let mut file = File::open(path)?;
|
||||
|
||||
from_reader(&mut lz4_file)
|
||||
from_reader(&mut file)
|
||||
.map_err(|e| io::Error::other(format!("failed to open database: {e}")))
|
||||
}
|
||||
|
||||
|
@ -67,11 +66,10 @@ impl Mochibase {
|
|||
/// Save the database to its file
|
||||
pub fn save(&self) -> Result<(), io::Error> {
|
||||
// Create a file and write the LZ4 compressed stream into it
|
||||
let file = File::create(self.path.with_extension("bkp"))?;
|
||||
let mut lz4_file = lz4_flex::frame::FrameEncoder::new(file);
|
||||
into_writer(self, &mut lz4_file)
|
||||
let mut file = File::create(self.path.with_extension("bkp"))?;
|
||||
into_writer(self, &mut file)
|
||||
.map_err(|e| io::Error::other(format!("failed to save database: {e}")))?;
|
||||
lz4_file.try_finish()?;
|
||||
file.flush()?;
|
||||
|
||||
fs::rename(self.path.with_extension("bkp"), &self.path).unwrap();
|
||||
|
||||
|
|
|
@ -19,11 +19,14 @@ pub fn head(page_title: &str) -> Markup {
|
|||
pub fn footer() -> Markup {
|
||||
html! {
|
||||
footer {
|
||||
p {a href="/" {"Home"}}
|
||||
p {a href="/about" {"About"}}
|
||||
p {a href="/api" {"API"}}
|
||||
p {a href="https://github.com/Dangoware/confetti-box" {"Source"}}
|
||||
p {a href="https://github.com/Dangoware/" {"Dangoware"}}
|
||||
div {
|
||||
p {a href="/" {"Home"}}
|
||||
p {a href="/about" {"About"}}
|
||||
p {a href="/api" {"API"}}
|
||||
p {a href="https://github.com/Dangoware/confetti-box" {"Source"}}
|
||||
p {a href="https://github.com/Dangoware/" {"Dangoware"}}
|
||||
}
|
||||
p.version { "Running Confetti-Box v" (env!("CARGO_PKG_VERSION")) }
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -24,16 +24,23 @@ center {
|
|||
}
|
||||
|
||||
footer {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
div {
|
||||
display: flex;
|
||||
width: fit-content;
|
||||
|
||||
p {
|
||||
border-right: 2px dotted grey;
|
||||
padding: 0 10px;
|
||||
p {
|
||||
border-right: 2px dotted grey;
|
||||
padding: 0 10px;
|
||||
}
|
||||
|
||||
p:last-child {
|
||||
border-right: none;
|
||||
}
|
||||
}
|
||||
|
||||
p:last-child {
|
||||
border-right: none;
|
||||
p.version {
|
||||
margin-top: 0;
|
||||
opacity: 45%;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -206,7 +206,7 @@ async function uploadFileWebsocket(file, duration, maxSize) {
|
|||
new_uri = "ws:";
|
||||
}
|
||||
new_uri += "//" + loc.host;
|
||||
new_uri += loc.pathname + "/upload/websocket?name=" + file.name +"&size=" + file.size + "&duration=" + parseInt(duration);
|
||||
new_uri += "/upload/websocket?name=" + file.name +"&size=" + file.size + "&duration=" + parseInt(duration);
|
||||
const socket = new WebSocket(new_uri);
|
||||
|
||||
const chunkSize = 10_000_000;
|
||||
|
|
Loading…
Reference in a new issue