add push settings
This commit is contained in:
@@ -18,6 +18,7 @@ export const SYSTEM_SETTING_GROUPS: Record<string, string> = {
|
||||
auth: 'Аутентификация и регистрация',
|
||||
ldap: 'LDAP / Active Directory',
|
||||
messaging: 'Email и SMS',
|
||||
firebase: 'Firebase Push',
|
||||
limits: 'Лимиты и ограничения',
|
||||
media: 'Медиа и файлы'
|
||||
};
|
||||
@@ -166,6 +167,69 @@ export const SYSTEM_SETTING_CATALOG: SystemSettingMeta[] = [
|
||||
{ key: 'SMS_LOGIN', label: 'Логин smsc.ru', group: 'messaging', type: 'text', showWhen: { key: 'SMS_ENABLED', equals: 'true' } },
|
||||
{ key: 'SMS_PASSWORD', label: 'Пароль smsc.ru', group: 'messaging', type: 'text', showWhen: { key: 'SMS_ENABLED', equals: 'true' } },
|
||||
{ key: 'SMS_SENDER', label: 'Имя отправителя SMS', group: 'messaging', type: 'text', hint: 'Опционально, если одобрено провайдером', showWhen: { key: 'SMS_ENABLED', equals: 'true' } },
|
||||
{
|
||||
key: 'FIREBASE_PUSH_ENABLED',
|
||||
label: 'Push-уведомления включены',
|
||||
group: 'firebase',
|
||||
type: 'boolean',
|
||||
hint: 'Отправка push через Firebase Cloud Messaging на зарегистрированные устройства'
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_PROJECT_ID',
|
||||
label: 'Firebase Project ID',
|
||||
group: 'firebase',
|
||||
type: 'text',
|
||||
hint: 'project_id из консоли Firebase и JSON сервисного аккаунта',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_CLIENT_EMAIL',
|
||||
label: 'Service Account Email',
|
||||
group: 'firebase',
|
||||
type: 'text',
|
||||
hint: 'client_email из JSON ключа сервисного аккаунта',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_PRIVATE_KEY',
|
||||
label: 'Service Account Private Key',
|
||||
group: 'firebase',
|
||||
type: 'textarea',
|
||||
hint: 'private_key из JSON. Вставьте как есть — переносы строк сохранятся',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_WEB_API_KEY',
|
||||
label: 'Web API Key',
|
||||
group: 'firebase',
|
||||
type: 'text',
|
||||
hint: 'Публичный ключ для клиентского Firebase SDK (веб и PWA)',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_WEB_APP_ID',
|
||||
label: 'Web App ID',
|
||||
group: 'firebase',
|
||||
type: 'text',
|
||||
hint: 'appId веб-приложения из консоли Firebase',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_WEB_MESSAGING_SENDER_ID',
|
||||
label: 'Messaging Sender ID',
|
||||
group: 'firebase',
|
||||
type: 'text',
|
||||
hint: 'senderId для FCM в браузере',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{
|
||||
key: 'FIREBASE_WEB_VAPID_KEY',
|
||||
label: 'Web Push VAPID Key',
|
||||
group: 'firebase',
|
||||
type: 'text',
|
||||
hint: 'Пара ключей Web Push certificates → Key pair из Firebase Cloud Messaging',
|
||||
showWhen: { key: 'FIREBASE_PUSH_ENABLED', equals: 'true' }
|
||||
},
|
||||
{ key: 'MAX_FAMILY_MEMBERS', label: 'Макс. участников семьи', group: 'limits', type: 'number' },
|
||||
{ key: 'MAX_ACTIVE_SESSIONS', label: 'Макс. активных сессий', group: 'limits', type: 'number' },
|
||||
{ key: 'AVATAR_URL_TTL_MINUTES', label: 'TTL ссылки на аватар', group: 'media', type: 'number', unit: 'мин' }
|
||||
@@ -189,6 +253,8 @@ function parseBooleanValue(value: string) {
|
||||
|
||||
export const MESSAGING_SETTING_KEYS = SYSTEM_SETTING_CATALOG.filter((item) => item.group === 'messaging').map((item) => item.key);
|
||||
|
||||
export const FIREBASE_SETTING_KEYS = SYSTEM_SETTING_CATALOG.filter((item) => item.group === 'firebase').map((item) => item.key);
|
||||
|
||||
export const EMAIL_SETTING_KEYS = SYSTEM_SETTING_CATALOG.filter((item) =>
|
||||
item.key.startsWith('EMAIL_')
|
||||
).map((item) => item.key);
|
||||
|
||||
Reference in New Issue
Block a user