faisalsns commited on
Commit
a8fc220
·
verified ·
1 Parent(s): 619adc6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +19 -0
app.py CHANGED
@@ -74,4 +74,23 @@ with gr.Blocks() as demo:
74
  view_btn = gr.Button("Load Feedback")
75
  view_btn.click(fn=fetch_feedback, inputs=[app_filter, pwd], outputs=[status, table])
76
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  demo.launch()
 
74
  view_btn = gr.Button("Load Feedback")
75
  view_btn.click(fn=fetch_feedback, inputs=[app_filter, pwd], outputs=[status, table])
76
 
77
+ with gr.Row():
78
+ admin_pw = gr.Textbox(label="Admin Password", type="password")
79
+ unlock_btn = gr.Button("Unlock Admin Panel")
80
+
81
+ admin_tab = gr.Tab("Admin Panel", visible=False)
82
+
83
+ def unlock_admin(pwd):
84
+ return gr.update(visible=(pwd == ADMIN_PASSWORD))
85
+
86
+ unlock_btn.click(fn=unlock_admin, inputs=[admin_pw], outputs=[admin_tab])
87
+
88
+ with admin_tab:
89
+ gr.Markdown("### View Feedback (Admin Only)")
90
+ app_filter = gr.Textbox(label="Filter by App ID (optional)")
91
+ status = gr.Textbox(label="Status")
92
+ table = gr.Dataframe(headers=["App ID", "Rating", "Comment", "Timestamp"], interactive=False)
93
+ view_btn = gr.Button("Load Feedback")
94
+ view_btn.click(fn=fetch_feedback, inputs=[app_filter, admin_pw], outputs=[status, table])
95
+
96
  demo.launch()