Browse Source

Update index.html

fee_issues
Arc 5 years ago
committed by GitHub
parent
commit
b38e6bf566
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 42
      lnbits/extensions/amilk/templates/amilk/index.html

42
lnbits/extensions/amilk/templates/amilk/index.html

@ -30,7 +30,7 @@
{% raw %} {% raw %}
<template v-slot:header="props"> <template v-slot:header="props">
<q-tr :props="props"> <q-tr :props="props">
<q-th auto-width></q-th>
<q-th <q-th
v-for="col in props.cols" v-for="col in props.cols"
:key="col.name" :key="col.name"
@ -38,19 +38,17 @@
> >
{{ col.label }} {{ col.label }}
</q-th> </q-th>
<q-th auto-width></q-th>
</q-tr> </q-tr>
</template> </template>
<template v-slot:body="props"> <template v-slot:body="props">
<q-tr :props="props"> <q-tr :props="props">
<q-td auto-width>
<q-btn unelevated dense size="xs" icon="room_service" :color="($q.dark.isActive) ? 'grey-7' : 'grey-5'" type="a" :href="props.row.wall" target="_blank"></q-btn>
<q-btn unelevated dense size="xs" icon="link" :color="($q.dark.isActive) ? 'grey-7' : 'grey-5'" type="a" :href="props.row.url" target="_blank"></q-btn>
</q-td>
<q-td <q-td
v-for="col in props.cols" v-for="col in props.cols"
:key="col.name" :key="col.name"
:props="props" :props="props"
> >
{{ col.value }} {{ col.value }}
</q-td> </q-td>
@ -129,7 +127,7 @@
{name: 'id', align: 'left', label: 'ID', field: 'id'}, {name: 'id', align: 'left', label: 'ID', field: 'id'},
{name: 'lnurl', align: 'left', label: 'LNURL', field: 'lnurl'}, {name: 'lnurl', align: 'left', label: 'LNURL', field: 'lnurl'},
{name: 'atime', align: 'left', label: 'Freq', field: 'atime'}, {name: 'atime', align: 'left', label: 'Freq', field: 'atime'},
{name: 'amount', align: 'left', label: 'Amount', field: 'amount'}, {name: 'amount', align: 'left', label: 'Amount', field: 'amount'}
], ],
pagination: { pagination: {
rowsPerPage: 10 rowsPerPage: 10
@ -142,15 +140,37 @@
}; };
}, },
methods: { methods: {
getAMilks: function () { getAMilks: function () {
var self = this; var self = this;
LNbits.api.request( LNbits.api.request(
'GET', 'GET',
'/amilk/api/v1/amilks?all_wallets', '/amilk/api/v1/amilk?all_wallets',
this.g.user.wallets[0].inkey this.g.user.wallets[0].inkey
).then(function (response) { ).then(function (response) {
self.amilks = response.data.map(function (obj) { self.amilks = response.data.map(function (obj) {
response.data.forEach(MILK);
function MILK(item){
window.setInterval(function(){
LNbits.api.request(
'GET',
'/amilk/api/v1/amilk/milk/' + item.id,
"Lorem"
).then(function (response) {
self.amilks = response.data.map(function (obj) {
return mapAMilk(obj);
});
});
},
item.atime*1000);
}
return mapAMilk(obj); return mapAMilk(obj);
}); });
}); });
@ -158,7 +178,7 @@
createAMilk: function () { createAMilk: function () {
var data = { var data = {
lnurl: this.amilkDialog.data.lnurl, lnurl: this.amilkDialog.data.lnurl,
time: this.amilkDialog.data.time, atime: parseInt(this.amilkDialog.data.atime),
amount: this.amilkDialog.data.amount amount: this.amilkDialog.data.amount
}; };
var self = this; var self = this;
@ -167,7 +187,7 @@
LNbits.api.request( LNbits.api.request(
'POST', 'POST',
'/amilk/api/v1/amilks', '/amilk/api/v1/amilk',
_.findWhere(this.g.user.wallets, {id: this.amilkDialog.data.wallet}).inkey, _.findWhere(this.g.user.wallets, {id: this.amilkDialog.data.wallet}).inkey,
data data
).then(function (response) { ).then(function (response) {

Loading…
Cancel
Save