3 Commits

Author SHA1 Message Date
96fd850b91 gfg 2025-08-11 12:03:01 +00:00
35353d63c8 cool patch with 5 lines of code 2025-08-11 11:55:14 +00:00
1d0ef1535f cool patch with 5 lines of code 2025-08-11 13:58:54 +03:00
3 changed files with 7 additions and 3 deletions

View File

@@ -63,7 +63,7 @@ pip install aiofiles
## preset.html ## preset.html
обычный html документ, являющийся шаблоном для листинга каталога обычный html документ, являющийся шаблоном для листинга каталога. если в директории будет находиться preset.html, сервер будет использовать именно его. в противном случае - тот, который указан в конфиге.
### теги пресета ### теги пресета

View File

@@ -1,4 +1,4 @@
name="debweb 1.2.0" name="debweb 1.2.1"
proxied=False proxied=False
addr="localhost" addr="localhost"

View File

@@ -108,7 +108,11 @@ class WebServer:
elif os.path.isdir(file_path): elif os.path.isdir(file_path):
resp = "" resp = ""
async with aiofiles.open(config.preset_file, "r", encoding="utf-8") as f: if os.path.isfile(os.path.join(file_path, "preset.html")):
preset_file = os.path.join(file_path, "preset.html")
else:
preset_file = config.preset_file
async with aiofiles.open(preset_file, "r", encoding="utf-8") as f:
resp = await f.read() resp = await f.read()
files = "" files = ""