Update telegram.html

This commit is contained in:
Lizandro Guarnizo
2026-05-22 00:03:06 -05:00
parent d8cbf70593
commit c21fab079d
+11 -11
View File
@@ -281,24 +281,24 @@ function telegramApp() {
},
async testConfig(cfg) {
this.$set(this.testLoading, cfg.ID, true);
this.$set(this.testResult, cfg.ID, '');
this.testLoading[cfg.ID] = true;
this.testResult[cfg.ID] = '';
const res = await fetch(`/app/telegram/${cfg.ID}/test`, { method: 'POST' });
const d = await res.json();
this.$set(this.testOk, cfg.ID, d.ok);
this.$set(this.testResult, cfg.ID, d.ok ? '✅ Mensaje enviado correctamente.' : ('❌ ' + (d.error || 'Error')));
this.$set(this.testLoading, cfg.ID, false);
this.testOk[cfg.ID] = d.ok;
this.testResult[cfg.ID] = d.ok ? '✅ Mensaje enviado correctamente.' : ('❌ ' + (d.error || 'Error'));
this.testLoading[cfg.ID] = false;
},
async setWebhook(cfg) {
this.$set(this.webhookLoading, cfg.ID, true);
this.$set(this.webhookResult, cfg.ID, '');
this.webhookLoading[cfg.ID] = true;
this.webhookResult[cfg.ID] = '';
const res = await fetch(`/app/telegram/${cfg.ID}/set-portal-webhook`, { method: 'POST' });
const d = await res.json();
this.$set(this.webhookOk, cfg.ID, d.ok);
this.$set(this.webhookResult, cfg.ID, d.ok
this.webhookOk[cfg.ID] = d.ok;
this.webhookResult[cfg.ID] = d.ok
? '✅ Webhook registrado: ' + (d.webhook_url || '')
: '❌ Error: ' + (d.telegram?.description || d.error || 'Error desconocido'));
this.$set(this.webhookLoading, cfg.ID, false);
: '❌ Error: ' + (d.telegram?.description || d.error || 'Error desconocido');
this.webhookLoading[cfg.ID] = false;
},
async sendMessage() {