dirview/templates/page.html

65 lines
2.5 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="header">
<div id="key">
<h1>{{ root.path|pathjoin }}</h1>
{% macro tree(parts) %}{% if parts|len > 0 %}
<ul class="tree">
<li>
<div>
<span>{{ parts[0] }}</span>
{{ tree(parts[1:]) }}
</div>
</li>
</ul>
{% endif %}{% endmacro %}
{{ tree(node.path[1:]) }}
<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>
</div>
<div id="svg-container">
<svg width="0" height="0"><g class="chart"></g></svg>
</div>
</div>
{% if node.typ in (NodeType.ROOT, NodeType.DIR) %}
<div id="index">
<div id="dirs">
<h2>Subdirs:</h2>
{% for child in node.children|sort(attribute='total_children', reverse=True) %}{% if child.typ in NodeGroup.DIRLIKE %}
<hr />
<a href="/{{ child.path[1:]|pathjoin }}">{{ child.name }}</a>: {{ child.total_size|data }} - {{ child.total_children|commafy }} children
{% endif %}{% endfor %}
</div>
<div id="files">
<h2>Files:</h2>
{% for child in node.children|sort(attribute='name') %}{% if child.typ in NodeGroup.FILELIKE %}
<hr />
<a href="/{{ child.path[1:]|pathjoin }}">{{ child.name }}</a>: {{ child.total_size|data }}
{% endif %}{% endfor %}
</div>
</div>
{% endif %}
</body>
</html>