Remove Gradio API page and 'Use via API' link from web UI
- Set enable_api=False in app.launch() - Hide API-related links via CSS
This commit is contained in:
@@ -313,6 +313,14 @@ def create_app():
|
||||
.header-title {{
|
||||
font-size: 60px !important;
|
||||
}}
|
||||
/* Hide Gradio's "Use via API" link/button */
|
||||
#share-btn,
|
||||
a[href*="/api"],
|
||||
a[href*="#/api"],
|
||||
a[href*="#api"],
|
||||
.gradio-container a[href*="api"] {{
|
||||
display: none !important;
|
||||
}}
|
||||
/* Mobile-friendly adjustments */
|
||||
@media (max-width: 700px) {{
|
||||
.gradio-container {{
|
||||
@@ -338,6 +346,7 @@ def create_app():
|
||||
server_name=str(server_name),
|
||||
server_port=int(server_port),
|
||||
css=accent_css,
|
||||
enable_api=False,
|
||||
)
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user