mirror of
https://github.com/d0zingcat/deploy.git
synced 2026-06-09 15:11:00 +00:00
(feat) add orchestration pages
This commit is contained in:
13
pages/orchestration/file_manager/README.md
Normal file
13
pages/orchestration/file_manager/README.md
Normal 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)
|
||||
0
pages/orchestration/file_manager/__init__.py
Normal file
0
pages/orchestration/file_manager/__init__.py
Normal file
39
pages/orchestration/file_manager/app.py
Normal file
39
pages/orchestration/file_manager/app.py
Normal 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()
|
||||
Reference in New Issue
Block a user