Похоже работает
This commit is contained in:
@@ -23,6 +23,25 @@ This feature implements two new plugins for the `ss-tools` platform: `DashboardV
|
||||
**Constraints**: Must integrate with existing `PluginBase` and `TaskManager`. Secure storage for API keys.
|
||||
**Scale/Scope**: Support for configurable LLM providers, scheduled tasks, and notification integration.
|
||||
|
||||
## Implementation Notes
|
||||
|
||||
### Screenshot Capture Implementation
|
||||
The screenshot service uses Playwright with Chrome DevTools Protocol (CDP) to avoid font loading timeouts in headless mode. Key implementation details:
|
||||
- **Full Page Capture**: Uses CDP `Page.captureScreenshot` with `captureBeyondViewport: true` and `fromSurface: true`
|
||||
- **Tab Switching**: Implements recursive tab switching to trigger lazy-loaded chart rendering on multi-tab dashboards
|
||||
- **Authentication**: Uses direct UI login flow (navigating to `/login/` and filling credentials) instead of API cookie injection for better reliability
|
||||
- **Resolution**: 1920px width with dynamic full page height calculation
|
||||
|
||||
### Authentication Flow
|
||||
The service authenticates via Playwright UI login rather than API authentication:
|
||||
1. Navigate to `/login/` page
|
||||
2. Fill username/password fields (supports multiple Superset versions)
|
||||
3. Click login button
|
||||
4. Verify successful redirect to `/superset/welcome/`
|
||||
5. Navigate to dashboard with valid session
|
||||
|
||||
This approach is more reliable than API-to-UI cookie injection which was causing 403 Forbidden errors.
|
||||
|
||||
## Constitution Check
|
||||
|
||||
*GATE: Must pass before Phase 0 research. Re-check after Phase 1 design.*
|
||||
@@ -60,7 +79,8 @@ backend/
|
||||
│ │ ├── llm_analysis/ # New Plugin Directory
|
||||
│ │ │ ├── __init__.py
|
||||
│ │ │ ├── plugin.py # Implements DashboardValidationPlugin & DocumentationPlugin
|
||||
│ │ │ ├── service.py # LLM interaction logic
|
||||
│ │ │ ├── service.py # LLM interaction logic + ScreenshotService (CDP, tab switching)
|
||||
│ │ │ ├── scheduler.py # Scheduled validation task handler
|
||||
│ │ │ └── models.py # Pydantic models for LLM config/results
|
||||
│ │ └── git/ # Existing Git Plugin
|
||||
│ │ └── ... # Update for commit message generation
|
||||
|
||||
Reference in New Issue
Block a user