Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 10 additions & 5 deletions frontend/components/launch_strategy_v2.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,7 @@ def launch_new_bot(self):
st.warning("You need to select the controllers configs. Please select at least one controller "
"config by clicking on the checkbox.")
return
start_time_str = time.strftime("%Y.%m.%d_%H.%M")
start_time_str = time.strftime("%Y%m%d-%H%M")
bot_name = f"{self._bot_name}-{start_time_str}"
script_config = {
"name": bot_name,
Expand Down Expand Up @@ -166,13 +166,18 @@ def __call__(self):
all_controllers_config = self._backend_api_client.get_all_controllers_config()
data = []
for config in all_controllers_config:
# Handle case where config might be a string instead of dict
if isinstance(config, str):
st.warning(f"Unexpected config format: {config}. Expected a dictionary.")
continue

connector_name = config.get("connector_name", "Unknown")
trading_pair = config.get("trading_pair", "Unknown")
total_amount_quote = config.get("total_amount_quote", 0)
stop_loss = config.get("stop_loss", 0)
take_profit = config.get("take_profit", 0)
total_amount_quote = float(config.get("total_amount_quote", 0))
stop_loss = float(config.get("stop_loss", 0))
take_profit = float(config.get("take_profit", 0))
trailing_stop = config.get("trailing_stop", {"activation_price": 0, "trailing_delta": 0})
time_limit = config.get("time_limit", 0)
time_limit = float(config.get("time_limit", 0))
config_version = config["id"].split("_")
if len(config_version) > 1:
config_base = config_version[0]
Expand Down
34 changes: 29 additions & 5 deletions frontend/pages/orchestration/credentials/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,13 +98,37 @@ def get_all_connectors_config_map():

st.write(f"Configuration Map for {connector_name}:")
config_inputs = {}
cols = st.columns(NUM_COLUMNS)
for i, config in enumerate(config_map):
with cols[i % (NUM_COLUMNS - 1)]:
config_inputs[config] = st.text_input(config, type="password", key=f"{connector_name}_{config}")

with cols[-1]:
# Custom logic for XRPL connector
if connector_name == "xrpl":
# Define custom XRPL fields with default values
xrpl_fields = {
"xrpl_secret_key": "",
"wss_node_url": "wss://xrplcluster.com",
"wss_second_node_url": "wss://s1.ripple.com",
"wss_third_node_url": "wss://s2.ripple.com"
}

# Display XRPL-specific fields
for field, default_value in xrpl_fields.items():
if field == "xrpl_secret_key":
config_inputs[field] = st.text_input(field, type="password", key=f"{connector_name}_{field}")
else:
config_inputs[field] = st.text_input(field, value=default_value, key=f"{connector_name}_{field}")

if st.button("Submit Credentials"):
response = client.add_connector_keys(account_name, connector_name, config_inputs)
if response:
st.success(response)
else:
# Default behavior for other connectors
cols = st.columns(NUM_COLUMNS)
for i, config in enumerate(config_map):
with cols[i % (NUM_COLUMNS - 1)]:
config_inputs[config] = st.text_input(config, type="password", key=f"{connector_name}_{config}")

with cols[-1]:
if st.button("Submit Credentials"):
response = client.add_connector_keys(account_name, connector_name, config_inputs)
if response:
st.success(response)