Skip to content

Commit

Permalink
fix: errors
Browse files Browse the repository at this point in the history
  • Loading branch information
motorina0 committed Nov 8, 2024
1 parent 43a1bdf commit cc9dcc4
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 15 deletions.
2 changes: 1 addition & 1 deletion crud.py
Original file line number Diff line number Diff line change
Expand Up @@ -294,7 +294,7 @@ async def get_accounts(
return await db.fetchall(
"""
SELECT * FROM nostrrelay.accounts
WHERE relay_id = :id AND allowed = :allowed OR blocked = :blocked"
WHERE relay_id = :id AND allowed = :allowed OR blocked = :blocked
""",
{"id": relay_id, "allowed": allowed, "blocked": blocked},
NostrAccount,
Expand Down
8 changes: 4 additions & 4 deletions relay/relay.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,11 +100,11 @@ class RelaySpec(RelayPublicSpec, WalletSpec, AuthSpec):

class NostrRelay(BaseModel):
id: str
user_id: str
user_id: Optional[str] = None
name: str
description: Optional[str]
pubkey: Optional[str]
contact: Optional[str]
description: Optional[str] = None
pubkey: Optional[str] = None
contact: Optional[str] = None
active: bool = False
meta: RelaySpec = RelaySpec()

Expand Down
18 changes: 14 additions & 4 deletions templates/nostrrelay/index.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
{% extends "base.html" %} {% from "macros.jinja" import window_vars with context
%} {% block page %}
<template id="relay-details">
{% include("nostrrelay/relay-details.html") %}
</template>

<div class="row q-col-gutter-md">
<div class="col-12 col-md-7 q-gutter-y-md">
<q-card>
Expand Down Expand Up @@ -107,7 +105,13 @@ <h5 class="text-subtitle1 q-my-none">Relays</h5>
<q-td colspan="100%">
<div class="row items-center q-mb-lg">
<div class="col-12">
wwww<br/>
<span v-text="props.row.id"></span><br/>
<span v-text="g.user.wallets[0].inkey"></span><br/>
<span v-text="g.user.wallets[0].adminkey"></span><br/>
<span v-text="g.user.walletOptions"></span><br/>
<relay-details

:relay-id="props.row.id"
:adminkey="g.user.wallets[0].adminkey"
:inkey="g.user.wallets[0].inkey"
Expand Down Expand Up @@ -198,9 +202,15 @@ <h6 class="text-subtitle1 q-my-none">
</q-card>
</q-dialog>
</div>
{% endblock %} {% block vue_templates %}
<template id="relay-details">
{% include("nostrrelay/relay-details.html") %}
</template>

{% endblock %} {% block scripts %} {{ window_vars(user) }}
<script src="{{ static_url_for('nostrrelay/static', path='js/utils.js') }}"></script>
<script src="{{ static_url_for('nostrrelay/static', path='components/relay-details.js') }}"></script>
<script src="{{ static_url_for('nostrrelay/static', path='js/index.js') }}"></script>
<script src="{{ static_url_for('nostrrelay/static', path='components/relay-details.js') }}"></script>


{% endblock %}
15 changes: 9 additions & 6 deletions templates/nostrrelay/relay-details.html
Original file line number Diff line number Diff line change
Expand Up @@ -400,8 +400,7 @@
color="primary"
text-color="white"
>
<span v-text="e"></span>

<span v-text="e"></span>
</q-chip>
</div>
</div>
Expand Down Expand Up @@ -433,7 +432,7 @@
color="primary"
text-color="white"
>
<span v-text="e"></span>
<span v-text="e"></span>
</q-chip>
</div>
</div>
Expand Down Expand Up @@ -642,10 +641,14 @@
@input="togglePublicKey(props.row, 'block')"
></q-toggle>
</q-td>

<q-td auto-width><span v-text="props.row.paid_to_join"></span> </q-td>

<q-td auto-width
><span v-text="props.row.paid_to_join"></span>
</q-td>
<q-td auto-width> <span v-text="props.row.sats"></span></q-td>
<q-td auto-width><span v-text="props.row.storage"></span> </q-td>
<q-td auto-width
><span v-text="props.row.storage"></span>
</q-td>
</q-tr>
</template>
</q-table>
Expand Down

0 comments on commit cc9dcc4

Please sign in to comment.