dirview/templates/page.html

54 lines
2.0 KiB
HTML
Raw Normal View History

2019-05-24 19:41:45 -07:00
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NAS Viewer</title>
2019-06-01 18:45:52 -07:00
<script type="text/javascript">
var _node = {{ node|id }};
var _graph_depth = 2;
</script>
2019-05-27 16:22:23 -07:00
<script src="/static/scripts.js" type="text/javascript"></script>
2019-06-01 22:19:47 -07:00
<link rel="stylesheet" href="/static/style.css" />
2019-05-24 19:41:45 -07:00
</head>
2019-05-27 17:35:14 -07:00
<body onload="Application.boot();">
2019-06-01 22:19:47 -07:00
<div id="svg-container">
<svg><g class="chart"></g></svg>
</div>
2019-05-24 19:41:45 -07:00
<div class="viewer">
<h1>{{ node.path|pathjoin }}</h1>
<div>
<ul>
<li><strong>Controls:</strong> {% if node.parent %}<a href="/?n={{ node.parent|id }}">up</a>{% else %}up{% endif %}</li>
<li><strong>Sort by:</strong> name children size up down
</ul>
<ul>
<li>Type: {{ node.typ }}</li>
<li>Size: {{ node.size|commafy }} B</li>
2019-05-27 16:22:23 -07:00
<li>Total Size: {{ node.total_size|data }}</li>
2019-05-24 19:41:45 -07:00
<li>Recursive Children: {{ node.total_children|commafy }}</li>
<li>Children: {{ node.children|len }}</li>
</ul>
</div>
{% if node.typ in (NodeType.ROOT, NodeType.DIR) %}
<div class="children">
<div class="dirs">
<h2>Subdirs:</h2>
{% for child in node.children|sort(attribute='total_children', reverse=True) %}{% if child.typ in NodeGroup.DIRLIKE %}
<hr />
2019-05-27 16:22:23 -07:00
<a href="/?n={{ child|id }}">{{ child.name }}</a>: {{ child.total_size|data }} - {{ child.total_children|commafy }} children
2019-05-24 19:41:45 -07:00
{% endif %}{% endfor %}
</div>
<div class="files">
<h2>Files:</h2>
{% for child in node.children|sort(attribute='name') %}{% if child.typ in NodeGroup.FILELIKE %}
<hr />
2019-05-27 16:22:23 -07:00
<a href="/?n={{ child|id }}">{{ child.name }}</a>: {{ child.total_size|data }}
2019-05-24 19:41:45 -07:00
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
</div>
</body>
</html>