acecalisto3 commited on
Commit
5b175c0
·
verified ·
1 Parent(s): ce99a9a

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +46 -23
app.py CHANGED
@@ -551,31 +551,54 @@ if __name__ == "__main__":
551
  # Define Gradio interface
552
  demo = gr.Blocks()
553
  with demo:
554
- gr.HTML(custom_html)
555
-
556
- # Fetch issues endpoint
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
557
  fetch_issues_button = gr.Button("Fetch Issues")
558
- fetch_issues_button.click(
559
- lambda: gr.update(value=fetch_issues(github_token_input.value, repo_url_input.value))
560
- )
561
 
562
- # Resolve issue endpoint
563
- resolve_issue_button = gr.Button("Resolve Issue")
564
- resolve_issue_button.click(
565
- lambda: gr.update(value=resolve_issue(github_token_input.value, repo_url_input.value, issue_dropdown.value, resolution_textarea.value, forked_repo_url_input.value))
566
- )
 
567
 
568
- # Extract info endpoint
569
- extract_info_button = gr.Button("Extract Info")
570
- extract_info_button.click(
571
- lambda: gr.update(value=extract_info(url_textbox.value))
572
- )
573
 
574
- # Submit issue endpoint
575
- submit_button = gr.Button("Submit")
576
- submit_button.click(
577
- lambda: gr.update(value=submit_issue(github_token_input.value, repo_url_input.value, issue_dropdown.value, resolution_textarea.value, forked_repo_url_input.value))
578
- )
579
 
580
- # Launch Gradio interface
581
- demo.launch()
 
 
 
 
 
 
 
551
  # Define Gradio interface
552
  demo = gr.Blocks()
553
  with demo:
554
+ gr.HTML(custom_html)
555
+
556
+ # Define all input components first
557
+ with gr.Row():
558
+ github_token_input = gr.Textbox(label="GitHub Token", type="password")
559
+ repo_url_input = gr.Textbox(label="Repository URL")
560
+
561
+ with gr.Row():
562
+ issue_dropdown = gr.Dropdown(label="Select Issue", choices=[])
563
+ resolution_textarea = gr.Textbox(label="Resolution", lines=3)
564
+ forked_repo_url_input = gr.Textbox(label="Forked Repository URL")
565
+
566
+ with gr.Row():
567
+ output_area = gr.Textbox(label="Output", lines=5)
568
+
569
+ url_textbox = gr.Textbox(label="URL to Extract Info")
570
+
571
+ # Define buttons and their click events
572
+ with gr.Row():
573
  fetch_issues_button = gr.Button("Fetch Issues")
574
+ resolve_button = gr.Button("Resolve Issue")
575
+ extract_info_button = gr.Button("Extract Info")
576
+ submit_button = gr.Button("Submit")
577
 
578
+ # Connect event handlers
579
+ fetch_issues_button.click(
580
+ fn=fetch_issues,
581
+ inputs=[github_token_input, repo_url_input],
582
+ outputs=output_area
583
+ )
584
 
585
+ resolve_button.click(
586
+ fn=resolve_issue,
587
+ inputs=[github_token_input, repo_url_input, issue_dropdown, resolution_textarea, forked_repo_url_input],
588
+ outputs=output_area
589
+ )
590
 
591
+ extract_info_button.click(
592
+ fn=extract_info,
593
+ inputs=[url_textbox],
594
+ outputs=output_area
595
+ )
596
 
597
+ submit_button.click(
598
+ fn=submit_issue,
599
+ inputs=[github_token_input, repo_url_input, issue_dropdown, resolution_textarea, forked_repo_url_input],
600
+ outputs=output_area
601
+ )
602
+
603
+ if __name__ == "__main__":
604
+ demo.launch(share=True)