Hierarchy Builder Instructions
Welcome to the Hierarchy Builder, a tool for managing a hierarchical structure of nodes (Company → Site → Plant → Asset → Collection Point) stored in a PostgreSQL database. Use the tree interface to perform CRUD operations and duplicate nodes.
Getting Started
- View the Hierarchy: The tree on the left displays nodes with their names and levels (e.g., "Acme Corp (Company)"). Expand/collapse nodes to navigate.
- Interact with Nodes: Right-click any node to open a context menu with options: Add Child Node, Edit Node, Duplicate Node, and Delete Node.
Operations
Add a New Node
- Right-click a node (e.g., "NY Plant A") and select Add Child Node.
- In the modal, enter the Node Name (e.g., "New Sensor").
- The Parent Node is pre-filled based on your selection.
- Select a Level from the dropdown (e.g., "Collection Point"). Only valid levels below the parent’s level are available.
- Click Save. The tree will refresh to show the new node.
Edit a Node
- Right-click a node (e.g., "New Sensor") and select Edit Node.
- Update the Node Name or Level in the modal.
- Click Save to apply changes.
Duplicate a Node
- Right-click a node (e.g., "New York Site") and select Duplicate Node.
- Confirm the action. The node and its entire subtree (children, grandchildren, etc.) will be duplicated under the same parent with the suffix "(Copy)" added to the root node’s name.
- The tree will refresh to show the duplicated subtree.
Delete a Node
- Right-click a node and select Delete Node.
- Confirm the action. Only nodes without children can be deleted.
- The tree will refresh, and the node will be removed.
Integration with Grafana
- This tool integrates with a Grafana dashboard using the Interactive Tree Panel.
- In Grafana, ensure the panel uses the query:
SELECT id, parent_id, name FROM hierarchy;
- Map fields: Node ID (
id), Parent ID (parent_id), Node Label (name).
- Enable auto-refresh (e.g., 10 seconds) in Dashboard settings to reflect changes.
Troubleshooting
Support
For issues or enhancements, contact the administrator or check the server logs for detailed error messages.