Skip to content

Commit

Permalink
Merge pull request #119 from 1chooo/ho-dev
Browse files Browse the repository at this point in the history
update: NavBar
  • Loading branch information
1chooo authored Sep 11, 2023
2 parents b2d692b + 217dc15 commit aac5ff0
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 43 deletions.
11 changes: 6 additions & 5 deletions Refinaid/App/app.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
'''
Create Date: 2023/09/08
Author: @1chooo (Hugo ChunHo Lin)
Expand All @@ -13,7 +14,7 @@
from fastapi import Form, Depends, HTTPException
import gradio as gr

PLAYGROUND_PATH = "/gradio"
CLASSIFIER_PLAYGROUND_PATH = "/classifier"

app = FastAPI(
title="SIMPLE AI",
Expand All @@ -39,7 +40,7 @@
"favicon.png"
)
app = gr.mount_gradio_app(
app, classifier_demo, path=PLAYGROUND_PATH,
app, classifier_demo, path=CLASSIFIER_PLAYGROUND_PATH,
)

@app.get("/", response_class=HTMLResponse)
Expand Down Expand Up @@ -108,10 +109,10 @@ async def page_orders(request: Request, ):
f"orders.html", {"request": request}
)

@app.get("/playgrounds", response_class=HTMLResponse)
async def page_playgrounds(request: Request, ):
@app.get("/playgrounds_introduction", response_class=HTMLResponse)
async def page_playgrounds_introduction(request: Request, ):
return templates.TemplateResponse(
f"playgrounds.html", {"request": request}
f"playgrounds_introduction.html", {"request": request}
)

@app.get("/favicon.ico")
Expand Down
1 change: 1 addition & 0 deletions main.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# -*- coding: utf-8 -*-
'''
Create Date: 2023/08/25
Author: @VincentLi1216, @1chooo
Expand Down
7 changes: 3 additions & 4 deletions templates/about_us.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
7 changes: 3 additions & 4 deletions templates/docs.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
7 changes: 3 additions & 4 deletions templates/help.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
7 changes: 3 additions & 4 deletions templates/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
7 changes: 3 additions & 4 deletions templates/license.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
7 changes: 3 additions & 4 deletions templates/navbar.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -260,12 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link"
href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link"
href="/playgrounds">Playgrounds 1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down Expand Up @@ -388,7 +386,7 @@ <h1 class="app-page-title">Playgrounds</h1>

<div class="row g-4 mb-4">
<body>
<iframe src="http://127.0.0.1:5002/gradio" frameborder="0" width="1200" height="1600"></iframe>
<iframe src="http://127.0.0.1:5002/classifier" frameborder="0" width="1200" height="1600"></iframe>
</body>
</div>

Expand Down
7 changes: 3 additions & 4 deletions templates/settings.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down
7 changes: 3 additions & 4 deletions templates/teaching.html
Original file line number Diff line number Diff line change
Expand Up @@ -260,11 +260,10 @@ <h5 class="dropdown-menu-title mb-0">Notifications</h5>
</a><!--//nav-link-->
<div id="submenu-1" class="collapse submenu submenu-1" data-bs-parent="#menu-accordion">
<ul class="submenu-list list-unstyled">
<li class="submenu-item"><a class="submenu-link" href="/gradio"
target="_blank">Gradio</a>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds_introduction">Introduction</a>
</li>
<li class="submenu-item"><a class="submenu-link" href="/playgrounds">Playgrounds
1</a>
<li class="submenu-item"><a class="submenu-link" href="/classifier"
target="_blank">Classifier</a>
</li>
</ul>
</div>
Expand Down

0 comments on commit aac5ff0

Please sign in to comment.