add direnv
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@ -7,3 +7,4 @@
|
||||
**/*.rs.bk
|
||||
serveurhttp
|
||||
test
|
||||
.env
|
||||
|
||||
@ -164,18 +164,12 @@
|
||||
.visible {
|
||||
visibility: visible;
|
||||
}
|
||||
.m-0 {
|
||||
margin: calc(var(--spacing) * 0);
|
||||
}
|
||||
.hidden {
|
||||
display: none;
|
||||
}
|
||||
.table {
|
||||
display: table;
|
||||
}
|
||||
.w-1 {
|
||||
width: calc(var(--spacing) * 1);
|
||||
}
|
||||
.transform {
|
||||
transform: var(--tw-rotate-x,) var(--tw-rotate-y,) var(--tw-rotate-z,) var(--tw-skew-x,) var(--tw-skew-y,);
|
||||
}
|
||||
@ -188,9 +182,6 @@
|
||||
.px-2 {
|
||||
padding-inline: calc(var(--spacing) * 2);
|
||||
}
|
||||
.ps-6 {
|
||||
padding-inline-start: calc(var(--spacing) * 6);
|
||||
}
|
||||
.text-4xl {
|
||||
font-size: var(--text-4xl);
|
||||
line-height: var(--tw-leading, var(--text-4xl--line-height));
|
||||
|
||||
@ -13,4 +13,11 @@ pkgs.mkShell {
|
||||
lld
|
||||
];
|
||||
PKG_CONFIG_PATH = "${pkgs.openssl.dev}/lib/pkgconfig";
|
||||
|
||||
shellHook = ''
|
||||
source .env
|
||||
|
||||
'';
|
||||
|
||||
UPLOAD_FOLDER="./test/";
|
||||
}
|
||||
|
||||
@ -133,20 +133,19 @@ pub fn Upload() -> Element {
|
||||
}
|
||||
} }
|
||||
|
||||
input { id: "file", r#type : "file" ,multiple: true, class : "hidden", oninput: move |e| async move {
|
||||
for file in e.files() {
|
||||
selected.with_mut(|files| {files.push((file.name(), byte_to_human_size(file.size()), None)); } );
|
||||
let idx = selected().len() - 1;
|
||||
input { id: "file", r#type : "file" ,multiple: false, class : "hidden", oninput: move |e| async move {
|
||||
let file = &e.files()[0];
|
||||
selected.with_mut(|files| {files.push((file.name(), byte_to_human_size(file.size()), None)); } );
|
||||
let idx = selected().len() - 1;
|
||||
|
||||
if (file.size() > UPLOAD_SIZE_LIMIT) {
|
||||
//messy but firefox can't handle when server returns early
|
||||
selected.with_mut(|files| { files[idx].2 = Some(HttpError::payload_too_large("This file is too large")) });
|
||||
continue;
|
||||
}
|
||||
|
||||
let res = upload_file(file.clone().into()).await;
|
||||
selected.with_mut(|files| { files[idx].2 = Some(res) });
|
||||
if (file.size() > UPLOAD_SIZE_LIMIT) {
|
||||
//messy but firefox can't handle when server returns early
|
||||
selected.with_mut(|files| { files[idx].2 = Some(HttpError::payload_too_large("This file is too large")) });
|
||||
return ;
|
||||
}
|
||||
|
||||
let res = upload_file(file.clone().into()).await;
|
||||
selected.with_mut(|files| { files[idx].2 = Some(res) });
|
||||
}}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user