updata:更新接口和表结构
This commit is contained in:
12
web/page.py
12
web/page.py
@@ -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
|
||||
|
Reference in New Issue
Block a user