diff --git a/lnbits/extensions/gerty/crud.py b/lnbits/extensions/gerty/crud.py index fee57dba..a472ef37 100644 --- a/lnbits/extensions/gerty/crud.py +++ b/lnbits/extensions/gerty/crud.py @@ -17,26 +17,9 @@ async def create_gerty(wallet_id: str, data: Gerty) -> Gerty: lnbits_wallets, mempool_endpoint, exchange, - show_lnbits_wallets_balance, - show_sats_quote, - show_pieter_wuille_facts, - show_exchange_market_rate, - show_onchain_difficulty_epoch_progress, - show_onchain_difficulty_retarget_date, - show_onchain_difficulty_blocks_remaining, - show_onchain_difficulty_epoch_time_remaining, - show_onchain_mempool_recommended_fees, - show_onchain_mempool_number_of_tx, - show_mining_current_hash_rate, - show_mining_current_difficulty, - show_lightning_channel_count, - show_lightning_node_count, - show_lightning_tor_node_count, - show_lightning_clearnet_nodes, - show_lightning_unannounced_nodes, - show_lightning_average_channel_capacity + display_preferences ) - VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?) + VALUES (?, ?, ?, ?, ?, ?, ?) """, ( gerty_id, @@ -45,24 +28,7 @@ async def create_gerty(wallet_id: str, data: Gerty) -> Gerty: data.lnbits_wallets, data.mempool_endpoint, data.exchange, - data.show_lnbits_wallets_balance, - data.show_sats_quote, - data.show_pieter_wuille_facts, - data.show_exchange_market_rate, - data.show_onchain_difficulty_epoch_progress, - data.show_onchain_difficulty_retarget_date, - data.show_onchain_difficulty_blocks_remaining, - data.show_onchain_difficulty_epoch_time_remaining, - data.show_onchain_mempool_recommended_fees, - data.show_onchain_mempool_number_of_tx, - data.show_mining_current_hash_rate, - data.show_mining_current_difficulty, - data.show_lightning_channel_count, - data.show_lightning_node_count, - data.show_lightning_tor_node_count, - data.show_lightning_clearnet_nodes, - data.show_lightning_unannounced_nodes, - data.show_lightning_average_channel_capacity + data.display_preferences ), ) diff --git a/lnbits/extensions/gerty/migrations.py b/lnbits/extensions/gerty/migrations.py index 5e21495a..be4a1cc2 100644 --- a/lnbits/extensions/gerty/migrations.py +++ b/lnbits/extensions/gerty/migrations.py @@ -1,6 +1,6 @@ async def m001_initial(db): """ - Initial gertys table. + Initial Gertys table. """ await db.execute( """ @@ -11,24 +11,7 @@ async def m001_initial(db): lnbits_wallets TEXT, mempool_endpoint TEXT, exchange TEXT, - show_lnbits_wallets_balance BOOL, - show_sats_quote BOOL, - show_pieter_wuille_facts BOOL, - show_exchange_market_rate BOOL, - show_onchain_difficulty_epoch_progress BOOL, - show_onchain_difficulty_retarget_date BOOL, - show_onchain_difficulty_blocks_remaining BOOL, - show_onchain_difficulty_epoch_time_remaining BOOL, - show_onchain_mempool_recommended_fees BOOL, - show_onchain_mempool_number_of_tx BOOL, - show_mining_current_hash_rate BOOL, - show_mining_current_difficulty BOOL, - show_lightning_channel_count BOOL, - show_lightning_node_count BOOL, - show_lightning_tor_node_count BOOL, - show_lightning_clearnet_nodes BOOL, - show_lightning_unannounced_nodes BOOL, - show_lightning_average_channel_capacity BOOL + display_preferences TEXT ); """ ) \ No newline at end of file diff --git a/lnbits/extensions/gerty/models.py b/lnbits/extensions/gerty/models.py index bf3465d6..40185c92 100644 --- a/lnbits/extensions/gerty/models.py +++ b/lnbits/extensions/gerty/models.py @@ -4,8 +4,6 @@ from typing import Optional from fastapi import Query from pydantic import BaseModel - - class Gerty(BaseModel): id: str = Query(None) name: str @@ -13,25 +11,7 @@ class Gerty(BaseModel): lnbits_wallets: str = Query(None) # Wallets to keep an eye on, {"wallet-id": "wallet-read-key, etc"} mempool_endpoint: str = Query(None) # Mempool endpoint to use exchange: str = Query(None) # BTC <-> Fiat exchange rate to pull ie "USD", in 0.0001 and sats - show_lnbits_wallets_balance: bool = Query(False) - show_sats_quote: bool = Query(False) - show_pieter_wuille_facts: bool = Query(False) - show_exchange_market_rate: bool = Query(False) - show_onchain_difficulty_epoch_progress: bool = Query(False) - show_onchain_difficulty_retarget_date: bool = Query(False) - show_onchain_difficulty_blocks_remaining: bool = Query(False) - show_onchain_difficulty_epoch_time_remaining: bool = Query(False) - show_onchain_mempool_recommended_fees: bool = Query(False) - show_onchain_mempool_number_of_tx: bool = Query(False) - show_mining_current_hash_rate: bool = Query(False) - show_mining_current_difficulty: bool = Query(False) - show_lightning_channel_count: bool = Query(False) - show_lightning_node_count: bool = Query(False) - show_lightning_tor_node_count: bool = Query(False) - show_lightning_clearnet_nodes: bool = Query(False) - show_lightning_unannounced_nodes: bool = Query(False) - show_lightning_average_channel_capacity: bool = Query(False) - + display_preferences: str = Query(None) @classmethod def from_row(cls, row: Row) -> "Gerty": diff --git a/lnbits/extensions/gerty/templates/gerty/index.html b/lnbits/extensions/gerty/templates/gerty/index.html index 657b68a6..9308beac 100644 --- a/lnbits/extensions/gerty/templates/gerty/index.html +++ b/lnbits/extensions/gerty/templates/gerty/index.html @@ -31,7 +31,7 @@