updata:更新接口和表结构

This commit is contained in:
2024-07-05 23:20:12 +08:00
parent eff85c91db
commit 8b91e5a789
8 changed files with 159 additions and 173 deletions

View File

@@ -17,10 +17,12 @@ def showTable():
data = db.fz_data.LoadFzData()
return render_template("tables.html", data=data)
@page_bp.route("/fz", methods=["GET"])
def fz():
data = db.fz_data.LoadFzData()
return render_template("fz.html", data=data)
@page_bp.route("/log", methods=["GET"])
def log():
if request.cookies.get("user") == None:
return redirect("/login")
file = open("output.log","r").readlines()[::-1]
return render_template("log.html", data=file)
@page_bp.route("/", methods=["GET"])
def index():
@@ -30,7 +32,7 @@ def index():
total[0] = db.fz_data.total()
data = db.fz_data.LoadFzData()
for i in data:
w_time = time.mktime(time.strptime(i[4], "%Y-%m-%d %H:%M:%S"))
w_time = time.mktime(time.strptime(i[15], "%Y-%m-%d %H:%M:%S"))
nowtime = time.time()
if w_time + 60 * 60 * 24 * 7 > nowtime:
total[1] += 1