[feat] UI for user notifications (#3267)

This commit is contained in:
Vlad Stan
2025-07-15 11:15:17 +02:00
committed by dni ⚡
parent 5e9919c5c5
commit 094a9fc1a1
7 changed files with 142 additions and 6 deletions
+1 -1
View File
File diff suppressed because one or more lines are too long
+5 -3
View File
@@ -52,6 +52,7 @@ window.localisation.en = {
wallet: 'Wallet: ',
wallet_name: 'Wallet name',
wallets: 'Wallets',
exclude_wallets: 'Exclude Wallets',
add_wallet: 'Add wallet',
add_new_wallet: 'Add a new wallet',
pin_wallet: 'Pin wallet',
@@ -238,9 +239,10 @@ window.localisation.en = {
notifications_enable_telegram_desc: 'Send notfications over Telegram',
notifications_telegram_access_token: 'Access Token',
notifications_telegram_access_token_desc: 'Access token for the bot',
notifications_chat_id: 'Chat ID',
notifications_chat_id_desc: 'Chat ID to send the notifications to',
notifications_chat_id: 'Telegram Chat ID',
notifications_chat_id_desc: 'Telegram Chat ID to send the notifications to',
notifications_excluded_wallets_desc:
'Do not send notifications for these wallets',
notifications_email_config: 'Email Configuration',
notifications_enable_email: 'Enable Email',
notifications_enable_email_desc: 'Send notifications over email',
+32
View File
@@ -80,6 +80,11 @@ window.AccountPageLogic = {
token_id_list: [],
allRead: false,
allWrite: false
},
notifications: {
nostr: {
identifier: ''
}
}
}
},
@@ -394,8 +399,35 @@ window.AccountPageLogic = {
} finally {
this.apiAcl.password = ''
}
},
addNostrNotificationIdentifier() {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/
if (!emailRegex.test(this.notifications.nostr.identifier)) {
Quasar.Notify.create({
type: 'warning',
message: 'Invalid email format.'
})
return
}
const identifier = this.user.extra.nostr_notification_identifiers.find(
i => i === this.notifications.nostr.identifier
)
if (identifier) {
return
}
this.user.extra.nostr_notification_identifiers.push(
this.notifications.nostr.identifier
)
this.notifications.nostr.identifier = ''
},
removeNostrNotificationIdentifier(identifier) {
this.user.extra.nostr_notification_identifiers =
this.user.extra.nostr_notification_identifiers.filter(
i => i !== identifier
)
}
},
async created() {
try {
const {data} = await LNbits.api.getAuthenticatedUser()