Files
geutebruck/.playwright-mcp/check_api_data.mjs
Administrator 14893e62a5 feat: Geutebruck GeViScope/GeViSoft Action Mapping System - MVP
This MVP release provides a complete full-stack solution for managing action mappings
in Geutebruck's GeViScope and GeViSoft video surveillance systems.

## Features

### Flutter Web Application (Port 8081)
- Modern, responsive UI for managing action mappings
- Action picker dialog with full parameter configuration
- Support for both GSC (GeViScope) and G-Core server actions
- Consistent UI for input and output actions with edit/delete capabilities
- Real-time action mapping creation, editing, and deletion
- Server categorization (GSC: prefix for GeViScope, G-Core: prefix for G-Core servers)

### FastAPI REST Backend (Port 8000)
- RESTful API for action mapping CRUD operations
- Action template service with comprehensive action catalog (247 actions)
- Server management (G-Core and GeViScope servers)
- Configuration tree reading and writing
- JWT authentication with role-based access control
- PostgreSQL database integration

### C# SDK Bridge (gRPC, Port 50051)
- Native integration with GeViSoft SDK (GeViProcAPINET_4_0.dll)
- Action mapping creation with correct binary format
- Support for GSC and G-Core action types
- Proper Camera parameter inclusion in action strings (fixes CrossSwitch bug)
- Action ID lookup table with server-specific action IDs
- Configuration reading/writing via SetupClient

## Bug Fixes
- **CrossSwitch Bug**: GSC and G-Core actions now correctly display camera/PTZ head parameters in GeViSet
- Action strings now include Camera parameter: `@ PanLeft (Comment: "", Camera: 101028)`
- Proper filter flags and VideoInput=0 for action mappings
- Correct action ID assignment (4198 for GSC, 9294 for G-Core PanLeft)

## Technical Stack
- **Frontend**: Flutter Web, Dart, Dio HTTP client
- **Backend**: Python FastAPI, PostgreSQL, Redis
- **SDK Bridge**: C# .NET 8.0, gRPC, GeViSoft SDK
- **Authentication**: JWT tokens
- **Configuration**: GeViSoft .set files (binary format)

## Credentials
- GeViSoft/GeViScope: username=sysadmin, password=masterkey
- Default admin: username=admin, password=admin123

## Deployment
All services run on localhost:
- Flutter Web: http://localhost:8081
- FastAPI: http://localhost:8000
- SDK Bridge gRPC: localhost:50051
- GeViServer: localhost (default port)

Generated with Claude Code (https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
2025-12-31 18:10:54 +01:00

119 lines
4.2 KiB
JavaScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import { chromium } from 'playwright';
(async () => {
console.log('=== Checking API Data vs App Display ===\n');
const browser = await chromium.launch({ headless: false, slowMo: 300 });
const context = await browser.newContext();
const page = await context.newPage();
let apiData = null;
// Capture API response
page.on('response', async (response) => {
const url = response.url();
if (url.includes('/api/v1/configuration/action-mappings') && response.request().method() === 'GET') {
try {
const json = await response.json();
apiData = json;
console.log('✅ Captured API Response');
console.log(`Total mappings: ${json.mappings?.length || 0}\n`);
} catch (e) {
console.log('❌ Failed to parse API response');
}
}
});
try {
console.log('1⃣ Logging in...');
await page.goto('http://100.81.138.77:8081/', { waitUntil: 'networkidle', timeout: 60000 });
await page.waitForTimeout(2000);
await page.click('body');
await page.waitForTimeout(500);
await page.keyboard.press('Tab');
await page.waitForTimeout(300);
await page.keyboard.type('admin', { delay: 50 });
await page.waitForTimeout(300);
await page.keyboard.press('Tab');
await page.waitForTimeout(300);
await page.keyboard.type('admin123', { delay: 50 });
await page.waitForTimeout(300);
await page.keyboard.press('Enter');
await page.waitForTimeout(4000);
console.log('✅ Logged in\n');
console.log('2⃣ Navigating to Action Mappings...');
await page.goto('http://100.81.138.77:8081/#/action-mappings', { waitUntil: 'networkidle', timeout: 60000 });
await page.waitForTimeout(2000);
console.log('3⃣ Triggering download from server...');
// Tab to download button
for (let i = 0; i < 3; i++) {
await page.keyboard.press('Tab');
await page.waitForTimeout(300);
}
await page.keyboard.press('Enter');
await page.waitForTimeout(8000);
console.log('✅ Download completed\n');
// Find the specific mapping in API response
if (apiData && apiData.mappings) {
const mapping = apiData.mappings.find(m => m.name === 'GeVi PanLeft_101027');
if (mapping) {
console.log('📋 API Data for "GeVi PanLeft_101027":');
console.log('=' .repeat(70));
console.log(`ID: ${mapping.id}`);
console.log(`Name: ${mapping.name}`);
console.log(`\nInput Actions:`);
if (mapping.input_actions && mapping.input_actions.length > 0) {
mapping.input_actions.forEach((input, idx) => {
console.log(` ${idx + 1}. Action: ${input.action}`);
console.log(` Parameters:`, JSON.stringify(input.parameters, null, 6));
});
}
console.log(`\nOutput Actions:`);
if (mapping.output_actions && mapping.output_actions.length > 0) {
mapping.output_actions.forEach((output, idx) => {
console.log(` ${idx + 1}. Action: ${output.action}`);
console.log(` Parameters:`, JSON.stringify(output.parameters, null, 6));
});
}
console.log('=' .repeat(70));
} else {
console.log('❌ Mapping "GeVi PanLeft_101027" NOT FOUND in API response');
}
}
console.log('\n4⃣ Checking what app displays...');
await page.screenshot({ path: 'api-check-list.png', fullPage: true });
// Try to find and click on the mapping
const mappingText = await page.getByText('GeVi PanLeft_101027').first();
if (await mappingText.count() > 0) {
console.log('✅ Found "GeVi PanLeft_101027" in app UI');
// Try to get the displayed output actions
const card = mappingText.locator('xpath=ancestor::div[contains(@class, "card") or contains(@class, "Card")]').first();
const cardText = await card.textContent();
console.log('\n📱 App Display:');
console.log('=' .repeat(70));
console.log(cardText);
console.log('=' .repeat(70));
} else {
console.log('❌ "GeVi PanLeft_101027" NOT FOUND in app UI');
}
} catch (error) {
console.error('\n💥 ERROR:', error.message);
}
await page.waitForTimeout(3000);
await browser.close();
console.log('\n✅ Check complete! Screenshot saved to api-check-list.png');
})();