mirror of
https://github.com/sigoden/dufs.git
synced 2026-04-09 09:09:03 +03:00
Compare commits
2 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b48a7473fc | ||
|
|
a84c3b353d |
@@ -2,6 +2,12 @@
|
||||
|
||||
All notable changes to this project will be documented in this file.
|
||||
|
||||
## [0.15.1] - 2022-06-11
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
- Cannot upload ([#32](https://github.com/sigoden/duf/issues/32))
|
||||
|
||||
## [0.15.0] - 2022-06-10
|
||||
|
||||
### Bug Fixes
|
||||
|
||||
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -286,7 +286,7 @@ dependencies = [
|
||||
|
||||
[[package]]
|
||||
name = "duf"
|
||||
version = "0.15.0"
|
||||
version = "0.15.1"
|
||||
dependencies = [
|
||||
"async-walkdir",
|
||||
"async_zip",
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
[package]
|
||||
name = "duf"
|
||||
version = "0.15.0"
|
||||
version = "0.15.1"
|
||||
edition = "2021"
|
||||
authors = ["sigoden <sigoden@gmail.com>"]
|
||||
description = "Duf is a simple file server."
|
||||
|
||||
@@ -98,8 +98,8 @@ body {
|
||||
}
|
||||
|
||||
.empty-folder {
|
||||
display: block;
|
||||
padding-top: 1rem;
|
||||
font-style: italic;
|
||||
}
|
||||
|
||||
.uploaders-table th,
|
||||
|
||||
@@ -31,6 +31,7 @@
|
||||
</form>
|
||||
</div>
|
||||
<div class="main">
|
||||
<div class="empty-folder hidden"></div>
|
||||
<table class="uploaders-table hidden">
|
||||
<thead>
|
||||
<tr>
|
||||
|
||||
@@ -17,7 +17,19 @@ const dirEmptyNote = params.q ? 'No results' : DATA.dir_exists ? 'Empty folder'
|
||||
/**
|
||||
* @type Element
|
||||
*/
|
||||
let $pathsTable, $pathsTableBody, $uploadersTable;
|
||||
let $pathsTable;
|
||||
/**
|
||||
* @type Element
|
||||
*/
|
||||
let $pathsTableBody;
|
||||
/**
|
||||
* @type Element
|
||||
*/
|
||||
let $uploadersTable;
|
||||
/**
|
||||
* @type Element
|
||||
*/
|
||||
let $emptyFolder;
|
||||
/**
|
||||
* @type string
|
||||
*/
|
||||
@@ -59,8 +71,8 @@ class Uploader {
|
||||
<td class="cell-status" id="uploadStatus${idx}"></td>
|
||||
</tr>`);
|
||||
$uploadersTable.classList.remove("hidden");
|
||||
$emptyFolder.classList.add("hidden");
|
||||
this.$uploadStatus = document.getElementById(`uploadStatus${idx}`);
|
||||
document.querySelector('.main i.empty-folder').remove();
|
||||
|
||||
const ajax = new XMLHttpRequest();
|
||||
ajax.upload.addEventListener("progress", e => this.progress(e), false);
|
||||
@@ -187,8 +199,8 @@ async function deletePath(index) {
|
||||
DATA.paths[index] = null;
|
||||
if (!DATA.paths.find(v => !!v)) {
|
||||
$pathsTable.classList.add("hidden");
|
||||
document.querySelector('.main').insertAdjacentHTML("afterbegin", '<i class="empty-folder"></i>');
|
||||
document.querySelector('.main .empty-folder').textContent = dirEmptyNote;
|
||||
$emptyFolder.textContent = dirEmptyNote;
|
||||
$emptyFolder.classList.remove("hidden");
|
||||
}
|
||||
} else {
|
||||
throw new Error(await res.text())
|
||||
@@ -283,6 +295,7 @@ function ready() {
|
||||
$pathsTable = document.querySelector(".paths-table")
|
||||
$pathsTableBody = document.querySelector(".paths-table tbody");
|
||||
$uploadersTable = document.querySelector(".uploaders-table");
|
||||
$emptyFolder = document.querySelector(".empty-folder");
|
||||
|
||||
if (params.q) {
|
||||
document.getElementById('search').value = params.q;
|
||||
@@ -298,8 +311,8 @@ function ready() {
|
||||
addPath(DATA.paths[i], i);
|
||||
}
|
||||
if (len == 0) {
|
||||
document.querySelector('.main').insertAdjacentHTML("afterbegin", '<i class="empty-folder"></i>');
|
||||
document.querySelector('.main .empty-folder').textContent = dirEmptyNote;
|
||||
$emptyFolder.textContent = dirEmptyNote;
|
||||
$emptyFolder.classList.remove("hidden");
|
||||
}
|
||||
}
|
||||
if (DATA.allow_upload) {
|
||||
|
||||
Reference in New Issue
Block a user