diff --git a/static/js/admin.js b/static/js/admin.js index 4d15e41..b6fc801 100644 --- a/static/js/admin.js +++ b/static/js/admin.js @@ -43,8 +43,8 @@ window.app = Vue.createApp({ value: value, }); } - - this.entries = newEntries; + this.entries.length = 0; + this.entries.push(...newEntries); }) .catch(function (error) { console.error("Error fetching config:", error); @@ -62,14 +62,19 @@ window.app = Vue.createApp({ this.g.user.wallets[0].adminkey, data, ); - this.$q.notify({ - message: "Config saved, please restart the server", - color: "positive", - position: "top", - timeout: 2000, - actions: [{ icon: "close", color: "white" }], + Quasar.Notify.create({ + type: 'positive', + message: 'Config saved!', }); + Quasar.Notify.create({ + type: 'warning', + message: 'You need to restart the server for the changes to take effect!', + }); } catch (error) { + Quasar.Notify.create({ + type: 'negative', + message: "Error saving config: "+String(error), + }) console.error("Error saving config:", error); } }, diff --git a/static/js/index.js b/static/js/index.js index e650761..3141357 100644 --- a/static/js/index.js +++ b/static/js/index.js @@ -66,9 +66,9 @@ showConnectDialog() { const wallet = this.getWallet(); if (!wallet) { - this.$q.notify({ - color: "red", - message: "Please select a wallet first", + Quasar.Notify.create({ + type: 'negative', + message: 'Please select a wallet first', }); return; } else { @@ -94,12 +94,15 @@ if (url) { try { await navigator.clipboard.writeText(url); - this.$q.notify({ - color: "primary", - message: "URL copied to clipboard!", + Quasar.Notify.create({ + type: "positive", + message: "URL copied to clipboard" }); } catch (err) { - this.$q.notify({ color: "red", message: "Failed to copy URL." }); + Quasar.Notify.create({ + type: "negative", + message: "Failed to copy URL." + }); } } }, @@ -168,8 +171,8 @@ return out; }, deleteNWC: async function (pubkey) { - this.$q - .dialog({ + Quasar + .Dialog.create({ title: "Confirm Deletion", message: "Are you sure you want to delete this connection?", cancel: true, @@ -184,9 +187,9 @@ wallet.adminkey, ); this.loadNwcs(); - this.$q.notify({ + Quasar.Notify.create({ type: "positive", - message: "Deleted successfully", + message: "Deleted successfully" }); } catch (error) { LNbits.utils.notifyApiError(error); @@ -233,18 +236,18 @@ this.loadConnectDialogData(); const newTableEntries = []; for (const nwc of this.nwcs) { - const t = Quasar.utils.date.formatDate( + const t = Quasar.date.formatDate( new Date(nwc.data.created_at * 1000), "YYYY-MM-DD HH:mm", ); const e = nwc.data.expires_at > 0 - ? Quasar.utils.date.formatDate( + ? Quasar.date.formatDate( new Date(nwc.data.expires_at * 1000), "YYYY-MM-DD HH:mm", ) : "Never"; - const l = Quasar.utils.date.formatDate( + const l = Quasar.date.formatDate( new Date(nwc.data.last_used * 1000), "YYYY-MM-DD HH:mm", ); @@ -265,7 +268,7 @@ nwcTableEntry.status = "Expired"; } for (const budget of nwc.budgets) { - const createdAt = Quasar.utils.date.formatDate( + const createdAt = Quasar.date.formatDate( new Date(budget.created_at * 1000), "YYYY-MM-DD HH:mm", );