wabbajack/Wabbajack.Server/Controllers/Templates/AuthorControls.html

73 lines
1.7 KiB
HTML
Raw Normal View History

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
2021-04-13 04:54:33 +00:00
<title>Author Controls - {{$.User}} - {{$.TotalUsage}}</title>
</head>
<body>
2021-04-13 04:54:33 +00:00
<h2>Author Controls - {{$.User}} - {{$.TotalUsage}}</h2>
<br/>
2021-04-13 04:54:33 +00:00
<h3>Wabbajack Files</h3>
<table>
<tr>
2021-04-13 01:17:03 +00:00
<td><b>Commands</b></td>
<td><b>Name</b></td>
<td><b>Size</b></td>
<td><b>Finished Uploading</b></td>
<td><b>Unique Name</b></td>
</tr>
{{each $.WabbajackFiles }}
<tr>
2021-10-23 16:51:17 +00:00
<td>
2021-12-20 16:22:40 +00:00
<button onclick="deleteFile('{{@Escape($.MangledName)}}');">Delete</button>
2021-10-23 16:51:17 +00:00
</td>
<td>{{$.Name}}</td>
<td>{{$.Size}}</td>
<td>{{$.UploadedDate}}</td>
<td>{{$.MangledName}}</td>
2021-04-13 01:17:03 +00:00
</tr>
{{/each}}
</table>
<h3>Other Files</h3>
<table>
<tr>
2021-04-13 01:17:03 +00:00
<td><b>Commands</b></td>
<td><b>Name</b></td>
<td><b>Size</b></td>
<td><b>Finished Uploading</b></td>
<td><b>Unique Name</b></td>
2021-04-13 01:17:03 +00:00
</tr>
{{each $.OtherFiles }}
<tr>
2021-10-23 16:51:17 +00:00
<td>
2021-12-20 16:22:40 +00:00
<button onclick="deleteFile('{{@Escape($.MangledName)}}');">Delete</button>
2021-10-23 16:51:17 +00:00
</td>
<td>{{$.Name}}</td>
<td>{{$.Size}}</td>
<td>{{$.UploadedDate}}</td>
<td>{{$.MangledName}}</td>
</tr>
{{/each}}
</table>
2021-04-13 01:17:03 +00:00
<script lang="javascript">
2021-10-23 16:51:17 +00:00
if (!Array.prototype.last) {
Array.prototype.last = function () {
2021-04-13 04:54:33 +00:00
return this[this.length - 1];
};
2021-10-23 16:51:17 +00:00
}
2021-04-13 04:54:33 +00:00
2021-10-23 16:51:17 +00:00
function deleteFile(mangled) {
if (window.confirm("Are you sure you want to delete: " + mangled)) {
fetch("/authored_files/" + mangled.split("_").last(), {method: "DELETE"})
.then(r => location.reload());
2021-04-13 04:54:33 +00:00
}
}
2021-04-13 01:17:03 +00:00
</script>
</body>
</html>