Fix: extension links (#1764)

* fix: open extension link
* fix: do not show `Enable` for admin extensions to non-admin users
This commit is contained in:
Vlad Stan 2023-06-15 19:06:21 +02:00 committed by GitHub
parent 8c0e7725de
commit 49411e58cc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 9 additions and 4 deletions

View File

@ -1,6 +1,6 @@
// update cache version every time there is a new deployment
// so the service worker reinitializes the cache
const CACHE_VERSION = 37
const CACHE_VERSION = 38
const CURRENT_CACHE = `lnbits-${CACHE_VERSION}-`
const getApiKey = request => {

View File

@ -185,7 +185,7 @@
flat
color="primary"
type="a"
:href="[extension.id, '?usr=', g.user.id].join('')"
:href="[extension.id, '/?usr=', g.user.id].join('')"
>{%raw%}{{ $t('open') }}{%endraw%}</q-btn
>
<q-btn
@ -199,8 +199,11 @@
>
{%raw%}{{ $t('disable') }}{%endraw%}</q-btn
>
<q-badge v-if="extension.isAdminOnly && !user.admin">
{%raw%}{{ $t('admin_only') }}{%endraw%}
</q-badge>
<q-btn
v-if="extension.isInstalled && !user.extensions.includes(extension.id) && extension.isActive"
v-else-if="extension.isInstalled && extension.isActive && !user.extensions.includes(extension.id)"
flat
color="primary"
type="a"

View File

@ -128,6 +128,7 @@ async def extensions_install(
"isInstalled": ext.id in installed_exts_ids,
"hasDatabaseTables": ext.id in db_version,
"isAvailable": ext.id in all_extensions,
"isAdminOnly": ext.id in settings.lnbits_admin_extensions,
"isActive": ext.id not in inactive_extensions,
"latestRelease": dict(ext.latest_release)
if ext.latest_release

File diff suppressed because one or more lines are too long

View File

@ -100,6 +100,7 @@ window.localisation.en = {
featured: 'Featured',
all: 'All',
only_admins_can_install: '(Only admin accounts can install extensions)',
admin_only: 'Admin Only',
new_version: 'New Version',
extension_depends_on: 'Depends on:',
extension_rating_soon: 'Ratings coming soon',