Some new features
This commit is contained in:
parent
0739547520
commit
ef631b9c3f
1 changed files with 8 additions and 4 deletions
12
lomes-app.py
12
lomes-app.py
|
|
@ -10,8 +10,12 @@ app = Flask(__name__)
|
||||||
@app.route("/")
|
@app.route("/")
|
||||||
def index():
|
def index():
|
||||||
user = getpass.getuser()
|
user = getpass.getuser()
|
||||||
time = datetime.datetime.now()
|
preTime = datetime.datetime.now()
|
||||||
os = os.uname()
|
time = preTime.strftime("%H:%M:%S - %a %d.%m.%Y")
|
||||||
return render_template("index.html", user=user, time=time, os=os)
|
uname_fields = ("System", "Hostname", "Kernel")
|
||||||
|
uname_info = os.uname()
|
||||||
|
sysinfo = "\n".join(f"{field}: {value} | " for field, value in zip(uname_fields, uname_info))
|
||||||
|
|
||||||
app.run(host="127.0.0.1", port=5000)
|
return render_template("index.html", user=user, time=time, sysinfo=sysinfo)
|
||||||
|
|
||||||
|
app.run(host="127.0.0.1", port=5000, debug=True)
|
||||||
Loading…
Add table
Add a link
Reference in a new issue