mirror of
https://github.com/lnbits/lnbits.git
synced 2025-08-03 15:32:22 +02:00
feat(vue): move confirmDialog to LNbits.utils so we can reuse the styling
This commit is contained in:
@@ -307,7 +307,11 @@ new Vue({
|
|||||||
});
|
});
|
||||||
},
|
},
|
||||||
deleteWallet: function (walletId, user) {
|
deleteWallet: function (walletId, user) {
|
||||||
LNbits.href.deleteWallet(walletId, user);
|
LNbits.utils.confirmDialog(
|
||||||
|
'Are you sure you want to delete this wallet?'
|
||||||
|
).onOk(function () {
|
||||||
|
LNbits.href.deleteWallet(walletId, user);
|
||||||
|
});
|
||||||
},
|
},
|
||||||
fetchPayments: function (checkPending) {
|
fetchPayments: function (checkPending) {
|
||||||
var self = this;
|
var self = this;
|
||||||
|
@@ -202,17 +202,9 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
var amilk = _.findWhere(this.amilks, {id: amilkId});
|
var amilk = _.findWhere(this.amilks, {id: amilkId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this AMilk link?',
|
'Are you sure you want to delete this AMilk link?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/amilk/api/v1/amilks/' + amilkId,
|
'/amilk/api/v1/amilks/' + amilkId,
|
||||||
|
@@ -474,17 +474,9 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
var indexer = _.findWhere(this.indexers, {id: indexerId});
|
var indexer = _.findWhere(this.indexers, {id: indexerId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this Indexer link?',
|
'Are you sure you want to delete this Indexer link?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/diagonalley/api/v1/diagonalley/indexers/' + indexerId,
|
'/diagonalley/api/v1/diagonalley/indexers/' + indexerId,
|
||||||
@@ -538,17 +530,9 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
var order = _.findWhere(this.orders, {id: orderId});
|
var order = _.findWhere(this.orders, {id: orderId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this order link?',
|
'Are you sure you want to delete this order link?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/diagonalley/api/v1/diagonalley/orders/' + orderId,
|
'/diagonalley/api/v1/diagonalley/orders/' + orderId,
|
||||||
@@ -646,17 +630,9 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
var product = _.findWhere(this.products, {id: productId});
|
var product = _.findWhere(this.products, {id: productId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this products link?',
|
'Are you sure you want to delete this products link?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/diagonalley/api/v1/diagonalley/products/' + productId,
|
'/diagonalley/api/v1/diagonalley/products/' + productId,
|
||||||
|
@@ -186,17 +186,9 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
var paywall = _.findWhere(this.paywalls, {id: paywallId});
|
var paywall = _.findWhere(this.paywalls, {id: paywallId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this paywall link?',
|
'Are you sure you want to delete this paywall link?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/paywall/api/v1/paywalls/' + paywallId,
|
'/paywall/api/v1/paywalls/' + paywallId,
|
||||||
|
@@ -193,17 +193,9 @@
|
|||||||
var self = this;
|
var self = this;
|
||||||
var tpos = _.findWhere(this.tposs, {id: tposId});
|
var tpos = _.findWhere(this.tposs, {id: tposId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this TPoS?',
|
'Are you sure you want to delete this TPoS?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/tpos/api/v1/tposs/' + tposId,
|
'/tpos/api/v1/tposs/' + tposId,
|
||||||
|
@@ -131,17 +131,9 @@ new Vue({
|
|||||||
var self = this;
|
var self = this;
|
||||||
var link = _.findWhere(this.withdrawLinks, {id: linkId});
|
var link = _.findWhere(this.withdrawLinks, {id: linkId});
|
||||||
|
|
||||||
this.$q.dialog({
|
LNbits.utils.confirmDialog(
|
||||||
message: 'Are you sure you want to delete this withdraw link?',
|
'Are you sure you want to delete this withdraw link?'
|
||||||
ok: {
|
).onOk(function () {
|
||||||
flat: true,
|
|
||||||
color: 'orange'
|
|
||||||
},
|
|
||||||
cancel: {
|
|
||||||
flat: true,
|
|
||||||
color: 'grey'
|
|
||||||
}
|
|
||||||
}).onOk(function () {
|
|
||||||
LNbits.api.request(
|
LNbits.api.request(
|
||||||
'DELETE',
|
'DELETE',
|
||||||
'/withdraw/api/v1/links/' + linkId,
|
'/withdraw/api/v1/links/' + linkId,
|
||||||
|
@@ -87,6 +87,19 @@ var LNbits = {
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
utils: {
|
utils: {
|
||||||
|
confirmDialog: function (msg) {
|
||||||
|
return Quasar.plugins.Dialog.create({
|
||||||
|
message: msg,
|
||||||
|
ok: {
|
||||||
|
flat: true,
|
||||||
|
color: 'orange'
|
||||||
|
},
|
||||||
|
cancel: {
|
||||||
|
flat: true,
|
||||||
|
color: 'grey'
|
||||||
|
}
|
||||||
|
});
|
||||||
|
},
|
||||||
formatCurrency: function (value, currency) {
|
formatCurrency: function (value, currency) {
|
||||||
return new Intl.NumberFormat(LOCALE, {style: 'currency', currency: currency}).format(value);
|
return new Intl.NumberFormat(LOCALE, {style: 'currency', currency: currency}).format(value);
|
||||||
},
|
},
|
||||||
|
Reference in New Issue
Block a user