mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-25 11:14:02 +02:00
formatting
This commit is contained in:
@@ -13,6 +13,7 @@ from .helpers import fetch_onchain_balance
|
|||||||
from .models import Charges, CreateCharge, SatsPayThemes
|
from .models import Charges, CreateCharge, SatsPayThemes
|
||||||
|
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
|
|
||||||
###############CHARGES##########################
|
###############CHARGES##########################
|
||||||
|
|
||||||
|
|
||||||
@@ -97,7 +98,7 @@ async def update_charge(charge_id: str, **kwargs) -> Optional[Charges]:
|
|||||||
|
|
||||||
async def get_charge(charge_id: str) -> Charges:
|
async def get_charge(charge_id: str) -> Charges:
|
||||||
row = await db.fetchone("SELECT * FROM satspay.charges WHERE id = ?", (charge_id,))
|
row = await db.fetchone("SELECT * FROM satspay.charges WHERE id = ?", (charge_id,))
|
||||||
|
|
||||||
return Charges.from_row(row) if row else None
|
return Charges.from_row(row) if row else None
|
||||||
|
|
||||||
|
|
||||||
@@ -179,7 +180,6 @@ async def get_themes(user_id: str) -> List[SatsPayThemes]:
|
|||||||
return await get_config(row.user)
|
return await get_config(row.user)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
################## SETTINGS ###################
|
################## SETTINGS ###################
|
||||||
|
|
||||||
|
|
||||||
|
@@ -75,6 +75,7 @@ class Charges(BaseModel):
|
|||||||
def must_call_webhook(self):
|
def must_call_webhook(self):
|
||||||
return self.webhook and self.paid and self.config.webhook_success == False
|
return self.webhook and self.paid and self.config.webhook_success == False
|
||||||
|
|
||||||
|
|
||||||
class SatsPayThemes(BaseModel):
|
class SatsPayThemes(BaseModel):
|
||||||
css_id: str = Query(None)
|
css_id: str = Query(None)
|
||||||
title: str = Query(None)
|
title: str = Query(None)
|
||||||
|
@@ -23,7 +23,11 @@
|
|||||||
color="primary"
|
color="primary"
|
||||||
@click="getThemes();formDialogThemes.show = true"
|
@click="getThemes();formDialogThemes.show = true"
|
||||||
>New CSS Theme
|
>New CSS Theme
|
||||||
<q-tooltip>For security reason, custom css is only available to server admins.</q-tooltip></q-btn>
|
<q-tooltip
|
||||||
|
>For security reason, custom css is only available to server
|
||||||
|
admins.</q-tooltip
|
||||||
|
></q-btn
|
||||||
|
>
|
||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
@@ -276,7 +280,7 @@
|
|||||||
</q-card-section>
|
</q-card-section>
|
||||||
</q-card>
|
</q-card>
|
||||||
|
|
||||||
<q-card v-if="admin == 'True'">
|
<q-card v-if="admin == 'True'">
|
||||||
<q-card-section>
|
<q-card-section>
|
||||||
<div class="row items-center no-wrap q-mb-md">
|
<div class="row items-center no-wrap q-mb-md">
|
||||||
<div class="col">
|
<div class="col">
|
||||||
@@ -949,8 +953,8 @@
|
|||||||
},
|
},
|
||||||
created: async function () {
|
created: async function () {
|
||||||
console.log(this.admin)
|
console.log(this.admin)
|
||||||
if(this.admin == "True"){
|
if (this.admin == 'True') {
|
||||||
await this.getThemes()
|
await this.getThemes()
|
||||||
}
|
}
|
||||||
await this.getCharges()
|
await this.getCharges()
|
||||||
await this.getWalletConfig()
|
await this.getWalletConfig()
|
||||||
|
@@ -19,6 +19,7 @@ from loguru import logger
|
|||||||
|
|
||||||
templates = Jinja2Templates(directory="templates")
|
templates = Jinja2Templates(directory="templates")
|
||||||
|
|
||||||
|
|
||||||
@satspay_ext.get("/", response_class=HTMLResponse)
|
@satspay_ext.get("/", response_class=HTMLResponse)
|
||||||
async def index(request: Request, user: User = Depends(check_user_exists)):
|
async def index(request: Request, user: User = Depends(check_user_exists)):
|
||||||
admin = False
|
admin = False
|
||||||
|
@@ -151,7 +151,7 @@ async def api_charge_balance(charge_id):
|
|||||||
|
|
||||||
return {**public_charge(charge)}
|
return {**public_charge(charge)}
|
||||||
|
|
||||||
|
|
||||||
#############################THEMES##########################
|
#############################THEMES##########################
|
||||||
|
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user