Skip to content

Commit ba00739

Browse files
1 parent cb4156e commit ba00739

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

src/server/extension/monitoring-endpoint.js

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,29 @@ process.stdin.on('end', () => {
215215
});
216216
});
217217
}
218+
219+
function getPoolStatsFromAPI() {
220+
return new Promise((resolve, reject) => {
221+
var url = 'http://fylr.localhost:8081/api/v1/pool/1/stats?include_subpools=1&access_token=' + access_token
222+
console.error("POOLSTATS");
223+
fetch(url, {
224+
headers: {
225+
'Accept': 'application/json'
226+
},
227+
})
228+
.then(response => {
229+
if (response.ok) {
230+
resolve(response.json());
231+
} else {
232+
throwError("Fehler bei der Anfrage an /pool/stats ", '');
233+
}
234+
})
235+
.catch(error => {
236+
console.log(error);
237+
throwError("Fehler bei der Anfrage an /pool/stats ", '');
238+
});
239+
});
240+
}
218241

219242
async function fetchData() {
220243
const infoData = await Promise.all([
@@ -225,7 +248,8 @@ process.stdin.on('end', () => {
225248
getTagInfoFromAPI(),
226249
getPluginInfoFromAPI(),
227250
getConfigFromAPI(),
228-
getConfigFromInspectAPI()
251+
getConfigFromInspectAPI(),
252+
getPoolStatsFromAPI()
229253
]);
230254

231255
let configinfo = infoData[6];
@@ -351,6 +375,7 @@ process.stdin.on('end', () => {
351375
licenseDomains = licenseDomains.map((s) => s.trim());
352376
var externalURL = info.external_url;
353377
externalURL = externalURL.replace('https://', '');
378+
externalURL = externalURL.replace('https//', '');
354379
externalURL = externalURL.trim();
355380
if (!licenseDomains.includes(externalURL)) {
356381
result.license.domainConflict = true;
@@ -421,7 +446,10 @@ process.stdin.on('end', () => {
421446
// check if all objecttypes and tags, which are used in validation still exist!
422447
const objecttypeList = infoData[2].tables.map(item => item.name);
423448

449+
console.error(" infoData[4]");
450+
console.error( infoData[4]);
424451
const tagList = infoData[4].Tags.flatMap(item => item.Tags.map(tag => tag.Id));
452+
425453
// check tags
426454
let tagFilterFine = false;
427455
const tagfilter_select = sessionData.config.base.plugin['custom-vzg-validationhub'].config['VZG-Validationhub'].tagfilter_select;
@@ -464,6 +492,9 @@ process.stdin.on('end', () => {
464492
result.pluginsAllEnabled = false;
465493
result.pluginsDisabled = disabledPlugins;
466494
}
495+
496+
// poolstats
497+
console.error(infoData[8]);
467498

468499
// parse info from settings (via session)
469500
result.name = sessionData.instance.name;

0 commit comments

Comments
 (0)