Added type to Gerty extension Vue, migration and Crud
This commit is contained in:
parent
df56b84ad2
commit
592a52e9a2
4 changed files with 23 additions and 1 deletions
|
|
@ -15,19 +15,21 @@ async def create_gerty(wallet_id: str, data: Gerty) -> Gerty:
|
||||||
name,
|
name,
|
||||||
wallet,
|
wallet,
|
||||||
utc_offset,
|
utc_offset,
|
||||||
|
type,
|
||||||
lnbits_wallets,
|
lnbits_wallets,
|
||||||
mempool_endpoint,
|
mempool_endpoint,
|
||||||
exchange,
|
exchange,
|
||||||
display_preferences,
|
display_preferences,
|
||||||
refresh_time
|
refresh_time
|
||||||
)
|
)
|
||||||
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?)
|
||||||
""",
|
""",
|
||||||
(
|
(
|
||||||
gerty_id,
|
gerty_id,
|
||||||
data.name,
|
data.name,
|
||||||
data.wallet,
|
data.wallet,
|
||||||
data.utc_offset,
|
data.utc_offset,
|
||||||
|
data.type,
|
||||||
data.lnbits_wallets,
|
data.lnbits_wallets,
|
||||||
data.mempool_endpoint,
|
data.mempool_endpoint,
|
||||||
data.exchange,
|
data.exchange,
|
||||||
|
|
|
||||||
|
|
@ -23,3 +23,9 @@ async def m002_add_utc_offset_col(db):
|
||||||
support for UTC offset
|
support for UTC offset
|
||||||
"""
|
"""
|
||||||
await db.execute("ALTER TABLE gerty.gertys ADD COLUMN utc_offset INT;")
|
await db.execute("ALTER TABLE gerty.gertys ADD COLUMN utc_offset INT;")
|
||||||
|
|
||||||
|
async def m003_add_gerty_model_col(db):
|
||||||
|
"""
|
||||||
|
support for Gerty model col
|
||||||
|
"""
|
||||||
|
await db.execute("ALTER TABLE gerty.gertys ADD COLUMN type TEXT;")
|
||||||
|
|
@ -11,6 +11,7 @@ class Gerty(BaseModel):
|
||||||
wallet: str
|
wallet: str
|
||||||
refresh_time: int = Query(None)
|
refresh_time: int = Query(None)
|
||||||
utc_offset: int = Query(None)
|
utc_offset: int = Query(None)
|
||||||
|
type: str
|
||||||
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"}
|
||||||
|
|
|
||||||
|
|
@ -127,6 +127,14 @@
|
||||||
label="Name"
|
label="Name"
|
||||||
placeholder="Son of Gerty"
|
placeholder="Son of Gerty"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
<q-select
|
||||||
|
filled
|
||||||
|
dense
|
||||||
|
emit-value
|
||||||
|
v-model="formDialog.data.type"
|
||||||
|
:options="['Gerty', 'Mini Gerty']"
|
||||||
|
label="Gerty Type *"
|
||||||
|
></q-select>
|
||||||
<q-select
|
<q-select
|
||||||
filled
|
filled
|
||||||
dense
|
dense
|
||||||
|
|
@ -583,6 +591,7 @@
|
||||||
show: false,
|
show: false,
|
||||||
data: {
|
data: {
|
||||||
utc_offset: 0,
|
utc_offset: 0,
|
||||||
|
type: 'Gerty',
|
||||||
display_preferences: {
|
display_preferences: {
|
||||||
dashboard: true,
|
dashboard: true,
|
||||||
fun_satoshi_quotes: true,
|
fun_satoshi_quotes: true,
|
||||||
|
|
@ -619,6 +628,7 @@
|
||||||
lnbits_wallets: [],
|
lnbits_wallets: [],
|
||||||
mempool_endpoint: "https://mempool.space",
|
mempool_endpoint: "https://mempool.space",
|
||||||
refresh_time: 300,
|
refresh_time: 300,
|
||||||
|
type: 'Gerty',
|
||||||
display_preferences: {},
|
display_preferences: {},
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
@ -641,6 +651,7 @@
|
||||||
console.log('gerty.display_preferences', gerty.display_preferences)
|
console.log('gerty.display_preferences', gerty.display_preferences)
|
||||||
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.type = gerty.type
|
||||||
this.formDialog.data.wallet = gerty.wallet
|
this.formDialog.data.wallet = gerty.wallet
|
||||||
this.formDialog.data.utc_offset = gerty.utc_offset
|
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)
|
||||||
|
|
@ -669,6 +680,7 @@
|
||||||
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,
|
utc_offset: this.formDialog.data.utc_offset,
|
||||||
|
type: this.formDialog.data.type,
|
||||||
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,
|
||||||
|
|
@ -697,6 +709,7 @@
|
||||||
updateGerty: function (wallet, data) {
|
updateGerty: function (wallet, data) {
|
||||||
var self = this
|
var self = this
|
||||||
data.utc_offset = this.formDialog.data.utc_offset
|
data.utc_offset = this.formDialog.data.utc_offset
|
||||||
|
data.type = this.formDialog.data.type
|
||||||
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