dever vor 6 Jahren
Ursprung
Commit
531dc31799
1 geänderte Dateien mit 6 neuen und 5 gelöschten Zeilen
  1. 6 5
      admin/page/device.py

+ 6 - 5
admin/page/device.py

@@ -141,11 +141,12 @@ class info_path(Load):
 					type_info = device_type[value['type_id']]
 					if type_info:
 						self.data['list'][key]['type'] = type_info['name']
-				info = gateway[value['gateway_id']]
-				if info:
-					self.data['list'][key]['gateway'] = info['name']
-				else:
-					self.data['list'][key]['gateway'] = '无'
+				self.data['list'][key]['gateway'] = '无'
+				if value['gateway_id'] in gateway:
+					info = gateway[value['gateway_id']]
+					if info:
+						self.data['list'][key]['gateway'] = info['name']
+					
 				if value['status']:
 					self.data['list'][key]['status'] = '已连接'
 				else: