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
>>>>>>> 079d2a0 (terminal intigration)
from flask import *
from main import launchserver
import libtmux
@ -38,21 +34,6 @@ def getlpane() -> libtmux.Pane:
@app.route("/term", methods=["GET", "POST"])
def get_terminal_output():
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())
print(data,type(data))
content = data["content"]
@ -66,7 +47,6 @@ def get_terminal_output():
getlpane().send_keys(content[2])
return ["sucessful"]
>>>>>>> 079d2a0 (terminal intigration)
elif request.method == "GET":
term = get_term()
if term[1] == "mono":

View file

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

View file

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

View file

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

View file

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