feat: GeViScope SDK integration with C# Bridge and Flutter app
- Add GeViScope Bridge (C# .NET 8.0) on port 7720 - Full SDK wrapper for camera control, PTZ, actions/events - 17 REST API endpoints for GeViScope server interaction - Support for MCS (Media Channel Simulator) with 16 test channels - Real-time action/event streaming via PLC callbacks - Add GeViServer Bridge (C# .NET 8.0) on port 7710 - Integration with GeViSoft orchestration layer - Input/output control and event management - Update Python API with new routers - /api/geviscope/* - Proxy to GeViScope Bridge - /api/geviserver/* - Proxy to GeViServer Bridge - /api/excel/* - Excel import functionality - Add Flutter app GeViScope integration - GeViScopeRemoteDataSource with 17 API methods - GeViScopeBloc for state management - GeViScopeScreen with PTZ controls - App drawer navigation to GeViScope - Add SDK documentation (extracted from PDFs) - GeViScope SDK docs (7 parts + action reference) - GeViSoft SDK docs (12 chunks) - Add .mcp.json for Claude Code MCP server config Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -1,13 +1,15 @@
|
||||
/// Simple in-memory token storage for web (when secure storage fails)
|
||||
import 'dart:html' as html;
|
||||
|
||||
/// Token storage for web using localStorage to persist across page reloads
|
||||
class TokenManager {
|
||||
static final TokenManager _instance = TokenManager._internal();
|
||||
factory TokenManager() => _instance;
|
||||
TokenManager._internal();
|
||||
|
||||
String? _accessToken;
|
||||
String? _refreshToken;
|
||||
String? _username;
|
||||
String? _userRole;
|
||||
static const String _accessTokenKey = 'auth_access_token';
|
||||
static const String _refreshTokenKey = 'auth_refresh_token';
|
||||
static const String _usernameKey = 'auth_username';
|
||||
static const String _userRoleKey = 'auth_user_role';
|
||||
|
||||
void saveTokens({
|
||||
String? accessToken,
|
||||
@@ -15,21 +17,29 @@ class TokenManager {
|
||||
String? username,
|
||||
String? userRole,
|
||||
}) {
|
||||
if (accessToken != null) _accessToken = accessToken;
|
||||
if (refreshToken != null) _refreshToken = refreshToken;
|
||||
if (username != null) _username = username;
|
||||
if (userRole != null) _userRole = userRole;
|
||||
if (accessToken != null) {
|
||||
html.window.localStorage[_accessTokenKey] = accessToken;
|
||||
}
|
||||
if (refreshToken != null) {
|
||||
html.window.localStorage[_refreshTokenKey] = refreshToken;
|
||||
}
|
||||
if (username != null) {
|
||||
html.window.localStorage[_usernameKey] = username;
|
||||
}
|
||||
if (userRole != null) {
|
||||
html.window.localStorage[_userRoleKey] = userRole;
|
||||
}
|
||||
}
|
||||
|
||||
String? get accessToken => _accessToken;
|
||||
String? get refreshToken => _refreshToken;
|
||||
String? get username => _username;
|
||||
String? get userRole => _userRole;
|
||||
String? get accessToken => html.window.localStorage[_accessTokenKey];
|
||||
String? get refreshToken => html.window.localStorage[_refreshTokenKey];
|
||||
String? get username => html.window.localStorage[_usernameKey];
|
||||
String? get userRole => html.window.localStorage[_userRoleKey];
|
||||
|
||||
void clear() {
|
||||
_accessToken = null;
|
||||
_refreshToken = null;
|
||||
_username = null;
|
||||
_userRole = null;
|
||||
html.window.localStorage.remove(_accessTokenKey);
|
||||
html.window.localStorage.remove(_refreshTokenKey);
|
||||
html.window.localStorage.remove(_usernameKey);
|
||||
html.window.localStorage.remove(_userRoleKey);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user