mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-07-13 15:14:49 -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",
|
"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.",
|
"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",
|
"main": "dist",
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=16.0.0"
|
"node": ">=16.0.0"
|
||||||
|
@ -91,7 +91,7 @@ export default {
|
|||||||
components: [
|
components: [
|
||||||
"ConnectionAlert",
|
"ConnectionAlert",
|
||||||
"BasicInfo",
|
"BasicInfo",
|
||||||
// "ProfilePhoto",
|
"ProfilePhoto",
|
||||||
"Privacy",
|
"Privacy",
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
|
@ -26,8 +26,7 @@
|
|||||||
{{ error }}
|
{{ error }}
|
||||||
</v-alert>
|
</v-alert>
|
||||||
|
|
||||||
<div class="d-flex gap-x-4">
|
<div class="d-flex flex-wrap justify-center gap-x-4">
|
||||||
{{ instance.instance.profilePictureUrl }}
|
|
||||||
<v-avatar size="150">
|
<v-avatar size="150">
|
||||||
<v-img
|
<v-img
|
||||||
v-if="instance.instance.profilePictureUrl"
|
v-if="instance.instance.profilePictureUrl"
|
||||||
@ -46,13 +45,18 @@
|
|||||||
width="150"
|
width="150"
|
||||||
@click="selectPhoto"
|
@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
|
Selecionar foto
|
||||||
</v-card>
|
</v-card>
|
||||||
<v-card
|
<v-card
|
||||||
v-if="instance.instance.profilePictureUrl"
|
v-if="instance.instance.profilePictureUrl"
|
||||||
variant="outlined"
|
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"
|
width="150"
|
||||||
@click="removePicture"
|
@click="removePicture"
|
||||||
:disabled="loading"
|
:disabled="loading"
|
||||||
@ -121,7 +125,7 @@ export default {
|
|||||||
this.instance.instance.instanceName
|
this.instance.instance.instanceName
|
||||||
);
|
);
|
||||||
|
|
||||||
await this.AppStore.reconnect();
|
this.AppStore.setPhoto(this.instance.instance.instanceName, null);
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.error = e.message?.message || e.message || e;
|
this.error = e.message?.message || e.message || e;
|
||||||
} finally {
|
} finally {
|
||||||
@ -135,18 +139,19 @@ export default {
|
|||||||
if (!this.isOpen) return;
|
if (!this.isOpen) return;
|
||||||
|
|
||||||
const file = event.target.files[0];
|
const file = event.target.files[0];
|
||||||
|
|
||||||
const base64 = await this.fileToBase64(file);
|
const base64 = await this.fileToBase64(file);
|
||||||
|
|
||||||
await instanceController.profile.updatePicture(
|
await instanceController.profile.updatePicture(
|
||||||
this.instance.instance.instanceName,
|
this.instance.instance.instanceName,
|
||||||
base64
|
base64.split(",")[1]
|
||||||
);
|
);
|
||||||
|
this.AppStore.setPhoto(this.instance.instance.instanceName, base64);
|
||||||
await this.AppStore.reconnect();
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.error = e.message?.message || e.message || e;
|
this.error = e.message?.message || e.message || e;
|
||||||
} finally {
|
} finally {
|
||||||
this.loading = false;
|
this.loading = false;
|
||||||
|
event.target.value = "";
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
fileToBase64(file) {
|
fileToBase64(file) {
|
||||||
|
@ -133,6 +133,23 @@
|
|||||||
</template>
|
</template>
|
||||||
</v-checkbox>
|
</v-checkbox>
|
||||||
</div>
|
</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>
|
</div>
|
||||||
</v-form>
|
</v-form>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
@ -177,6 +194,7 @@ const defaultObj = () => ({
|
|||||||
sign_msg: true,
|
sign_msg: true,
|
||||||
reopen_conversation: true,
|
reopen_conversation: true,
|
||||||
conversation_pending: false,
|
conversation_pending: false,
|
||||||
|
auto_create: undefined,
|
||||||
});
|
});
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
|
@ -70,7 +70,7 @@ export default {
|
|||||||
{
|
{
|
||||||
title: "Doc",
|
title: "Doc",
|
||||||
icon: "mdi-book-open-page-variant",
|
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
|
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 }) {
|
addInstanceKey({ instance, key }) {
|
||||||
this.instancesKeys[instance] = key
|
this.instancesKeys[instance] = key
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user