-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
Copy pathlisting.hbs
130 lines (130 loc) · 8.2 KB
/
listing.hbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
<!DOCTYPE html>
<html lang="en">
<head>
<title>Index of {{path}}</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<!---->
<link rel="icon" href="data:,">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.7.5/semantic.min.css" integrity="sha256-S4n5rcKkPwT9YZGXPue8OorJ7GCPxBA5o/Z0ALWXyHs=" crossorigin="anonymous" />
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/dist/file-icon-square-o.min.css">
<link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Source+Code+Pro">
<link rel="stylesheet" href="{{base}}default.min.css">
<link rel="stylesheet" href="{{base}}style.css">
<script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js" integrity="sha256-CSXorXvZcTkaix6Yvo6HppcZGetbYMGWSFlBw8HfCJo=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/fomantic-ui/2.7.5/semantic.min.js" integrity="sha256-x9fzgXT3ttK2cZF12FIafkDJzEqqLnaWcchT+Y/plJ4=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.1.0/tablesort.min.js" integrity="sha256-p3wukcf2d2jxbVnlqPDO9t4AAjnl42D2aIzrK4S0X6w=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.1.0/sorts/tablesort.number.min.js" integrity="sha256-ra1pWQ7MfuVIolZ/phcEXegs9m1ehXaCNI8cmc3gJEs=" crossorigin="anonymous"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/tablesort/5.1.0/sorts/tablesort.filesize.min.js" integrity="sha256-qNYlSpvv2lsmkcarYkQBkUzVcHKaml/BHcGxcSNsyrU=" crossorigin="anonymous"></script>
<!---->
<script>
(function() {
$(document).ready(function() {
$("table th").click(function(e) {
localStorage.setItem("table_sort", Array.from(e.target.parentElement.children).indexOf(e.target).toString());
});
const ts = localStorage.getItem("table_sort");
if (ts !== null && ts.length > 0) {
document.querySelectorAll("table th")[parseInt(ts)].setAttribute("data-sort-default", "");
}
new Tablesort(document.querySelector("table"), {
descending: false,
});
const mel = document.querySelector(".modal .content").children;
$("table tr td i.info.icon").click(function(e) {
const f = e.target.parentElement.parentElement.children[3].firstElementChild.pathname;
const url = "{{base}}api/search?q="+f;
fetch(url).then(x => x.json()).then(x => {
if (x.count === 0) {
return
}
mel[0].parentElement.parentElement.children[1].textContent = x.results[0].path;
mel[0].children[0].children[1].value = x.results[0].hash_md5;
mel[1].children[0].children[1].value = x.results[0].hash_sha1;
mel[2].children[0].children[1].value = x.results[0].hash_sha256;
mel[3].children[0].children[1].value = x.results[0].hash_sha512;
mel[4].children[0].children[1].value = x.results[0].hash_sha3;
mel[5].children[0].children[1].value = x.results[0].hash_blake2b;
$(".ui.basic.modal").modal("show");
})
});
})
})();
</script>
</head>
<body class="page-listing">
<div class="ui main menu">
<div class="header item">Welcome, {{user.Name}}@{{user.Provider}}</div>
<div class="item"><a href="{{base}}">Home</a></div>
{{#if can_search}}
<div class="item"><a href="{{base}}{{root}}/search"><i class="search icon"></i> Search</a></div>
{{/if}}
{{#if admin}}
<div class="item"><a href="{{base}}admin">Admin Panel</a></div>
{{/if}}
{{#if user.PassKey}}
<div class="item"><a href="{{base}}logout">Logout</a></div>
{{/if}}
<div class="right item">Powered by <a href="https://github.com/nektro/andesite" target="_blank">Andesite</a> <code>{{version}}</code></div>
</div>
<div>
<h1 class="ui header">Index of {{path}}</h1>
<div class="ui divider"></div>
{{#if can_search}}
<div class="ui icon message">
<i class="folder open icon"></i>
<div class="content">
<div class="header">Directory size:</div>
<p>{{dir_size}}</p>
<div class="header">File count (including subdirectories):</div>
<p>{{file_total}}</p>
</div>
</div>
{{/if}}
<div class="ui icon message">
<i class="folder icon"></i>
<div class="content">
<div class="header">File count:</div>
<p>{{file_count}}</p>
</div>
</div>
<table class="ui sortable compact table">
<thead>
<th class="collapsing" data-sort-method="number"></th>
{{#if can_search}}
<th class="collapsing" data-sort-method="none"></th>
{{/if}}
<th class="collapsing"></th>
<th class="collapsing">Name</th>
<th class="collapsing" data-sort-method="number">Last Modified</th>
<th class="collapsing" data-sort-method="filesize">Size</th>
<th data-sort-method="none"></th>
</thead>
<tbody>
<tr data-sort-method="none">{{#if can_search}}<td></td>{{/if}}<td></td><td></td><td><a href="../">Parent Directory</a></td><td></td><td></td><td></td></tr>
{{#each files}}
<tr><td>{{add_i @index 1}}</td>{{#if can_search}}<td>{{#if is_file}}<i class="info circle icon"></i>{{/if}}</td>{{/if}}<td data-sort="{{is_file}}_{{name}}"><span class="fiv-sqo fiv-icon-{{ext}}"></span></td><td><a href="{{url_name name}}">{{name}}</a></td><td data-sort="{{mod_raw}}">{{mod}}</td><td>{{size}}</td><td></td></tr>
{{/each}}
</tbody>
</table>
</div>
<div id="dlbox">
{{#if user.PassKey}}<p>Download the contents of the entire folder using your passkey: <code>{{user.PassKey}}</code> (<a href="{{base}}regen_passkey">Regenerate Key</a>)</p>{{/if}}
<p><code>wget -m -np -c -R "index.html*"{{#if user.PassKey}} --header="x-passkey:{{user.PassKey}}"{{/if}} "{{dl_url host base path}}"</code></p>
<p><code>rclone copy --http-url="{{grab_url host base path user.PassKey}}" :http: ./ -P</code></p>
</div>
<div class="ui basic modal">
<div class="ui icon header"><i class="hashtag icon"></i> File Details</div>
<h4></h4>
<div class="content">
<div><div class="ui fluid labeled input"><div class="ui label">MD5</div><input type="text" readonly=""></div></div>
<div><div class="ui fluid labeled input"><div class="ui label">SHA1</div><input type="text" readonly=""></div></div>
<div><div class="ui fluid labeled input"><div class="ui label">SHA256</div><input type="text" readonly=""></div></div>
<div><div class="ui fluid labeled input"><div class="ui label">SHA512</div><input type="text" readonly=""></div></div>
<div><div class="ui fluid labeled input"><div class="ui label">SHA3_512</div><input type="text" readonly=""></div></div>
<div><div class="ui fluid labeled input"><div class="ui label">Blake2b_512</div><input type="text" readonly=""></div></div>
</div>
</div>
</body>
</html>