Compare commits
21 Commits
| Author | SHA1 | Date |
|---|---|---|
|
|
78019e8e24 | |
|
|
6c07ba32b0 | |
|
|
ac8566bbb4 | |
|
|
46b002aa06 | |
|
|
e01228e30e | |
|
|
973c93764d | |
|
|
b9bb9ad693 | |
|
|
da908b8f74 | |
|
|
03552606ca | |
|
|
d514835e08 | |
|
|
513f283fa2 | |
|
|
d1ddb67485 | |
|
|
a4d1e9ec0d | |
|
|
dae6d2db2f | |
|
|
28cdf06664 | |
|
|
7d98241028 | |
|
|
6c70ad48a1 | |
|
|
22ef252326 | |
|
|
4d5a7ced33 | |
|
|
f72488e257 | |
|
|
ce1ab06770 |
10
CHANGELOG.md
10
CHANGELOG.md
|
|
@ -5,13 +5,17 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/).
|
|||
|
||||
## [Unreleased]
|
||||
### Added
|
||||
- None.
|
||||
- added API reverse proxy in Apache conf.
|
||||
|
||||
### Changed
|
||||
- None.
|
||||
- replaced true with 1 in SQL statements of myems-api.
|
||||
- updated user insert sql statement for failed_login_count.
|
||||
- updated icons for vertical menu items.
|
||||
- updated acquisition procedure of myems-modbus-tcp.
|
||||
|
||||
### Fixed
|
||||
- None.
|
||||
- fixed typo in virtualmetercarbon.
|
||||
- updated database upgrade1.4.0 sql script
|
||||
|
||||
### Removed
|
||||
- None.
|
||||
|
|
|
|||
|
|
@ -50,6 +50,7 @@ WHERE tv.expression_id = te.id ;
|
|||
|
||||
DROP TABLE IF EXISTS myems_system_db.tbl_variables;
|
||||
DROP TABLE IF EXISTS myems_system_db.tbl_virtual_meters;
|
||||
DROP TABLE IF EXISTS myems_system_db.tbl_expressions;
|
||||
|
||||
ALTER TABLE myems_system_db.tbl_variables_new RENAME myems_system_db.tbl_variables;
|
||||
ALTER TABLE myems_system_db.tbl_virtual_meters_new RENAME myems_system_db.tbl_virtual_meters;
|
||||
|
|
|
|||
|
|
@ -164,7 +164,7 @@ Listen 8001
|
|||
sudo vi /etc/apache2/sites-available/000-default.conf
|
||||
```
|
||||
Add a new 'VirtualHost' as below
|
||||
```xml
|
||||
```
|
||||
<VirtualHost 127.0.0.1:8001>
|
||||
ServerAdmin MyEMS-admin
|
||||
DocumentRoot /var/www/myems-admin
|
||||
|
|
@ -173,9 +173,19 @@ Add a new 'VirtualHost' as below
|
|||
Options FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
Header set Access-Control-Allow-Origin *
|
||||
</Directory>
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
|
||||
<Proxy *>
|
||||
Order Deny,Allow
|
||||
Allow from all
|
||||
</Proxy>
|
||||
ProxyPass /api http://127.0.0.1:8000/
|
||||
ProxyPassReverse /api http://127.0.0.1:8000/
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
|
|
|
|||
|
|
@ -166,8 +166,8 @@ class UserCollection:
|
|||
|
||||
add_row = (" INSERT INTO tbl_users "
|
||||
" (name, uuid, display_name, email, salt, password, is_admin, privilege_id, "
|
||||
" account_expiration_datetime_utc, password_expiration_datetime_utc) "
|
||||
" VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s) ")
|
||||
" account_expiration_datetime_utc, password_expiration_datetime_utc, failed_login_count) "
|
||||
" VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s) ")
|
||||
|
||||
salt = uuid.uuid4().hex
|
||||
password = new_values['data']['password']
|
||||
|
|
@ -182,7 +182,8 @@ class UserCollection:
|
|||
is_admin,
|
||||
privilege_id,
|
||||
account_expiration_datetime,
|
||||
password_expiration_datetime))
|
||||
password_expiration_datetime,
|
||||
0))
|
||||
new_id = cursor.lastrowid
|
||||
cnx.commit()
|
||||
cursor.close()
|
||||
|
|
@ -814,7 +815,7 @@ class ResetPassword:
|
|||
|
||||
query = (" SELECT name "
|
||||
" FROM tbl_users "
|
||||
" WHERE uuid = %s AND is_admin = true ")
|
||||
" WHERE uuid = %s AND is_admin = 1 ")
|
||||
cursor.execute(query, (admin_user_uuid,))
|
||||
row = cursor.fetchone()
|
||||
if row is None:
|
||||
|
|
|
|||
|
|
@ -52,7 +52,7 @@ def access_control(req):
|
|||
description='API.ADMINISTRATOR_SESSION_TIMEOUT')
|
||||
query = (" SELECT name "
|
||||
" FROM tbl_users "
|
||||
" WHERE uuid = %s AND is_admin = true ")
|
||||
" WHERE uuid = %s AND is_admin = 1 ")
|
||||
cursor.execute(query, (admin_user_uuid,))
|
||||
row = cursor.fetchone()
|
||||
cursor.close()
|
||||
|
|
|
|||
|
|
@ -245,8 +245,8 @@ class Reporting:
|
|||
" AND start_datetime_utc >= %s "
|
||||
" AND start_datetime_utc < %s "
|
||||
" ORDER BY start_datetime_utc ")
|
||||
cursor_carbon.execute(query, (virtual_meter['id'], reporting_start_datetime_utc, reporting_end_datetime_utc))
|
||||
rows_virtual_meter_hourly = cursor_carbon.fetchall()
|
||||
cursor_energy.execute(query, (virtual_meter['id'], reporting_start_datetime_utc, reporting_end_datetime_utc))
|
||||
rows_virtual_meter_hourly = cursor_energy.fetchall()
|
||||
|
||||
rows_virtual_meter_periodically = utilities.aggregate_hourly_data_by_period(rows_virtual_meter_hourly,
|
||||
reporting_start_datetime_utc,
|
||||
|
|
|
|||
|
|
@ -194,18 +194,15 @@ def process(logger, data_source_id, host, port):
|
|||
value = result[0]
|
||||
|
||||
if point['object_type'] == 'ANALOG_VALUE':
|
||||
analog_value_list.append({'data_source_id': data_source_id,
|
||||
'point_id': point['id'],
|
||||
analog_value_list.append({'point_id': point['id'],
|
||||
'is_trend': point['is_trend'],
|
||||
'value': Decimal(value) * point['ratio']})
|
||||
elif point['object_type'] == 'ENERGY_VALUE':
|
||||
energy_value_list.append({'data_source_id': data_source_id,
|
||||
'point_id': point['id'],
|
||||
energy_value_list.append({'point_id': point['id'],
|
||||
'is_trend': point['is_trend'],
|
||||
'value': Decimal(value) * point['ratio']})
|
||||
elif point['object_type'] == 'DIGITAL_VALUE':
|
||||
digital_value_list.append({'data_source_id': data_source_id,
|
||||
'point_id': point['id'],
|
||||
digital_value_list.append({'point_id': point['id'],
|
||||
'is_trend': point['is_trend'],
|
||||
'value': int(value) * int(point['ratio'])})
|
||||
|
||||
|
|
|
|||
|
|
@ -230,9 +230,19 @@ Add a new 'VirtualHost' as below
|
|||
Options FollowSymLinks
|
||||
AllowOverride All
|
||||
Require all granted
|
||||
Header set Access-Control-Allow-Origin *
|
||||
</Directory>
|
||||
ErrorLog ${APACHE_LOG_DIR}/error.log
|
||||
CustomLog ${APACHE_LOG_DIR}/access.log combined
|
||||
ProxyRequests Off
|
||||
ProxyPreserveHost On
|
||||
|
||||
<Proxy *>
|
||||
Order Deny,Allow
|
||||
Allow from all
|
||||
</Proxy>
|
||||
ProxyPass /api http://127.0.0.1:8000/
|
||||
ProxyPassReverse /api http://127.0.0.1:8000/
|
||||
</VirtualHost>
|
||||
```
|
||||
|
||||
|
|
@ -266,7 +276,7 @@ sudo vi .htaccess
|
|||
```
|
||||
Add a IfModule as below:
|
||||
```bash
|
||||
IfModule mod_rewrite.c>
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
RewriteBase /
|
||||
RewriteRule ^index\.html$ - [L]
|
||||
|
|
|
|||
|
|
@ -72,6 +72,13 @@ import {
|
|||
faClock,
|
||||
faCodeBranch,
|
||||
faCog,
|
||||
faCogs,
|
||||
faTv,
|
||||
faIndustry,
|
||||
faBuilding,
|
||||
faEye,
|
||||
faTachometerAlt,
|
||||
faFolder,
|
||||
faComments,
|
||||
faCopy,
|
||||
faCrown,
|
||||
|
|
@ -86,7 +93,6 @@ import {
|
|||
faExclamationCircle,
|
||||
faExclamationTriangle,
|
||||
faExternalLinkAlt,
|
||||
faEye,
|
||||
faFileAlt,
|
||||
faFileArchive,
|
||||
faFilePdf,
|
||||
|
|
@ -125,6 +131,7 @@ import {
|
|||
faSearch,
|
||||
faShare,
|
||||
faShareAlt,
|
||||
faShoppingBag,
|
||||
faShoppingCart,
|
||||
faSignInAlt,
|
||||
faSlidersH,
|
||||
|
|
@ -216,6 +223,7 @@ library.add(
|
|||
faFilter,
|
||||
faExternalLinkAlt,
|
||||
faCartPlus,
|
||||
faShoppingBag,
|
||||
faShoppingCart,
|
||||
faStar,
|
||||
faStarHalfAlt,
|
||||
|
|
@ -226,6 +234,12 @@ library.add(
|
|||
faReply,
|
||||
faLocationArrow,
|
||||
faCog,
|
||||
faCogs,
|
||||
faTv,
|
||||
faIndustry,
|
||||
faBuilding,
|
||||
faTachometerAlt,
|
||||
faFolder,
|
||||
faPaperclip,
|
||||
faImage,
|
||||
faEllipsisV,
|
||||
|
|
|
|||
|
|
@ -312,13 +312,13 @@ export const dashboardRoutes = {
|
|||
name: 'Dashboard',
|
||||
to: '/dashboard',
|
||||
exact: true,
|
||||
icon: 'chart-pie'
|
||||
icon: 'tachometer-alt'
|
||||
};
|
||||
|
||||
export const spaceRoutes = {
|
||||
name: 'Space Data',
|
||||
to: '/space',
|
||||
icon: 'chart-pie',
|
||||
icon: 'building',
|
||||
exact: true,
|
||||
children: [
|
||||
{ to: '/space/energycategory', name: 'Energy Category Data' },
|
||||
|
|
@ -336,7 +336,7 @@ export const spaceRoutes = {
|
|||
export const equipmentRoutes = {
|
||||
name: 'Equipment Data',
|
||||
to: '/equipment',
|
||||
icon: 'chart-pie',
|
||||
icon: 'cog',
|
||||
children: [
|
||||
{ to: '/equipment/energycategory', name: 'Energy Category Data' },
|
||||
{ to: '/equipment/energyitem', name: 'Energy Item Data' },
|
||||
|
|
@ -376,7 +376,7 @@ export const meterRoutes = {
|
|||
export const tenantRoutes = {
|
||||
name: 'Tenant Data',
|
||||
to: '/tenant',
|
||||
icon: 'chart-pie',
|
||||
icon: 'user',
|
||||
children: [
|
||||
{ to: '/tenant/energycategory', name: 'Energy Category Data' },
|
||||
{ to: '/tenant/energyitem', name: 'Energy Item Data' },
|
||||
|
|
@ -392,7 +392,7 @@ export const tenantRoutes = {
|
|||
export const storeRoutes = {
|
||||
name: 'Store Data',
|
||||
to: '/store',
|
||||
icon: 'chart-pie',
|
||||
icon: 'shopping-bag',
|
||||
children: [
|
||||
{ to: '/store/energycategory', name: 'Energy Category Data' },
|
||||
{ to: '/store/energyitem', name: 'Energy Item Data' },
|
||||
|
|
@ -407,7 +407,7 @@ export const storeRoutes = {
|
|||
export const shopfloorRoutes = {
|
||||
name: 'Shopfloor Data',
|
||||
to: '/shopfloor',
|
||||
icon: 'chart-pie',
|
||||
icon: 'industry',
|
||||
children: [
|
||||
{ to: '/shopfloor/energycategory', name: 'Energy Category Data' },
|
||||
{ to: '/shopfloor/energyitem', name: 'Energy Item Data' },
|
||||
|
|
@ -422,7 +422,7 @@ export const shopfloorRoutes = {
|
|||
export const combinedEquipmentRoutes = {
|
||||
name: 'Combined Equipment Data',
|
||||
to: '/combinedequipment',
|
||||
icon: 'chart-pie',
|
||||
icon: 'cogs',
|
||||
children: [
|
||||
{ to: '/combinedequipment/energycategory', name: 'Energy Category Data' },
|
||||
{ to: '/combinedequipment/energyitem', name: 'Energy Item Data' },
|
||||
|
|
@ -440,7 +440,7 @@ export const combinedEquipmentRoutes = {
|
|||
export const auxiliarySystemRoutes = {
|
||||
name: 'Auxiliary System',
|
||||
to: '/auxiliarysystem',
|
||||
icon: 'chart-pie',
|
||||
icon: 'tv',
|
||||
children: [
|
||||
{ to: '/auxiliarysystem/energyflowdiagram', name: 'Energy Flow Diagram' },
|
||||
{ to: '/auxiliarysystem/distributionsystem', name: 'Distribution System' }
|
||||
|
|
@ -464,7 +464,7 @@ export const fddRoutes = {
|
|||
export const monitoringRoutes = {
|
||||
name: 'Monitoring',
|
||||
to: '/monitoring',
|
||||
icon: 'chart-pie',
|
||||
icon: 'eye',
|
||||
children: [
|
||||
{ to: '/monitoring/spaceequipments', name: 'Space Equipments' },
|
||||
{ to: '/monitoring/combinedequipments', name: 'Combined Equipments' },
|
||||
|
|
@ -485,7 +485,7 @@ export const knowledgeBaseRoutes = {
|
|||
name: 'Knowledge Base',
|
||||
to: '/knowledgebase',
|
||||
exact: true,
|
||||
icon: 'book'
|
||||
icon: 'folder'
|
||||
};
|
||||
|
||||
export default [
|
||||
|
|
|
|||
Loading…
Reference in New Issue