Skip to content

Commit

Permalink
✨ feat(config): Webhook Domain
Browse files Browse the repository at this point in the history
  • Loading branch information
web-ppanel committed Dec 24, 2024
1 parent 38d5616 commit 01e06c6
Show file tree
Hide file tree
Showing 30 changed files with 118 additions and 24 deletions.
13 changes: 13 additions & 0 deletions apps/admin/app/dashboard/system/telegram.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,19 @@ export default function Telegram() {
return (
<Table>
<TableBody>
<TableRow>
<TableCell>
<Label>{t('webhookDomain')}</Label>
<p className='text-muted-foreground text-xs'>{t('webhookDomainDescription')}</p>
</TableCell>
<TableCell className='text-right'>
<EnhancedInput
placeholder={t('inputPlaceholderWebhookDomain')}
value={data?.telegram_web_hook_domain}
onValueBlur={(value) => updateConfig('telegram_web_hook_domain', value)}
/>
</TableCell>
</TableRow>
<TableRow>
<TableCell>
<Label>{t('botToken')}</Label>
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/cs-CZ/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Po vyplnění se zobrazí na uživatelské straně nebo tam, kde je potřeba",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Úspěšně uloženo"
"saveSuccess": "Úspěšně uloženo",
"webhookDomain": "Doména webhooku",
"webhookDomainDescription": "Zadejte název domény serveru webhooku",
"webhookDomainPlaceholder": "Zadejte název domény serveru webhooku"
},
"tos": {
"saveSuccess": "Uložení bylo úspěšné",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/de-DE/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Nach Eingabe wird sie auf der Benutzerseite angezeigt oder dort verwendet, wo sie benötigt wird",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Erfolgreich gespeichert"
"saveSuccess": "Erfolgreich gespeichert",
"webhookDomain": "Webhook-Domain",
"webhookDomainDescription": "Geben Sie den Domainnamen des Webhook-Servers ein",
"webhookDomainPlaceholder": "Geben Sie den Domainnamen des Webhook-Servers ein"
},
"tos": {
"saveSuccess": "Erfolgreich gespeichert",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/en-US/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "If filled, will be displayed to users or used in required locations",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Save Successful"
"saveSuccess": "Save Successful",
"webhookDomain": "Webhook Domain",
"webhookDomainDescription": "Enter the domain name of the webhook server",
"webhookDomainPlaceholder": "Enter the domain name of the webhook server"
},
"tos": {
"saveSuccess": "Save Successful",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/es-ES/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Al completar, se mostrará en el lado del usuario o se usará donde sea necesario",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Guardado exitosamente"
"saveSuccess": "Guardado exitosamente",
"webhookDomain": "Dominio del Webhook",
"webhookDomainDescription": "Ingrese el nombre de dominio del servidor de webhook",
"webhookDomainPlaceholder": "Ingrese el nombre de dominio del servidor de webhook"
},
"tos": {
"saveSuccess": "Guardado exitosamente",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/es-MX/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Al completar, se mostrará en el lado del usuario o se usará donde sea necesario",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Guardado exitosamente"
"saveSuccess": "Guardado exitosamente",
"webhookDomain": "Dominio del Webhook",
"webhookDomainDescription": "Ingrese el nombre de dominio del servidor de webhook",
"webhookDomainPlaceholder": "Ingrese el nombre de dominio del servidor de webhook"
},
"tos": {
"saveSuccess": "Guardado exitoso",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/fa-IR/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "در صورت پر شدن، به کاربران نمایش داده می‌شود یا در مکان‌های مورد نیاز استفاده می‌شود",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "ذخیره با موفقیت انجام شد"
"saveSuccess": "ذخیره با موفقیت انجام شد",
"webhookDomain": "دامنه وب‌هوک",
"webhookDomainDescription": "نام دامنه سرور وب‌هوک را وارد کنید",
"webhookDomainPlaceholder": "نام دامنه سرور وب‌هوک را وارد کنید"
},
"tos": {
"saveSuccess": "ذخیره با موفقیت انجام شد",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/fi-FI/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Kun tämä on täytetty, se näytetään käyttäjäpuolella tai käytetään tarvittaessa",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Tallennus onnistui"
"saveSuccess": "Tallennus onnistui",
"webhookDomain": "Webhook-verkkotunnus",
"webhookDomainDescription": "Anna webhook-palvelimen verkkotunnuksen nimi",
"webhookDomainPlaceholder": "Anna webhook-palvelimen verkkotunnuksen nimi"
},
"tos": {
"saveSuccess": "Tallennus onnistui",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/fr-FR/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Une fois rempli, il sera affiché ou utilisé là où nécessaire sur le côté utilisateur",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Enregistrement réussi"
"saveSuccess": "Enregistrement réussi",
"webhookDomain": "Domaine du Webhook",
"webhookDomainDescription": "Entrez le nom de domaine du serveur de webhook",
"webhookDomainPlaceholder": "Entrez le nom de domaine du serveur de webhook"
},
"tos": {
"saveSuccess": "Enregistrement réussi",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/hi-IN/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "भरने पर, यह उपयोगकर्ता पक्ष पर प्रदर्शित होगा या आवश्यक स्थानों पर उपयोग किया जाएगा",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "सफलतापूर्वक सहेजा गया"
"saveSuccess": "सफलतापूर्वक सहेजा गया",
"webhookDomain": "वेबहुक डोमेन",
"webhookDomainDescription": "वेबहुक सर्वर के डोमेन नाम को दर्ज करें",
"webhookDomainPlaceholder": "वेबहुक सर्वर के डोमेन नाम को दर्ज करें"
},
"tos": {
"saveSuccess": "सहेजा गया",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/hu-HU/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Kitöltés után megjelenik a felhasználói oldalon vagy ahol szükséges",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Sikeres mentés"
"saveSuccess": "Sikeres mentés",
"webhookDomain": "Webhook Domain",
"webhookDomainDescription": "Adja meg a webhook szerver domain nevét",
"webhookDomainPlaceholder": "Adja meg a webhook szerver domain nevét"
},
"tos": {
"saveSuccess": "Sikeres mentés",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/ja-JP/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "入力すると、ユーザー側に表示されるか必要な場所で使用されます",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "保存に成功しました"
"saveSuccess": "保存に成功しました",
"webhookDomain": "Webhook ドメイン",
"webhookDomainDescription": "Webhook サーバーのドメイン名を入力してください",
"webhookDomainPlaceholder": "Webhook サーバーのドメイン名を入力してください"
},
"tos": {
"saveSuccess": "保存成功",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/ko-KR/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "입력하면 사용자 인터페이스에 표시되거나 필요한 위치에 사용됩니다",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "저장 성공"
"saveSuccess": "저장 성공",
"webhookDomain": "웹훅 도메인",
"webhookDomainDescription": "웹훅 서버의 도메인 이름을 입력하세요",
"webhookDomainPlaceholder": "웹훅 서버의 도메인 이름을 입력하세요"
},
"tos": {
"saveSuccess": "저장 성공",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/no-NO/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Når fylt ut, vil den vises på brukersiden eller brukes der det er nødvendig",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Lagret vellykket"
"saveSuccess": "Lagret vellykket",
"webhookDomain": "Webhook-domene",
"webhookDomainDescription": "Skriv inn domenenavnet til webhook-serveren",
"webhookDomainPlaceholder": "Skriv inn domenenavnet til webhook-serveren"
},
"tos": {
"saveSuccess": "Lagring vellykket",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/pl-PL/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Po wypełnieniu będzie wyświetlany na interfejsie użytkownika lub używany tam, gdzie jest to potrzebne",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Zapisano pomyślnie"
"saveSuccess": "Zapisano pomyślnie",
"webhookDomain": "Domena Webhook",
"webhookDomainDescription": "Wprowadź nazwę domeny serwera webhook",
"webhookDomainPlaceholder": "Wprowadź nazwę domeny serwera webhook"
},
"tos": {
"saveSuccess": "Zapisano pomyślnie",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/pt-BR/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Após preenchido, será exibido no lado do usuário ou usado onde necessário",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Salvo com sucesso"
"saveSuccess": "Salvo com sucesso",
"webhookDomain": "Domínio do Webhook",
"webhookDomainDescription": "Insira o nome de domínio do servidor de webhook",
"webhookDomainPlaceholder": "Insira o nome de domínio do servidor de webhook"
},
"tos": {
"saveSuccess": "Salvo com sucesso",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/ro-RO/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "După completare, va fi afișat pe partea utilizatorului sau utilizat acolo unde este necesar",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Salvare reușită"
"saveSuccess": "Salvare reușită",
"webhookDomain": "Domeniu Webhook",
"webhookDomainDescription": "Introduceți numele de domeniu al serverului webhook",
"webhookDomainPlaceholder": "Introduceți numele de domeniu al serverului webhook"
},
"tos": {
"saveSuccess": "Salvare reușită",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/ru-RU/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "После заполнения будет отображаться на стороне пользователя или использоваться там, где это необходимо",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Успешно сохранено"
"saveSuccess": "Успешно сохранено",
"webhookDomain": "Домен вебхука",
"webhookDomainDescription": "Введите доменное имя сервера вебхука",
"webhookDomainPlaceholder": "Введите доменное имя сервера вебхука"
},
"tos": {
"saveSuccess": "Сохранение успешно",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/th-TH/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "เมื่อกรอกแล้ว จะแสดงในฝั่งผู้ใช้หรือใช้ในตำแหน่งที่ต้องการ",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "บันทึกสำเร็จ"
"saveSuccess": "บันทึกสำเร็จ",
"webhookDomain": "โดเมนของ Webhook",
"webhookDomainDescription": "กรอกชื่อโดเมนของเซิร์ฟเวอร์ webhook",
"webhookDomainPlaceholder": "กรอกชื่อโดเมนของเซิร์ฟเวอร์ webhook"
},
"tos": {
"saveSuccess": "บันทึกสำเร็จ",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/tr-TR/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Doldurulduğunda, kullanıcı arayüzünde gösterilecek veya gerektiği yerlerde kullanılacaktır",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Başarıyla kaydedildi"
"saveSuccess": "Başarıyla kaydedildi",
"webhookDomain": "Webhook Alan Adı",
"webhookDomainDescription": "Webhook sunucusunun alan adını girin",
"webhookDomainPlaceholder": "Webhook sunucusunun alan adını girin"
},
"tos": {
"saveSuccess": "Kaydetme Başarılı",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/uk-UA/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Після заповнення буде відображатися на стороні користувача або використовуватися там, де це потрібно",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Успішно збережено"
"saveSuccess": "Успішно збережено",
"webhookDomain": "Домен вебхука",
"webhookDomainDescription": "Введіть ім'я домену сервера вебхука",
"webhookDomainPlaceholder": "Введіть ім'я домену сервера вебхука"
},
"tos": {
"saveSuccess": "Збережено успішно",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/vi-VN/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "Sau khi điền, sẽ hiển thị ở phía người dùng hoặc sử dụng ở vị trí cần thiết",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "Lưu thành công"
"saveSuccess": "Lưu thành công",
"webhookDomain": "Tên miền Webhook",
"webhookDomainDescription": "Nhập tên miền của máy chủ webhook",
"webhookDomainPlaceholder": "Nhập tên miền của máy chủ webhook"
},
"tos": {
"saveSuccess": "Lưu thành công",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/zh-CN/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "填写后,将在用户端显示或用于需要的位置",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "保存成功"
"saveSuccess": "保存成功",
"webhookDomain": "Webhook 域名",
"webhookDomainDescription": "输入 webhook 服务器的域名",
"webhookDomainPlaceholder": "输入 webhook 服务器的域名"
},
"tos": {
"saveSuccess": "保存成功",
Expand Down
5 changes: 4 additions & 1 deletion apps/admin/locales/zh-HK/system.json
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@
"groupURLDescription": "填寫後,將在用戶端顯示或用於需要的位置",
"inputPlaceholderBotToken": "0000000000:xxxxxxxxx_xxxxxxxxxxxxxxx",
"inputPlaceholderGroupURL": "https://t.me/xxxxxx",
"saveSuccess": "儲存成功"
"saveSuccess": "儲存成功",
"webhookDomain": "Webhook 網域",
"webhookDomainDescription": "輸入 Webhook 伺服器的網域名稱",
"webhookDomainPlaceholder": "輸入 Webhook 伺服器的網域名稱"
},
"tos": {
"saveSuccess": "儲存成功",
Expand Down
2 changes: 1 addition & 1 deletion apps/admin/services/admin/index.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// @ts-ignore

// API 更新时间:
// API 唯一标识:
import * as announcement from './announcement';
Expand Down
8 changes: 8 additions & 0 deletions apps/admin/services/admin/system.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,14 @@ export async function updateRegisterConfig(
});
}

/** setting telegram bot POST /v1/admin/system/setting_telegram_bot */
export async function settingTelegramBot(options?: { [key: string]: any }) {
return request<API.Response & { data?: any }>('/v1/admin/system/setting_telegram_bot', {
method: 'POST',
...(options || {}),
});
}

/** Get site config GET /v1/admin/system/site_config */
export async function getSiteConfig(options?: { [key: string]: any }) {
return request<API.Response & { data?: API.SiteConfig }>('/v1/admin/system/site_config', {
Expand Down
1 change: 1 addition & 0 deletions apps/admin/services/admin/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -762,6 +762,7 @@ declare namespace API {
telegram_bot_token: string;
telegram_group_url: string;
telegram_notify: boolean;
telegram_web_hook_domain: string;
};

type TestEmailSmtpRequest = {
Expand Down
1 change: 1 addition & 0 deletions apps/admin/services/common/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ declare namespace API {
telegram_bot_token: string;
telegram_group_url: string;
telegram_notify: boolean;
telegram_web_hook_domain: string;
};

type Ticket = {
Expand Down
1 change: 1 addition & 0 deletions apps/user/services/common/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -355,6 +355,7 @@ declare namespace API {
telegram_bot_token: string;
telegram_group_url: string;
telegram_notify: boolean;
telegram_web_hook_domain: string;
};

type Ticket = {
Expand Down
1 change: 1 addition & 0 deletions apps/user/services/user/typings.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -498,6 +498,7 @@ declare namespace API {
telegram_bot_token: string;
telegram_group_url: string;
telegram_notify: boolean;
telegram_web_hook_domain: string;
};

type Ticket = {
Expand Down

0 comments on commit 01e06c6

Please sign in to comment.