mirror of
https://github.com/EvolutionAPI/evolution-api.git
synced 2025-12-19 03:42:23 -06:00
feat: Added env var QRCODE_COLOR
This commit is contained in:
@@ -105,7 +105,7 @@ export type GlobalWebhook = {
|
||||
export type SslConf = { PRIVKEY: string; FULLCHAIN: string };
|
||||
export type Webhook = { GLOBAL?: GlobalWebhook; EVENTS: EventsWebhook };
|
||||
export type ConfigSessionPhone = { CLIENT: string; NAME: string };
|
||||
export type QrCode = { LIMIT: number };
|
||||
export type QrCode = { LIMIT: number; COLOR: string };
|
||||
export type Production = boolean;
|
||||
|
||||
export interface Env {
|
||||
@@ -245,6 +245,7 @@ export class ConfigService {
|
||||
},
|
||||
QRCODE: {
|
||||
LIMIT: Number.parseInt(process.env.QRCODE_LIMIT) || 30,
|
||||
COLOR: process.env.QRCODE_COLOR || '#198754',
|
||||
},
|
||||
AUTHENTICATION: {
|
||||
TYPE: process.env.AUTHENTICATION_TYPE as 'jwt',
|
||||
|
||||
@@ -122,6 +122,7 @@ CONFIG_SESSION_PHONE:
|
||||
# Set qrcode display limit
|
||||
QRCODE:
|
||||
LIMIT: 30
|
||||
COLOR: '#198754'
|
||||
|
||||
# Defines an authentication type for the api
|
||||
# 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.instance.qrcode.count++;
|
||||
|
||||
const color = this.configService.get<QrCode>('QRCODE').COLOR;
|
||||
|
||||
const optsQrcode: QRCodeToDataURLOptions = {
|
||||
margin: 3,
|
||||
scale: 4,
|
||||
errorCorrectionLevel: 'H',
|
||||
color: { light: '#ffffff', dark: '#198754' },
|
||||
color: { light: '#ffffff', dark: color },
|
||||
};
|
||||
|
||||
if (this.phoneNumber) {
|
||||
|
||||
Reference in New Issue
Block a user