Compare commits

..

No commits in common. "cf50254baeb4f5d895a13fa3996bf8087236200c" and "af987ce195a8380721534bbd3218194cd2d68f3c" have entirely different histories.

3 changed files with 5 additions and 84 deletions

View File

@ -20,47 +20,10 @@ function parseRq (bytes) {
class APIMethods {
constructor (parentObj) {
this.parentObj = parentObj;
this.info.cache = new Object();
// Clear method cache on update config
global.server.on("config.update", () => {
this.info.cache = new Object();
});
}
info (con, req, cb) {
if (!req.fields) req.fields = "*";
if (!req.fieldsExtSource) req.fieldsExtSource = "*";
const cache = this.info.cache[
JSON.stringify({
f: req.fields, e: req.fieldsExtSource
})
];
if (cache) {
console.debug("CACHE!");
return cb({ result: cache, trace_id: req.trace_id, ended: true });
}
const serverInfo = require("./server-info")();
if (req.fields !== "*") {
const fields = Object.fromEntries(req.fields.split(/\s*,\s*/g).map(x => [x.trim(), true]));
Object.keys(serverInfo).forEach(k => {
if (!fields[k]) serverInfo[k] = undefined;
});
}
if (req.fieldsExtSource !== "*" && req.fields.extSource !== undefined) {
const fields = Object.fromEntries(req.fieldsExtSource.split(/\s*,\s*/g).map(x => [x.trim(), true]));
Object.keys(serverInfo).forEach(k => {
if (!fields[k]) serverInfo.extSource[k] = undefined;
});
}
this.info.cache[
JSON.stringify({
f: req.fields, e: req.fieldsExtSource
})
] = serverInfo;
const serverInfo = require("./server-info");
cb({ result: serverInfo, trace_id: req.trace_id, ended: true });
}
@ -125,7 +88,7 @@ class API {
}
decrypt (address, bytes) {
throw new Error("Deprecated. Use TLS. If you see this error, please, create issue into: https://git.fullgream.tech/fullgream/ai-adventure-labs/issues");
throw new Error("Deprecated. Use TLS. If you see this error, please, add issue into: https://git.fullgream.tech/fullgream/ai-adventure-labs/issues");
}
async exec (connection, bytes, cb) {

View File

@ -116,40 +116,14 @@
backdrop-filter: blur(5px);
border-radius : 15px;
width: calc(90vw);
height: calc(85vh);
height: calc(80vh);
margin-left: calc(5vw);
margin-top: calc(5vh);
margin-left: calc(5%);
margin-top: calc(5%);
padding: 5px;
}
.flex-box {
display: flex;
}
.charlist-item {
width: 25vw;
}
.avatar-on-charlist {
width: 50px;
height: 50px;
margin-right: 15px;
border-radius: 100%;
}
.characters-menu {
width: 25vw;
height: 75vh;
}
.character-menu {
float: left;
width: 65vw;
height: 75vh;
}
/* $accordion-color:green; */
/* $accordion-padding-y:1.3rem; */
/* $accordion-padding-x:2.5rem; */

View File

@ -104,22 +104,6 @@ ServerAuth.mainMenuForm.innerHTML = `
<div id="main-panel" >
<div id="main-content">
<center><h2>Your Profile</h2></center><hr/>
<div class="flex-box">
<div class="characters-menu">
<center><h4>Characters</h4></center>
<div class="user-character-list btn-group-vertical charlist-item" role="group" aria-label="Characters">
<button type="button" class="btn btn-dark btn-outline-light">
<div class="flex-box"><img src="https://fullgream.tech/assets/contacts-image.jpg" class="avatar-on-charlist" /><h5>John Doe</h5></div>
</button>
<button type="button" class="btn btn-success btn-outline-light">Add character</button>
</div>
</div>
<div class="character-menu">
<center><h4>Character</h4></center>
<div>
</div>
</div>
</div>
</div>
</div>