up
This commit is contained in:
@@ -238,7 +238,18 @@ function telegramApp() {
|
||||
|
||||
async loadConfigs() {
|
||||
const res = await fetch('/app/loadtelegram');
|
||||
this.configs = await res.json();
|
||||
const data = await res.json();
|
||||
this.configs = data;
|
||||
// Pre-inicializar claves reactivas para cada config.
|
||||
// Sin esto Alpine.js no detecta las asignaciones dinámicas cfg.ID -> value.
|
||||
const tl = {}, tr = {}, to = {};
|
||||
const wl = {}, wr = {}, wo = {};
|
||||
for (const cfg of data) {
|
||||
tl[cfg.ID] = false; tr[cfg.ID] = ''; to[cfg.ID] = false;
|
||||
wl[cfg.ID] = false; wr[cfg.ID] = ''; wo[cfg.ID] = false;
|
||||
}
|
||||
this.testLoading = tl; this.testResult = tr; this.testOk = to;
|
||||
this.webhookLoading = wl; this.webhookResult = wr; this.webhookOk = wo;
|
||||
},
|
||||
|
||||
openAdd() {
|
||||
|
||||
Reference in New Issue
Block a user