From 2f6c896f0a4d16eb8715347ba8eb3bed745050bb Mon Sep 17 00:00:00 2001 From: Gabriel Pastori <58153955+gabrielpastori1@users.noreply.github.com> Date: Sun, 7 Jan 2024 17:19:01 -0300 Subject: [PATCH] add EventsSelect component --- lib/api/migrateToMongo/migrators/instance.js | 12 +- package.json | 2 +- src/components/global/EventsSelect.vue | 99 ++++++++++++++ src/components/instance/settings/Rabbitmq.vue | 20 +-- src/components/instance/settings/Webhook.vue | 43 +----- .../instance/settings/Websocket.vue | 18 +-- src/components/modal/ConnectPhone.vue | 129 ++++++++++++++---- src/i18n/en.js | 4 + src/i18n/es.js | 4 + src/i18n/pt.js | 8 +- 10 files changed, 241 insertions(+), 98 deletions(-) create mode 100644 src/components/global/EventsSelect.vue diff --git a/lib/api/migrateToMongo/migrators/instance.js b/lib/api/migrateToMongo/migrators/instance.js index 734358a..7dd3013 100644 --- a/lib/api/migrateToMongo/migrators/instance.js +++ b/lib/api/migrateToMongo/migrators/instance.js @@ -34,14 +34,22 @@ module.exports = async (instanceName, options, progressBars, conn, connInstance) const collectionName = file.key || instanceName const collection = (!file.secondaryConnection ? conn : connInstance).collection(collectionName) - const data = JSON.parse(fs.readFileSync(file.path, 'utf8')) + var data; + try { + data = JSON.parse(fs.readFileSync(file.path, 'utf8')) + } catch (err) { + continue; + } + + if (Array.isArray(data)) continue data._id = file.path.split('\\').pop().split('.')[0] await collection.findOneAndUpdate({ _id: data._id }, { $set: data }, { upsert: true }) - progress.increment() } catch (err) { progress.stop() throw { err, file } + } finally { + progress.increment() } } } diff --git a/package.json b/package.json index e528797..fe1138b 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "evolution-manager", "description": "Evolution Manager is an open-source interface for managing the Evolution API, simplifying the creation and administration of API instances with advanced features and diverse integrations.", - "version": "0.4.10", + "version": "0.4.11", "main": "dist", "engines": { "node": ">=16.0.0" diff --git a/src/components/global/EventsSelect.vue b/src/components/global/EventsSelect.vue new file mode 100644 index 0000000..5e41519 --- /dev/null +++ b/src/components/global/EventsSelect.vue @@ -0,0 +1,99 @@ + + + + + + + {{ icon }} + + + {{ $t(`toggleSelect.${allSelected ? "none" : "all"}`) }} + + + + + + + + + diff --git a/src/components/instance/settings/Rabbitmq.vue b/src/components/instance/settings/Rabbitmq.vue index 68a1552..0d479e0 100644 --- a/src/components/instance/settings/Rabbitmq.vue +++ b/src/components/instance/settings/Rabbitmq.vue @@ -31,18 +31,7 @@ - + @@ -65,16 +54,19 @@ variant="tonal" > {{ $t("save") }} - +