Initial commit

This commit is contained in:
Marc Ole Bulling
2021-03-12 10:38:42 +01:00
commit 5b9bbebc20
40 changed files with 1464 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 106 KiB

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

0
static/assets/dist/css/index.html vendored Normal file
View File

0
static/assets/dist/index.html vendored Normal file
View File

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

1
static/assets/dist/js/dropzone.min.js vendored Normal file

File diff suppressed because one or more lines are too long

0
static/assets/dist/js/index.html vendored Normal file
View File

2
static/assets/dist/js/jquery.min.js vendored Normal file

File diff suppressed because one or more lines are too long

0
static/assets/index.html Normal file
View File

104
static/css/cover.css Normal file
View File

@@ -0,0 +1,104 @@
/*
* Globals
*/
/* Custom default button */
.btn-secondary,
.btn-secondary:hover,
.btn-secondary:focus {
color: #333;
text-shadow: none; /* Prevent inheritance from `body` */
}
/*
* Base structure
*/
body {
text-shadow: 0 .05rem .1rem rgba(0, 0, 0, .5);
background: url('../assets/background.jpg') no-repeat center center fixed;
-webkit-background-size: cover;
-moz-background-size: cover;
-o-background-size: cover;
background-size: cover;
}
td {
vertical-align:middle;
position:relative;
}
a {
color: inherit;
}
a:hover {
color: inherit;
filter: brightness(80%);
}
.dropzone {
background: #efefef;
color: #646363;
}
.card {
margin: 0 auto;
float: none;
margin-bottom: 10px;
}
.card-body {
background-color: #555;
color: #ddd;
border: 0px;
}
.bd-placeholder-img {
font-size: 1.125rem;
text-anchor: middle;
-webkit-user-select: none;
-moz-user-select: none;
user-select: none;
}
@media (min-width: 768px) {
.bd-placeholder-img-lg {
font-size: 3.5rem;
}
}
.cover-container {
max-width: 42em;
}
/*
* Header
*/
.nav-masthead .nav-link {
padding: .25rem 0;
font-weight: 700;
color: rgba(255, 255, 255, .5);
background-color: transparent;
border-bottom: .25rem solid transparent;
}
.nav-masthead .nav-link:hover,
.nav-masthead .nav-link:focus {
border-bottom-color: rgba(255, 255, 255, .25);
}
.nav-masthead .nav-link + .nav-link {
margin-left: 1rem;
}
.nav-masthead .active {
color: #fff;
border-bottom-color: #fff;
}

0
static/css/index.html Normal file
View File

1
static/index.html Normal file
View File

@@ -0,0 +1 @@
<head><meta http-equiv="Refresh" content="0; URL=./index"></head>

49
static/js/admin.js Normal file
View File

@@ -0,0 +1,49 @@
var clipboard = new ClipboardJS('.btn');
Dropzone.options.uploaddropzone = {
paramName: "file",
createImageThumbnails: false,
success: function (file, response) {
addRow(response)
this.removeFile(file);
},
init: function() {
this.on("sending", function(file, xhr, formData){
formData.append("allowedDownloads", document.getElementById("allowedDownloads").value);
formData.append("expiryDays", document.getElementById("expiryDays").value);
});
}
};
function addRow(jsonText) {
let jsonObject = JSON.parse(jsonText);
if (jsonObject.Result != "OK") {
alert("Failed to upload file!");
location.reload();
return;
}
let item = jsonObject.FileInfo;
let table = document.getElementById("downloadtable");
let row = table.insertRow(0);
let cell1 = row.insertCell(0);
let cell2 = row.insertCell(1);
let cell3 = row.insertCell(2);
let cell4 = row.insertCell(3);
let cell5 = row.insertCell(4);
let cell6 = row.insertCell(5);
cell1.innerText = item.Name;
cell2.innerText = item.Size;
cell3.innerText = item.DownloadsRemaining;
cell4.innerText = item.ExpireAtString;
cell5.innerHTML = '<a target="_blank" style="color: inherit" href="'+jsonObject.Url+item.Id+'">'+jsonObject.Url+item.Id+'</a>';
cell6.innerHTML = "<button type=\"button\" data-clipboard-text=\""+jsonObject.Url+item.Id+"\" class=\"copyurl btn btn-outline-light btn-sm\">Copy URL</button> <button type=\"button\" class=\"btn btn-outline-light btn-sm\" onclick=\"window.location='./delete?id="+item.Id+"'\">Delete</button>";
cell1.style.backgroundColor="green"
cell2.style.backgroundColor="green"
cell3.style.backgroundColor="green"
cell4.style.backgroundColor="green"
cell5.style.backgroundColor="green"
cell6.style.backgroundColor="green"
}

0
static/js/index.html Normal file
View File