From 239d35a60a730eb828e33ef6e1df005afb2609b4 Mon Sep 17 00:00:00 2001 From: ben Date: Wed, 4 Jan 2023 11:49:50 +0000 Subject: [PATCH] trying to fix errors in software gerty --- .../gerty/templates/gerty/gerty.html | 76 +++++++++++-------- 1 file changed, 43 insertions(+), 33 deletions(-) diff --git a/lnbits/extensions/gerty/templates/gerty/gerty.html b/lnbits/extensions/gerty/templates/gerty/gerty.html index d45484a41..b2fb86b62 100644 --- a/lnbits/extensions/gerty/templates/gerty/gerty.html +++ b/lnbits/extensions/gerty/templates/gerty/gerty.html @@ -3,39 +3,39 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
- {{fun_exchange_market_rate["amount"]}} + {{elements.fun_exchange_market_rate["amount"]}} {{fun_exchange_market_rate["unit"].split(" ")[1]}}{{elements.fun_exchange_market_rate["unit"].split(" ")[1]}}
-

"{{fun_satoshi_quotes["quote"]}}"

- ~ Satoshi {{fun_satoshi_quotes["date"]}} +

"{{elements.fun_satoshi_quotes["quote"]}}"

+ ~ Satoshi {{elements.fun_satoshi_quotes["date"]}}
-
+
@@ -61,40 +61,40 @@ gertyname }}{% endraw %}{% endblock %}{% block page %} {% raw %}
Onchain
-

+

{{item[0].value}}: {{item[1].value}}

- +
Mining
-

+

{{item[0].value}}: {{item[1].value}}

- +
Lightning (Last 7 days)
-

+

{{item[0].value}}: {{item[1].value}}

- +
Servers to check
-
+
@@ -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