feat: Add initial manage page

This commit is contained in:
2023-12-28 18:31:44 +11:00
parent f5c222576b
commit 5f01cf5e83
10 changed files with 174 additions and 20 deletions

View File

@@ -27,9 +27,6 @@ def check_account(cookie: str):
return False
account = cookie.split(":")[0]
password = ":".join(cookie.split(":")[1:])
# Check if the account is valid
info = hsw.getAccountInfo(account, 'default')
if 'error' in info:
@@ -66,10 +63,9 @@ def getAddress(account: str):
def getPendingTX(account: str):
# Get the pending transactions
info = hsw.getWalletTxHistory()
info = hsw.getWalletTxHistory(account)
if 'error' in info:
return 0
pending = 0
for tx in info:
if tx['confirmations'] < 1:
@@ -77,7 +73,6 @@ def getPendingTX(account: str):
return pending
def getDomains(account):
# Get the domains
# info = hsw.getWalletNames(account)
@@ -182,4 +177,25 @@ def getDomain(domain: str):
return {
"error": response['error']['message']
}
return response['result']
return response['result']
def renewDomain(account,domain):
account_name = check_account(account)
password = ":".join(account.split(":")[1:])
if account_name == False:
return {
"error": "Invalid account"
}
response = hsw.sendRENEW(account_name,password,domain)
return response
def getDNS(domain: str):
# Get the DNS
response = hsd.rpc_getNameResource(domain)
if response['error'] is not None:
return {
"error": response['error']['message']
}
return response['result']['records']