From 08eacce0a9685e8408622f6a4138b3a74ad502a9 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Mon, 12 Nov 2018 00:13:44 +0200 Subject: [PATCH] Fix log map entry for instances and plugins --- .../management/frontend/src/pages/dashboard/index.js | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/maubot/management/frontend/src/pages/dashboard/index.js b/maubot/management/frontend/src/pages/dashboard/index.js index 232923e..ec4ad7d 100644 --- a/maubot/management/frontend/src/pages/dashboard/index.js +++ b/maubot/management/frontend/src/pages/dashboard/index.js @@ -87,6 +87,16 @@ class Dashboard extends Component { this.setState({ [stateField]: data }) } + getLog(field, id) { + if (field === "clients") { + return this.logMap[`maubot.client.${id}`] + } else if (field === "instances") { + return this.logMap[`maubot.plugin.${id}`] + } else if (field === "plugins") { + return this.logMap["maubot.loader.zip"] + } + } + renderView(field, type, id) { const entry = this.state[field][id] if (!entry) { @@ -98,7 +108,7 @@ class Dashboard extends Component { onDelete: () => this.delete(field, id), onChange: newEntry => this.add(field, newEntry, id), ctx: this.state, - log: this.logMap[`maubot.${field.slice(0, -1)}.${id}`] || [], + log: this.getLog(field, id) || [], }) }