4c1dc4082e
Build and Push Images / build-and-push (push) Has been cancelled
이전 세션들에서 작업된 아래 범위를 모두 포함: Fleet 서브시스템 (src/fleet/) - fleetDeviceService / fleetCommandService / fleetDeploymentService / fleetReleaseService - fleetMetricsService, fleetScriptService, fleetEdgeConfigService - Edge 디바이스 관리, 커맨드 발행, 배포/릴리스, 스크립트 동기화 Collector 확장 - centralMqttForwarder / centralForwarderConfigService - equipmentStateService, pythonHookRunner, scriptCache - Modbus/OPC-UA/S7/XGT 프로토콜 클라이언트 - targetDbIntrospection (저장 DB 조회) Routes / API - automationDashboardRoutes, centralForwarderRoutes, equipmentStateRoutes DB - importEdgeConfig (Python cached config → Pipeline DB) - seedDataSources (external_db_connections 초기 시드) 엣지 배포 리소스 - docker/edge/Dockerfile.backend.prod, Dockerfile.frontend.prod - docker/edge/docker-compose.edge.yml 프론트엔드 - admin/automaticMng (centralForwarder, dashboard, equipmentState) - admin/fleet (commands, devices, deployments, releases, scripts, alerts) - admin/pipeline-device 개선 (저장 DB 드롭다운, 태그 매핑 등) - ExternalDbConnectionModal, ScriptsManagerDialog 등 신규 컴포넌트 - lib/api: automationDashboard, centralForwarder, equipmentState, fleet docs/ - EDGE_SERVER_STRUCTURE, FLEET_COMPLETE, FLEET_EDGE_INTEGRATION, FLEET_HOOK_INTEGRATION Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
52 lines
1.4 KiB
TypeScript
52 lines
1.4 KiB
TypeScript
// Equipment Current State API 클라이언트
|
|
|
|
import { apiClient } from "./client";
|
|
|
|
export interface EquipmentTagState {
|
|
id: number;
|
|
connection_id: number;
|
|
company_code: string;
|
|
tag_name: string;
|
|
tag_display_name: string | null;
|
|
tag_unit: string | null;
|
|
value_numeric: number | null;
|
|
value_text: string | null;
|
|
value_boolean: boolean | null;
|
|
quality: string;
|
|
last_collected_at: string;
|
|
updated_at: string;
|
|
}
|
|
|
|
export interface ConnectionStatusSummary {
|
|
connection_id: number;
|
|
connection_name: string;
|
|
protocol: string;
|
|
host: string;
|
|
port: number;
|
|
connection_status: string;
|
|
last_test_result: string | null;
|
|
last_test_message: string | null;
|
|
last_test_date: string | null;
|
|
company_code: string;
|
|
tag_count: number;
|
|
last_collected_at: string | null;
|
|
good_tag_count: number;
|
|
}
|
|
|
|
const BASE = "/api/equipment-state";
|
|
|
|
export const EquipmentStateAPI = {
|
|
async summary(companyCode?: string): Promise<ConnectionStatusSummary[]> {
|
|
const url = companyCode ? `${BASE}/summary?company_code=${companyCode}` : `${BASE}/summary`;
|
|
const r = await apiClient.get<{ success: boolean; data: ConnectionStatusSummary[] }>(url);
|
|
return r.data.data || [];
|
|
},
|
|
|
|
async tagsByConnection(connectionId: number): Promise<EquipmentTagState[]> {
|
|
const r = await apiClient.get<{ success: boolean; data: EquipmentTagState[] }>(
|
|
`${BASE}/${connectionId}`
|
|
);
|
|
return r.data.data || [];
|
|
},
|
|
};
|