Add HTML templates for dashboard, metrics, overview, and backtesting
CI / lint-test-build (push) Failing after 1m7s
CI / lint-test-build (push) Failing after 1m7s
- Introduced new HTML templates for the dashboard, metrics, overview, and backtesting functionalities. - Implemented partial templates for metrics, overview, audit, controls, and charts to enhance modularity. - Updated the Jinja2 template resolution logic to support different deployment environments. - Added a health check template to display the service status. - Included a test suite to verify the template resolution logic. - Updated `pyproject.toml` to include new HTML templates in the package data.
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import platform
|
||||
from importlib import import_module
|
||||
|
||||
import uvicorn
|
||||
|
||||
from arbitrade.api.app import create_app
|
||||
from arbitrade.config.settings import get_settings
|
||||
|
||||
|
||||
def _install_uvloop_if_available() -> None:
|
||||
if platform.system() == "Windows":
|
||||
return
|
||||
|
||||
try:
|
||||
uvloop = import_module("uvloop")
|
||||
uvloop.install()
|
||||
except Exception:
|
||||
# App can still run with default asyncio loop.
|
||||
return
|
||||
|
||||
|
||||
def main() -> None:
|
||||
_install_uvloop_if_available()
|
||||
|
||||
settings = get_settings()
|
||||
app = create_app(settings)
|
||||
|
||||
uvicorn.run(
|
||||
app,
|
||||
host=settings.app_host,
|
||||
port=settings.app_port,
|
||||
log_level=settings.log_level.lower(),
|
||||
loop="uvloop" if platform.system() != "Windows" else "asyncio",
|
||||
http="httptools",
|
||||
)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
main()
|
||||
Reference in New Issue
Block a user