forked from Ailur/burgernotes-server
burger
This commit is contained in:
parent
52cff35cd2
commit
38c0f90285
|
@ -61,3 +61,7 @@ please display a warning before this action
|
||||||
|
|
||||||
POST - /api/exportnotes - export notes, provide "secretKey"
|
POST - /api/exportnotes - export notes, provide "secretKey"
|
||||||
note content and title will have to be decrypted
|
note content and title will have to be decrypted
|
||||||
|
|
||||||
|
POST - /api/sessions/list - show all sessions, provide "secretKey"
|
||||||
|
|
||||||
|
POST - /api/sessions/remove - remove session, provide "secretKey" and "sessionId"
|
|
@ -9,6 +9,10 @@ if (localStorage.getItem("DONOTSHARE-password") === null) {
|
||||||
throw new Error();
|
throw new Error();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (localStorage.getItem("CACHE-username") !== null) {
|
||||||
|
document.getElementById("usernameBox").innerText = localStorage.getItem("CACHE-username")
|
||||||
|
}
|
||||||
|
|
||||||
function formatBytes(a, b = 2) { if (!+a) return "0 Bytes"; const c = 0 > b ? 0 : b, d = Math.floor(Math.log(a) / Math.log(1000)); return `${parseFloat((a / Math.pow(1000, d)).toFixed(c))} ${["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][d]}` }
|
function formatBytes(a, b = 2) { if (!+a) return "0 Bytes"; const c = 0 > b ? 0 : b, d = Math.floor(Math.log(a) / Math.log(1000)); return `${parseFloat((a / Math.pow(1000, d)).toFixed(c))} ${["Bytes", "KB", "MB", "GB", "TB", "PB", "EB", "ZB", "YB"][d]}` }
|
||||||
|
|
||||||
function truncateString(str, num) {
|
function truncateString(str, num) {
|
||||||
|
@ -193,6 +197,7 @@ function updateUserInfo() {
|
||||||
storageProgressThing.value = responseData["storageused"]
|
storageProgressThing.value = responseData["storageused"]
|
||||||
storageProgressThing.max = responseData["storagemax"]
|
storageProgressThing.max = responseData["storagemax"]
|
||||||
noteCount = responseData["notecount"]
|
noteCount = responseData["notecount"]
|
||||||
|
localStorage.setItem("CACHE-username", responseData["username"])
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
doStuff()
|
doStuff()
|
||||||
|
@ -256,9 +261,9 @@ sessionManagerButton.addEventListener("click", (event) => {
|
||||||
let sessionRemoveButton = document.createElement("button")
|
let sessionRemoveButton = document.createElement("button")
|
||||||
sessionText.classList.add("w300")
|
sessionText.classList.add("w300")
|
||||||
if (responseData[i]["thisSession"] == true) {
|
if (responseData[i]["thisSession"] == true) {
|
||||||
sessionText.innerHTML = "<span style='background-color: #157efb; color: white; padding: 8px; border-radius: 8px; margin-right: 5px;'>current</span>" + truncateString(responseData[i]["device"], 18)
|
sessionText.innerText = "(current) " + truncateString(responseData[i]["device"], 18)
|
||||||
} else {
|
} else {
|
||||||
sessionText.innerHTML = truncateString(responseData[i]["device"], 27)
|
sessionText.innerText = truncateString(responseData[i]["device"], 27)
|
||||||
}
|
}
|
||||||
sessionText.title = responseData[i]["device"]
|
sessionText.title = responseData[i]["device"]
|
||||||
sessionRemoveButton.innerText = "X"
|
sessionRemoveButton.innerText = "X"
|
||||||
|
|
Loading…
Reference in New Issue