feat(ui): add message cache management page and dashboard enhancements
- 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:
@@ -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"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user