Wire Azure OCR to central settings toggle; remove redundant Users section
- settings/src/integrations/schema.js: rename azure from 'Azure AD' to 'Azure Document Intelligence', swap fields to endpoint + api_key - Add use_global_azure column (migration + model) - global_settings_service: add azure to check_global_status and apply_global_overrides - api/settings.py: expose use_global_azure in response/update; apply overrides in test_azure_connection before credential check - Settings.tsx: add 'Use credentials from main stack settings' toggle for Azure OCR section (endpoint/key disabled when on, test button enabled when global is configured); remove Users section (managed centrally via auth service), clean up UserData interface, users query and mutations Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
parent
d7898ba897
commit
1564a66283
5 changed files with 44 additions and 161 deletions
|
|
@ -43,6 +43,7 @@ async def check_global_status() -> dict[str, bool]:
|
|||
"newbook": ["api_key"],
|
||||
"resos": ["api_key"],
|
||||
"sambapos": ["password"],
|
||||
"azure": ["api_key"],
|
||||
}
|
||||
results: dict[str, bool] = {}
|
||||
for slug, fields in required.items():
|
||||
|
|
@ -95,3 +96,9 @@ async def apply_global_overrides(settings) -> None:
|
|||
settings.sambapos_db_name = creds.get("database") or settings.sambapos_db_name
|
||||
settings.sambapos_db_username = creds.get("username") or settings.sambapos_db_username
|
||||
settings.sambapos_db_password = creds.get("password") or settings.sambapos_db_password
|
||||
|
||||
if getattr(settings, "use_global_azure", False):
|
||||
creds = await get_global_integration("azure")
|
||||
if creds:
|
||||
settings.azure_endpoint = creds.get("endpoint") or settings.azure_endpoint
|
||||
settings.azure_key = creds.get("api_key") or settings.azure_key
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue