Merge pull request #1 from MyEMS/master

catch up with the main site.
pull/67/MERGE
Winnerineast Lee 2021-10-02 19:47:37 +08:00 committed by GitHub
commit aa7db89bb9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
15 changed files with 160 additions and 162 deletions

View File

@ -106,24 +106,28 @@ git clone https://gitee.com/myems/myems.git
```
修改以下文件中的数据库IP
假定数据库IP为: 192.168.2.2
假定数据库IP为: 192.168.0.1
```
sudo nano myems-api/config.py
sudo nano myems-aggregation/config.py
sudo nano myems-cleaning/config.py
sudo nano myems-modbus-tcp/config.py
sudo nano myems-normalization/config.py
# host: '127.0.0.1' => 'host': '192.168.2.2'
```
~~'host': '127.0.0.1'~~
'host': '192.168.0.1'
修改web和admin文件夹下nginx.conf中的location '/api'
假定本机IP为: 192.168.2.3
假定本机IP为: 192.168.0.2
```
sudo nano admin/nginx.conf
sudo nano web/nginx.conf
# proxy_pass http://127.0.0.1:8000/; => proxy_pass http://192.168.2.3:8000/;
```
~~proxy_pass http://127.0.0.1:8000/;~~
proxy_pass http://192.168.0.2:8000/;
将Web打包生成产品文件
```

View File

@ -107,24 +107,28 @@ git clone https://gitee.com/myems/myems.git
```
Ändern Sie die Datenbankkonfiguration in den folgenden Dateien
Angenommen, die Datenbank-IP lautet 192.168.2.2
Angenommen, die Datenbank-IP lautet 192.168.0.1
```
sudo nano myems-api/config.py
sudo nano myems-aggregation/config.py
sudo nano myems-cleaning/config.py
sudo nano myems-modbus-tcp/config.py
sudo nano myems-normalization/config.py
# host: '127.0.0.1' => 'host': '192.168.2.2'
```
~~'host': '127.0.0.1'~~
'host': '192.168.0.1'
Ändern Sie den location '/api' von nginx.conf in web und admin
Angenommen, die Host-IP lautet 192.168.2.3
Angenommen, die Host-IP lautet 192.168.0.2
```
sudo nano admin/nginx.conf
sudo nano web/nginx.conf
# proxy_pass http://127.0.0.1:8000/; => proxy_pass http://192.168.2.3:8000/;
```
~~proxy_pass http://127.0.0.1:8000/;~~
proxy_pass http://192.168.0.2:8000/;
Verpacken Sie das web, um Produktdateien zu generieren
```

View File

@ -106,23 +106,28 @@ git clone https://gitee.com/myems/myems.git
```
Modify Database IP in the following files
Assume the Database IP is 192.168.2.2
Assume the Database IP is 192.168.0.1
```
sudo nano myems-api/config.py
sudo nano myems-aggregation/config.py
sudo nano myems-cleaning/config.py
sudo nano myems-modbus-tcp/config.py
sudo nano myems-normalization/config.py
# host: '127.0.0.1' => 'host': '192.168.2.2'
```
~~'host': '127.0.0.1'~~
'host': '192.168.0.1'
Modify location '/api' in nginx.conf of web and admin
Assume the Host IP is 192.168.2.3
Assume the Host IP is 192.168.0.2
```
sudo nano admin/nginx.conf
sudo nano web/nginx.conf
# proxy_pass http://127.0.0.1:8000/; => proxy_pass http://192.168.2.3:8000/;
```
~~proxy_pass http://127.0.0.1:8000/;~~
proxy_pass http://192.168.0.2:8000/;
Build web for production
```

View File

@ -110,24 +110,23 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Space:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = space_name
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "~" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['B5'].alignment = b_r_alignment
ws['B5'] = 'Reporting End Datetime:'
ws['C5'].border = b_border
ws['C5'].alignment = b_c_alignment
ws['C5'] = reporting_end_datetime_local
# Title
ws['B6'].border = f_border

View File

@ -110,24 +110,23 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Space:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = space_name
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Datetime:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "~" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['B5'].alignment = b_r_alignment
ws['B5'] = 'Reporting End Datetime:'
ws['C5'].border = b_border
ws['C5'].alignment = b_c_alignment
ws['C5'] = reporting_end_datetime_local
# Title
ws['B6'].border = f_border

View File

@ -110,24 +110,23 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Space:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = space_name
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Datetime:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "~" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['B5'].alignment = b_r_alignment
ws['B5'] = 'Reporting End Datetime:'
ws['C5'].border = b_border
ws['C5'].alignment = b_c_alignment
ws['C5'] = reporting_end_datetime_local
# Title
ws['B6'].border = f_border

View File

@ -110,24 +110,23 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Space:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = space_name
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Datetime:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "~" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['B5'].alignment = b_r_alignment
ws['B5'] = 'Reporting End Datetime:'
ws['C5'].border = b_border
ws['C5'].alignment = b_c_alignment
ws['C5'] = reporting_end_datetime_local
# Title
ws['B6'].border = f_border

View File

@ -120,31 +120,29 @@ def generate_excel(report,
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Name:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = name
ws['D3'].font = name_font
ws['D3'].alignment = b_r_alignment
ws['D3'] = 'Period:'
ws['E3'].border = b_border
ws['E3'].alignment = b_c_alignment
ws['E3'].font = name_font
ws['E3'] = period_type
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "__" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['D4'].alignment = b_r_alignment
ws['D4'] = 'Reporting End Datetime:'
ws['E4'].border = b_border
ws['E4'].alignment = b_c_alignment
ws['E4'] = reporting_end_datetime_local
if "reporting_period" not in report.keys() or \
"names" not in report['reporting_period'].keys() or len(report['reporting_period']['names']) == 0:

View File

@ -120,32 +120,29 @@ def generate_excel(report,
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Name:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = name
ws['D3'].font = name_font
ws['D3'].alignment = b_r_alignment
ws['D3'] = 'Period:'
ws['E3'].border = b_border
ws['E3'].alignment = b_c_alignment
ws['E3'].font = name_font
ws['E3'] = period_type
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local[:10] + "__" + reporting_end_datetime_local[:10]
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['D4'].alignment = b_r_alignment
ws['D4'] = 'Reporting End Datetime:'
ws['E4'].border = b_border
ws['E4'].alignment = b_c_alignment
ws['E4'] = reporting_end_datetime_local
if "reporting_period" not in report.keys() or \
"names" not in report['reporting_period'].keys() or len(report['reporting_period']['names']) == 0:

View File

@ -117,32 +117,29 @@ def generate_excel(report,
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Name:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = name
ws['D3'].font = name_font
ws['D3'].alignment = b_r_alignment
ws['D3'] = 'Period:'
ws['E3'].border = b_border
ws['E3'].alignment = b_c_alignment
ws['E3'].font = name_font
ws['E3'] = period_type
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "__" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['D4'].alignment = b_r_alignment
ws['D4'] = 'Reporting End Datetime:'
ws['E4'].border = b_border
ws['E4'].alignment = b_c_alignment
ws['E4'] = reporting_end_datetime_local
if "reporting_period" not in report.keys() or \
"names" not in report['reporting_period'].keys() or len(report['reporting_period']['names']) == 0:

View File

@ -118,30 +118,29 @@ def generate_excel(report,
ws.add_image(img, 'A1')
# Title
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Name:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = name
ws['D3'].font = name_font
ws['D3'].alignment = b_r_alignment
ws['D3'] = 'Period:'
ws['E3'].border = b_border
ws['E3'].alignment = b_c_alignment
ws['E3'].font = name_font
ws['E3'] = period_type
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "__" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['D4'].alignment = b_r_alignment
ws['D4'] = 'Reporting End Datetime:'
ws['E4'].border = b_border
ws['E4'].alignment = b_c_alignment
ws['E4'] = reporting_end_datetime_local
if "reporting_period" not in report.keys() or \
"names" not in report['reporting_period'].keys() or len(report['reporting_period']['names']) == 0:

View File

@ -120,32 +120,29 @@ def generate_excel(report,
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Name:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = name
ws['D3'].font = name_font
ws['D3'].alignment = b_r_alignment
ws['D3'] = 'Period:'
ws['E3'].border = b_border
ws['E3'].alignment = b_c_alignment
ws['E3'].font = name_font
ws['E3'] = period_type
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "__" + reporting_end_datetime_local
ws['G3'].border = b_border
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['D4'].alignment = b_r_alignment
ws['D4'] = 'Reporting End Datetime:'
ws['E4'].border = b_border
ws['E4'].alignment = b_c_alignment
ws['E4'] = reporting_end_datetime_local
if "reporting_period" not in report.keys() or \
"names" not in report['reporting_period'].keys() or len(report['reporting_period']['names']) == 0:

View File

@ -118,30 +118,29 @@ def generate_excel(report,
ws.add_image(img, 'A1')
# Title
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Name:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = name
ws['D3'].font = name_font
ws['D3'].alignment = b_r_alignment
ws['D3'] = 'Period:'
ws['E3'].border = b_border
ws['E3'].alignment = b_c_alignment
ws['E3'].font = name_font
ws['E3'] = period_type
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Date:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "__" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['D4'].alignment = b_r_alignment
ws['D4'] = 'Reporting End Datetime:'
ws['E4'].border = b_border
ws['E4'].alignment = b_c_alignment
ws['E4'] = reporting_end_datetime_local
if "reporting_period" not in report.keys() or \
"names" not in report['reporting_period'].keys() or len(report['reporting_period']['names']) == 0:

View File

@ -110,24 +110,23 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
ws.add_image(img, 'A1')
# Title
ws.row_dimensions[3].height = 60
ws['B3'].font = name_font
ws['B3'].alignment = b_r_alignment
ws['B3'] = 'Space:'
ws['C3'].border = b_border
ws['C3'].alignment = b_c_alignment
ws['C3'].font = name_font
ws['C3'] = space_name
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Datetime:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "~" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['B5'].alignment = b_r_alignment
ws['B5'] = 'Reporting End Datetime:'
ws['C5'].border = b_border
ws['C5'].alignment = b_c_alignment
ws['C5'] = reporting_end_datetime_local
# Title
ws['B6'].border = f_border

View File

@ -120,14 +120,17 @@ def generate_excel(report, space_name, reporting_start_datetime_local, reporting
ws['C3'].font = name_font
ws['C3'] = space_name
ws['F3'].font = name_font
ws['F3'].alignment = b_r_alignment
ws['F3'] = 'Datetime:'
ws['G3'].border = b_border
ws['G3'].alignment = b_c_alignment
ws['G3'].font = name_font
ws['G3'] = reporting_start_datetime_local + "~" + reporting_end_datetime_local
ws.merge_cells("G3:H3")
ws['B4'].alignment = b_r_alignment
ws['B4'] = 'Reporting Start Datetime:'
ws['C4'].border = b_border
ws['C4'].alignment = b_c_alignment
ws['C4'] = reporting_start_datetime_local
ws['B5'].alignment = b_r_alignment
ws['B5'] = 'Reporting End Datetime:'
ws['C5'].border = b_border
ws['C5'].alignment = b_c_alignment
ws['C5'] = reporting_end_datetime_local
# Title
ws['B6'].border = f_border