(feat) add orchestration pages

This commit is contained in:
cardosofede
2024-07-09 18:11:12 +03:00
parent 291252c853
commit abfb9e96ae
19 changed files with 520 additions and 0 deletions

View File

@@ -0,0 +1,13 @@
### Description
This page helps you manage and edit script files to run with Hummingbot instances:
- Selecting files
- Editing and saving files
### Maintainers
This page is maintained by Hummingbot Foundation:
* [cardosfede](https://github.com/cardosfede)
* [fengtality](https://github.com/fengtality)

View File

@@ -0,0 +1,39 @@
from types import SimpleNamespace
import streamlit as st
from streamlit_elements import elements, mui
from frontend.components.bots_file_explorer import BotsFileExplorer
from frontend.components.dashboard import Dashboard
from frontend.components.editor import Editor
from frontend.st_utils import initialize_st_page
initialize_st_page(title="Strategy Configs", icon="🗂️")
if "fe_board" not in st.session_state:
board = Dashboard()
fe_board = SimpleNamespace(
dashboard=board,
file_explorer=BotsFileExplorer(board, 0, 0, 3, 7),
editor=Editor(board, 4, 0, 9, 7),
)
st.session_state.fe_board = fe_board
else:
fe_board = st.session_state.fe_board
# Add new tabs
for tab_name, content in fe_board.file_explorer.tabs.items():
if tab_name not in fe_board.editor.tabs:
fe_board.editor.add_tab(tab_name, content["content"], content["language"])
# Remove deleted tabs
for tab_name in list(fe_board.editor.tabs.keys()):
if tab_name not in fe_board.file_explorer.tabs:
fe_board.editor.remove_tab(tab_name)
with elements("file_manager"):
with mui.Paper(elevation=3, style={"padding": "2rem"}, spacing=[2, 2], container=True):
with fe_board.dashboard():
fe_board.file_explorer()
fe_board.editor()