Skip to content

Commit

Permalink
Merge pull request #7 from GOcontroll/dev
Browse files Browse the repository at this point in the history
Dev
  • Loading branch information
SpieringsAE authored Sep 5, 2024
2 parents b826a11 + 8370c67 commit e94bd9b
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 9 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
## V1.0.1
- Fix: Changed get_sim_ver api to use the three files in mem-sim instead of trying to pull the version from the CHANGELOG.md
- Fix: Added fallback font

## V1.0.0
Initial release
17 changes: 12 additions & 5 deletions ModulineWebUI/controller.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from microdot.session import Session, with_session

from ModulineWebUI.app import app, auth
from ModulineWebUI.handlers.service import get_service, set_service, services
from ModulineWebUI.handlers.service import get_service, services, set_service


@app.post("/api/get_service")
Expand All @@ -32,7 +32,9 @@ async def set_service_route(req: Request, session: Session):
if is_changed:
return json.dumps({"new_state": new_state})
else:
return json.dumps({"err": f"Failed to change service '{service}' state {error}"})
return json.dumps(
{"err": f"Failed to change service '{service}' state {error}"}
)
else:
return json.dumps({"err": "Invalid service"})

Expand All @@ -43,9 +45,14 @@ async def set_service_route(req: Request, session: Session):
@auth
async def get_sim_ver(req: Request, session: Session):
try:
with open("/usr/simulink/CHANGELOG.md", "r") as changelog:
head = changelog.readline()
return json.dumps({"version": head.split(" ")[1].strip()})
with open("/usr/mem-sim/MODEL_MAJOR", "r") as major:
major_ver = major.readline()
with open("/usr/mem-sim/MODEL_FEATURE", "r") as feature:
feature_ver = feature.readline()
with open("/usr/mem-sim/MODEL_FIX", "r") as fix:
fix_ver = fix.readline()
version = f"V{major_ver}.{feature_ver}.{fix_ver}"
return json.dumps({"version": version})
except Exception as ex:
return json.dumps({"err": f"No changelog found\n{ex}"})

Expand Down
2 changes: 1 addition & 1 deletion ModulineWebUI/style/color.css
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@


* {
font-family: NotoSans;
font-family: 'NotoSans', Arial, Helvetica, sans-serif;
color: black;
}

Expand Down
2 changes: 1 addition & 1 deletion ModulineWebUI/style/main.css
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@


* {
font-family: NotoSans;
font-family: 'NotoSans', Arial, Helvetica, sans-serif;
color: black;
}

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ then run
to install the module in your venv while using the regular project files as the source

then run
`go-webui -passkey test`
`go-webui --passkey test`
to launch the webserver with the passkey 'test'

`python3 setup.py sdist`
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="ModulineWebUI",
version="1.0.0",
version="1.0.1",
description="A web UI to configure GOcontroll Moduline controllers",
url="https://github.com/GOcontroll/Moduline-WebUI",
license="MIT",
Expand Down

0 comments on commit e94bd9b

Please sign in to comment.