xet7
May 20, 2024, 12:21pm
1
Hi,
at Slack, someone asked:
how can i check which mongodb driver version is my Meteor app using?
So here is how to show versions of MongoDB, Node.js etc. It is shown in WeKan Open Source kanban https://wekan.github.io right to username / Admin Panel / Version.
Serverside:
peakMallocedMemory: v8.getHeapStatistics().peak_malloced_memory,
doesZapGarbage: v8.getHeapStatistics().does_zap_garbage,
numberOfNativeContexts: v8.getHeapStatistics().number_of_native_contexts,
numberOfDetachedContexts: v8.getHeapStatistics().number_of_detached_contexts,
};
let memoryUsage = process.memoryUsage();
statistics.nodeMemoryUsage = {
rss: memoryUsage.rss,
heapTotal: memoryUsage.heapTotal,
heapUsed: memoryUsage.heapUsed,
external: memoryUsage.external,
};
}
let meteorVersion = Meteor.release;
meteorVersion = meteorVersion.replace('METEOR@', '');
statistics.meteor = {
meteorVersion,
};
// Database facts shown in Admin Panel / Version:
// - databaseType: MongoDB or FerretDB (WeKan can run on either; FerretDB
// v1 speaks the MongoDB wire protocol, so most of this looks the same).
Client template:
//- independently: "WeKan ® Version" made the first one's label column wide and
//- "OS Type" made the next one's narrow, so the values started at a different x
//- in every group and the pane read as five unrelated things. One table with a
//- colgroup of two 50% columns puts every label and every value in the same place
//- (.info-table in informationBody.css).
template(name='statistics')
.version-check
button.js-check-newest-versions.primary(type="button" disabled=versionCheckRunning)
i.fa.fa-refresh
| {{_ 'check-version'}}
if versionCheckRunning
span.version-check-state {{_ 'loading'}}
if versionCheckError
span.version-check-state.error {{versionCheckError}}
if versionManifestText
pre.version-check-results {{versionManifestText}}
table.info-table
//- Two equal columns, stated once here rather than left to the widest cell:
with table-layout fixed these are what the browser uses, so the labels and
the values line up down the whole pane no matter which group is longest.
colgroup
Client Javascript:
this.versionCheckError = new ReactiveVar('');
this.versionCheckRunning = new ReactiveVar(false);
Meteor.call('getStatistics', (error, ret) => {
if (!error && ret) {
this.info.set(ret);
}
});
});
// No page template and no menu of its own any more: Version is the first pane of
4 Likes