mirror of
https://github.com/EvolutionAPI/evolution-manager.git
synced 2025-07-16 12:12:56 -06:00
add about
This commit is contained in:
parent
d1653c3408
commit
f12e3b2b8e
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "evolution-manager",
|
"name": "evolution-manager",
|
||||||
"version": "0.2.7",
|
"version": "0.2.8",
|
||||||
"main": "dist",
|
"main": "dist",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"dev": "vite",
|
"dev": "vite",
|
||||||
|
78
src/components/modal/About.vue
Normal file
78
src/components/modal/About.vue
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
<template>
|
||||||
|
<v-dialog v-model="dialog" max-width="600px" scrollable>
|
||||||
|
<v-card>
|
||||||
|
<v-card-text>
|
||||||
|
<div class="d-flex flex-column align-center">
|
||||||
|
<v-img
|
||||||
|
src="@/assets/logo.png"
|
||||||
|
height="100"
|
||||||
|
width="100"
|
||||||
|
class="mb-4"
|
||||||
|
/>
|
||||||
|
<h3 class="mt-5 mb-2">Evolution Manager</h3>
|
||||||
|
<p>
|
||||||
|
O Evolution Manager, independente da
|
||||||
|
<a
|
||||||
|
href="https://github.com/EvolutionAPI/evolution-api/"
|
||||||
|
target="_blank"
|
||||||
|
>Evolution API</a
|
||||||
|
>, facilita a gestão de suas APIs com uma interface intuitiva. Ele
|
||||||
|
foi criado por desenvolvedores independentes, focando em melhorar a
|
||||||
|
experiência do usuário e a administração das funcionalidades da API.
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<v-btn
|
||||||
|
href="https://github.com/gabrielpastori1/evolution-manager"
|
||||||
|
target="_blank"
|
||||||
|
class="mt-5"
|
||||||
|
color="grey darken-3"
|
||||||
|
>
|
||||||
|
<v-icon start>mdi-github</v-icon>
|
||||||
|
Repositório no GitHub
|
||||||
|
</v-btn>
|
||||||
|
|
||||||
|
<h3 class="mt-5 mb-2">Processamento de Dados</h3>
|
||||||
|
<p>
|
||||||
|
O processamento e armazenamento de dados ocorre <b>localmente</b> no
|
||||||
|
seu navegador, sem uso de um backend centralizado. Isso reforça a
|
||||||
|
segurança e privacidade, mantendo suas informações confidenciais e
|
||||||
|
protegidas.
|
||||||
|
</p>
|
||||||
|
<v-alert v-if="!isHttps" color="info" class="mt-2" variant="tonal">
|
||||||
|
Por conta de todo o processamento ser realizado no navegador, é
|
||||||
|
necessário que o servidor da Evolution API seja acessado através de
|
||||||
|
uma conexão segura (HTTPS).
|
||||||
|
</v-alert>
|
||||||
|
|
||||||
|
<h3 class="mt-5 mb-2">Limitações do Projeto</h3>
|
||||||
|
<p>
|
||||||
|
Como um projeto open-source mantido por voluntários, não há
|
||||||
|
garantias de atualizações futuras. A independência do Evolution
|
||||||
|
Manager em relação à Evolution API significa que alterações na API
|
||||||
|
podem afetar a funcionalidade do Manager.
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
</v-card-text>
|
||||||
|
<v-card-actions>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
<v-btn text @click="dialog = false" :disabled="loading"> Fechar </v-btn>
|
||||||
|
<v-spacer></v-spacer>
|
||||||
|
</v-card-actions>
|
||||||
|
</v-card>
|
||||||
|
</v-dialog>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
export default {
|
||||||
|
name: "SettingsModal",
|
||||||
|
data: () => ({
|
||||||
|
dialog: false,
|
||||||
|
isHttps: !window.location.protocol === "https:",
|
||||||
|
}),
|
||||||
|
methods: {
|
||||||
|
open() {
|
||||||
|
this.dialog = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
};
|
||||||
|
</script>
|
@ -13,11 +13,7 @@
|
|||||||
label="URL"
|
label="URL"
|
||||||
required
|
required
|
||||||
outlined
|
outlined
|
||||||
:rules="[
|
:rules="hostRules"
|
||||||
// regex to verify is has http or https
|
|
||||||
(v) =>
|
|
||||||
new RegExp('^(http|https)://', 'i').test(v) || 'URL inválida',
|
|
||||||
]"
|
|
||||||
/>
|
/>
|
||||||
<v-text-field
|
<v-text-field
|
||||||
v-model="connection.globalApiKey"
|
v-model="connection.globalApiKey"
|
||||||
@ -35,13 +31,7 @@
|
|||||||
</v-alert>
|
</v-alert>
|
||||||
</v-card-text>
|
</v-card-text>
|
||||||
<v-card-actions>
|
<v-card-actions>
|
||||||
<v-btn
|
<v-btn size="small" text @click="showAbout"> Sobre esse Manager </v-btn>
|
||||||
v-if="!AppStore.connection.host === connection.host"
|
|
||||||
text
|
|
||||||
@click="dialog = false"
|
|
||||||
>
|
|
||||||
Cancel
|
|
||||||
</v-btn>
|
|
||||||
|
|
||||||
<v-spacer></v-spacer>
|
<v-spacer></v-spacer>
|
||||||
<v-btn
|
<v-btn
|
||||||
@ -118,12 +108,14 @@
|
|||||||
</v-card-text>
|
</v-card-text>
|
||||||
</v-card>
|
</v-card>
|
||||||
</v-dialog>
|
</v-dialog>
|
||||||
|
<about-modal ref="about" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
import { useAppStore } from "@/store/app";
|
import { useAppStore } from "@/store/app";
|
||||||
|
import AboutModal from "./About.vue";
|
||||||
export default {
|
export default {
|
||||||
|
components: { AboutModal },
|
||||||
name: "SettingsModal",
|
name: "SettingsModal",
|
||||||
data: () => ({
|
data: () => ({
|
||||||
dialog: false,
|
dialog: false,
|
||||||
@ -136,8 +128,12 @@ export default {
|
|||||||
loading: false,
|
loading: false,
|
||||||
error: false,
|
error: false,
|
||||||
AppStore: useAppStore(),
|
AppStore: useAppStore(),
|
||||||
|
isHttps: !window.location.protocol === "https:",
|
||||||
}),
|
}),
|
||||||
methods: {
|
methods: {
|
||||||
|
showAbout() {
|
||||||
|
this.$refs.about.open();
|
||||||
|
},
|
||||||
removeConnection(connection) {
|
removeConnection(connection) {
|
||||||
this.AppStore.removeConnection(connection);
|
this.AppStore.removeConnection(connection);
|
||||||
},
|
},
|
||||||
@ -159,12 +155,26 @@ export default {
|
|||||||
this.connection = Object.assign({}, this.AppStore.connection);
|
this.connection = Object.assign({}, this.AppStore.connection);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
watch: {
|
||||||
|
"AppStore.validConnection"(val, oldVal) {
|
||||||
|
if (val === oldVal) return;
|
||||||
|
if (!val) this.dialog = true;
|
||||||
|
},
|
||||||
|
},
|
||||||
computed: {
|
computed: {
|
||||||
connectionsList() {
|
connectionsList() {
|
||||||
return this.AppStore.connectionsList;
|
return this.AppStore.connectionsList;
|
||||||
},
|
},
|
||||||
|
hostRules() {
|
||||||
|
return [
|
||||||
|
(v) =>
|
||||||
|
new RegExp(`^(${!this.isHttps ? "http|" : ""}https)://`, "i").test(
|
||||||
|
v
|
||||||
|
) || (this.isHttps ? "URL inválida, use https" : "URL inválida"),
|
||||||
|
];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
emits: ["close"],
|
emits: ["close"],
|
||||||
};
|
};
|
||||||
</script>
|
</script>
|
||||||
|
@ -1,15 +1,20 @@
|
|||||||
<template>
|
<template>
|
||||||
<v-app-bar flat>
|
<v-app-bar flat>
|
||||||
<v-app-bar-title>
|
<v-app-bar-title class="flex-shrink-0">
|
||||||
<v-btn variant="text" @click="$router.push('/')">
|
<v-btn variant="text" @click="$router.push('/')">
|
||||||
<v-img src="@/assets/logo.png" height="24" width="24" class="mr-2" />
|
<v-img src="@/assets/logo.png" height="24" width="24" class="mr-2" />
|
||||||
Evolution Manager
|
Evolution Manager
|
||||||
</v-btn>
|
</v-btn>
|
||||||
</v-app-bar-title>
|
</v-app-bar-title>
|
||||||
|
<v-icon v-if="AppStore.connecting" color="info">
|
||||||
<v-icon v-if="AppStore.validConnection" color="success">
|
mdi-loading mdi-spin
|
||||||
mdi-check-circle
|
|
||||||
</v-icon>
|
</v-icon>
|
||||||
|
<v-chip v-else-if="AppStore.validConnection" color="success" style="max-width: 40vw">
|
||||||
|
<v-icon color="success" start> mdi-check-circle </v-icon>
|
||||||
|
{{
|
||||||
|
AppStore.connection.host.replace(/https?:\/\//, "").replace(/\/$/, "")
|
||||||
|
}}
|
||||||
|
</v-chip>
|
||||||
<v-icon v-else color="error"> mdi-alert-circle </v-icon>
|
<v-icon v-else color="error"> mdi-alert-circle </v-icon>
|
||||||
<v-btn @click="openSettings" icon>
|
<v-btn @click="openSettings" icon>
|
||||||
<v-icon>mdi-cog</v-icon>
|
<v-icon>mdi-cog</v-icon>
|
||||||
|
@ -16,6 +16,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
state: () => ({
|
state: () => ({
|
||||||
|
connecting: false,
|
||||||
connection: {
|
connection: {
|
||||||
valid: false,
|
valid: false,
|
||||||
host: null,
|
host: null,
|
||||||
@ -31,6 +32,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
actions: {
|
actions: {
|
||||||
async setConnection({ host, globalApiKey }) {
|
async setConnection({ host, globalApiKey }) {
|
||||||
try {
|
try {
|
||||||
|
this.connecting = true
|
||||||
const responde = await axios({
|
const responde = await axios({
|
||||||
method: 'GET',
|
method: 'GET',
|
||||||
baseURL: host,
|
baseURL: host,
|
||||||
@ -47,13 +49,15 @@ export const useAppStore = defineStore('app', {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.connection.valid = false
|
this.connection.valid = false
|
||||||
throw e.response?.data?.response?.message || e.response || e
|
throw e.response?.data?.response?.message || e.response || e
|
||||||
|
} finally {
|
||||||
|
this.connecting = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
async loadInstance(instanceName) {
|
async loadInstance(instanceName) {
|
||||||
try {
|
try {
|
||||||
const { host, globalApiKey } = this.connection;
|
console.log('loadInstance', instanceName)
|
||||||
|
// const { host, globalApiKey } = this.connection;
|
||||||
return this.reconnect()
|
return this.reconnect()
|
||||||
// const response = await axios({
|
// const response = await axios({
|
||||||
// method: 'GET',
|
// method: 'GET',
|
||||||
@ -93,6 +97,8 @@ export const useAppStore = defineStore('app', {
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
this.connection.valid = false
|
this.connection.valid = false
|
||||||
throw e.response?.data?.response?.message || e.response || e
|
throw e.response?.data?.response?.message || e.response || e
|
||||||
|
} finally {
|
||||||
|
this.connecting = false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
@ -152,6 +158,7 @@ export const useAppStore = defineStore('app', {
|
|||||||
const connection = window.localStorage.getItem('connection')
|
const connection = window.localStorage.getItem('connection')
|
||||||
if (connection) {
|
if (connection) {
|
||||||
this.connection = JSON.parse(connection || '{}')
|
this.connection = JSON.parse(connection || '{}')
|
||||||
|
this.connecting = true
|
||||||
return this.reconnect()
|
return this.reconnect()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user