a
This commit is contained in:
0
server/src/data.db
Normal file
0
server/src/data.db
Normal file
@@ -24,6 +24,7 @@ CREATE TABLE IF NOT EXISTS val (
|
|||||||
default_time TEXT NOT NULL DEFAULT '21:00'
|
default_time TEXT NOT NULL DEFAULT '21:00'
|
||||||
)
|
)
|
||||||
""")
|
""")
|
||||||
|
cursor.execute("INSERT INTO settings (default_time) VALUES (?)", ('21:00',))
|
||||||
conn.commit()
|
conn.commit()
|
||||||
conn.close()
|
conn.close()
|
||||||
|
|
||||||
@@ -40,7 +41,7 @@ def mainpage():
|
|||||||
items = cursor.fetchall()
|
items = cursor.fetchall()
|
||||||
cursor.execute("SELECT default_time FROM val")
|
cursor.execute("SELECT default_time FROM val")
|
||||||
default_time_row = cursor.fetchone()
|
default_time_row = cursor.fetchone()
|
||||||
default_time = default_time_row[0] if default_time_row else None
|
default_time = default_time_row[0] if default_time_row else '21:00'
|
||||||
conn.close()
|
conn.close()
|
||||||
return render_template('index.html', title='BS Shutdown', items=items, default_time=default_time)
|
return render_template('index.html', title='BS Shutdown', items=items, default_time=default_time)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user