removed doc
This commit is contained in:
@ -11,6 +11,7 @@ _ml_module_loaded = False
|
|||||||
|
|
||||||
#directory for generated images and basic reports
|
#directory for generated images and basic reports
|
||||||
MEDIA_DIRECTORY = Path(__file__).parent.parent.parent / "media"
|
MEDIA_DIRECTORY = Path(__file__).parent.parent.parent / "media"
|
||||||
|
VBT_DOC_DIRECTORY = Path(__file__).parent.parent.parent / "vbt-doc" #directory for vbt doc
|
||||||
RUNNER_DETAIL_DIRECTORY = Path(__file__).parent.parent.parent / "runner_detail"
|
RUNNER_DETAIL_DIRECTORY = Path(__file__).parent.parent.parent / "runner_detail"
|
||||||
|
|
||||||
#location of strat.log - it is used to fetch by gui
|
#location of strat.log - it is used to fetch by gui
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
import os,sys
|
import os,sys
|
||||||
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
sys.path.append(os.path.dirname(os.path.dirname(os.path.abspath(__file__))))
|
||||||
os.environ["KERAS_BACKEND"] = "jax"
|
os.environ["KERAS_BACKEND"] = "jax"
|
||||||
from v2realbot.config import WEB_API_KEY, DATA_DIR, MEDIA_DIRECTORY, LOG_PATH, MODEL_DIR
|
from v2realbot.config import WEB_API_KEY, DATA_DIR, MEDIA_DIRECTORY, LOG_PATH, MODEL_DIR, VBT_DOC_DIRECTORY
|
||||||
from alpaca.data.timeframe import TimeFrame, TimeFrameUnit
|
from alpaca.data.timeframe import TimeFrame, TimeFrameUnit
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from rich import print
|
from rich import print
|
||||||
@ -122,6 +122,22 @@ async def static_files(request: Request, path: str, authenticated: bool = Depend
|
|||||||
|
|
||||||
return FileResponse(file_path)
|
return FileResponse(file_path)
|
||||||
|
|
||||||
|
@app.get("/vbt-doc/{file_path:path}")
|
||||||
|
async def serve_protected_docs(file_path: str, credentials: HTTPBasicCredentials = Depends(authenticate_user)):
|
||||||
|
file_location = VBT_DOC_DIRECTORY / file_path
|
||||||
|
|
||||||
|
if file_location.is_dir(): # If it's a directory, serve index.html
|
||||||
|
index_file = file_location / "index.html"
|
||||||
|
if index_file.exists():
|
||||||
|
return FileResponse(index_file)
|
||||||
|
else:
|
||||||
|
raise HTTPException(status_code=404, detail="Index file not found")
|
||||||
|
elif file_location.exists():
|
||||||
|
return FileResponse(file_location)
|
||||||
|
else:
|
||||||
|
raise HTTPException(status_code=404, detail="File not found")
|
||||||
|
|
||||||
|
|
||||||
def get_current_username(
|
def get_current_username(
|
||||||
credentials: Annotated[HTTPBasicCredentials, Depends(security)]
|
credentials: Annotated[HTTPBasicCredentials, Depends(security)]
|
||||||
):
|
):
|
||||||
|
|||||||
Reference in New Issue
Block a user