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

70 lines
1.6 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-04-13 04:54:33 +00:00
<td><button onclick="deleteFile('{{$.MangledName}}');">Delete</button></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-04-13 04:54:33 +00:00
<td><button onclick="deleteFile('{{$.MangledName}}');">Delete</button></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-04-13 04:54:33 +00:00
if (!Array.prototype.last){
Array.prototype.last = function(){
return this[this.length - 1];
};
};
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 01:17:03 +00:00
</script>
</body>
</html>