disconnect command (hard disconnect in electron, soft disconnect in webapp)

This commit is contained in:
Jan Prochazka
2021-05-06 09:34:05 +02:00
parent e739aed80d
commit cd7edcb443
6 changed files with 95 additions and 43 deletions

View File

@@ -80,7 +80,7 @@ module.exports = {
msgtype: 'connect',
connection: { ...connection, database },
structure: lastClosed ? lastClosed.structure : null,
globalSettings: config.settingsValue
globalSettings: config.settingsValue,
});
return newOpened;
},
@@ -149,8 +149,8 @@ module.exports = {
},
refresh_meta: 'post',
async refresh({ conid, database }) {
this.close(conid, database);
async refresh({ conid, database, keepOpen }) {
if (!keepOpen) this.close(conid, database);
await this.ensureOpened(conid, database);
return { status: 'ok' };
@@ -173,6 +173,12 @@ module.exports = {
}
},
disconnect_meta: 'post',
async disconnect({ conid, database }) {
await this.close(conid, database, true);
return { status: 'ok' };
},
structure_meta: 'get',
async structure({ conid, database }) {
const opened = await this.ensureOpened(conid, database);