|
@@ -24,12 +24,17 @@ class gateway_path(Load):
|
|
,state = False
|
|
,state = False
|
|
)
|
|
)
|
|
self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
self.data['common']['search_farm_id-select-'] = Demeter.config['setting']['farmList']
|
|
|
|
+
|
|
|
|
+ farm_list = {}
|
|
|
|
+ for value in self.data['common']['search_farm_id-select-']:
|
|
|
|
+ farm_list[value['id']] = value
|
|
|
|
+
|
|
self.commonList('device_gateway')
|
|
self.commonList('device_gateway')
|
|
if self.data['list']:
|
|
if self.data['list']:
|
|
for key, value in enumerate(self.data['list']):
|
|
for key, value in enumerate(self.data['list']):
|
|
- farm = self.service('common').one('farm', id=value['farm_id'])
|
|
|
|
|
|
+ farm = farm_list[value['farm_id']]
|
|
self.data['list'][key]['farm'] = farm['name']
|
|
self.data['list'][key]['farm'] = farm['name']
|
|
- device = self.service('common').list('device_info', search={'hardware_id':value['hardware_id']})
|
|
|
|
|
|
+ device = self.service('common').list('device_info', search={'hardware_id':value['hardware_id'],'hardware_type--ins':(4,5)})
|
|
self.data['list'][key]['status'] = '断开'
|
|
self.data['list'][key]['status'] = '断开'
|
|
self.data['list'][key]['power_status'] = '断开'
|
|
self.data['list'][key]['power_status'] = '断开'
|
|
self.data['list'][key]['power_num'] = 0
|
|
self.data['list'][key]['power_num'] = 0
|