This commit is contained in:
megamichi 2024-09-16 21:15:57 +02:00
parent 66f5f97ee3
commit bb918a4ddc
7 changed files with 0 additions and 92 deletions

Binary file not shown.

Binary file not shown.

20
app.py
View file

@ -1,8 +1,4 @@
<<<<<<< HEAD
#!/usr/bin/python3
=======
#!/usr/bi/python3 #!/usr/bi/python3
>>>>>>> 079d2a0 (terminal intigration)
from flask import * from flask import *
from main import launchserver from main import launchserver
import libtmux import libtmux
@ -38,21 +34,6 @@ def getlpane() -> libtmux.Pane:
@app.route("/term", methods=["GET", "POST"]) @app.route("/term", methods=["GET", "POST"])
def get_terminal_output(): def get_terminal_output():
if request.method == "POST": if request.method == "POST":
<<<<<<< HEAD
data = request.data.decode()
print(data)
if data == "bla":
print("test")
getlpane().send_keys("test")
elif data == "start":
launchserver(getlpane())
elif data == "stop":
getlpane().send_keys("exit")
return ["sucessful"]
=======
data = request.get_json()#json.loads(request.data.decode()) data = request.get_json()#json.loads(request.data.decode())
print(data,type(data)) print(data,type(data))
content = data["content"] content = data["content"]
@ -66,7 +47,6 @@ def get_terminal_output():
getlpane().send_keys(content[2]) getlpane().send_keys(content[2])
return ["sucessful"] return ["sucessful"]
>>>>>>> 079d2a0 (terminal intigration)
elif request.method == "GET": elif request.method == "GET":
term = get_term() term = get_term()
if term[1] == "mono": if term[1] == "mono":

View file

@ -1,8 +1,4 @@
<<<<<<< HEAD
#!/usr/bin/python3
=======
#!/usr/bi/python3 #!/usr/bi/python3
>>>>>>> 079d2a0 (terminal intigration)
import libtmux import libtmux
import settings import settings
import libtmux.constants import libtmux.constants

View file

@ -1,8 +1,4 @@
<<<<<<< HEAD
#!/usr/bin/python3
=======
#!/usr/bi/python3 #!/usr/bi/python3
>>>>>>> 079d2a0 (terminal intigration)
from os import path from os import path
path = ( path = (

View file

@ -1,9 +1,5 @@
a { a {
<<<<<<< HEAD
color: rgb(107, 214, 0);
=======
color: chartreuse; color: chartreuse;
>>>>>>> 079d2a0 (terminal intigration)
} }
body { body {
@ -23,10 +19,6 @@ body {
padding: 10px; padding: 10px;
border-radius: 20px; border-radius: 20px;
border-style:hidden; border-style:hidden;
<<<<<<< HEAD
margin-bottom: 10px;
=======
>>>>>>> 079d2a0 (terminal intigration)
} }
#buttons { #buttons {
@ -34,17 +26,9 @@ body {
flex-direction: column; flex-direction: column;
padding: 10px; padding: 10px;
} }
<<<<<<< HEAD
.input {
color: chartreuse;
background-color: rgb(0, 0, 0);
=======
input { input {
color: chartreuse; color: chartreuse;
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
>>>>>>> 079d2a0 (terminal intigration)
border-color: chartreuse; border-color: chartreuse;
padding: 10px; padding: 10px;
border-style: solid; border-style: solid;
@ -52,14 +36,9 @@ input {
border-radius: 20px; border-radius: 20px;
} }
<<<<<<< HEAD
#terminal {
background-color: #0001002a;
=======
#terminal { #terminal {
background-color: rgba(0, 0, 0, 0.1); background-color: rgba(0, 0, 0, 0.1);
>>>>>>> 079d2a0 (terminal intigration)
color: chartreuse; color: chartreuse;
border-style: solid; border-style: solid;
border-color: chartreuse; border-color: chartreuse;
@ -67,19 +46,7 @@ input {
padding: 15px; padding: 15px;
font-family: 'Courier New', Courier, monospace; font-family: 'Courier New', Courier, monospace;
font-size: 16px; font-size: 16px;
<<<<<<< HEAD
width: 100%;
height: 100%;
overflow-y: auto;
box-shadow: 0 0 10px rgba(0, 255, 0, 0.5);
flex-grow: 1;
}
#dash {
display: flex;
height: 100vh;
=======
height: 100%; height: 100%;
overflow-y: auto; overflow-y: auto;
box-shadow: 0 0 10px rgb(0, 255, 0); box-shadow: 0 0 10px rgb(0, 255, 0);
>>>>>>> 079d2a0 (terminal intigration)
} }

View file

@ -3,17 +3,6 @@
<head> <head>
<script> <script>
let termdiv; let termdiv;
<<<<<<< HEAD
function sendcommand(list) {
fetch("/term",{
method:"POST",
body: list,
headers: {"Content-type":"application/json; charset=UTF-8"}
});
getterm();
};
=======
let terminput; let terminput;
let timer; let timer;
let timertext; let timertext;
@ -35,7 +24,6 @@
terminput.value = ""; terminput.value = "";
} }
>>>>>>> 079d2a0 (terminal intigration)
function getterm() { function getterm() {
let tmpterm = ""; let tmpterm = "";
@ -50,17 +38,6 @@
}) })
.catch(termdiv.innerHTML = 'Fehler beim Abrufen der Daten'); .catch(termdiv.innerHTML = 'Fehler beim Abrufen der Daten');
} }
<<<<<<< HEAD
function initstuff() {
termdiv = document.getElementById("terminal");
getterm();
setInterval(getterm,8000)
}
=======
function getterminterval() { function getterminterval() {
timer -= 1 timer -= 1
timertext.innerHTML = `Reload in ${timer} Seconds` timertext.innerHTML = `Reload in ${timer} Seconds`
@ -79,7 +56,6 @@
getterm(); getterm();
setInterval(getterminterval,1000) setInterval(getterminterval,1000)
} }
>>>>>>> 079d2a0 (terminal intigration)
window.onload = initstuff; window.onload = initstuff;
</script> </script>
@ -93,12 +69,6 @@
<img src="{{ url_for('static', filename='logo.png') }}" alt="Terra-Dash"> <img src="{{ url_for('static', filename='logo.png') }}" alt="Terra-Dash">
<div id="dash"> <div id="dash">
<div id="buttons"> <div id="buttons">
<<<<<<< HEAD
<button class="button" onclick="sendcommand([`start`])">start</button>
<button style="background-color: rgb(186, 0, 0);" class="button" onclick="sendcommand([`stop`])">stop</button>
</div>
<div id="terminal">
=======
<button style="margin-bottom: 10px;" <button style="margin-bottom: 10px;"
class="button" class="button"
onclick="sendcommand([COMMAND,`start`]);timer=2">start</button> onclick="sendcommand([COMMAND,`start`]);timer=2">start</button>
@ -117,7 +87,6 @@
onclick="sendtermcommand(); onclick="sendtermcommand();
terminput.value = ``">send</button> terminput.value = ``">send</button>
</div> </div>
>>>>>>> 079d2a0 (terminal intigration)
</div> </div>
</div> </div>
</body> </body>