🏥 Add complete FARMQ Admin Flask application
## Features - 한국어 Flask 관리 인터페이스 with Bootstrap 5 - Headscale과 분리된 독립 데이터베이스 구조 - 약국 관리 시스템 (pharmacy management) - 머신 모니터링 및 상태 관리 - 실시간 대시보드 with 통계 및 알림 - Headscale 사용자명과 약국명 분리 관리 ## Database Architecture - 별도 FARMQ SQLite DB (farmq.sqlite) - Headscale DB와 외래키 충돌 방지 - 느슨한 결합 설계 (ID 참조만 사용) ## UI Components - 반응형 대시보드 with 실시간 통계 - 약국별 머신 상태 모니터링 - 한국어 지역화 및 사용자 친화적 인터페이스 - 머신 온라인/오프라인 상태 표시 (24시간 타임아웃) ## API Endpoints - `/api/sync/machines` - Headscale 머신 동기화 - `/api/sync/users` - Headscale 사용자 동기화 - `/api/pharmacy/<id>/update` - 약국 정보 업데이트 - 대시보드 통계 및 알림 API ## Problem Resolution - Fixed foreign key conflicts preventing Windows client connections - Resolved machine online status detection with proper timeout handling - Separated technical Headscale usernames from business pharmacy names 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
34
farmq-admin/models/__init__.py
Normal file
34
farmq-admin/models/__init__.py
Normal file
@@ -0,0 +1,34 @@
|
||||
"""
|
||||
모델 패키지 초기화
|
||||
Headscale 호환성 모델과 FARMQ 전용 모델 분리
|
||||
"""
|
||||
|
||||
# Headscale 읽기 전용 모델 (외래키 제약조건 없음)
|
||||
from .headscale_models import (
|
||||
User, Node, PreAuthKey, ApiKey, Policy,
|
||||
Base, create_all_tables
|
||||
)
|
||||
|
||||
# FARMQ 전용 모델 (별도 데이터베이스)
|
||||
from .farmq_models import (
|
||||
PharmacyInfo, MachineProfile, MonitoringMetrics, SystemAlert,
|
||||
FarmqDatabaseManager, create_farmq_database_manager,
|
||||
FarmqBase
|
||||
)
|
||||
|
||||
# 하위 호환성을 위한 별칭
|
||||
MachineSpecs = MachineProfile # 기존 이름과의 호환성
|
||||
MonitoringData = MonitoringMetrics # 기존 이름과의 호환성
|
||||
|
||||
__all__ = [
|
||||
# Headscale 모델
|
||||
'User', 'Node', 'PreAuthKey', 'ApiKey', 'Policy',
|
||||
'Base', 'create_all_tables',
|
||||
|
||||
# FARMQ 모델
|
||||
'PharmacyInfo', 'MachineProfile', 'MonitoringMetrics', 'SystemAlert',
|
||||
'FarmqDatabaseManager', 'create_farmq_database_manager', 'FarmqBase',
|
||||
|
||||
# 하위 호환성 별칭
|
||||
'MachineSpecs', 'MonitoringData'
|
||||
]
|
||||
Reference in New Issue
Block a user