Update app.py
Browse files
app.py
CHANGED
|
@@ -44,9 +44,8 @@ def log_entry(tab, inputs, result, note=""):
|
|
| 44 |
def load_journal():
|
| 45 |
try:
|
| 46 |
if not LOG_PATH.exists():
|
| 47 |
-
return
|
| 48 |
df = pd.read_csv(LOG_PATH)
|
| 49 |
-
# Convert to markdown for nice display
|
| 50 |
if df.empty:
|
| 51 |
return "No entries yet."
|
| 52 |
return df.tail(20).to_markdown(index=False)
|
|
@@ -591,7 +590,6 @@ def plot_corona():
|
|
| 591 |
width=500, height=400
|
| 592 |
)
|
| 593 |
return fig
|
| 594 |
-
|
| 595 |
# ========== CSS ==========
|
| 596 |
css = f"""
|
| 597 |
body, .gradio-container {{ background: {BG} !important; color: {TXT} !important; }}
|
|
@@ -814,7 +812,6 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 814 |
with gr.TabItem("S1-D · R5a · CSF/BM 🔴"):
|
| 815 |
gr.HTML(proj_badge("S1-D · R5a", "LNP Corona in CSF · Vitreous · Bone Marrow", "🔴 0 prior studies"))
|
| 816 |
gr.Markdown("> Planned for Q2–Q3 2026")
|
| 817 |
-
|
| 818 |
# === S1-E · PHYLO-BIOMARKERS ===
|
| 819 |
# Розкоментовано проблемну вкладку "оце" - Liquid Biopsy
|
| 820 |
with gr.TabItem("S1-E · R1a · Liquid Biopsy"):
|
|
@@ -917,9 +914,10 @@ with gr.Blocks(css=css, title="K R&D Lab · S1 Biomedical") as demo:
|
|
| 917 |
with gr.Row():
|
| 918 |
note_text = gr.Textbox(label="📝 Observation", placeholder="What did you discover?", lines=3)
|
| 919 |
note_tab = gr.Textbox(label="Project code (e.g. S1-A·R1a)", value="General")
|
| 920 |
-
|
| 921 |
-
|
| 922 |
-
|
|
|
|
| 923 |
journal_display = gr.Markdown(value=load_journal())
|
| 924 |
|
| 925 |
save_btn.click(save_note, [note_text, note_tab], journal_display)
|
|
|
|
| 44 |
def load_journal():
|
| 45 |
try:
|
| 46 |
if not LOG_PATH.exists():
|
| 47 |
+
return "No entries yet."
|
| 48 |
df = pd.read_csv(LOG_PATH)
|
|
|
|
| 49 |
if df.empty:
|
| 50 |
return "No entries yet."
|
| 51 |
return df.tail(20).to_markdown(index=False)
|
|
|
|
| 590 |
width=500, height=400
|
| 591 |
)
|
| 592 |
return fig
|
|
|
|
| 593 |
# ========== CSS ==========
|
| 594 |
css = f"""
|
| 595 |
body, .gradio-container {{ background: {BG} !important; color: {TXT} !important; }}
|
|
|
|
| 812 |
with gr.TabItem("S1-D · R5a · CSF/BM 🔴"):
|
| 813 |
gr.HTML(proj_badge("S1-D · R5a", "LNP Corona in CSF · Vitreous · Bone Marrow", "🔴 0 prior studies"))
|
| 814 |
gr.Markdown("> Planned for Q2–Q3 2026")
|
|
|
|
| 815 |
# === S1-E · PHYLO-BIOMARKERS ===
|
| 816 |
# Розкоментовано проблемну вкладку "оце" - Liquid Biopsy
|
| 817 |
with gr.TabItem("S1-E · R1a · Liquid Biopsy"):
|
|
|
|
| 914 |
with gr.Row():
|
| 915 |
note_text = gr.Textbox(label="📝 Observation", placeholder="What did you discover?", lines=3)
|
| 916 |
note_tab = gr.Textbox(label="Project code (e.g. S1-A·R1a)", value="General")
|
| 917 |
+
with gr.Row():
|
| 918 |
+
save_btn = gr.Button("💾 Save", variant="primary")
|
| 919 |
+
refresh_btn = gr.Button("🔄 Refresh")
|
| 920 |
+
clear_btn = gr.Button("🗑️ Clear Journal", variant="secondary")
|
| 921 |
journal_display = gr.Markdown(value=load_journal())
|
| 922 |
|
| 923 |
save_btn.click(save_note, [note_text, note_tab], journal_display)
|