From 8a261433fc87d6845b11f89cfa43c88f850ca623 Mon Sep 17 00:00:00 2001 From: Tiago Vasconcelos Date: Mon, 23 Feb 2026 16:53:55 +0000 Subject: [PATCH 1/4] add disable option --- migrations.py | 6 ++++++ models.py | 2 ++ static/js/index.js | 6 ++++-- templates/withdraw/index.html | 28 ++++++++++++++++++++++++++++ views_lnurl.py | 17 +++++++++++++---- 5 files changed, 53 insertions(+), 6 deletions(-) diff --git a/migrations.py b/migrations.py index 754a57f..e27af8a 100644 --- a/migrations.py +++ b/migrations.py @@ -139,3 +139,9 @@ async def m007_add_created_at_timestamp(db): "ALTER TABLE withdraw.withdraw_link " f"ADD COLUMN created_at TIMESTAMP DEFAULT {db.timestamp_column_default}" ) + + +async def m008_add_enabled_column(db): + await db.execute( + "ALTER TABLE withdraw.withdraw_link ADD COLUMN enabled BOOLEAN DEFAULT true;" + ) diff --git a/models.py b/models.py index 0b4b910..e888cdf 100644 --- a/models.py +++ b/models.py @@ -15,6 +15,7 @@ class CreateWithdrawData(BaseModel): webhook_headers: str = Query(None) webhook_body: str = Query(None) custom_url: str = Query(None) + enabled: bool = Query(True) class WithdrawLink(BaseModel): @@ -37,6 +38,7 @@ class WithdrawLink(BaseModel): webhook_body: str = Query(None) custom_url: str = Query(None) created_at: datetime + enabled: bool = Query(True) lnurl: str | None = Field( default=None, no_database=True, diff --git a/static/js/index.js b/static/js/index.js index a5f4dbf..416e325 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -78,7 +78,8 @@ window.app = Vue.createApp({ use_custom: false, title: 'Vouchers', min_withdrawable: 0, - wait_time: 1 + wait_time: 1, + enabled: true } }, qrCodeDialog: { @@ -131,7 +132,8 @@ window.app = Vue.createApp({ simplecloseFormDialog() { this.simpleformDialog.data = { is_unique: false, - use_custom: false + use_custom: false, + enabled: true } }, openQrCodeDialog(linkId) { diff --git a/templates/withdraw/index.html b/templates/withdraw/index.html index 3b75e11..276abab 100644 --- a/templates/withdraw/index.html +++ b/templates/withdraw/index.html @@ -38,6 +38,7 @@
Withdraw links
>