add in current runs table
Build and Push Image / Build and push image (push) Has been skipped

This commit is contained in:
2024-09-23 03:04:38 +00:00
parent b0f3ad9fce
commit 589c1f62fa
3 changed files with 62 additions and 12 deletions
+15 -6
View File
@@ -30,6 +30,12 @@ def create_graphs():
sg = chart.line_chart("SG", "sg", 30)
show(column(sg))
def data_frame_to_table(df) -> str:
tr_replace_string = '<tr align="center" style="border-bottom:1pt solid black;">'
return_html = df.to_html(col_space='75px', index=False,
justify='center', border=3).replace('<tr>', tr_replace_string)
return return_html
class userForm(FlaskForm):
username = StringField("User Name?", validators=[DataRequired()])
@@ -64,10 +70,13 @@ def index():
def updater():
if 'logged_in' not in session:
return redirect("/")
predicted_alc_table = table_builder.TableBuilder().table_build()
tr_replace_string = '<tr align="center" style="border-bottom:1pt solid black;">'
beer_html = predicted_alc_table.to_html(col_space='75px', index=False,
justify='center', border=3).replace('<tr>', tr_replace_string)
table_Data = table_builder.TableBuilder()
predicted_alc_table = table_Data.done_runs_build()
current_runs_table = table_Data.current_runs_build()
beer_html = data_frame_to_table(predicted_alc_table)
current_html = data_frame_to_table(current_runs_table)
query_db = beer_database_query.pool_query()
query = query_db.get_top(10, "sg")
form = dataForm()
@@ -98,10 +107,10 @@ def updater():
database.create_re_record(new_record["beer_run_id"], new_record["beer_type"], new_record["sg"],
new_record["date"], final_run_value, new_record["comment"])
return render_template("updater.html", beer_data = beer_html
return render_template("updater.html", beer_data = beer_html, current_data = current_html
, list=query, form=form, success=True, updater_name = "Saucy Beer Maker")
else:
return render_template("updater.html", beer_data = beer_html
return render_template("updater.html", beer_data = beer_html, current_data = current_html
, list=query, form=form, sucess=False)
# @app.route("/update_db", methods=["POST"])