Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #93 +/- ##
==========================================
+ Coverage 76.00% 77.39% +1.39%
==========================================
Files 26 27 +1
Lines 3776 3849 +73
==========================================
+ Hits 2870 2979 +109
+ Misses 906 870 -36 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
|
This contribution has received funding from the Spanish government (grant EQC2021-007479-P, funded by MCIN/AEI/10.13039/501100011033), the EU NextGeneration/PRTR (PRTR-C17.I1), and the Generalitat de Catalunya. |
0b8e9b0 to
e6ee57a
Compare
|
@rexzhang just following up on this PR. Whenever you have time, I’d appreciate a review or any feedback. |
|
I'm very sorry, I've been very busy lately...
|
39da949 to
04b1ef5
Compare
|
|
6168e25 to
afb5763
Compare
|
Regarding the design part; it is recommended to discuss it thoroughly before starting to write code. BTW: in AI era, talk in the mother tongue is also welcome |
|
I agree! Let's discuss the design first. I have simplified the code for now to open the discussion at this early stage before things get too complex. For the structure, I completely agree with putting the templates under Since this feature moves the HTML outside of the Python code, I would like to move all of it out. We have two options for how to structure the files inside
I am fine with either approach. In my last two commits, I tried the second approach to explore how it would look in practice. I also tested it on our server with an additional acknowledgment for our institution, and it works as expected. What is your view on this? I would prefer to agree on the overall structure first, and then continue with the implementation :) |
BTW: during Draft stage, no test coverage is required. |
f8a8c2e to
20c1bd8
Compare
|
Thank you for the thorough design feedback! Here's how each point was addressed:
Done.
Done.
Done. Each file is resolved independently. You can override just
Done.
Done. Directory browser uses:
Done. Layout: Users provide the same structure under their template_dir. |
|
thank for you do this! The btw: I'll be 2-4 weeks before I have time to do a full review. |
|
Agreed, |
|
For independent fixes, please create a separate pull request. The simpler the PR, the less review time is needed. |
f21b831 to
68e7adc
Compare
- Remove jinja2 dependency; use string.Template, html.escape, urllib.parse.quote - Load template once at init instead of every request - Inline CSS into template, remove external stylesheet link - Add dir_browser_template to Config, EnvConfig, and AppEntryParameters - Add --dir-browser-template CLI argument - Rewrite tests to use real DAVProperty/DAVPropertyBasicData and real template rendering (100% coverage of new code)
- Allow --dir-browser-template to point to a directory instead of a file - Fall back to built-in index.html when custom directory lacks one - Prepend custom directory to static_root_paths so CSS overrides work - Update CLI help text and log messages to reflect directory semantics
- Change href from relative to absolute - Applied to bundled template and acknowledgment template - Set in webdav.json to use acknowledgment template
…plates() - Remove asgi_webdav/template_loader.py (51-line class with properties and dead get_static_root_paths method) - Move load_templates() into web_dav.py as a 17-line module-level function - Use _TEMPLATES dict as single source of truth for template filenames - Update tests for new function-based API, remove dead-code tests
Replace the dir_browser-only template loading with a general-purpose TemplateLoader class that supports any page. - Add asgi_webdav/template.py with TemplateLoader (per-file fallback, in-memory caching) - Add bundled templates: admin/index.html, admin/logging.html, error/401.html - Rename config dir_browser_dir → template_dir (breaking) - Refactor auth.py 401 page and web_page.py admin pages to use templates instead of hardcoded HTML - Refactor web_dav.py: remove load_templates(), _TEMPLATES dict, and _BUNDLED_DIR; use TemplateLoader.get_template(page, name) - Create shared TemplateLoader in server.py, pass to all consumers - Remove stale asgi_webdav/static/ packaging references - Update tests, add TemplateLoader unit tests, remove redundant @pytest.mark.asyncio decorators - Add howto-customise-html-templates.en.md - Update changelog, CLI docs, env var docs, config reference contributed by PIC
All except blocks in webhdfs.py only caught httpx.HTTPStatusError, which does not cover transport-level exceptions like PoolTimeout, ConnectError, etc. This caused unhandled exceptions to propagate as generic 500 errors when the HDFS backend was slow or unreachable.
d47fbeb to
02932cb
Compare
|
I've just updated the branch with the changes from |
|
Hi @rexzhang, have you had a chance to review this PR? Just wanted to check in and get up to date on its status. Thanks! |
Checklist
changelog.en.mdif necessaryDescription
This PR introduces support for configurable HTML templates for the directory browser page, replacing the previous hardcoded HTML generation.
The goal is to decouple presentation from backend logic and allow full UI customization without modifying core server code.
Changes
pathparentitemsversioncurrent_timeFeatures enabled
This change allows deployments to fully customize the directory browser UI, including:
fixes #91