adding urls
This commit is contained in:
parent
495719c366
commit
2403d0adfb
5 changed files with 47 additions and 6 deletions
|
|
@ -25,9 +25,10 @@ async def create_gerty(wallet_id: str, data: Gerty) -> Gerty:
|
|||
mempool_endpoint,
|
||||
exchange,
|
||||
display_preferences,
|
||||
refresh_time
|
||||
refresh_time,
|
||||
urls
|
||||
)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||
""",
|
||||
(
|
||||
gerty_id,
|
||||
|
|
@ -40,6 +41,7 @@ async def create_gerty(wallet_id: str, data: Gerty) -> Gerty:
|
|||
data.exchange,
|
||||
data.display_preferences,
|
||||
data.refresh_time,
|
||||
data.urls,
|
||||
),
|
||||
)
|
||||
|
||||
|
|
|
|||
|
|
@ -6,7 +6,7 @@ import httpx
|
|||
from loguru import logger
|
||||
import os
|
||||
import random
|
||||
from .crud import get_mempool_info
|
||||
from .crud import get_mempool_info, get_gerty
|
||||
|
||||
from .number_prefixer import *
|
||||
from ...settings import LNBITS_PATH
|
||||
|
|
@ -940,3 +940,8 @@ def get_time_remaining(seconds, granularity=2):
|
|||
name = name.rstrip("s")
|
||||
result.append("{} {}".format(round(value), name))
|
||||
return ", ".join(result[:granularity])
|
||||
|
||||
|
||||
async def get_urls_to_watch(gerty):
|
||||
gerty = await get_gerty(gerty)
|
||||
return json.loads(gerty.urls)
|
||||
|
|
@ -50,3 +50,9 @@ async def m004_initial(db):
|
|||
);
|
||||
"""
|
||||
)
|
||||
|
||||
async def m005_add_gerty_model_col(db):
|
||||
"""
|
||||
support for Gerty model col
|
||||
"""
|
||||
await db.execute("ALTER TABLE gerty.gertys ADD COLUMN urls TEXT DEFAULT '';")
|
||||
|
|
@ -20,6 +20,7 @@ class Gerty(BaseModel):
|
|||
None
|
||||
) # BTC <-> Fiat exchange rate to pull ie "USD", in 0.0001 and sats
|
||||
display_preferences: str = Query(None)
|
||||
urls: str = Query(None)
|
||||
|
||||
@classmethod
|
||||
def from_row(cls, row: Row) -> "Gerty":
|
||||
|
|
@ -44,4 +45,4 @@ class Mempool(BaseModel):
|
|||
mempool_endpoint: str = Query(None)
|
||||
endpoint: str = Query(None)
|
||||
data: str = Query(None)
|
||||
time: int = Query(None)
|
||||
time: int = Query(None)
|
||||
|
|
@ -185,7 +185,13 @@
|
|||
val="xs"
|
||||
label="Lightning"
|
||||
></q-checkbox>
|
||||
|
||||
<q-checkbox
|
||||
class="q-pl-md"
|
||||
size="xs"
|
||||
v-model="formDialog.data.display_preferences.url_checker"
|
||||
val="xs"
|
||||
label="URL Checker"
|
||||
></q-checkbox>
|
||||
<q-select
|
||||
v-if="formDialog.data.display_preferences.fun_exchange_market_rate"
|
||||
filled
|
||||
|
|
@ -213,6 +219,23 @@
|
|||
<q-tooltip>Hit enter to add values</q-tooltip>
|
||||
</q-select>
|
||||
|
||||
<q-select
|
||||
v-if="formDialog.data.display_preferences.url_checker"
|
||||
filled
|
||||
multiple
|
||||
dense
|
||||
emit-value
|
||||
v-model="formDialog.data.urls"
|
||||
use-input
|
||||
use-chips
|
||||
multiple
|
||||
hide-dropdown-icon
|
||||
new-value-mode="add-unique"
|
||||
label="Urls to watch."
|
||||
>
|
||||
<q-tooltip>Hit enter to add values</q-tooltip>
|
||||
</q-select>
|
||||
|
||||
<q-toggle
|
||||
label="*Advanced"
|
||||
v-model="toggleStates.advanced"
|
||||
|
|
@ -504,6 +527,7 @@
|
|||
mempool_recommended_fees: false,
|
||||
dashboard_mining: false,
|
||||
lightning_dashboard: false,
|
||||
url_checker: false,
|
||||
onchain: false,
|
||||
onchain_difficulty_epoch_progress: false,
|
||||
onchain_difficulty_retarget_date: false,
|
||||
|
|
@ -584,6 +608,7 @@
|
|||
this.formDialog.data.type = gerty.type
|
||||
this.formDialog.data.utc_offset = gerty.utc_offset
|
||||
this.formDialog.data.lnbits_wallets = JSON.parse(gerty.lnbits_wallets)
|
||||
this.formDialog.data.urls = JSON.stringify(gerty.urls)
|
||||
;(this.formDialog.data.exchange = gerty.exchange),
|
||||
(this.formDialog.data.mempool_endpoint = gerty.mempool_endpoint),
|
||||
(this.formDialog.data.refresh_time = gerty.refresh_time),
|
||||
|
|
@ -610,7 +635,8 @@
|
|||
this.formDialog.data.display_preferences.dashboard ||
|
||||
this.formDialog.data.display_preferences.dashboard_onchain ||
|
||||
this.formDialog.data.display_preferences.dashboard_onchain ||
|
||||
this.formDialog.data.display_preferences.lightning_dashboard
|
||||
this.formDialog.data.display_preferences.lightning_dashboard ||
|
||||
this.formDialog.data.display_preferences.url_checker
|
||||
) {
|
||||
this.formDialog.data.type = 'Gerty'
|
||||
}
|
||||
|
|
@ -619,6 +645,7 @@
|
|||
utc_offset: this.formDialog.data.utc_offset,
|
||||
type: this.formDialog.data.type,
|
||||
lnbits_wallets: JSON.stringify(this.formDialog.data.lnbits_wallets),
|
||||
urls: JSON.stringify(this.formDialog.data.urls),
|
||||
exchange: this.formDialog.data.exchange,
|
||||
mempool_endpoint: this.formDialog.data.mempool_endpoint,
|
||||
refresh_time: this.formDialog.data.refresh_time,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue