Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nengyuanzhang committed Jun 1, 2023
2 parents 59ba7df + 27f3f9b commit 31c71c2
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 28 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
- changed theme of BarChart and MultiTrendChart in myems-web
- swapped cloumns color in dashboard of myems-web
- compacted distribuition system in myems-web
- updated supported protocols of datasoure in myems-api

### Fixed
- fixed HTTPError Deprecated Warning in myems-api
Expand Down
68 changes: 40 additions & 28 deletions myems-api/core/datasource.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,25 +99,31 @@ def on_post(req, resp):

if 'protocol' not in new_values['data'].keys() \
or new_values['data']['protocol'] not in \
('modbus-tcp',
('bacnet-ip',
'cassandra',
'clickhouse',
'coap'
'controllogix',
'dlt645',
'iec104',
'influxdb',
'lora',
'modbus-rtu',
'bacnet-ip',
's7',
'modbus-tcp',
'mongodb',
'mqtt-seg'
'mqtt',
'mysql',
'opc-ua',
'oracle',
'postgresql',
'profibus',
'profinet',
'opc-ua',
'lora',
's7',
'simulation',
'controllogix',
'weather',
'mysql',
'sqlserver',
'postgresql',
'oracle',
'mongodb',
'influxdb',
'mqtt',
'mqtt-seg'):
'tdengine',
'weather',):
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_DATA_SOURCE_PROTOCOL')
protocol = new_values['data']['protocol']
Expand Down Expand Up @@ -307,25 +313,31 @@ def on_put(req, resp, id_):

if 'protocol' not in new_values['data'].keys() \
or new_values['data']['protocol'] not in \
('modbus-tcp',
('bacnet-ip',
'cassandra',
'clickhouse',
'coap'
'controllogix',
'dlt645',
'iec104',
'influxdb',
'lora',
'modbus-rtu',
'bacnet-ip',
's7',
'modbus-tcp',
'mongodb',
'mqtt-seg'
'mqtt',
'mysql',
'opc-ua',
'oracle',
'postgresql',
'profibus',
'profinet',
'opc-ua',
'lora',
's7',
'simulation',
'controllogix',
'weather',
'mysql',
'sqlserver',
'postgresql',
'oracle',
'mongodb',
'influxdb',
'mqtt',
'mqtt-seg'):
'tdengine',
'weather',):
raise falcon.HTTPError(status=falcon.HTTP_400, title='API.BAD_REQUEST',
description='API.INVALID_DATA_SOURCE_PROTOCOL')
protocol = new_values['data']['protocol']
Expand Down

0 comments on commit 31c71c2

Please sign in to comment.