-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
admin.hbs
140 lines (140 loc) · 8.11 KB
/
admin.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
131
132
133
134
135
136
137
138
139
140
<!DOCTYPE html>
<html lang="en">
<head>
<title>Admin Panel</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="default.min.css">
<link rel="stylesheet" href="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>
<!---->
</head>
<body class="page-admin">
<div class="ui main menu">
<div class="header item">Welcome, {{user.Name}}@{{user.Provider}}</div>
<div class="item"><a href="./files/">Back to Files</a></div>
<div class="right item">Powered by <a href="https://github.com/nektro/andesite" target="_blank">Andesite</a> <code>{{version}}</code></div>
</div>
<div class="ui main menu">
<div class="item"><a href="./admin">Access</a></div>
<div class="item"><a href="./admin/users">Users</a></div>
<div class="item"><a href="./admin/roots">Roots</a></div>
</div>
<div>
<h1 class="ui header">Andesite Admin Panel</h1>
<details open id="tab_users">
<summary>User Access</summary>
<table class="ui compact table">
<thead>
<th class="collapsing">User</th>
<th class="collapsing">Name</th>
<th>Path</th>
<th class="collapsing"></th>
<th class="collapsing"></th>
</thead>
<tbody>
{{#each accesses as |ac|}}
<tr>
<form method="POST">
<input type="hidden" name="id" value="{{ac.ID}}">
<td><select name="user">{{#each users as |us|}}<option value="{{ID}}"{{#equal us.ID ac.User}} selected{{/equal}}>{{user_name us.ID}}</option>{{/each}}</select></td>
<td><input type="text" name="name" class="name" placeholder="{User Name}" value="{{user_name ac.User}}" readonly></td>
<td><input type="text" name="path" placeholder="Path" value="{{ac.Path}}"></td>
<td><button class="ui button" formaction="./api/access/update">Update</button></td>
<td><button class="ui button" formaction="./api/access/delete">Delete</button></td>
</form>
</tr>
{{/each}}
<tr>
<form method="POST">
<td><select name="user">{{#each users}}<option value="{{ID}}">{{user_name ID}}</option>{{/each}}</select></td>
<td colspan="2"><input type="text" name="path" placeholder="Path"></td>
<td colspan="2"><button class="ui button" formaction="./api/access/create">Add Access</button></td>
</form>
</tr>
</tbody>
</table>
</details>
<details open id="tab_shares">
<summary>Share Links</summary>
<table class="ui compact table">
<thead>
<th class="collapsing">Hash</th>
<th>Path</th>
<th class="collapsing"></th>
<th class="collapsing"></th>
<th class="collapsing"></th>
</thead>
<tbody>
{{#each shares}}
<tr>
<form method="POST">
<input type="hidden" name="id" value="{{ID}}">
<td><input type="text" name="hash" class="hash" value="{{Hash}}" readonly></td>
<td><input type="text" name="path" placeholder="Path" value="{{Path}}"></td>
<td><button class="ui button" formaction="./api/share/update">Update</button></td>
<td><button class="ui button" formaction="./api/share/delete">Delete</button></td>
<td><a href="./open/{{hash}}/">Open</a></td>
</form>
</tr>
{{/each}}
<tr>
<form method="POST">
<td colspan="2"><input type="text" name="path" placeholder="Path"></td>
<td colspan="2"><button class="ui button" formaction="./api/share/create">Create Link</button></td>
</form>
</tr>
</tbody>
</table>
</details>
{{#equal auth "discord"}}
{{#if discord_role_share_on}}
<details open id="tab_discord_access">
<summary>Discord Guild Role Access</summary>
<table class="ui compact table">
<thead>
{{!-- <th class="collapsing">Guild ID</th> --}}
{{!-- <th class="collapsing">Guild Name</th> --}}
<th class="collapsing">Role ID</th>
<th class="collapsing">Role Name</th>
<th>Path</th>
<th class="collapsing"></th>
</thead>
<tbody>
{{#each discord_shares}}
<tr>
<form method="POST">
<input type="hidden" name="id" value="{{ID}}">
{{!-- <td><input type="text" name="GuildID" class="snowflake" value="{{GuildID}}"></td> --}}
{{!-- <td><input type="text" name="GuildName" class="name" value="{{GuildName}}" readonly></td> --}}
<td><input type="text" name="RoleID" class="snowflake" value="{{RoleID}}"></td>
<td><input type="text" name="RoleName" class="name" value="{{RoleName}}" readonly></td>
<td><input type="text" name="Path" placeholder="Path" value="{{Path}}"></td>
<td><button class="ui button" formaction="./api/access_discord_role/update">Update</button></td>
<td><button class="ui button" formaction="./api/access_discord_role/delete">Delete</button></td>
</form>
</tr>
{{/each}}
<tr>
<form method="POST">
{{!-- <td><input type="text" name="GuildID" class="snowflake" placeholder="Guild ID"></td> --}}
{{!-- <td></td> --}}
<td><input type="text" name="RoleID" class="snowflake" placeholder="Role ID"></td>
<td></td>
<td><input type="text" name="Path" placeholder="Path"></td >
<td><button class="ui button" formaction="./api/access_discord_role/create">Add Access</button></td>
</form>
</tr>
</tbody>
</table>
</details>
{{/if}}
{{/equal}}
</div>
</body>
</html>