add: timer & reboot
This commit is contained in:
@@ -35,7 +35,7 @@ def get_db_connection():
|
||||
conn = sqlite3.connect(DB_PATH)
|
||||
conn.row_factory = sqlite3.Row
|
||||
return conn
|
||||
|
||||
# --- MAIN ---
|
||||
@app.route("/")
|
||||
def mainpage():
|
||||
conn = get_db_connection()
|
||||
@@ -104,6 +104,8 @@ def delete():
|
||||
conn.close()
|
||||
return redirect(url_for("mainpage"))
|
||||
|
||||
# --- END MAIN ---
|
||||
# --- API ---
|
||||
@app.route("/lookup", methods=["POST"])
|
||||
def lookup():
|
||||
data = request.get_json()
|
||||
@@ -125,4 +127,5 @@ def lookup():
|
||||
if item:
|
||||
return jsonify({"name": item["name"], "noshutdown": item["noshutdown"], "time": item["time"]}), 200
|
||||
else:
|
||||
return jsonify({"noshutdown": 0, "time": default_time}), 200
|
||||
return jsonify({"noshutdown": 0, "time": default_time}), 200
|
||||
# --- END API ---
|
||||
Reference in New Issue
Block a user