Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Show all file content in iframes #172

Merged
merged 5 commits into from
Mar 18, 2024
Merged

Commits on Mar 15, 2024

  1. Use iframe to display all file contents.

    This means changing the contents url for files to render csv/txt files
    as html, and just serve up other files.
    
    Also, I split the download parts of serve_file into its own function, as
    serve_file is more complex, and the caching logic doesn't apply to
    downloads.
    
    Changed some test assertions to assert that the url to the content is
    present, rather than the content itself.
    bloodearnest committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    b6a9768 View commit details
    Browse the repository at this point in the history
  2. Implement conditional GETs for file contents

    This means we will return 304s if the file contents have not changed,
    which means the browser cache will be used, and we don't need to render
    the content. For larger files, especially csv or text, this avoids a lot
    of work.
    
    For content that we render (text and csv atm), the etag is a bit more
    involved. We want the etag value to capture both the original file and
    the template file that was used. This is so that if either changes, the
    cache is invalid and the new content is served.
    
    To do this, I added a micro rendering framework that ties the templating
    together with the rendering, so that we can inspect the template and
    check *before* doing the potentially expensive rendering.
    bloodearnest committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    a01c60d View commit details
    Browse the repository at this point in the history
  3. Configuration menu
    Copy the full SHA
    e4bbf4d View commit details
    Browse the repository at this point in the history
  4. Add a View link, that will open just the file in a new tab

    This helps view larger files in detail
    bloodearnest committed Mar 15, 2024
    Configuration menu
    Copy the full SHA
    688e9e7 View commit details
    Browse the repository at this point in the history

Commits on Mar 18, 2024

  1. Configuration menu
    Copy the full SHA
    59bc383 View commit details
    Browse the repository at this point in the history