mirror of
				https://github.com/9technologygroup/patchmon.net.git
				synced 2025-10-31 03:53:51 +00:00 
			
		
		
		
	feat(ui): Display machine_id in host details page and enable search
- Added machine_id field to host details page - Backend now returns machine_id in all host queries - Users can search hosts by machine_id - Added hostname index to schema for better performance
This commit is contained in:
		| @@ -185,6 +185,7 @@ router.get("/hosts", authenticateToken, requireViewHosts, async (_req, res) => { | |||||||
| 			// Show all hosts regardless of status | 			// Show all hosts regardless of status | ||||||
| 			select: { | 			select: { | ||||||
| 				id: true, | 				id: true, | ||||||
|  | 				machine_id: true, | ||||||
| 				friendly_name: true, | 				friendly_name: true, | ||||||
| 				hostname: true, | 				hostname: true, | ||||||
| 				ip: true, | 				ip: true, | ||||||
|   | |||||||
| @@ -70,10 +70,12 @@ router.get("/", authenticateToken, async (req, res) => { | |||||||
| 							{ hostname: { contains: searchTerm, mode: "insensitive" } }, | 							{ hostname: { contains: searchTerm, mode: "insensitive" } }, | ||||||
| 							{ friendly_name: { contains: searchTerm, mode: "insensitive" } }, | 							{ friendly_name: { contains: searchTerm, mode: "insensitive" } }, | ||||||
| 							{ ip: { contains: searchTerm, mode: "insensitive" } }, | 							{ ip: { contains: searchTerm, mode: "insensitive" } }, | ||||||
|  | 							{ machine_id: { contains: searchTerm, mode: "insensitive" } }, | ||||||
| 						], | 						], | ||||||
| 					}, | 					}, | ||||||
| 					select: { | 					select: { | ||||||
| 						id: true, | 						id: true, | ||||||
|  | 						machine_id: true, | ||||||
| 						hostname: true, | 						hostname: true, | ||||||
| 						friendly_name: true, | 						friendly_name: true, | ||||||
| 						ip: true, | 						ip: true, | ||||||
|   | |||||||
| @@ -387,6 +387,17 @@ const HostDetail = () => { | |||||||
| 											</div> | 											</div> | ||||||
| 										)} | 										)} | ||||||
|  |  | ||||||
|  | 										{host.machine_id && ( | ||||||
|  | 											<div> | ||||||
|  | 												<p className="text-xs text-secondary-500 dark:text-secondary-300 mb-1.5"> | ||||||
|  | 													Machine ID | ||||||
|  | 												</p> | ||||||
|  | 												<p className="font-medium text-secondary-900 dark:text-white font-mono text-sm break-all"> | ||||||
|  | 													{host.machine_id} | ||||||
|  | 												</p> | ||||||
|  | 											</div> | ||||||
|  | 										)} | ||||||
|  |  | ||||||
| 										<div> | 										<div> | ||||||
| 											<p className="text-xs text-secondary-500 dark:text-secondary-300 mb-1.5"> | 											<p className="text-xs text-secondary-500 dark:text-secondary-300 mb-1.5"> | ||||||
| 												Host Group | 												Host Group | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user