Node
Palito의 노드에서 사용되는 데이터 타입으로써, 최하위 데이터 타입입니다. 각 노드의 컴포넌트 이름, IP, 타입, 연결 정보 등을 담고 있습니다.
정의 예시
Node = {
id: string;
type: string;
position: {
x: number;
y: number;
};
data: {
component_name: string;
type: string;
security_zone: string;
ip_address: string;
system_category: string;
other_system_connection: {
id: string;
type: string; // 예: "Default", "Internet"
}[];
};
measured: {
width: number;
height: number;
};
selected?: boolean;
parentId?: string;
extent?: "parent";
};
필드 설명
| 필드명 | 타입 | 설명 |
|---|---|---|
id | string | 노드를 식별하는 유니크한 ID |
type | string | 노드 유형 (예: "custom", "node", "cbs") |
position | { x: number, y: number } | 노드의 좌표 위치 |
data | object | 노드의 핵심 데이터 정보 |
data.component_name | string | 자산 이름 (예: "Router") |
data.type | string | 자산 유형 (예: "PLC", "Camera") |
data.security_zone | string | 자산이 속한 보안 Zone ID |
data.ip_address | string | 자산의 IP 주소 |
data.system_category | string | 자산의 시스템 분류 (예: "Network", "Other") |
data.other_system_connection | { id: string; type: string; }[] | 연결된 다른 자산 목록 (Source 기준) |
measured | { width: number, height: number } | 실제 측정된 노드 크기 |
selected | boolean? | 현재 선택된 상태 여부 (선택적) |
parentId | string? | 상위 그룹 노드 ID (cbs 또는 zone 등) |
extent | "parent"? | 위치 제한 플래그 (부모 존재 시 "parent", 없으면 생략 가능) |
사용 예시
{
"id": "117",
"type": "custom",
"position": {
"x": 230,
"y": 505
},
"data": {
"component_name": "Router",
"type": "Router",
"security_zone": "zone-6",
"ip_address": "192.168.0.1",
"system_category": "Network",
"other_system_connection": [
{
"id": "114",
"type": "Default"
}
]
},
"measured": {
"width": 80,
"height": 100
},
"selected": false,
"parentId": "112",
"extent": "parent"
}