mirror of
https://github.com/sigoden/dufs.git
synced 2026-06-07 23:16:54 +03:00
Compare commits
4 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 30587cedfa | |||
| 5df9265de0 | |||
| 3ac409ca58 | |||
| f97a47f625 |
Generated
+1
@@ -654,6 +654,7 @@ dependencies = [
|
||||
"if-addrs",
|
||||
"indexmap",
|
||||
"lazy_static",
|
||||
"liblzma",
|
||||
"log",
|
||||
"md5",
|
||||
"mime_guess",
|
||||
|
||||
@@ -22,6 +22,7 @@ serde = { version = "1", features = ["derive"] }
|
||||
serde_json = "1"
|
||||
futures-util = { version = "0.3", default-features = false, features = ["alloc"] }
|
||||
async_zip = { version = "0.0.18", default-features = false, features = ["deflate", "bzip2", "xz", "chrono", "tokio"] }
|
||||
liblzma = { version = "0.4", features = ["static"] } # avoid dynamic linking issues on MacOS
|
||||
headers = "0.4"
|
||||
mime_guess = "2.0"
|
||||
if-addrs = "0.15"
|
||||
|
||||
+1
-1
@@ -186,7 +186,7 @@
|
||||
same "printed page" as the copyright notice for easier
|
||||
identification within third-party archives.
|
||||
|
||||
Copyright [yyyy] [name of copyright owner]
|
||||
Copyright 2026 sigoden
|
||||
|
||||
Licensed under the Apache License, Version 2.0 (the "License");
|
||||
you may not use this file except in compliance with the License.
|
||||
|
||||
+58
-59
@@ -1,13 +1,35 @@
|
||||
:root {
|
||||
color-scheme: light;
|
||||
--bg-primary: #fff;
|
||||
--bg-secondary: #fafafa;
|
||||
--bg-tertiary: #fff;
|
||||
--bg-hover: #fafafa;
|
||||
--text-primary: #24292e;
|
||||
--text-secondary: #5c5c5c;
|
||||
--text-tertiary: #586069;
|
||||
--text-accent: #0366d6;
|
||||
--svg-primary: #24292e;
|
||||
--svg-secondary: rgba(3, 47, 98, 0.5);
|
||||
--svg-tertiary: #24292e;
|
||||
--border-primary: #ddd;
|
||||
--border-secondary: #ced4da;
|
||||
}
|
||||
|
||||
html {
|
||||
font-family: -apple-system, BlinkMacSystemFont, Roboto, Helvetica, Arial, sans-serif;
|
||||
line-height: 1.5;
|
||||
color: #24292e;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
body {
|
||||
/* prevent premature breadcrumb wrapping on mobile */
|
||||
min-width: 538px;
|
||||
margin: 0;
|
||||
background-color: var(--bg-primary);
|
||||
}
|
||||
|
||||
svg {
|
||||
fill: var(--svg-primary);
|
||||
}
|
||||
|
||||
.hidden {
|
||||
@@ -21,7 +43,7 @@ body {
|
||||
padding: 0.6em 1em;
|
||||
position: sticky;
|
||||
top: 0;
|
||||
background-color: white;
|
||||
background-color: var(--bg-tertiary);
|
||||
}
|
||||
|
||||
.breadcrumb {
|
||||
@@ -31,7 +53,7 @@ body {
|
||||
}
|
||||
|
||||
.breadcrumb>a {
|
||||
color: #0366d6;
|
||||
color: var(--text-accent);
|
||||
text-decoration: none;
|
||||
}
|
||||
|
||||
@@ -41,17 +63,17 @@ body {
|
||||
|
||||
/* final breadcrumb */
|
||||
.breadcrumb>b {
|
||||
color: #24292e;
|
||||
color: var(--text-primary);
|
||||
}
|
||||
|
||||
.breadcrumb>.separator {
|
||||
color: #586069;
|
||||
color: var(--text-tertiary);
|
||||
padding: 0 0.25em;
|
||||
}
|
||||
|
||||
.breadcrumb svg {
|
||||
height: 100%;
|
||||
fill: rgba(3, 47, 98, 0.5);
|
||||
fill: var(--svg-secondary);
|
||||
}
|
||||
|
||||
.toolbox {
|
||||
@@ -83,9 +105,9 @@ body {
|
||||
flex-wrap: nowrap;
|
||||
width: 246px;
|
||||
height: 22px;
|
||||
background-color: #fafafa;
|
||||
background-color: var(--bg-secondary);
|
||||
transition: all .15s;
|
||||
border: 1px #ddd solid;
|
||||
border: 1px var(--border-primary) solid;
|
||||
border-radius: 15px;
|
||||
margin-bottom: 2px;
|
||||
}
|
||||
@@ -97,17 +119,22 @@ body {
|
||||
font-size: 16px;
|
||||
line-height: 16px;
|
||||
padding: 1px;
|
||||
color: var(--text-primary);
|
||||
background-color: transparent;
|
||||
border: none;
|
||||
outline: none;
|
||||
}
|
||||
|
||||
.searchbar .icon {
|
||||
color: #9a9a9a;
|
||||
color: var(--svg-tertiary);
|
||||
padding: 3px 3px;
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.searchbar svg {
|
||||
fill: var(--svg-tertiary);
|
||||
}
|
||||
|
||||
.main {
|
||||
padding: 0 1em;
|
||||
}
|
||||
@@ -120,7 +147,7 @@ body {
|
||||
.paths-table th {
|
||||
text-align: left;
|
||||
font-weight: unset;
|
||||
color: #5c5c5c;
|
||||
color: var(--text-secondary);
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
||||
@@ -148,7 +175,7 @@ body {
|
||||
}
|
||||
|
||||
.paths-table tbody tr:hover {
|
||||
background-color: #fafafa;
|
||||
background-color: var(--bg-hover);
|
||||
}
|
||||
|
||||
.paths-table .cell-actions {
|
||||
@@ -172,7 +199,7 @@ body {
|
||||
|
||||
.path svg {
|
||||
height: 16px;
|
||||
fill: rgba(3, 47, 98, 0.5);
|
||||
fill: var(--svg-secondary);
|
||||
padding-right: 0.5em;
|
||||
vertical-align: text-top;
|
||||
}
|
||||
@@ -182,7 +209,7 @@ body {
|
||||
}
|
||||
|
||||
.path a {
|
||||
color: #0366d6;
|
||||
color: var(--text-accent);
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
@@ -212,7 +239,9 @@ body {
|
||||
.editor {
|
||||
width: 100%;
|
||||
height: calc(100vh - 5rem);
|
||||
border: 1px solid #ced4da;
|
||||
border: 1px solid var(--border-secondary);
|
||||
background: var(--bg-primary);
|
||||
color: var(--text-primary);
|
||||
outline: none;
|
||||
padding: 5px;
|
||||
}
|
||||
@@ -258,50 +287,20 @@ body {
|
||||
|
||||
/* dark theme */
|
||||
@media (prefers-color-scheme: dark) {
|
||||
body {
|
||||
background-color: #000;
|
||||
}
|
||||
|
||||
html,
|
||||
.breadcrumb>b,
|
||||
.searchbar #search {
|
||||
color: #fff;
|
||||
}
|
||||
|
||||
.uploaders-table th,
|
||||
.paths-table th {
|
||||
color: #ddd;
|
||||
}
|
||||
|
||||
svg,
|
||||
.path svg,
|
||||
.breadcrumb svg {
|
||||
fill: #fff;
|
||||
}
|
||||
|
||||
.head {
|
||||
background-color: #111;
|
||||
}
|
||||
|
||||
.searchbar {
|
||||
background-color: #111;
|
||||
border-color: #fff6;
|
||||
}
|
||||
|
||||
.searchbar svg {
|
||||
fill: #fff6;
|
||||
}
|
||||
|
||||
.path a {
|
||||
color: #3191ff;
|
||||
}
|
||||
|
||||
.paths-table tbody tr:hover {
|
||||
background-color: #1a1a1a;
|
||||
}
|
||||
|
||||
.editor {
|
||||
background: black;
|
||||
color: white;
|
||||
:root {
|
||||
color-scheme: dark;
|
||||
--bg-primary: #000;
|
||||
--bg-secondary: #111;
|
||||
--bg-tertiary: #111;
|
||||
--bg-hover: #1a1a1a;
|
||||
--text-primary: #fff;
|
||||
--text-secondary: #ddd;
|
||||
--text-tertiary: #586069; /*Unchanged in both color schemes*/
|
||||
--text-accent: #3191ff;
|
||||
--svg-primary: #fff;
|
||||
--svg-secondary: #fff;
|
||||
--svg-tertiary: #fff6;
|
||||
--border-primary: #fff6;
|
||||
--border-secondary: #ced4da; /*Unchanged in both color schemes*/
|
||||
}
|
||||
}
|
||||
+1
-1
@@ -97,7 +97,7 @@
|
||||
<svg viewBox="0 0 1024 1024" width="24" height="24">
|
||||
<path
|
||||
d="M426.666667 682.666667v42.666666h170.666666v-42.666666h-170.666666z m-42.666667-85.333334h298.666667v128h42.666666V418.133333L605.866667 298.666667H298.666667v426.666666h42.666666v-128h42.666667z m260.266667-384L810.666667 379.733333V810.666667H213.333333V213.333333h430.933334zM341.333333 341.333333h85.333334v170.666667H341.333333V341.333333z"
|
||||
fill="#444444" p-id="8311"></path>
|
||||
p-id="8311"></path>
|
||||
</svg>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+11
-8
@@ -211,28 +211,31 @@ fn create_listener(addr: SocketAddr) -> Result<TcpListener> {
|
||||
fn check_addrs(args: &Args) -> Result<(Vec<BindAddr>, Vec<BindAddr>)> {
|
||||
let mut new_addrs = vec![];
|
||||
let mut print_addrs = vec![];
|
||||
let (ipv4_addrs, ipv6_addrs) = interface_addrs()?;
|
||||
let has_unspecified = args
|
||||
.addrs
|
||||
.iter()
|
||||
.any(|a| matches!(a, BindAddr::IpAddr(ip) if ip.is_unspecified()));
|
||||
let (ipv4_addrs, ipv6_addrs) = if has_unspecified {
|
||||
interface_addrs()?
|
||||
} else {
|
||||
(vec![], vec![])
|
||||
};
|
||||
for bind_addr in args.addrs.iter() {
|
||||
new_addrs.push(bind_addr.clone());
|
||||
match bind_addr {
|
||||
BindAddr::IpAddr(ip) => match &ip {
|
||||
IpAddr::V4(_) => {
|
||||
if !ipv4_addrs.is_empty() {
|
||||
new_addrs.push(bind_addr.clone());
|
||||
if ip.is_unspecified() {
|
||||
print_addrs.extend(ipv4_addrs.clone());
|
||||
} else {
|
||||
print_addrs.push(bind_addr.clone());
|
||||
}
|
||||
}
|
||||
}
|
||||
IpAddr::V6(_) => {
|
||||
if !ipv6_addrs.is_empty() {
|
||||
new_addrs.push(bind_addr.clone());
|
||||
if ip.is_unspecified() {
|
||||
print_addrs.extend(ipv6_addrs.clone());
|
||||
} else {
|
||||
print_addrs.push(bind_addr.clone())
|
||||
}
|
||||
print_addrs.push(bind_addr.clone());
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user