get server version

This commit is contained in:
Jan Prochazka
2021-04-25 10:25:16 +02:00
parent 08692dc63f
commit 8ff706a17f
8 changed files with 88 additions and 2 deletions

View File

@@ -17,6 +17,12 @@ module.exports = {
existing.databases = databases;
socket.emitChanged(`database-list-changed-${conid}`);
},
handle_version(conid, { version }) {
const existing = this.opened.find(x => x.conid == conid);
if (!existing) return;
existing.version = version;
socket.emitChanged(`server-version-changed-${conid}`);
},
handle_status(conid, { status }) {
const existing = this.opened.find(x => x.conid == conid);
if (!existing) return;
@@ -85,6 +91,12 @@ module.exports = {
return opened.databases;
},
version_meta: 'get',
async version({ conid }) {
const opened = await this.ensureOpened(conid);
return opened.version;
},
serverStatus_meta: 'get',
async serverStatus() {
return {