mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-07-13 07:04:50 -06:00
Merge pull request #5 from EvolutionAPI/0.4.1
add chatwoot auto_create and profile photo
This commit is contained in:
commit
b55a7fe54b
@ -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.0",
|
||||
"version": "0.4.1",
|
||||
"main": "dist",
|
||||
"engines": {
|
||||
"node": ">=16.0.0"
|
||||
|
@ -91,7 +91,7 @@ export default {
|
||||
components: [
|
||||
"ConnectionAlert",
|
||||
"BasicInfo",
|
||||
// "ProfilePhoto",
|
||||
"ProfilePhoto",
|
||||
"Privacy",
|
||||
],
|
||||
},
|
||||
|
@ -26,8 +26,7 @@
|
||||
{{ error }}
|
||||
</v-alert>
|
||||
|
||||
<div class="d-flex gap-x-4">
|
||||
{{ instance.instance.profilePictureUrl }}
|
||||
<div class="d-flex flex-wrap justify-center gap-x-4">
|
||||
<v-avatar size="150">
|
||||
<v-img
|
||||
v-if="instance.instance.profilePictureUrl"
|
||||
@ -46,13 +45,18 @@
|
||||
width="150"
|
||||
@click="selectPhoto"
|
||||
>
|
||||
<v-icon size="50">mdi-upload</v-icon>
|
||||
<v-progress-circular
|
||||
indeterminate
|
||||
v-if="loading == 'uploading'"
|
||||
size="50"
|
||||
/>
|
||||
<v-icon size="50" v-else>mdi-upload</v-icon>
|
||||
Selecionar foto
|
||||
</v-card>
|
||||
<v-card
|
||||
v-if="instance.instance.profilePictureUrl"
|
||||
variant="outlined"
|
||||
class="h-full d-flex justify-center align-center rounded-pill"
|
||||
class="h-full d-flex flex-column justify-center align-center rounded-pill"
|
||||
width="150"
|
||||
@click="removePicture"
|
||||
:disabled="loading"
|
||||
@ -121,7 +125,7 @@ export default {
|
||||
this.instance.instance.instanceName
|
||||
);
|
||||
|
||||
await this.AppStore.reconnect();
|
||||
this.AppStore.setPhoto(this.instance.instance.instanceName, null);
|
||||
} catch (e) {
|
||||
this.error = e.message?.message || e.message || e;
|
||||
} finally {
|
||||
@ -135,18 +139,19 @@ export default {
|
||||
if (!this.isOpen) return;
|
||||
|
||||
const file = event.target.files[0];
|
||||
|
||||
const base64 = await this.fileToBase64(file);
|
||||
|
||||
await instanceController.profile.updatePicture(
|
||||
this.instance.instance.instanceName,
|
||||
base64
|
||||
base64.split(",")[1]
|
||||
);
|
||||
|
||||
await this.AppStore.reconnect();
|
||||
this.AppStore.setPhoto(this.instance.instance.instanceName, base64);
|
||||
} catch (e) {
|
||||
this.error = e.message?.message || e.message || e;
|
||||
} finally {
|
||||
this.loading = false;
|
||||
event.target.value = "";
|
||||
}
|
||||
},
|
||||
fileToBase64(file) {
|
||||
|
@ -133,6 +133,23 @@
|
||||
</template>
|
||||
</v-checkbox>
|
||||
</div>
|
||||
<div v-if="chatwootData.auto_create !== undefined">
|
||||
<v-checkbox
|
||||
v-model="chatwootData.auto_create"
|
||||
label="Conversa pendente"
|
||||
:disabled="loading"
|
||||
hide-details
|
||||
class="mb-3"
|
||||
density="compact"
|
||||
>
|
||||
<template v-slot:label>
|
||||
<span>Criar Caixa de Entrada</span>
|
||||
<HelpTooltip>
|
||||
Cria automaticamente a caixa de entrada no Chatwoot
|
||||
</HelpTooltip>
|
||||
</template>
|
||||
</v-checkbox>
|
||||
</div>
|
||||
</div>
|
||||
</v-form>
|
||||
</v-card-text>
|
||||
@ -177,6 +194,7 @@ const defaultObj = () => ({
|
||||
sign_msg: true,
|
||||
reopen_conversation: true,
|
||||
conversation_pending: false,
|
||||
auto_create: undefined,
|
||||
});
|
||||
|
||||
export default {
|
||||
|
@ -70,7 +70,7 @@ export default {
|
||||
{
|
||||
title: "Doc",
|
||||
icon: "mdi-book-open-page-variant",
|
||||
url: "https://doc.evolution-api.com/help-center",
|
||||
url: "https://doc.evolution-api.com",
|
||||
},
|
||||
],
|
||||
}),
|
||||
|
@ -123,6 +123,13 @@ export const useAppStore = defineStore('app', {
|
||||
this.instancesList[index].instance.status = status
|
||||
},
|
||||
|
||||
setPhoto(instanceName, photo) {
|
||||
const index = this.instancesList.findIndex(
|
||||
(instance) => instance.instance.instanceName === instanceName
|
||||
)
|
||||
if (index !== -1) this.instancesList[index].instance.profilePictureUrl = photo
|
||||
},
|
||||
|
||||
addInstanceKey({ instance, key }) {
|
||||
this.instancesKeys[instance] = key
|
||||
},
|
||||
|
Loading…
Reference in New Issue
Block a user