diff --git a/.gitignore b/.gitignore index 903309c..1ff2c61 100644 --- a/.gitignore +++ b/.gitignore @@ -3,4 +3,6 @@ *.pyc *.cfg *.bak +*.log env/* +bin/* \ No newline at end of file diff --git a/flaskapp/__init__.py b/flaskapp/__init__.py index 4c33ac1..13eae43 100644 --- a/flaskapp/__init__.py +++ b/flaskapp/__init__.py @@ -57,13 +57,16 @@ def reload(): return render_index("Commands in cmds.cfg reloaded") -@app.route("/") -def cm(cmd): - if cmd in keys: +@app.route("/") +def cm(k): + if k in keys: if "vers" in cfg and cfg.vers == 2: - c=cmds[cmd].cmd + if "cmd" in cmds[k] and cmds[k]: + c=cmds[k]["cmd"] + else: + c=cmds[k] else: - c=cmds[cmd] + c=cmds[k] return run_cmd(c) else: - return render_template("index.html", out="Command not found", cmds=cmds, keys=keys, title=cfg.title.decode("utf8"), vers=cfg.vers), 404 + return render_index("Command not found", 404) diff --git a/flaskapp/templates/index.html b/flaskapp/templates/index.html index d1bf89a..449f1f7 100644 --- a/flaskapp/templates/index.html +++ b/flaskapp/templates/index.html @@ -1,3 +1,4 @@ + {{title}} @@ -9,49 +10,49 @@
-

{{title}}

-{% if vers == 1 %} - -{% endif %} -{% if vers == 2 %} - - -{% endif %} - -
{{out.decode('utf-8')}}
+
{{out.decode('utf-8')}}
-
- + + diff --git a/requirements.txt b/requirements.txt index 550468a..ce96721 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,3 +1,4 @@ flask config uwsgi +PyYAML