mirror of
https://github.com/lnbits/lnbits.git
synced 2025-09-27 12:26:19 +02:00
feat: stub for extension versions
This commit is contained in:
@@ -313,9 +313,16 @@
|
|||||||
this.showUninstallDialog = true
|
this.showUninstallDialog = true
|
||||||
},
|
},
|
||||||
|
|
||||||
showUpgrade: function (extension) {
|
showUpgrade: async function (extension) {
|
||||||
|
console.log('### showUpgrade')
|
||||||
this.selectedExtension = extension
|
this.selectedExtension = extension
|
||||||
this.showUpgradeDialog = true
|
this.showUpgradeDialog = true
|
||||||
|
const releases = await LNbits.api.request(
|
||||||
|
'GET',
|
||||||
|
`/api/v1/extension/${extension.id}/releases?usr=${this.g.user.id}`,
|
||||||
|
this.g.user.wallets[0].adminkey
|
||||||
|
)
|
||||||
|
console.log('### releases', releases)
|
||||||
},
|
},
|
||||||
|
|
||||||
showExtensionDetails: function (extension) {
|
showExtensionDetails: function (extension) {
|
||||||
|
@@ -795,3 +795,19 @@ async def api_uninstall_extension(ext_id: str, user: User = Depends(check_admin)
|
|||||||
raise HTTPException(
|
raise HTTPException(
|
||||||
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(ex)
|
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(ex)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
|
@core_app.get("/api/v1/extension/{ext_id}/releases")
|
||||||
|
async def get_extension_releases(ext_id: str, user: User = Depends(check_admin)):
|
||||||
|
try:
|
||||||
|
installable_extensions: List[
|
||||||
|
InstallableExtension
|
||||||
|
] = await InstallableExtension.get_installable_extensions()
|
||||||
|
extensions = [e for e in installable_extensions if e.id == ext_id]
|
||||||
|
|
||||||
|
return extensions
|
||||||
|
|
||||||
|
except Exception as ex:
|
||||||
|
raise HTTPException(
|
||||||
|
status_code=HTTPStatus.INTERNAL_SERVER_ERROR, detail=str(ex)
|
||||||
|
)
|
||||||
|
@@ -127,7 +127,7 @@ class ExtensionRelease(BaseModel):
|
|||||||
class InstallableExtension(BaseModel):
|
class InstallableExtension(BaseModel):
|
||||||
id: str
|
id: str
|
||||||
name: str
|
name: str
|
||||||
archive: str
|
archive: str #todo: move to installed_release
|
||||||
hash: str
|
hash: str
|
||||||
short_description: Optional[str] = None
|
short_description: Optional[str] = None
|
||||||
details: Optional[str] = None
|
details: Optional[str] = None
|
||||||
|
Reference in New Issue
Block a user