feat(providers): add provider categorization system
- Add ProviderCategory type with official, cn_official, aggregator, third_party, and custom categories - Update Provider interface and Rust struct to include optional category field - Enhance ProviderForm to automatically sync category when selecting presets - Improve PresetSelector to show category-based styling and hints - Add category classification to all provider presets - Support differentiated interactions (e.g., hide API key input for official providers) - Maintain backward compatibility with existing configurations
This commit is contained in:
@@ -14,6 +14,8 @@ pub struct Provider {
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
#[serde(rename = "websiteUrl")]
|
||||
pub website_url: Option<String>,
|
||||
#[serde(skip_serializing_if = "Option::is_none")]
|
||||
pub category: Option<String>,
|
||||
}
|
||||
|
||||
impl Provider {
|
||||
@@ -29,6 +31,7 @@ impl Provider {
|
||||
name,
|
||||
settings_config,
|
||||
website_url,
|
||||
category: None,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user