initial commit

This commit is contained in:
Benjamin Bärthlein
2020-03-28 17:56:11 +01:00
parent 4a3673e0d3
commit c4809b85b4
51 changed files with 26929 additions and 1 deletions
+83
View File
@@ -0,0 +1,83 @@
function deleteHost(id) {
$.ajax({
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
type: 'GET',
url: "/hosts/delete/" + id
}).done(function(data, textStatus, jqXHR) {
location.href="/hosts";
}).fail(function(jqXHR, textStatus, errorThrown) {
alert("Error: " + $.parseJSON(jqXHR.responseText).message);
location.reload()
});
}
function addEditHost(id, addedit) {
if (id == null) {
id = ""
} else {
id = "/"+id
}
$.ajax({
contentType: 'application/x-www-form-urlencoded; charset=UTF-8',
data: $('#edithostform').serialize(),
type: 'POST',
url: '/hosts/'+addedit+id,
}).done(function(data, textStatus, jqXHR) {
location.href="/hosts";
}).fail(function(jqXHR, textStatus, errorThrown) {
alert("Error: " + $.parseJSON(jqXHR.responseText).message);
});
return false;
}
function logOut(){
try {
// This is for Firefox
$.ajax({
// This can be any path on your same domain which requires HTTPAuth
url: "",
username: 'reset',
password: 'reset',
// If the return is 401, refresh the page to request new details.
statusCode: { 401: function() {
document.location = document.location;
}
}
});
} catch (exception) {
// Firefox throws an exception since we didn't handle anything but a 401 above
// This line works only in IE
if (!document.execCommand("ClearAuthenticationCache")) {
// exeCommand returns false if it didn't work (which happens in Chrome) so as a last
// resort refresh the page providing new, invalid details.
document.location = "http://reset:reset@" + document.location.hostname + document.location.pathname;
}
}
}
function randomHash() {
var chars = "abcdefghijklmnopqrstuvwxyz!@#$%^&*()-+<>ABCDEFGHIJKLMNOP1234567890";
var pass = "";
for (var x = 0; x < 32; x++) {
var i = Math.floor(Math.random() * chars.length);
pass += chars.charAt(i);
}
return pass;
}
function generateUsername() {
edithostform.username.value = randomHash();
}
function generatePassword() {
edithostform.password.value = randomHash();
}
function copyToClipboard(inputId) {
var copyText = document.getElementById(inputId);
copyText.select();
copyText.setSelectionRange(0, 99999);
document.execCommand("copy");
}
File diff suppressed because it is too large Load Diff
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
+4435
View File
File diff suppressed because it is too large Load Diff
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,0 +1,24 @@
/*!
* IE10 viewport hack for Surface/desktop Windows 8 bug
* Copyright 2014-2017 The Bootstrap Authors
* Copyright 2014-2017 Twitter, Inc.
* Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
*/
// See the Getting Started docs for more information:
// https://getbootstrap.com/getting-started/#support-ie10-width
(function () {
'use strict'
if (navigator.userAgent.match(/IEMobile\/10\.0/)) {
var msViewportStyle = document.createElement('style')
msViewportStyle.appendChild(
document.createTextNode(
'@-ms-viewport{width:auto!important}'
)
)
document.head.appendChild(msViewportStyle)
}
}())
File diff suppressed because one or more lines are too long