Skip to content

Commit

Permalink
Merge branch 'develop'
Browse files Browse the repository at this point in the history
  • Loading branch information
nengyuanzhang committed Jul 11, 2024
2 parents 3a446d0 + d4b2b15 commit 617f522
Show file tree
Hide file tree
Showing 4 changed files with 343 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
### Added
- added clone action to energy storage container in myems-api
- added export action to energy storage container in myems-api
- added actions for protocol in myems-api
### Changed
- updated tariff price to keep 5 decimal places in database and myems-admin
### Fixed
Expand Down
78 changes: 78 additions & 0 deletions myems-admin/app/translations.js
Original file line number Diff line number Diff line change
Expand Up @@ -1269,6 +1269,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -1416,6 +1419,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -2863,6 +2869,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -3010,6 +3019,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -4454,6 +4466,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -4600,6 +4615,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -6042,6 +6060,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -6189,6 +6210,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -7632,6 +7656,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -7779,6 +7806,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -9222,6 +9252,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -9369,6 +9402,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -10811,6 +10847,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -10958,6 +10997,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -12399,6 +12441,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -12546,6 +12591,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -13985,6 +14033,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -14132,6 +14183,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -15572,6 +15626,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -15719,6 +15776,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -17158,6 +17218,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -17305,6 +17368,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -18745,6 +18811,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -18892,6 +18961,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down Expand Up @@ -20337,6 +20409,9 @@ function config($translateProvider) {
INVALID_PRIVILEGE_DATA: 'Invalid Privilege Data',
INVALID_PRIVILEGE_ID: 'Invalid Privilege ID',
INVALID_PRIVILEGE_NAME: 'Invalid Privilege Name',
INVALID_PROTOCOL_CODE: 'Invalid Protocol Code',
INVALID_PROTOCOL_ID: 'Invalid Protocol ID',
INVALID_PROTOCOL_NAME: 'Invalid Protocol Name',
INVALID_RATIO_VALUE: 'Invalid Ratio Value',
INVALID_RECIPIENT_EMAIL: 'Invalid Recipient Email',
INVALID_RECIPIENT_MOBILE: 'Invalid Recipient Mobile',
Expand Down Expand Up @@ -20484,6 +20559,9 @@ function config($translateProvider) {
POWER_POINT_NOT_FOUND: 'Power Point Not Found',
PRIVILEGE_NAME_IS_ALREADY_IN_USE: 'Privilege Name Is Already In Use',
PRIVILEGE_NOT_FOUND: 'Privilege Not Found',
PROTOCOL_CODE_IS_ALREADY_IN_USE: 'Protocol Code Is Already In Use',
PROTOCOL_NAME_IS_ALREADY_IN_USE: 'Protocol Name Is Already In Use',
PROTOCOL_NOT_FOUND: 'Protocol Not Found',
RULE_NAME_IS_ALREADY_IN_USE: 'Rule Name Is Already In Use',
RULE_NOT_FOUND: 'Rule Not Found',
SELL_METER_NOT_FOUND: 'Sell Meter Not Found',
Expand Down
7 changes: 6 additions & 1 deletion myems-api/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
shopfloor, webmessage, distributionsystem, store, emailmessage, tenanttype, wechatmessage, space, gateway, \
offlinemeter, rule, energycategory, sensor, energyitem, notification, menu, datarepairfile, workingcalendar, \
microgrid, virtualpowerplant, energystoragecontainer, energystoragepowerstation, photovoltaicpowerstation, \
windfarm, energyplanfile, svg
windfarm, energyplanfile, svg, protocol

from reports import advancedreportfile
from reports import combinedequipmentbatch
Expand Down Expand Up @@ -568,6 +568,11 @@
api.add_route('/privileges/{id_}',
privilege.PrivilegeItem())

api.add_route('/protocols',
protocol.ProtocolCollection())
api.add_route('/protocols/{id_}',
protocol.ProtocolItem())

api.add_route('/rules',
rule.RuleCollection())
api.add_route('/rules/{id_}',
Expand Down
Loading

0 comments on commit 617f522

Please sign in to comment.