2019-09-10 06:05:59 +00:00
|
|
|
function loadHumanReadableToCache(key){
|
2019-09-09 08:56:50 +00:00
|
|
|
fetch('/getHumanReadable/' + key, {
|
|
|
|
headers: {
|
|
|
|
"token": webpass
|
|
|
|
}})
|
|
|
|
.then((resp) => resp.text())
|
|
|
|
.then(function(resp) {
|
2019-09-10 06:05:59 +00:00
|
|
|
humanReadableCache[key] = resp
|
2019-09-09 08:56:50 +00:00
|
|
|
})
|
2019-09-10 06:05:59 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function setHumanReadableValue(el, key){
|
|
|
|
if (typeof humanReadableCache[key] != 'undefined'){
|
|
|
|
el.value = humanReadableCache[key]
|
|
|
|
return
|
|
|
|
}
|
|
|
|
else{
|
2019-09-10 16:55:44 +00:00
|
|
|
loadHumanReadableToCache(key)
|
|
|
|
setTimeout(function(){setHumanReadableValue(el, key)}, 100)
|
2019-09-10 06:05:59 +00:00
|
|
|
return
|
|
|
|
}
|
2019-09-09 08:56:50 +00:00
|
|
|
}
|