diff --git a/frontend/components/directional_strategy_creation_card.py b/frontend/components/directional_strategy_creation_card.py deleted file mode 100644 index 9aa733d..0000000 --- a/frontend/components/directional_strategy_creation_card.py +++ /dev/null @@ -1,47 +0,0 @@ -from streamlit_elements import mui, lazy - -import constants -from utils.file_templates import directional_trading_controller_template -from utils.os_utils import save_file -from .dashboard import Dashboard - - -class DirectionalStrategyCreationCard(Dashboard.Item): - def __init__(self, *args, **kwargs): - super().__init__(*args, **kwargs) - self._strategy_name = "CustomStrategy" - self._strategy_type = "directional" - - def _set_strategy_name(self, event): - self._strategy_name = event.target.value - - def _set_strategy_type(self, _, childs): - self._strategy_type = childs.props.value - - def _create_strategy(self): - if self._strategy_type == "directional": - strategy_code = directional_trading_controller_template(self._strategy_name) - save_file(name=f"{self._strategy_name.lower()}.py", content=strategy_code, - path=constants.CONTROLLERS_PATH) - - def __call__(self): - with mui.Paper(key=self._key, sx={"display": "flex", "flexDirection": "column", "borderRadius": 3, "overflow": "hidden"}, elevation=1): - with self.title_bar(padding="10px 15px 10px 15px", dark_switcher=False): - mui.icon.NoteAdd() - mui.Typography("Create new strategy", variant="h6") - - with mui.Grid(container=True, spacing=2, sx={"padding": "10px"}): - with mui.Grid(item=True, xs=5): - with mui.FormControl(variant="standard", sx={"width": "100%"}): - mui.FormHelperText("Template name") - with mui.Select(label="Select strategy type", defaultValue="directional", - variant="standard", onChange=lazy(self._set_strategy_type)): - mui.MenuItem("Directional", value="directional") - with mui.Grid(item=True, xs=5): - with mui.FormControl(variant="standard", sx={"width": "100%"}): - mui.TextField(defaultValue="CustomStrategy", label="Strategy Name", - variant="standard", onChange=lazy(self._set_strategy_name)) - with mui.Grid(item=True, xs=2): - with mui.Button(variant="contained", onClick=self._create_strategy): - mui.icon.Add() - mui.Typography("Create", variant="body1") diff --git a/frontend/components/exited_bot_card.py b/frontend/components/exited_bot_card.py index eb020f3..df40ae7 100644 --- a/frontend/components/exited_bot_card.py +++ b/frontend/components/exited_bot_card.py @@ -2,7 +2,7 @@ from docker_manager import DockerManager from streamlit_elements import mui from frontend.components.dashboard import Dashboard -from utils import os_utils +from backend.utils import os_utils class ExitedBotCard(Dashboard.Item): diff --git a/frontend/components/launch_bot_card.py b/frontend/components/launch_bot_card.py index 6cf9f7f..c435518 100644 --- a/frontend/components/launch_bot_card.py +++ b/frontend/components/launch_bot_card.py @@ -6,7 +6,7 @@ import streamlit as st from streamlit_elements import mui, lazy import constants -from utils.os_utils import get_directories_from_directory +from backend.utils.os_utils import get_directories_from_directory from .dashboard import Dashboard diff --git a/frontend/components/launch_strategy_v2.py b/frontend/components/launch_strategy_v2.py index 12ca115..1de6430 100644 --- a/frontend/components/launch_strategy_v2.py +++ b/frontend/components/launch_strategy_v2.py @@ -4,7 +4,7 @@ import streamlit as st from streamlit_elements import mui, lazy from CONFIG import BACKEND_API_HOST, BACKEND_API_PORT -from utils.backend_api_client import BackendAPIClient +from backend.services.backend_api_client import BackendAPIClient from .dashboard import Dashboard