Pretty much everything loading in software Gerty
This commit is contained in:
parent
eb9ec21c89
commit
2e786e63bf
2 changed files with 130 additions and 209 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{% extends "public.html" %} {% block toolbar_title %} Gerty: {% raw %}{{ gertyname }}{% endraw %}{%
|
{% extends "public.html" %} {% block toolbar_title %} Gerty: {% raw %}{{ gertyname }}{% endraw %}{%
|
||||||
endblock %}{% block page %} {% raw %}
|
endblock %}{% block page %} {% raw %}
|
||||||
|
|
||||||
<div class="q-pa-md row items-start q-gutter-md">
|
<div class="q-pa-md row items-start q-gutter-md" v-if="fun_exchange_market_rate || fun_satoshi_quotes">
|
||||||
|
|
||||||
<q-card v-if="fun_exchange_market_rate" unelevated class="q-pa-sm" style="background: none !important">
|
<q-card v-if="fun_exchange_market_rate" unelevated class="q-pa-sm" style="background: none !important">
|
||||||
<q-card-section class="text-h1 q-pa-none">
|
<q-card-section class="text-h1 q-pa-none">
|
||||||
|
|
@ -30,6 +30,36 @@ endblock %}{% block page %} {% raw %}
|
||||||
</q-card>
|
</q-card>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="q-pa-md row items-start q-gutter-md" v-if="dashboard_onchain || dashboard_mining || lightning_dashboard">
|
||||||
|
<q-card class="q-pa-sm" v-if="dashboard_onchain" unelevated class="q-pa-sm">
|
||||||
|
<q-card-section>
|
||||||
|
<div class="text-h6">Onchain</div>
|
||||||
|
</q-card-section>
|
||||||
|
<q-card-section class="q-pa-none">
|
||||||
|
<p v-for="(item, t) in dashboard_onchain"><b>{{item[0].value}}: </b>{{item[1].value}}</p>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
|
<q-card class="q-pa-sm" v-if="dashboard_mining" unelevated class="q-pa-sm">
|
||||||
|
<q-card-section>
|
||||||
|
<div class="text-h6">Mining</div>
|
||||||
|
</q-card-section>
|
||||||
|
<q-card-section class="q-pa-none">
|
||||||
|
<p v-for="(item, t) in dashboard_mining"><b>{{item[0].value}}:</b> {{item[1].value}}</p>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
|
<q-card class="q-pa-sm" v-if="lightning_dashboard" unelevated class="q-pa-sm">
|
||||||
|
<q-card-section>
|
||||||
|
<div class="text-h6">Lightning (Last 7 days)</div>
|
||||||
|
</q-card-section>
|
||||||
|
<q-card-section class="q-pa-none">
|
||||||
|
<p v-for="(item, t) in lightning_dashboard"><b>{{item[0].value}}:</b> {{item[1].value}}</p>
|
||||||
|
</q-card-section>
|
||||||
|
</q-card>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
{% endraw %} {% endblock %} {% block scripts %}
|
{% endraw %} {% endblock %} {% block scripts %}
|
||||||
<script>
|
<script>
|
||||||
Vue.component(VueQrcode.name, VueQrcode)
|
Vue.component(VueQrcode.name, VueQrcode)
|
||||||
|
|
@ -40,7 +70,7 @@ endblock %}{% block page %} {% raw %}
|
||||||
data: function () {
|
data: function () {
|
||||||
return {
|
return {
|
||||||
lnbits_wallets_balance: {},
|
lnbits_wallets_balance: {},
|
||||||
onchain: {},
|
dashboard_onchain: {},
|
||||||
fun_satoshi_quotes: {},
|
fun_satoshi_quotes: {},
|
||||||
fun_exchange_market_rate: {},
|
fun_exchange_market_rate: {},
|
||||||
gerty: [],
|
gerty: [],
|
||||||
|
|
@ -67,7 +97,7 @@ endblock %}{% block page %} {% raw %}
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
getGertyInfo: async function () {
|
getGertyInfo: async function () {
|
||||||
for (let i = 0; i < 5; i++){
|
for (let i = 0; i < 8; i++){
|
||||||
try {
|
try {
|
||||||
const {data} = await LNbits.api.request(
|
const {data} = await LNbits.api.request(
|
||||||
'GET',
|
'GET',
|
||||||
|
|
@ -79,10 +109,6 @@ endblock %}{% block page %} {% raw %}
|
||||||
LNbits.utils.notifyApiError(error)
|
LNbits.utils.notifyApiError(error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
|
||||||
},
|
|
||||||
created: async function () {
|
|
||||||
await this.getGertyInfo()
|
|
||||||
console.log(this.gerty)
|
console.log(this.gerty)
|
||||||
for (let i = 0; i < this.gerty.length; i++) {
|
for (let i = 0; i < this.gerty.length; i++) {
|
||||||
if(this.gerty[i].screen.group == "lnbits_wallets_balance"){
|
if(this.gerty[i].screen.group == "lnbits_wallets_balance"){
|
||||||
|
|
@ -96,9 +122,17 @@ endblock %}{% block page %} {% raw %}
|
||||||
this.gertyname = this.gerty[i].settings.name
|
this.gertyname = this.gerty[i].settings.name
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if(this.gerty[i].screen.group == "onchain"){
|
if(this.gerty[i].screen.group == "dashboard_onchain"){
|
||||||
this.onchain = this.gerty[i].screen.areas
|
this.dashboard_onchain = this.gerty[i].screen.areas
|
||||||
console.log(this.onchain)
|
this.gertyname = this.gerty[i].settings.name
|
||||||
|
}
|
||||||
|
if(this.gerty[i].screen.group == "dashboard_mining"){
|
||||||
|
this.dashboard_mining = this.gerty[i].screen.areas
|
||||||
|
this.gertyname = this.gerty[i].settings.name
|
||||||
|
}
|
||||||
|
if(this.gerty[i].screen.group == "lightning_dashboard"){
|
||||||
|
this.lightning_dashboard = this.gerty[i].screen.areas
|
||||||
|
this.gertyname = this.gerty[i].settings.name
|
||||||
}
|
}
|
||||||
if(this.gerty[i].screen.group == "fun_satoshi_quotes"){
|
if(this.gerty[i].screen.group == "fun_satoshi_quotes"){
|
||||||
this.fun_satoshi_quotes["quote"] = this.gerty[i].screen.areas[0][0].value
|
this.fun_satoshi_quotes["quote"] = this.gerty[i].screen.areas[0][0].value
|
||||||
|
|
@ -110,7 +144,17 @@ endblock %}{% block page %} {% raw %}
|
||||||
this.fun_exchange_market_rate["amount"] = this.gerty[i].screen.areas[0][1].value
|
this.fun_exchange_market_rate["amount"] = this.gerty[i].screen.areas[0][1].value
|
||||||
this.gertyname = this.gerty[i].settings.name
|
this.gertyname = this.gerty[i].settings.name
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
setTimeout(this.getGertyInfo, 20000);
|
||||||
|
this.$forceUpdate();
|
||||||
|
return this.gerty
|
||||||
|
},
|
||||||
|
},
|
||||||
|
created: async function () {
|
||||||
|
|
||||||
|
await this.getGertyInfo()
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
</script>
|
</script>
|
||||||
|
|
|
||||||
|
|
@ -140,24 +140,56 @@
|
||||||
label="Name"
|
label="Name"
|
||||||
placeholder="Son of Gerty"
|
placeholder="Son of Gerty"
|
||||||
></q-input>
|
></q-input>
|
||||||
|
<q-checkbox
|
||||||
|
class="q-pl-md"
|
||||||
|
|
||||||
<p>Use the toggles below to control what your Gerty will display</p>
|
size="xs"
|
||||||
|
|
||||||
<div class="column">
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
v-model="formDialog.data.display_preferences.fun_satoshi_quotes"
|
v-model="formDialog.data.display_preferences.fun_satoshi_quotes"
|
||||||
|
val="xs"
|
||||||
label="Satoshi Quotes"
|
label="Satoshi Quotes"
|
||||||
>
|
><q-tooltip>Displays random quotes from Satoshi</q-tooltip></q-checkbox>
|
||||||
<q-tooltip>Displays random quotes from Satoshi</q-tooltip>
|
<q-checkbox
|
||||||
</q-toggle>
|
class="q-pl-md"
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="col">
|
size="xs"
|
||||||
<q-toggle
|
|
||||||
v-model="formDialog.data.display_preferences.fun_exchange_market_rate"
|
v-model="formDialog.data.display_preferences.fun_exchange_market_rate"
|
||||||
|
val="xs"
|
||||||
label="Fiat to BTC price"
|
label="Fiat to BTC price"
|
||||||
></q-toggle>
|
></q-checkbox>
|
||||||
|
<q-checkbox
|
||||||
|
class="q-pl-md"
|
||||||
|
|
||||||
|
size="xs"
|
||||||
|
v-model="formDialog.data.display_preferences.lnbits_wallets_balance"
|
||||||
|
val="xs"
|
||||||
|
label="LNbits"
|
||||||
|
></q-checkbox>
|
||||||
|
<q-checkbox
|
||||||
|
class="q-pl-md"
|
||||||
|
|
||||||
|
size="xs"
|
||||||
|
v-model="formDialog.data.display_preferences.dashboard_onchain"
|
||||||
|
val="xs"
|
||||||
|
label="Onchain"
|
||||||
|
></q-checkbox>
|
||||||
|
<q-checkbox
|
||||||
|
class="q-pl-md"
|
||||||
|
|
||||||
|
size="xs"
|
||||||
|
v-model="formDialog.data.display_preferences.dashboard_mining"
|
||||||
|
val="xs"
|
||||||
|
label="Mining"
|
||||||
|
></q-checkbox>
|
||||||
|
<q-checkbox
|
||||||
|
class="q-pl-md"
|
||||||
|
|
||||||
|
size="xs"
|
||||||
|
v-model="formDialog.data.display_preferences.lightning_dashboard"
|
||||||
|
val="xs"
|
||||||
|
label="Lightning"
|
||||||
|
></q-checkbox>
|
||||||
|
|
||||||
|
|
||||||
<q-select
|
<q-select
|
||||||
v-if="formDialog.data.display_preferences.fun_exchange_market_rate"
|
v-if="formDialog.data.display_preferences.fun_exchange_market_rate"
|
||||||
filled
|
filled
|
||||||
|
|
@ -167,13 +199,7 @@
|
||||||
:options="currencyOptions"
|
:options="currencyOptions"
|
||||||
label="Exchange rate"
|
label="Exchange rate"
|
||||||
></q-select>
|
></q-select>
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
v-model="formDialog.data.display_preferences.lnbits_wallets_balance"
|
|
||||||
label="Show LNbits wallet balances"
|
|
||||||
@input="setWallets"
|
|
||||||
></q-toggle>
|
|
||||||
<q-select
|
<q-select
|
||||||
v-if="formDialog.data.display_preferences.lnbits_wallets_balance"
|
v-if="formDialog.data.display_preferences.lnbits_wallets_balance"
|
||||||
filled
|
filled
|
||||||
|
|
@ -190,110 +216,7 @@
|
||||||
>
|
>
|
||||||
<q-tooltip>Hit enter to add values</q-tooltip>
|
<q-tooltip>Hit enter to add values</q-tooltip>
|
||||||
</q-select>
|
</q-select>
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
v-model="toggleStates.onchain"
|
|
||||||
label="Onchain Information"
|
|
||||||
@input="setOnchain"
|
|
||||||
>
|
|
||||||
</q-toggle>
|
|
||||||
<br />
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.onchain"
|
|
||||||
v-model="formDialog.data.display_preferences.onchain_difficulty_epoch_progress"
|
|
||||||
label="Epoch percentage"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.onchain"
|
|
||||||
v-model="formDialog.data.display_preferences.onchain_difficulty_retarget_date"
|
|
||||||
label="Retarget date"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.onchain"
|
|
||||||
v-model="formDialog.data.display_preferences.onchain_difficulty_blocks_remaining"
|
|
||||||
label="Blocks until adjustment"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.onchain"
|
|
||||||
v-model="formDialog.data.display_preferences.onchain_difficulty_epoch_time_remaining"
|
|
||||||
label="Time until adjustment"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.onchain"
|
|
||||||
v-model="formDialog.data.display_preferences.onchain_block_height"
|
|
||||||
label="Current block height"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle v-model="toggleStates.mempool" label="The Mempool">
|
|
||||||
</q-toggle>
|
|
||||||
<br />
|
|
||||||
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-model="formDialog.data.display_preferences.mempool_recommended_fees"
|
|
||||||
v-if="toggleStates.mempool"
|
|
||||||
label="Recommended fees"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-model="formDialog.data.display_preferences.mempool_tx_count"
|
|
||||||
v-if="toggleStates.mempool"
|
|
||||||
label="Transactions in mempool"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
label="Mining Data"
|
|
||||||
v-model="toggleStates.mining"
|
|
||||||
@input="setMining"
|
|
||||||
></q-toggle>
|
|
||||||
<br />
|
|
||||||
<div class="row">
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.mining"
|
|
||||||
v-model="formDialog.data.display_preferences.mining_current_hash_rate"
|
|
||||||
label="Mining hashrate"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
|
||||||
class="q-pl-lg"
|
|
||||||
v-if="toggleStates.mining"
|
|
||||||
v-model="formDialog.data.display_preferences.mining_current_difficulty"
|
|
||||||
label="Mining difficulty"
|
|
||||||
></q-toggle>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="col">
|
|
||||||
<q-toggle
|
<q-toggle
|
||||||
label="*Advanced"
|
label="*Advanced"
|
||||||
v-model="toggleStates.advanced"
|
v-model="toggleStates.advanced"
|
||||||
|
|
@ -321,52 +244,6 @@
|
||||||
>The amount of time in seconds between screen updates
|
>The amount of time in seconds between screen updates
|
||||||
</q-tooltip>
|
</q-tooltip>
|
||||||
</q-input>
|
</q-input>
|
||||||
<q-separator
|
|
||||||
class="q-mb-md"
|
|
||||||
v-if="toggleStates.advanced"
|
|
||||||
></q-separator>
|
|
||||||
<p class="q-pl-sm q-mb-xs" v-if="toggleStates.advanced">
|
|
||||||
Gerty Device Dashboards (for Gerty
|
|
||||||
<a
|
|
||||||
target="_blank"
|
|
||||||
href="https://shop.lnbits.com/product/gerty-a-bitcoin-assistant"
|
|
||||||
>devices</a
|
|
||||||
>):
|
|
||||||
</p>
|
|
||||||
<q-checkbox
|
|
||||||
class="q-pl-md"
|
|
||||||
v-if="toggleStates.advanced"
|
|
||||||
size="xs"
|
|
||||||
v-model="formDialog.data.display_preferences.dashboard"
|
|
||||||
val="xs"
|
|
||||||
label="LNbits"
|
|
||||||
></q-checkbox>
|
|
||||||
<q-checkbox
|
|
||||||
class="q-pl-md"
|
|
||||||
v-if="toggleStates.advanced"
|
|
||||||
size="xs"
|
|
||||||
v-model="formDialog.data.display_preferences.dashboard_onchain"
|
|
||||||
val="xs"
|
|
||||||
label="Onchain"
|
|
||||||
></q-checkbox>
|
|
||||||
<q-checkbox
|
|
||||||
class="q-pl-md"
|
|
||||||
v-if="toggleStates.advanced"
|
|
||||||
size="xs"
|
|
||||||
v-model="formDialog.data.display_preferences.dashboard_mining"
|
|
||||||
val="xs"
|
|
||||||
label="Mining"
|
|
||||||
></q-checkbox>
|
|
||||||
<q-checkbox
|
|
||||||
class="q-pl-md"
|
|
||||||
v-if="toggleStates.advanced"
|
|
||||||
size="xs"
|
|
||||||
v-model="formDialog.data.display_preferences.lightning_dashboard"
|
|
||||||
val="xs"
|
|
||||||
label="Lightning"
|
|
||||||
></q-checkbox>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div class="row q-mt-lg">
|
<div class="row q-mt-lg">
|
||||||
<q-btn
|
<q-btn
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue