trying to fix errors in software gerty

This commit is contained in:
ben 2023-01-04 11:49:50 +00:00
parent 19ef282581
commit 239d35a60a

View File

@ -3,39 +3,39 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
<div
class="q-pa-md row items-start q-gutter-md"
v-if="fun_exchange_market_rate || fun_satoshi_quotes"
v-if="elements.fun_exchange_market_rate || elements.fun_satoshi_quotes"
>
<q-card
v-if="fun_exchange_market_rate"
v-if="elements.fun_exchange_market_rate['unit']"
unelevated
class="q-pa-sm"
style="background: none !important"
>
<q-card-section class="text-h1 q-pa-none">
<small> <b>{{fun_exchange_market_rate["amount"]}}</b></small>
<small> <b>{{elements.fun_exchange_market_rate["amount"]}}</b></small>
<small class="text-h4"
>{{fun_exchange_market_rate["unit"].split(" ")[1]}}</small
>{{elements.fun_exchange_market_rate["unit"].split(" ")[1]}}</small
>
</q-card-section>
</q-card>
<q-card
v-if="fun_satoshi_quotes['quote']"
v-if="elements.fun_satoshi_quotes['quote']"
unelevated
class="q-pa-none text-body1 blockquote"
style="background: none !important"
>
<blockquote class="text-right" style="max-width: 900px">
<p>"{{fun_satoshi_quotes["quote"]}}"</p>
<small>~ Satoshi {{fun_satoshi_quotes["date"]}}</small>
<p>"{{elements.fun_satoshi_quotes["quote"]}}"</p>
<small>~ Satoshi {{elements.fun_satoshi_quotes["date"]}}</small>
</blockquote>
</q-card>
</div>
<div class="q-pa-md row items-start q-gutter-md" v-if="lnbits_wallets_balance">
<div class="q-pa-md row items-start q-gutter-md" v-if="elements.lnbits_wallets_balance">
<q-card
class="q-pa-sm"
v-for="(wallet, t) in lnbits_wallets_balance"
v-for="(wallet, t) in elements.lnbits_wallets_balance"
:style="`background-color: ${wallet.color1} !important`"
unelevated
class="q-pa-none q-pa-sm"
@ -49,11 +49,11 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
<div
class="q-pa-md row items-start q-gutter-md"
v-if="dashboard_onchain || dashboard_mining || lightning_dashboard"
v-if="elements.dashboard_onchain || elements.dashboard_mining || elements.lightning_dashboard"
>
<q-card
class="q-pa-sm"
v-if="dashboard_onchain[0]"
v-if="elements.dashboard_onchain[0]"
unelevated
class="q-pa-sm"
>
@ -61,40 +61,40 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
<div class="text-h6">Onchain</div>
</q-card-section>
<q-card-section class="q-pa-none">
<p v-for="(item, t) in dashboard_onchain">
<p v-for="(item, t) in elements.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 class="q-pa-sm" v-if="elements.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">
<p v-for="(item, t) in elements.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 class="q-pa-sm" v-if="elements.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">
<p v-for="(item, t) in elements.lightning_dashboard">
<b>{{item[0].value}}:</b> {{item[1].value}}
</p>
</q-card-section>
</q-card>
<q-card class="q-pa-sm" v-if="url_checker" unelevated class="q-pa-sm">
<q-card class="q-pa-sm" v-if="elements.url_checker" unelevated class="q-pa-sm">
<q-card-section>
<div class="text-h6">Servers to check</div>
</q-card-section>
<q-card-section class="q-pa-none">
<div class="row q-pb-md" v-for="(item, t) in url_checker">
<div class="row q-pb-md" v-for="(item, t) in elements.url_checker">
<div class="col-8">
<small>
<b style="word-wrap: break-word; max-width: 230px; display: block">
@ -150,10 +150,15 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
mixins: [windowMixin],
data: function () {
return {
lnbits_wallets_balance: {},
dashboard_onchain: {},
fun_satoshi_quotes: {},
fun_exchange_market_rate: {},
elements:{
lnbits_wallets_balance: [],
dashboard_onchain: [],
fun_satoshi_quotes: [],
fun_exchange_market_rate: [],
lightning_dashboard: [],
url_checker: [],
dashboard_mining: [],
},
gerty: [],
gerty_id: `{{gerty}}`,
gertyname: '',
@ -177,16 +182,20 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
'GET',
`/gerty/api/v1/gerty/pages/${this.gerty_id}/${i}`
)
this.gerty[i] = data
console.log(data.screen.slug)
if(data.screen.slug){
this.gerty[i] = data
}
} catch (error) {
LNbits.utils.notifyApiError(error)
}
}
console.log(this.gerty)
console.log(this.gerty[0].screen.group)
for (let i = 0; i < this.gerty.length; i++) {
if (this.gerty[i].screen.group == 'lnbits_wallets_balance') {
for (let q = 0; q < this.gerty[i].screen.areas.length; q++) {
this.lnbits_wallets_balance[q] = {
this.elements.lnbits_wallets_balance[q] = {
name: this.gerty[i].screen.areas[q][0].value,
amount: this.gerty[i].screen.areas[q][1].value,
color1: this.walletColors[q].first,
@ -196,35 +205,36 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
}
}
if (this.gerty[i].screen.group == 'url_checker') {
this.url_checker = this.gerty[i].screen.areas
this.elements.url_checker = this.gerty[i].screen.areas
this.gertyname = this.gerty[i].settings.name
}
if (this.gerty[i].screen.group == 'dashboard_onchain') {
this.dashboard_onchain = this.gerty[i].screen.areas
this.elements.dashboard_onchain = this.gerty[i].screen.areas
this.gertyname = this.gerty[i].settings.name
}
if (this.gerty[i].screen.group == 'dashboard_mining') {
this.dashboard_mining = this.gerty[i].screen.areas
this.elements.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.elements.lightning_dashboard = this.gerty[i].screen.areas
this.gertyname = this.gerty[i].settings.name
}
if (this.gerty[i].screen.group == 'fun_satoshi_quotes') {
this.fun_satoshi_quotes['quote'] = this.gerty[
console.log(this.gerty[i]);
this.elements.fun_satoshi_quotes['quote'] = this.gerty[
i
].screen.areas[0][0].value
this.fun_satoshi_quotes['date'] = this.gerty[
this.elements.fun_satoshi_quotes['date'] = this.gerty[
i
].screen.areas[0][1].value
this.gertyname = this.gerty[i].settings.name
}
if (this.gerty[i].screen.group == 'fun_exchange_market_rate') {
this.fun_exchange_market_rate['unit'] = this.gerty[
this.elements.fun_exchange_market_rate['unit'] = this.gerty[
i
].screen.areas[0][0].value
this.fun_exchange_market_rate['amount'] = this.gerty[
this.elements.fun_exchange_market_rate['amount'] = this.gerty[
i
].screen.areas[0][1].value
this.gertyname = this.gerty[i].settings.name