diff --git a/lnbits/static/js/admin.js b/lnbits/static/js/admin.js index 51555e426..fdbb06f9d 100644 --- a/lnbits/static/js/admin.js +++ b/lnbits/static/js/admin.js @@ -77,6 +77,30 @@ new Vue({ } }, methods: { + addAdminUser() { + let addUser = this.formAddAdmin + let admin_users = this.formData.lnbits_admin_users + if (addUser && addUser.length && !admin_users.includes(addUser)) { + this.formData.lnbits_admin_users = [...admin_users, addUser] + this.formAddAdmin = '' + } + }, + removeAdminUser(user) { + let admin_users = this.formData.lnbits_admin_users + this.formData.lnbits_admin_users = admin_users.filter(u => u !== user) + }, + addAllowedUser() { + let addUser = this.formAddUser + let allowed_users = this.formData.lnbits_allowed_users + if (addUser && addUser.length && !allowed_users.includes(addUser)) { + this.formData.lnbits_allowed_users = [...allowed_users, addUser] + this.formAddUser = '' + } + }, + removeAllowedUser(user) { + let allowed_users = this.formData.lnbits_allowed_users + this.formData.lnbits_allowed_users = allowed_users.filter(u => u !== user) + }, addExtensionsManifest() { const addManifest = this.formAddExtensionsManifest.trim() const manifests = this.formData.lnbits_extensions_manifests