feat(ui): add message cache management page and dashboard enhancements
Some checks failed
CI / Test (1.23) (push) Failing after -30m37s
CI / Test (1.22) (push) Failing after -30m33s
CI / Build (push) Failing after -30m45s
CI / Lint (push) Failing after -30m39s

- Introduced MessageCachePage for browsing and managing cached webhook events.
- Enhanced DashboardPage to display runtime stats and message cache information.
- Added new API types for message cache events and system stats.
- Integrated SwaggerPage for API documentation and live request testing.
This commit is contained in:
2026-03-05 00:32:57 +02:00
parent 4b44340c58
commit 1490e0b596
47 changed files with 4430 additions and 611 deletions

View File

@@ -62,7 +62,7 @@ type WhatsAppConfig struct {
type BusinessAPIConfig struct {
PhoneNumberID string `json:"phone_number_id"`
AccessToken string `json:"access_token"`
WABAId string `json:"waba_id,omitempty"` // WhatsApp Business Account ID (resolved at connect time)
WABAId string `json:"waba_id,omitempty"` // WhatsApp Business Account ID (resolved at connect time)
BusinessAccountID string `json:"business_account_id,omitempty"` // Facebook Business Manager ID (optional)
APIVersion string `json:"api_version,omitempty"` // Default: v21.0
WebhookPath string `json:"webhook_path,omitempty"`
@@ -131,6 +131,7 @@ type MQTTConfig struct {
// MessageCacheConfig holds message cache configuration
type MessageCacheConfig struct {
Enabled bool `json:"enabled"` // Enable message caching
Storage string `json:"storage,omitempty"` // Storage backend: "database" (default) or "disk"
DataPath string `json:"data_path,omitempty"` // Directory to store cached events
MaxAgeDays int `json:"max_age_days,omitempty"` // Maximum age in days before purging (default: 7)
MaxEvents int `json:"max_events,omitempty"` // Maximum number of events to cache (default: 10000)
@@ -207,6 +208,9 @@ func Load(path string) (*Config, error) {
}
// Set message cache defaults
if cfg.MessageCache.Storage == "" {
cfg.MessageCache.Storage = "database"
}
if cfg.MessageCache.DataPath == "" {
cfg.MessageCache.DataPath = "./data/message_cache"
}