copy changes
more copy clean debugging... prints! lol clean console logs fix get users Only get users that explicitly have been allowed or blocked UI UI-2 prevent getting all accounts (false, false is default) remove client side filtering remove prints
This commit is contained in:
parent
07a07fc079
commit
3c45acc4d5
4 changed files with 9 additions and 7 deletions
7
crud.py
7
crud.py
|
|
@ -391,9 +391,12 @@ async def get_accounts(
|
||||||
allowed=True,
|
allowed=True,
|
||||||
blocked=False,
|
blocked=False,
|
||||||
) -> List[NostrAccount]:
|
) -> List[NostrAccount]:
|
||||||
|
|
||||||
|
if not allowed and not blocked:
|
||||||
|
return []
|
||||||
|
|
||||||
rows = await db.fetchall(
|
rows = await db.fetchall(
|
||||||
"SELECT * FROM nostrrelay.accounts WHERE relay_id = ? AND allowed = ? AND blocked = ?",
|
"SELECT * FROM nostrrelay.accounts WHERE relay_id = ? AND allowed = ? OR blocked = ?",
|
||||||
(relay_id, allowed, blocked),
|
(relay_id, allowed, blocked),
|
||||||
)
|
)
|
||||||
|
|
||||||
return [NostrAccount.from_row(row) for row in rows]
|
return [NostrAccount.from_row(row) for row in rows]
|
||||||
|
|
|
||||||
|
|
@ -609,7 +609,6 @@
|
||||||
row-key="pubkey"
|
row-key="pubkey"
|
||||||
:columns="accountsTable.columns"
|
:columns="accountsTable.columns"
|
||||||
:pagination.sync="accountsTable.pagination"
|
:pagination.sync="accountsTable.pagination"
|
||||||
:filter="accountsFilter"
|
|
||||||
>
|
>
|
||||||
<template v-slot:body="props">
|
<template v-slot:body="props">
|
||||||
<q-tr :props="props">
|
<q-tr :props="props">
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,6 @@ async function relayDetails(path) {
|
||||||
description: ''
|
description: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
accountsFilter: '',
|
|
||||||
showBlockedAccounts: true,
|
showBlockedAccounts: true,
|
||||||
showAllowedAccounts: false,
|
showAllowedAccounts: false,
|
||||||
accountsTable: {
|
accountsTable: {
|
||||||
|
|
|
||||||
|
|
@ -195,6 +195,7 @@ async def api_create_or_update_account(
|
||||||
|
|
||||||
try:
|
try:
|
||||||
data.pubkey = normalize_public_key(data.pubkey)
|
data.pubkey = normalize_public_key(data.pubkey)
|
||||||
|
|
||||||
account = await get_account(data.relay_id, data.pubkey)
|
account = await get_account(data.relay_id, data.pubkey)
|
||||||
if not account:
|
if not account:
|
||||||
account = NostrAccount(
|
account = NostrAccount(
|
||||||
|
|
@ -256,8 +257,8 @@ async def api_delete_account(
|
||||||
@nostrrelay_ext.get("/api/v1/account")
|
@nostrrelay_ext.get("/api/v1/account")
|
||||||
async def api_get_accounts(
|
async def api_get_accounts(
|
||||||
relay_id: str,
|
relay_id: str,
|
||||||
allowed=False,
|
allowed: bool = False,
|
||||||
blocked=True,
|
blocked: bool = True,
|
||||||
wallet: WalletTypeInfo = Depends(require_invoice_key),
|
wallet: WalletTypeInfo = Depends(require_invoice_key),
|
||||||
) -> List[NostrAccount]:
|
) -> List[NostrAccount]:
|
||||||
try:
|
try:
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue