Skip to content

Commit

Permalink
Interface improvements
Browse files Browse the repository at this point in the history
Interface Improvements
  • Loading branch information
RafaelLyra8 authored Aug 9, 2023
2 parents cf872a4 + f993e5d commit f12e71b
Show file tree
Hide file tree
Showing 16 changed files with 7,289 additions and 5,183 deletions.
Binary file added back_end/__pycache__/__init__.cpython-39.pyc
Binary file not shown.
Empty file added back_end/assets/access.log
Empty file.
17 changes: 13 additions & 4 deletions back_end/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,12 @@
"integrated_dose", "probe", "gamma",
"gamma_status_probe", "color"
"""
@app.route("/load")
@app.route("/load", methods=["POST"])
def load():
data = {}
with open('./assets/pvs_rad.json', 'r') as file:
data = json.loads(file.read())

return data


Expand All @@ -34,9 +36,16 @@ def load():
"""
@app.route("/save", methods=["POST"])
def save():
with open('./assets/pvs_rad.json', 'w') as file:
data = json.dumps(request.json['data'])
file.write(data)
req_type = request.json["data"]["type"]
req_data = request.json["data"]["data"]
if req_type == "detectors":
with open('./assets/pvs_rad.json', 'w') as file:
data = json.dumps(req_data)
file.write(data)
elif req_type == "log":
with open('./assets/access.log', 'a+') as file:
file.write(req_data+"\n")

return ''

if __name__ == "__main__":
Expand Down
4 changes: 2 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ version: '3.8'
services:
backend:
container_name: 'rad-det-api'
image: 'ghcr.io/lnls-sirius/rad-det-backend:1.1.2'
image: 'ghcr.io/lnls-sirius/rad-det-backend:1.2.0'
build:
context: ./back_end
ports:
- 80:80
frontend:
container_name: 'rad-det'
image: 'ghcr.io/lnls-sirius/rad-det-frontend:1.2.0'
image: 'ghcr.io/lnls-sirius/rad-det-frontend:1.2.1'
build:
context: ./front_end
ports:
Expand Down
Loading

0 comments on commit f12e71b

Please sign in to comment.