1
0
mirror of https://github.com/garraflavatra/rolens.git synced 2025-07-19 22:18:03 +00:00

Display host stats

This commit is contained in:
2023-06-07 21:52:43 +02:00
parent be7643bd31
commit be4e3e778e
11 changed files with 219 additions and 12 deletions

View File

@ -30,17 +30,24 @@
async function openConnection(hostKey) {
const progress = startProgress(`Connecting to "${hostKey}"…`);
activeCollKey = '';
activeDbKey = '';
activeHostKey = hostKey;
const databases = await OpenConnection(hostKey);
const { databases, status, systemInfo } = await OpenConnection(hostKey);
if (databases) {
$connections[hostKey] = { databases: {} };
$connections[hostKey] = $connections[hostKey] || {};
$connections[hostKey].status = status;
$connections[hostKey].systemInfo = systemInfo;
$connections[hostKey].databases = $connections[hostKey].databases || {};
databases.forEach(dbKey => {
$connections[hostKey].databases[dbKey] =
$connections[hostKey].databases[dbKey] || { collections: {} };
});
activeHostKey = hostKey;
dispatch('connected', hostKey);
WindowSetTitle(`${$hosts[activeHostKey].name} - Rolens`);