(feat) refactor deploy pages

This commit is contained in:
cardosofede
2024-05-18 03:17:26 -04:00
parent 47e81413e1
commit d93dd73f9d
4 changed files with 50 additions and 3 deletions

View File

@@ -1,4 +1,10 @@
from frontend.components.deploy_v2_with_controllers import LaunchV2WithControllers
from types import SimpleNamespace
import streamlit as st
from streamlit_elements import elements, mui
from frontend.components.dashboard import Dashboard
from frontend.components.launch_strategy_v2 import LaunchStrategyV2
from frontend.st_utils import initialize_st_page
CARD_WIDTH = 6
@@ -7,6 +13,19 @@ NUM_CARD_COLS = 2
initialize_st_page(title="Launch Bot", icon="🙌")
if "launch_bots_board" not in st.session_state:
board = Dashboard()
launch_bots_board = SimpleNamespace(
dashboard=board,
launch_bot=LaunchStrategyV2(board, 0, 0, 12, 10),
)
st.session_state.launch_bots_board = launch_bots_board
launcher = LaunchV2WithControllers()
launcher()
else:
launch_bots_board = st.session_state.launch_bots_board
with elements("create_bot"):
with mui.Paper(elevation=3, style={"padding": "2rem"}, spacing=[2, 2], container=True):
with launch_bots_board.dashboard():
launch_bots_board.launch_bot()

View File

@@ -0,0 +1,19 @@
### Description
This page helps you deploy and manage Hummingbot instances:
- Starting and stopping Hummingbot Broker
- Creating, starting and stopping bot instances
- Managing strategy and script files that instances run
- Fetching status of running instances
### Maintainers
This page is maintained by Hummingbot Foundation as a template other pages:
* [cardosfede](https://github.com/cardosfede)
* [fengtality](https://github.com/fengtality)
### Wiki
See the [wiki](https://github.com/hummingbot/dashboard/wiki/%F0%9F%90%99-Bot-Orchestration) for more information.

View File

@@ -0,0 +1,9 @@
from frontend.components.deploy_v2_with_controllers import LaunchV2WithControllers
from frontend.st_utils import initialize_st_page
initialize_st_page(title="Launch Bot ST", icon="🙌")
launcher = LaunchV2WithControllers()
launcher()