diff --git a/.idea/.gitignore b/.idea/.gitignore new file mode 100644 index 0000000..26d3352 --- /dev/null +++ b/.idea/.gitignore @@ -0,0 +1,3 @@ +# Default ignored files +/shelf/ +/workspace.xml diff --git a/.idea/inspectionProfiles/profiles_settings.xml b/.idea/inspectionProfiles/profiles_settings.xml new file mode 100644 index 0000000..105ce2d --- /dev/null +++ b/.idea/inspectionProfiles/profiles_settings.xml @@ -0,0 +1,6 @@ + + + + \ No newline at end of file diff --git a/.idea/misc.xml b/.idea/misc.xml new file mode 100644 index 0000000..db8786c --- /dev/null +++ b/.idea/misc.xml @@ -0,0 +1,7 @@ + + + + + + \ No newline at end of file diff --git a/.idea/modules.xml b/.idea/modules.xml new file mode 100644 index 0000000..fa5068d --- /dev/null +++ b/.idea/modules.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/terradash.iml b/.idea/terradash.iml new file mode 100644 index 0000000..d0876a7 --- /dev/null +++ b/.idea/terradash.iml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/.idea/vcs.xml b/.idea/vcs.xml new file mode 100644 index 0000000..35eb1dd --- /dev/null +++ b/.idea/vcs.xml @@ -0,0 +1,6 @@ + + + + + + \ No newline at end of file diff --git a/__pycache__/app.cpython-311.pyc b/__pycache__/app.cpython-311.pyc deleted file mode 100644 index 803e33f..0000000 Binary files a/__pycache__/app.cpython-311.pyc and /dev/null differ diff --git a/__pycache__/app.cpython-312.pyc b/__pycache__/app.cpython-312.pyc deleted file mode 100644 index 0839ad9..0000000 Binary files a/__pycache__/app.cpython-312.pyc and /dev/null differ diff --git a/__pycache__/main.cpython-312.pyc b/__pycache__/main.cpython-312.pyc index e69146f..931e451 100644 Binary files a/__pycache__/main.cpython-312.pyc and b/__pycache__/main.cpython-312.pyc differ diff --git a/app.py b/app.py index 92edcb8..a8c52fb 100644 --- a/app.py +++ b/app.py @@ -1,4 +1,5 @@ #!/usr/bi/python3 +import flask from flask import * from main import launchserver import libtmux @@ -31,7 +32,7 @@ def getlpane() -> libtmux.Pane: return lpane -@app.route("/term", methods=["GET", "POST"]) +@app.route("/termapi", methods=["GET", "POST"]) def get_terminal_output(): if request.method == "POST": data = request.get_json()#json.loads(request.data.decode()) @@ -55,9 +56,43 @@ def get_terminal_output(): return ["Server not running."] + + @app.route("/") def root(): - return render_template("index.html") + return flask.redirect("/dash") + +@app.errorhandler(404) +def e404(e): + return render_template("404.html") + + +## sites + +@app.route("/dash") +def dash(): + navbar = render_template("navbar.html") + return render_template("sites/dash.html",navbar=navbar) + +@app.route("/config") +def configs(): + navbar = render_template("navbar.html") + return render_template("sites/config.html",navbar=navbar) + +@app.route("/worlds") +def worlds(): + navbar = render_template("navbar.html") + return render_template("sites/worlds.html",navbar=navbar) + +@app.route("/log") +def logs(): + navbar = render_template("navbar.html") + return render_template("sites/log.html",navbar=navbar) + +@app.route("/terminal") +def term(): + navbar = render_template("navbar.html") + return render_template("sites/terminal.html",navbar=navbar) if __name__ == "__main__": diff --git a/main.py b/main.py index 8de8925..0dadd54 100644 --- a/main.py +++ b/main.py @@ -3,6 +3,7 @@ import libtmux import settings import libtmux.constants +#Terra-Dash def launchserver(lpane: libtmux.Pane): lpane.send_keys(settings.RUN_SERVER_COMMAND) diff --git a/recycle.txt b/recycle.txt new file mode 100644 index 0000000..7804ed1 --- /dev/null +++ b/recycle.txt @@ -0,0 +1,9 @@ +
+
+ + +
\ No newline at end of file diff --git a/static/background.png b/static/background.png deleted file mode 100644 index 6e68933..0000000 Binary files a/static/background.png and /dev/null differ diff --git a/static/icons/home.svg b/static/icons/home.svg new file mode 100644 index 0000000..ef54108 --- /dev/null +++ b/static/icons/home.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/paper.svg b/static/icons/paper.svg new file mode 100644 index 0000000..793c2a4 --- /dev/null +++ b/static/icons/paper.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/settings.svg b/static/icons/settings.svg new file mode 100644 index 0000000..63cebb1 --- /dev/null +++ b/static/icons/settings.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/terminal.svg b/static/icons/terminal.svg new file mode 100644 index 0000000..6c23702 --- /dev/null +++ b/static/icons/terminal.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/icons/world.svg b/static/icons/world.svg new file mode 100644 index 0000000..b87a4d9 --- /dev/null +++ b/static/icons/world.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/static/navbar.css b/static/navbar.css new file mode 100644 index 0000000..c171bc3 --- /dev/null +++ b/static/navbar.css @@ -0,0 +1,64 @@ +:root { + font-size: 16px; + color: black; + font-family: 'Courier New', Courier, monospace; +} + +a { + font-size: 16px; + color: black; + text-decoration: none; +} + + +body { + display: flex; + justify-content: start; +} + +.navbar { + border-style: solid; + border-color: #ced4da; + border-radius: 1rem; + width: 19rem; + height: 100vh; + background-color: #ced4da; + padding-top: 5%; +} + +.navbar-cont { + display: flex; + flex-direction: column; + list-style: none; + gap: 1.5rem; + justify-content: start; + align-items:center; + text-align: center; + padding: 0; + margin: 0; +} + +.nav-item { + width: 15rem; + height: 3rem; + display: flex; + align-items: center; + justify-content: center; + + border-style: solid; + border-color: rgb(255, 255, 255); + border-radius: 20px; + transition: background-color 0.4s ; +} +.nav-item a { + padding-left: 1rem; +} + +.nav-item:hover { + background-color: rgb(255, 255, 255); +} + +.icon { + width: 2rem; + filter: invert(100%) +} diff --git a/static/style.css b/static/style.css index 34c479c..32a07aa 100644 --- a/static/style.css +++ b/static/style.css @@ -1,52 +1,48 @@ -a { - color: chartreuse; -} -body { - color: chartreuse; -} - -#dash { +.main { + padding: 5%; display: flex; - align-content: center; - justify-content: start; + flex-direction: column; } .button { color: black; - background-color: chartreuse; - border-color: chartreuse; + background-color: rgb(0, 0, 0); + border-color: rgb(0, 0, 0); padding: 10px; border-radius: 20px; border-style:hidden; - } #buttons { display: flex; flex-direction: column; padding: 10px; } -input { - color: chartreuse; - background-color: rgba(0, 0, 0, 0.1); - border-color: chartreuse; +#term-input { + color: rgb(0, 0, 0); + background-color: rgba(166, 166, 166, 0.1); + border-color: white; padding: 10px; border-style: solid; border-width: 1px; border-radius: 20px; } - - #terminal { - background-color: rgba(0, 0, 0, 0.1); - color: chartreuse; + background-color: black; + color: white; border-style: solid; - border-color: chartreuse; + border-color: rgb(0, 0, 0); border-radius: 20px; padding: 15px; - font-family: 'Courier New', Courier, monospace; font-size: 16px; height: 100%; + width: 50%; overflow-y: auto; - box-shadow: 0 0 10px rgb(0, 255, 0); + box-shadow: 0 0 10px rgb(0, 0, 0); } + +#timer { + font-size: 11px; + margin: 0px; + margin-left: 15px; +} \ No newline at end of file diff --git a/templates/404.html b/templates/404.html new file mode 100644 index 0000000..241b433 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,14 @@ + + + + + + Document + + +

404

+ + \ No newline at end of file diff --git a/templates/navbar.html b/templates/navbar.html new file mode 100644 index 0000000..a74ad29 --- /dev/null +++ b/templates/navbar.html @@ -0,0 +1,30 @@ + \ No newline at end of file diff --git a/templates/sites/dash.html b/templates/sites/dash.html new file mode 100644 index 0000000..8558970 --- /dev/null +++ b/templates/sites/dash.html @@ -0,0 +1,96 @@ + + + + + + + + + Terradash + + + {{ navbar | safe }} +
+

Dash

+
+
+ + +
+
+

Reload in _ Seconds

+
+
+ + +
+
+
+
+ + diff --git a/templates/index.html b/templates/sites/terminal.html similarity index 73% rename from templates/index.html rename to templates/sites/terminal.html index be47085..53846fb 100644 --- a/templates/index.html +++ b/templates/sites/terminal.html @@ -10,7 +10,7 @@ function sendcommand(contentlist) { - fetch("/term",{ + fetch("/termapi",{ method:"POST", body: JSON.stringify({"content":contentlist}), headers: {"Content-type":"application/json; charset=UTF-8"} @@ -59,25 +59,19 @@ window.onload = initstuff; - + + Terradash - - Terra-Dash -
-
- - -
-
-

Reload in _ Seconds

+ + {{ navbar | safe }} +
+

Terminal

+
+

Reload in _ Seconds

@@ -88,6 +82,6 @@ terminput.value = ``">send
-
+