mirror of
https://github.com/aljazceru/hummingbot-dashboard.git
synced 2026-01-11 01:14:25 +01:00
(feat) improve accounts name
This commit is contained in:
@@ -253,7 +253,7 @@ class BackendAPIClient:
|
||||
|
||||
def delete_account(self, account_name: str):
|
||||
"""Delete an account."""
|
||||
endpoint = "delete-account/"
|
||||
endpoint = "delete-account"
|
||||
return self.post(endpoint, params={"account_name": account_name})
|
||||
|
||||
def delete_credential(self, account_name: str, connector_name: str):
|
||||
|
||||
@@ -42,6 +42,7 @@ with c1:
|
||||
st.header("Create a New Account")
|
||||
new_account_name = st.text_input("New Account Name")
|
||||
if st.button("Create Account"):
|
||||
new_account_name = new_account_name.strip()
|
||||
if new_account_name:
|
||||
if new_account_name in accounts:
|
||||
st.warning(f"Account {new_account_name} already exists.")
|
||||
@@ -49,7 +50,7 @@ with c1:
|
||||
elif new_account_name == "":
|
||||
st.warning("Please enter a valid account name.")
|
||||
st.stop()
|
||||
response = client.add_account(new_account_name.strip())
|
||||
response = client.add_account(new_account_name)
|
||||
st.write(response)
|
||||
else:
|
||||
st.write("Please enter an account name.")
|
||||
|
||||
Reference in New Issue
Block a user