cdnV2

git clone https://github.com/notamitgamer/cdnV2.git
· rebuilt hourlyOpen on GitHub
root / app / templates / index.html

index.html (2153B)


      1 {% extends "base.html" %}
      2 {#- Folder listings, file pages, batches, uploads, history, search and the 404 page. Each lives in its own
      3     _page_*.html partial; this file only picks one. /api/shell renders it with skeleton=True. -#}
      4 {% from "_listing.html" import visit_script %}
      5 
      6 {% if page == 'file' %}{% set page_title = filename %}
      7 {% elif page == 'upload' %}{% set page_title = 'New' %}
      8 {% elif page == 'search' %}{% set page_title = 'Find' %}
      9 {% elif page == 'history' %}{% set page_title = 'History' %}
     10 {% elif page == 'batch' %}{% set page_title = 'Batch' %}
     11 {% elif page == '404' %}{% set page_title = 'Not found' %}
     12 {% else %}{% set page_title = 'Listing' %}
     13 {% endif %}
     14 
     15 {% block content %}
     16 {% if page == 'listing' %}{% include "_page_listing.html" %}
     17 {% elif page == 'file' %}{% include "_page_file.html" %}
     18 {% elif page == 'batch' %}{% include "_page_batch.html" %}
     19 {% elif page == '404' %}{% include "_page_404.html" %}
     20 {% elif page == 'upload' %}{% include "_page_upload.html" %}
     21 {% elif page == 'history' %}{% include "_page_history.html" %}
     22 {% elif page == 'search' %}{% include "_page_search.html" %}
     23 {% endif %}
     24 {% endblock %}
     25 
     26 {% block scripts %}
     27     <script>
     28         // --- Visited history: silently logs file/folder pages viewed on this browser,
     29         // shown on /history. localStorage only - there's no account system, so this is
     30         // per-browser, same limitation as ordinary browser history.
     31         {% if skeleton %}/*@visit*/{% elif page in ('file', 'listing') and path %}
     32         {% set visit_fields %}
     33                     type: {{ ('file' if page == 'file' else 'folder')|tojson }},
     34                     path: {{ path|tojson }},
     35                     {% if page == 'file' %}
     36                     filename: {{ filename|tojson }},
     37                     cdn_url: {{ (cdn_base_url ~ '/' ~ path)|tojson }},
     38                     raw_url: {{ (raw_base_url ~ '/' ~ path)|tojson }},
     39                     {% else %}
     40                     cdn_url: {{ (cdn_base_url ~ '/' ~ path ~ '/')|tojson }},
     41                     {% endif %}
     42         {% endset %}
     43         {{ visit_script(visit_fields) }}
     44         {% endif %}
     45     </script>
     46 {% endblock %}