Add device page filter
	
		
			
	
		
	
	
		
	
		
			All checks were successful
		
		
	
	
		
			
				
	
				continuous-integration/drone/push Build is passing
				
			
		
		
	
	
				
					
				
			
		
			All checks were successful
		
		
	
	continuous-integration/drone/push Build is passing
				
			This commit is contained in:
		
							parent
							
								
									26017568f0
								
							
						
					
					
						commit
						d7c38191ce
					
				| @ -25,11 +25,12 @@ namespace ManagementPage.Pages | ||||
|             humidity = new List<DataSet>(); | ||||
|             temperature = new List<DataSet>(); | ||||
|             _dbClient = dbClient; | ||||
|             device = new DeviceData("","",0); | ||||
|         } | ||||
| 
 | ||||
|         public async Task<IActionResult> OnGetAsync() | ||||
|         { | ||||
|             var deviceId = 0l ; | ||||
|             var deviceId = 0L; | ||||
|             try | ||||
|             { | ||||
|                 var idString = (string?)RouteData.Values.Where(k => k.Key == "id")?.First().Value; | ||||
|  | ||||
| @ -50,7 +50,7 @@ | ||||
| 
 | ||||
|     <footer class="border-top footer text-muted"> | ||||
|         <div class="container"> | ||||
|             © 2021 - ManagementPage - <a asp-area="" asp-page="/Privacy">Privacy</a> | ||||
|             © 2021 - 51m0n</a> | ||||
|         </div> | ||||
|     </footer> | ||||
| 
 | ||||
|  | ||||
| @ -44,12 +44,9 @@ namespace ManagementPage.Pages | ||||
|             var id = await binder.GetLocalAccount(User.FindFirstValue(ClaimTypes.NameIdentifier)); | ||||
|             name = User.FindFirstValue(ClaimTypes.GivenName); | ||||
| 
 | ||||
|             data.Clear(); | ||||
| 
 | ||||
|             _dbClient.DeviceCollection.AsQueryable().Where(s => id.Devices.Contains(s._id)).ToArray(); | ||||
| 
 | ||||
|             using var cursor = await _dbClient.DeviceCollection.FindAsync(new BsonDocument()); | ||||
|             data = cursor.ToList(); | ||||
| 
 | ||||
|             data.AddRange(_dbClient.DeviceCollection.AsQueryable().Where(s => id.Devices.Contains(s._id)).ToArray()); | ||||
| 
 | ||||
|             foreach (var item in data) | ||||
|             { | ||||
| @ -66,7 +63,7 @@ namespace ManagementPage.Pages | ||||
|             { | ||||
|                 return Page(); | ||||
|             } | ||||
|             var id = BitConverter.ToInt64(Guid.NewGuid().ToByteArray(),4); | ||||
|             var id = BitConverter.ToInt64(Guid.NewGuid().ToByteArray(), 4); | ||||
|             var device = new DeviceData(NewDevice.Name, NewDevice.Passcode, id); | ||||
|             device._id = ObjectId.GenerateNewId(); | ||||
|             await _dbClient.DeviceCollection.InsertOneAsync(device); | ||||
|  | ||||
| @ -14,7 +14,7 @@ | ||||
|       "environmentVariables": { | ||||
|         "ASPNETCORE_ENVIRONMENT": "Development" | ||||
|       }, | ||||
|       "applicationUrl": "https://environment.51m0n.com;http://+:80", | ||||
|       "applicationUrl": "https://localhost:443;http://+:80", | ||||
|       "dotnetRunMessages": true | ||||
|     }, | ||||
|     "IIS Express": { | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user