database & connection color overrides

This commit is contained in:
Jan Prochazka
2021-12-05 11:08:17 +01:00
parent 5ca54220b5
commit 50dbb9d1bd
9 changed files with 127 additions and 30 deletions

View File

@@ -170,6 +170,23 @@ module.exports = {
return res;
},
updateDatabase_meta: 'post',
async updateDatabase({ conid, database, values }) {
if (portalConnections) return;
const conn = await this.datastore.find({ _id: conid });
let databaseConfig = conn.databaseConfig || {};
databaseConfig = {
...databaseConfig,
[database]: {
...databaseConfig[database],
...values,
},
};
const res = await this.datastore.update({ _id: conid }, { $set: { databaseConfig } });
socket.emitChanged('connection-list-changed');
return res;
},
delete_meta: 'post',
async delete(connection) {
if (portalConnections) return;