Added UTC field to gerty modal
This commit is contained in:
parent
f636951d3c
commit
ecfd4b3d66
3 changed files with 26 additions and 11 deletions
|
|
@ -14,21 +14,25 @@ async def create_gerty(wallet_id: str, data: Gerty) -> Gerty:
|
||||||
id,
|
id,
|
||||||
name,
|
name,
|
||||||
wallet,
|
wallet,
|
||||||
|
utc_offset,
|
||||||
lnbits_wallets,
|
lnbits_wallets,
|
||||||
mempool_endpoint,
|
mempool_endpoint,
|
||||||
exchange,
|
exchange,
|
||||||
display_preferences
|
display_preferences,
|
||||||
|
refresh_time
|
||||||
)
|
)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
gerty_id,
|
gerty_id,
|
||||||
data.name,
|
data.name,
|
||||||
data.wallet,
|
data.wallet,
|
||||||
|
data.utc_offset,
|
||||||
data.lnbits_wallets,
|
data.lnbits_wallets,
|
||||||
data.mempool_endpoint,
|
data.mempool_endpoint,
|
||||||
data.exchange,
|
data.exchange,
|
||||||
data.display_preferences,
|
data.display_preferences,
|
||||||
|
data.refresh_time,
|
||||||
),
|
),
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,6 +10,7 @@ class Gerty(BaseModel):
|
||||||
name: str
|
name: str
|
||||||
wallet: str
|
wallet: str
|
||||||
refresh_time: int = Query(None)
|
refresh_time: int = Query(None)
|
||||||
|
utc_offset: int = Query(None)
|
||||||
lnbits_wallets: str = Query(
|
lnbits_wallets: str = Query(
|
||||||
None
|
None
|
||||||
) # Wallets to keep an eye on, {"wallet-id": "wallet-read-key, etc"}
|
) # Wallets to keep an eye on, {"wallet-id": "wallet-read-key, etc"}
|
||||||
|
|
|
||||||
|
|
@ -179,6 +179,17 @@
|
||||||
>
|
>
|
||||||
</q-input>
|
</q-input>
|
||||||
|
|
||||||
|
<q-input
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
v-model.trim="formDialog.data.utc_offset"
|
||||||
|
label="UTC Time Offset (e.g. -1)"
|
||||||
|
>
|
||||||
|
<q-tooltip
|
||||||
|
>Enter a UTC time offset value (e.g. -1)</q-tooltip
|
||||||
|
>
|
||||||
|
</q-input>
|
||||||
|
|
||||||
<p>Use the toggles below to control what your Gerty will display</p>
|
<p>Use the toggles below to control what your Gerty will display</p>
|
||||||
|
|
||||||
<q-toggle
|
<q-toggle
|
||||||
|
|
@ -438,14 +449,7 @@
|
||||||
],
|
],
|
||||||
gertysTable: {
|
gertysTable: {
|
||||||
columns: [
|
columns: [
|
||||||
{name: 'id', align: 'left', label: 'ID', field: 'id'},
|
|
||||||
{name: 'name', align: 'left', label: 'Name', field: 'name'},
|
{name: 'name', align: 'left', label: 'Name', field: 'name'},
|
||||||
{
|
|
||||||
name: 'lnbits_wallets',
|
|
||||||
align: 'left',
|
|
||||||
label: 'Wallets',
|
|
||||||
field: 'lnbits_wallets'
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
name: 'exchange',
|
name: 'exchange',
|
||||||
align: 'left',
|
align: 'left',
|
||||||
|
|
@ -457,7 +461,9 @@
|
||||||
align: 'left',
|
align: 'left',
|
||||||
label: 'Mempool Endpoint',
|
label: 'Mempool Endpoint',
|
||||||
field: 'mempool_endpoint'
|
field: 'mempool_endpoint'
|
||||||
}
|
},
|
||||||
|
{name: 'id', align: 'left', label: 'Gerty ID', field: 'id'},
|
||||||
|
|
||||||
],
|
],
|
||||||
pagination: {
|
pagination: {
|
||||||
rowsPerPage: 10
|
rowsPerPage: 10
|
||||||
|
|
@ -466,13 +472,13 @@
|
||||||
formDialog: {
|
formDialog: {
|
||||||
show: false,
|
show: false,
|
||||||
data: {
|
data: {
|
||||||
|
utc_offset: 0,
|
||||||
display_preferences: {
|
display_preferences: {
|
||||||
dashboard: true,
|
dashboard: true,
|
||||||
fun_satoshi_quotes: true,
|
fun_satoshi_quotes: true,
|
||||||
fun_exchange_market_rate: true,
|
fun_exchange_market_rate: true,
|
||||||
onchain_dashboard: true,
|
onchain_dashboard: true,
|
||||||
mempool_recommended_fees: true,
|
mempool_recommended_fees: true,
|
||||||
mempool_tx_count: true,
|
|
||||||
mining_dashboard: true,
|
mining_dashboard: true,
|
||||||
lightning_dashboard: true
|
lightning_dashboard: true
|
||||||
},
|
},
|
||||||
|
|
@ -490,6 +496,7 @@
|
||||||
methods: {
|
methods: {
|
||||||
closeFormDialog: function () {
|
closeFormDialog: function () {
|
||||||
this.formDialog.data = {
|
this.formDialog.data = {
|
||||||
|
utc_offset: 0,
|
||||||
lnbits_wallets: [],
|
lnbits_wallets: [],
|
||||||
mempool_endpoint: "https://mempool.space",
|
mempool_endpoint: "https://mempool.space",
|
||||||
refresh_time: 300,
|
refresh_time: 300,
|
||||||
|
|
@ -516,6 +523,7 @@
|
||||||
this.formDialog.data.id = gerty.id
|
this.formDialog.data.id = gerty.id
|
||||||
this.formDialog.data.name = gerty.name
|
this.formDialog.data.name = gerty.name
|
||||||
this.formDialog.data.wallet = gerty.wallet
|
this.formDialog.data.wallet = gerty.wallet
|
||||||
|
this.formDialog.data.utc_offset = gerty.utc_offset
|
||||||
this.formDialog.data.lnbits_wallets = JSON.parse(gerty.lnbits_wallets)
|
this.formDialog.data.lnbits_wallets = JSON.parse(gerty.lnbits_wallets)
|
||||||
this.formDialog.data.exchange = gerty.exchange,
|
this.formDialog.data.exchange = gerty.exchange,
|
||||||
this.formDialog.data.mempool_endpoint = gerty.mempool_endpoint,
|
this.formDialog.data.mempool_endpoint = gerty.mempool_endpoint,
|
||||||
|
|
@ -541,6 +549,7 @@
|
||||||
var data = {
|
var data = {
|
||||||
name: this.formDialog.data.name,
|
name: this.formDialog.data.name,
|
||||||
wallet: this.formDialog.data.wallet,
|
wallet: this.formDialog.data.wallet,
|
||||||
|
utc_offset: this.formDialog.data.utc_offset,
|
||||||
lnbits_wallets: JSON.stringify(this.formDialog.data.lnbits_wallets),
|
lnbits_wallets: JSON.stringify(this.formDialog.data.lnbits_wallets),
|
||||||
exchange: this.formDialog.data.exchange,
|
exchange: this.formDialog.data.exchange,
|
||||||
mempool_endpoint: this.formDialog.data.mempool_endpoint,
|
mempool_endpoint: this.formDialog.data.mempool_endpoint,
|
||||||
|
|
@ -568,6 +577,7 @@
|
||||||
},
|
},
|
||||||
updateGerty: function (wallet, data) {
|
updateGerty: function (wallet, data) {
|
||||||
var self = this
|
var self = this
|
||||||
|
data.utc_offset = this.formDialog.data.utc_offset
|
||||||
data.lnbits_wallets = JSON.stringify(this.formDialog.data.lnbits_wallets)
|
data.lnbits_wallets = JSON.stringify(this.formDialog.data.lnbits_wallets)
|
||||||
data.display_preferences = JSON.stringify(this.formDialog.data.display_preferences)
|
data.display_preferences = JSON.stringify(this.formDialog.data.display_preferences)
|
||||||
LNbits.api
|
LNbits.api
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue