dirview/templates/page.html

54 lines
2.0 KiB
HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>NAS Viewer</title>
<script type="text/javascript">
var _node = {{ node|id }};
var _graph_depth = 2;
</script>
<script src="/static/scripts.js" type="text/javascript"></script>
<link rel="stylesheet" href="/static/style.css" />
</head>
<body onload="Application.boot();">
<div id="svg-container">
<svg><g class="chart"></g></svg>
</div>
<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>
<li>Total Size: {{ node.total_size|data }}</li>
<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 />
<a href="/?n={{ child|id }}">{{ child.name }}</a>: {{ child.total_size|data }} - {{ child.total_children|commafy }} children
{% endif %}{% endfor %}
</div>
<div class="files">
<h2>Files:</h2>
{% for child in node.children|sort(attribute='name') %}{% if child.typ in NodeGroup.FILELIKE %}
<hr />
<a href="/?n={{ child|id }}">{{ child.name }}</a>: {{ child.total_size|data }}
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
</div>
</body>
</html>