Admin Dashboard Overview
The Admin Dashboard serves as the central control hub for the Atslegas system. It provides administrators with a high-level view of key circulation, system statistics, and management tools for users and key groups.
Dashboard Overview
The primary dashboard view is designed for quick situational awareness. It integrates real-time data from the backend to visualize the current status of the school's key management system.
Key Statistics
The dashboard displays live counters and indicators for:
- Total Keys: The total inventory managed by the system.
- Active Loans: Keys currently issued to persons.
- System Logs: Recent activity records indicating who took or returned which key.
Activity Calendar
The Activity Calendar is a visual tool used to track key circulation trends over time. It provides a historical view of the previous 7 days and a forward-looking window for scheduled events.
- Calendar Strip: A horizontal view where each day displays the volume of activity.
- Action Badges: Each day shows two primary metrics:
- Issued (Izsniegti): The number of keys given out on that date.
- Returned (Atgriezti): The number of keys returned to storage.
- Selection Details: Clicking a specific day in the calendar updates the "Day Log List," showing a detailed breakdown of every transaction (action, key number, user, and timestamp) for that specific date.
Key Group Management
Key Groups allow administrators to organize keys logically—for example, by school wings, floors, or specific departments (e.g., "Old Wing" or "Science Lab").
Creating a Group
To organize keys into a new group, navigate to the Groups section:
- Click Pievienot jaunu grupu (Add New Group).
- Enter a descriptive name (e.g., "Vecais korpuss").
- The group will be initialized with an empty set of keys and persons, ready for assignment.
Managing Group Assignments
Each group can be modified to include specific keys or authorized persons.
- Atslēgas (Keys): Assign specific key IDs to the group.
- Rediģēt (Edit): Change the group name or basic metadata.
- Dzēst (Delete): Remove the group (this does not delete the keys themselves, only the organizational grouping).
User and Person Management
The dashboard provides interfaces to manage the two types of entities in the system:
- Users: Individuals with system access (Admins or standard users).
- Persons: Faculty or staff members who are eligible to receive keys but may not necessarily have login access to the dashboard.
Administrators can use the User Management panel to:
- Create new administrative accounts.
- Enable or disable user access.
- Review user metadata and assigned roles.
API Integration for Admins
For advanced administrators or for integrating with other school systems, the dashboard interacts with several RESTful endpoints. These can be used programmatically to fetch current state data.
Fetching Dashboard Data
To retrieve the same data used by the dashboard programmatically, send a GET request to the user and group list endpoints:
GET /api/user/list
GET /api/keyGroup/list
Adding a Group via API
You can create groups programmatically by sending a JSON payload to the API:
Example Request:
curl -X POST http://<server-url>/api/keyGroup/add \
-H "Content-Type: application/json" \
-d '{
"name": "New Wing",
"users": [],
"keys": [],
"persons": []
}'
Response Types:
| Status Code | Description |
| :--- | :--- |
| 201 Created | Group successfully added. |
| 400 Bad Request | Validation error (e.g., name too long). |
| 401 Unauthorized | Session expired or insufficient permissions. |
Session Security
The Admin Dashboard includes an automatic timeout mechanism. If the dashboard is left idle for the duration specified in config.json (default: 3600 seconds), the session will be invalidated, and the administrator will be redirected to the login page to ensure system security.