mirror of
https://github.com/PotentiaRobotics/robot-gui.git
synced 2025-04-20 19:00:16 -04:00
added print functionality to input boxes
This commit is contained in:
parent
a372b0fd9b
commit
bf0ad7755b
15
app.py
15
app.py
|
@ -1,7 +1,8 @@
|
||||||
# app.py
|
# app.py
|
||||||
|
|
||||||
from flask import Flask, render_template
|
from flask import Flask, render_template, request
|
||||||
from flask_assets import Bundle, Environment
|
from flask_assets import Bundle, Environment
|
||||||
|
import jyserver.Flask as jsf
|
||||||
|
|
||||||
app = Flask(__name__)
|
app = Flask(__name__)
|
||||||
|
|
||||||
|
@ -11,10 +12,20 @@ css = Bundle("src/main.css", output="dist/main.css")
|
||||||
assets.register("css", css)
|
assets.register("css", css)
|
||||||
css.build()
|
css.build()
|
||||||
|
|
||||||
|
@jsf.use(app)
|
||||||
|
class App:
|
||||||
|
def __init__(self) -> None:
|
||||||
|
pass
|
||||||
|
|
||||||
|
def printinput(self):
|
||||||
|
x = self.js.document.getElementById('userInput').value
|
||||||
|
print(x)
|
||||||
|
|
||||||
|
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def homepage():
|
def homepage():
|
||||||
return render_template("index.html")
|
|
||||||
|
return App.render(render_template("index.html"))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
|
@ -32,10 +32,10 @@
|
||||||
<input
|
<input
|
||||||
class="inputbox"
|
class="inputbox"
|
||||||
type="text"
|
type="text"
|
||||||
id="fname"
|
id="userInput"
|
||||||
name="fname"
|
name="fname"
|
||||||
/>
|
/>
|
||||||
<button class="button">Enter</button>
|
<button class="button" onclick="server.printinput()">Enter</button>
|
||||||
<p class="units">Deg</p>
|
<p class="units">Deg</p>
|
||||||
<select name="input" id="unit">
|
<select name="input" id="unit">
|
||||||
<option value="Position">Position</option>
|
<option value="Position">Position</option>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user