Skip to content

Commit

Permalink
what the hell
Browse files Browse the repository at this point in the history
  • Loading branch information
CamDavidsonPilon committed Dec 29, 2024
1 parent 229d789 commit 15b8d2d
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 9 deletions.
6 changes: 3 additions & 3 deletions asset-manifest.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"files": {
"main.css": "/static/css/main.a3dbeddd.css",
"main.js": "/static/js/main.dad34b73.js",
"main.js": "/static/js/main.dc4aa768.js",
"static/media/roboto-all-500-normal.woff": "/static/media/roboto-all-500-normal.0ab669b7a0d19b178f57.woff",
"static/media/roboto-all-700-normal.woff": "/static/media/roboto-all-700-normal.a457fde362a540fcadff.woff",
"static/media/roboto-all-400-normal.woff": "/static/media/roboto-all-400-normal.c5d001fa922fa66a147f.woff",
Expand Down Expand Up @@ -36,10 +36,10 @@
"static/media/roboto-greek-ext-700-normal.woff2": "/static/media/roboto-greek-ext-700-normal.bd9854c751441ccc1a70.woff2",
"index.html": "/index.html",
"main.a3dbeddd.css.map": "/static/css/main.a3dbeddd.css.map",
"main.dad34b73.js.map": "/static/js/main.dad34b73.js.map"
"main.dc4aa768.js.map": "/static/js/main.dc4aa768.js.map"
},
"entrypoints": [
"static/css/main.a3dbeddd.css",
"static/js/main.dad34b73.js"
"static/js/main.dc4aa768.js"
]
}
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.dad34b73.js"></script><link href="/static/css/main.a3dbeddd.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
<!doctype html><html lang="en"><head><meta charset="utf-8"/><link rel="icon" href="/favicon.ico"/><meta name="viewport" content="width=device-width,initial-scale=1"/><meta name="theme-color" content="#000000"/><meta name="description" content="Pioreactor"/><link rel="apple-touch-icon" href="/logo192.png"/><link rel="manifest" href="/manifest.json"/><script defer="defer" src="/static/js/main.dc4aa768.js"></script><link href="/static/css/main.a3dbeddd.css" rel="stylesheet"></head><body><div id="root"></div></body></html>
23 changes: 23 additions & 0 deletions pioreactorui/unit_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from flask import jsonify
from flask import request
from flask import Response
from flask import send_file
from flask.typing import ResponseReturnValue
from huey.exceptions import HueyException
from huey.exceptions import TaskException
Expand Down Expand Up @@ -177,6 +178,28 @@ def set_clock_time():
return jsonify({"status": "error", "message": str(e)}), 500


#### DIR
@unit_api.route("/system/path/", defaults={"req_path": ""})
@unit_api.route("/system/path/<path:req_path>")
def dir_listing(req_path: str):
BASE_DIR = env["DOT_PIOREACTOR"]

# Joining the base and the requested path
abs_path = os.path.join(BASE_DIR, req_path)

# Return 404 if path doesn't exist
if not os.path.exists(abs_path):
return abort(404)

# Check if path is a file and serve
if os.path.isfile(abs_path):
return send_file(abs_path)

# Show directory contents
current, dirs, files = next(os.walk(abs_path))
return jsonify({"current": current, "dirs": dirs, "files": files})


## RUNNING JOBS CONTROL


Expand Down
8 changes: 4 additions & 4 deletions static/js/main.dad34b73.js → static/js/main.dc4aa768.js

Large diffs are not rendered by default.

File renamed without changes.

Large diffs are not rendered by default.

0 comments on commit 15b8d2d

Please sign in to comment.