mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-07-14 09:51:24 -06:00
feat: Added env var QRCODE_COLOR
This commit is contained in:
parent
aefe6a5943
commit
b88656829e
@ -5,6 +5,7 @@
|
|||||||
* New instance manager in /manager route
|
* New instance manager in /manager route
|
||||||
* Added extra files for chatwoot and appsmith
|
* Added extra files for chatwoot and appsmith
|
||||||
* Added Get Last Message and Archive for Chat
|
* Added Get Last Message and Archive for Chat
|
||||||
|
* Added env var QRCODE_COLOR
|
||||||
|
|
||||||
### Fixed
|
### Fixed
|
||||||
|
|
||||||
|
@ -84,6 +84,7 @@ CONFIG_SESSION_PHONE_NAME=chrome
|
|||||||
|
|
||||||
# Set qrcode display limit
|
# Set qrcode display limit
|
||||||
QRCODE_LIMIT=30
|
QRCODE_LIMIT=30
|
||||||
|
QRCODE_COLOR=#198754
|
||||||
|
|
||||||
# Defines an authentication type for the api
|
# Defines an authentication type for the api
|
||||||
# We recommend using the apikey because it will allow you to use a custom token,
|
# We recommend using the apikey because it will allow you to use a custom token,
|
||||||
|
@ -83,6 +83,7 @@ ENV CONFIG_SESSION_PHONE_CLIENT=EvolutionAPI
|
|||||||
ENV CONFIG_SESSION_PHONE_NAME=chrome
|
ENV CONFIG_SESSION_PHONE_NAME=chrome
|
||||||
|
|
||||||
ENV QRCODE_LIMIT=30
|
ENV QRCODE_LIMIT=30
|
||||||
|
ENV QRCODE_COLOR=#198754
|
||||||
|
|
||||||
ENV AUTHENTICATION_TYPE=apikey
|
ENV AUTHENTICATION_TYPE=apikey
|
||||||
|
|
||||||
|
@ -105,7 +105,7 @@ export type GlobalWebhook = {
|
|||||||
export type SslConf = { PRIVKEY: string; FULLCHAIN: string };
|
export type SslConf = { PRIVKEY: string; FULLCHAIN: string };
|
||||||
export type Webhook = { GLOBAL?: GlobalWebhook; EVENTS: EventsWebhook };
|
export type Webhook = { GLOBAL?: GlobalWebhook; EVENTS: EventsWebhook };
|
||||||
export type ConfigSessionPhone = { CLIENT: string; NAME: string };
|
export type ConfigSessionPhone = { CLIENT: string; NAME: string };
|
||||||
export type QrCode = { LIMIT: number };
|
export type QrCode = { LIMIT: number; COLOR: string };
|
||||||
export type Production = boolean;
|
export type Production = boolean;
|
||||||
|
|
||||||
export interface Env {
|
export interface Env {
|
||||||
@ -245,6 +245,7 @@ export class ConfigService {
|
|||||||
},
|
},
|
||||||
QRCODE: {
|
QRCODE: {
|
||||||
LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30,
|
LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30,
|
||||||
|
COLOR: process.env.QRCODE_COLOR || '#198754',
|
||||||
},
|
},
|
||||||
AUTHENTICATION: {
|
AUTHENTICATION: {
|
||||||
TYPE: process.env.AUTHENTICATION_TYPE as 'jwt',
|
TYPE: process.env.AUTHENTICATION_TYPE as 'jwt',
|
||||||
|
@ -122,6 +122,7 @@ CONFIG_SESSION_PHONE:
|
|||||||
# Set qrcode display limit
|
# Set qrcode display limit
|
||||||
QRCODE:
|
QRCODE:
|
||||||
LIMIT: 30
|
LIMIT: 30
|
||||||
|
COLOR: '#198754'
|
||||||
|
|
||||||
# Defines an authentication type for the api
|
# Defines an authentication type for the api
|
||||||
# We recommend using the apikey because it will allow you to use a custom token,
|
# We recommend using the apikey because it will allow you to use a custom token,
|
||||||
|
@ -597,11 +597,13 @@ export class WAStartupService {
|
|||||||
this.logger.verbose('Incrementing QR code count');
|
this.logger.verbose('Incrementing QR code count');
|
||||||
this.instance.qrcode.count++;
|
this.instance.qrcode.count++;
|
||||||
|
|
||||||
|
const color = this.configService.get<QrCode>('QRCODE').COLOR;
|
||||||
|
|
||||||
const optsQrcode: QRCodeToDataURLOptions = {
|
const optsQrcode: QRCodeToDataURLOptions = {
|
||||||
margin: 3,
|
margin: 3,
|
||||||
scale: 4,
|
scale: 4,
|
||||||
errorCorrectionLevel: 'H',
|
errorCorrectionLevel: 'H',
|
||||||
color: { light: '#ffffff', dark: '#198754' },
|
color: { light: '#ffffff', dark: color },
|
||||||
};
|
};
|
||||||
|
|
||||||
if (this.phoneNumber) {
|
if (this.phoneNumber) {
|
||||||
|
Loading…
Reference in New Issue
Block a user