mirror of
				https://github.com/open-webui/open-webui
				synced 2025-06-26 18:26:48 +00:00 
			
		
		
		
	refac
This commit is contained in:
		
							parent
							
								
									1902d4238b
								
							
						
					
					
						commit
						5bdb1c99bb
					
				@ -18,6 +18,8 @@ from typing import Optional
 | 
			
		||||
from aiocache import cached
 | 
			
		||||
import aiohttp
 | 
			
		||||
import requests
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
from fastapi import (
 | 
			
		||||
    Depends,
 | 
			
		||||
    FastAPI,
 | 
			
		||||
@ -29,8 +31,9 @@ from fastapi import (
 | 
			
		||||
    status,
 | 
			
		||||
    applications,
 | 
			
		||||
)
 | 
			
		||||
from fastapi.middleware.cors import CORSMiddleware
 | 
			
		||||
from fastapi.openapi.docs import get_swagger_ui_html
 | 
			
		||||
 | 
			
		||||
from fastapi.middleware.cors import CORSMiddleware
 | 
			
		||||
from fastapi.responses import JSONResponse, RedirectResponse
 | 
			
		||||
from fastapi.staticfiles import StaticFiles
 | 
			
		||||
 | 
			
		||||
@ -1109,7 +1112,7 @@ app.mount("/static", StaticFiles(directory=STATIC_DIR), name="static")
 | 
			
		||||
app.mount("/cache", StaticFiles(directory=CACHE_DIR), name="cache")
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
def swagger_monkey_patch(*args, **kwargs):
 | 
			
		||||
def swagger_ui_html(*args, **kwargs):
 | 
			
		||||
    return get_swagger_ui_html(
 | 
			
		||||
        *args,
 | 
			
		||||
        **kwargs,
 | 
			
		||||
@ -1119,7 +1122,7 @@ def swagger_monkey_patch(*args, **kwargs):
 | 
			
		||||
    )
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
applications.get_swagger_ui_html = swagger_monkey_patch
 | 
			
		||||
applications.get_swagger_ui_html = swagger_ui_html
 | 
			
		||||
 | 
			
		||||
if os.path.exists(FRONTEND_BUILD_DIR):
 | 
			
		||||
    mimetypes.add_type("text/javascript", ".js")
 | 
			
		||||
 | 
			
		||||
		Loading…
	
		Reference in New Issue
	
	Block a user