- Remove hardcoded OPENROUTER_MODEL_CHOICES from openrouter.py
- Add API endpoint /integrations/openrouter/models/ to fetch models dynamically
- Models loaded from OpenRouter API with free models (':free') at top
- Update OpenRouterIntegration model_name field (remove choices, blank=True)
- Add async buildForm() with dynamic_choices support
- Show asterisks (********) for saved API keys with helpful placeholder
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
30 lines
1.0 KiB
Python
30 lines
1.0 KiB
Python
from django.urls import path
|
||
from .views import (
|
||
IntegrationsListView,
|
||
toggle_integration,
|
||
save_integration_settings,
|
||
get_integration_form_data,
|
||
test_integration_connection,
|
||
RecommerceBatchSyncView,
|
||
get_openrouter_models,
|
||
)
|
||
|
||
app_name = 'integrations'
|
||
|
||
urlpatterns = [
|
||
# Страница со списком интеграций
|
||
path("", IntegrationsListView.as_view(), name="list"),
|
||
|
||
# API endpoints для управления интеграциями
|
||
path("toggle/<str:integration_id>/", toggle_integration, name="toggle"),
|
||
path("settings/<str:integration_id>/", save_integration_settings, name="settings"),
|
||
path("form/<str:integration_id>/", get_integration_form_data, name="form_data"),
|
||
path("test/<str:integration_id>/", test_integration_connection, name="test"),
|
||
|
||
# Синхронизация
|
||
path("recommerce/sync/", RecommerceBatchSyncView.as_view(), name="recommerce_sync"),
|
||
|
||
# OpenRouter модели
|
||
path("openrouter/models/", get_openrouter_models, name="openrouter_models"),
|
||
]
|