feat: bot config visual editor, chat admin, debug logging, HMAC toggle

This commit is contained in:
Lizandro Guarnizo
2026-06-13 11:24:32 -05:00
parent 774cd829d9
commit dd57cba0e2
4 changed files with 24 additions and 2 deletions
+6
View File
@@ -1375,6 +1375,7 @@ HTML;
['key' => 'whatsapp_verify_token', 'label' => 'Verify Token', 'type' => 'text', 'placeholder' => 'PLM360_WH_...'],
['key' => 'whatsapp_business_account_id', 'label' => 'Business Account ID', 'type' => 'text', 'placeholder' => '920641783052817'],
['key' => 'whatsapp_default_phone_number_id', 'label' => 'Phone Number ID (default)', 'type' => 'text', 'placeholder' => '384710295638401'],
['key' => 'verify_hmac_signature', 'label' => 'Validar firma HMAC de Meta', 'type' => 'checkbox', 'placeholder' => ''],
],
'Inteligencia Artificial' => [
['key' => 'ai_provider', 'label' => 'Proveedor', 'type' => 'select', 'options' => ['mock' => 'Mock (simulado)', 'openai' => 'OpenAI']],
@@ -1423,6 +1424,8 @@ HTML;
.btn-primary{background:#0b3d91;color:#fff;border:none;border-radius:8px;padding:10px 24px;font-size:14px;font-weight:600;cursor:pointer}
.btn-primary:hover{background:#1565c0}
.btn-row{display:flex;justify-content:flex-end;gap:10px;margin-top:18px}
.chk-lbl{display:flex;align-items:center;gap:8px;font-size:13px;font-weight:500;color:#333;cursor:pointer;padding:8px 0}
.chk-lbl input[type=checkbox]{width:18px;height:18px;accent-color:#0b3d91}
.toast{padding:12px 18px;border-radius:8px;font-size:13px;font-weight:600;margin-bottom:16px;text-align:center}
.toast-success{background:#dcfce7;color:#166534;border:1px solid #a3e4bc}
.version-info{margin-top:16px;padding:12px;background:#f8f9fb;border-radius:8px;font-size:12px;color:#888;text-align:center}
@@ -1479,6 +1482,9 @@ HTML;
echo "<textarea class=\"inp\" id=\"{$key}\" name=\"{$key}\" placeholder=\"{$placeholder}\">{$val}</textarea>";
} elseif ($f['type'] === 'number') {
echo "<input class=\"inp\" type=\"number\" id=\"{$key}\" name=\"{$key}\" value=\"{$val}\" placeholder=\"{$placeholder}\">";
} elseif ($f['type'] === 'checkbox') {
$checked = !empty($settings[$key]) ? ' checked' : '';
echo "<label class=\"chk-lbl\"><input type=\"checkbox\" name=\"{$key}\" value=\"1\"{$checked}> {$label}</label>";
} else {
echo "<input class=\"inp\" type=\"{$f['type']}\" id=\"{$key}\" name=\"{$key}\" value=\"{$val}\" placeholder=\"{$placeholder}\">";
}