diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html index 82a965313..9cbec03a1 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.html @@ -23,7 +23,7 @@
- + () constructor ( @@ -104,6 +102,10 @@ export class PluginListInstalledComponent implements OnInit { return !!this.updating[this.getUpdatingKey(plugin)] } + isTheme (plugin: PeerTubePlugin) { + return plugin.type === PluginType.THEME + } + async uninstall (plugin: PeerTubePlugin) { const res = await this.confirmService.confirm( $localize`Do you really want to uninstall ${plugin.name}?`, diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html index 8edf03a89..727633399 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.html @@ -48,6 +48,8 @@ Installed
+ + diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts index 4c571dee4..d2c179aba 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts @@ -3,7 +3,7 @@ import { debounceTime, distinctUntilChanged } from 'rxjs/operators' import { Component, OnInit } from '@angular/core' import { ActivatedRoute, Router } from '@angular/router' import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' -import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' +import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core' import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' import { PluginType } from '@shared/models/plugins/plugin.type' @@ -39,6 +39,7 @@ export class PluginSearchComponent implements OnInit { private searchSubject = new Subject() constructor ( + private pluginService: PluginService, private pluginApiService: PluginApiService, private notifier: Notifier, private confirmService: ConfirmService, @@ -119,6 +120,14 @@ export class PluginSearchComponent implements OnInit { return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name) } + getShowRouterLink (plugin: PeerTubePluginIndex) { + return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, this.pluginType) ] + } + + isThemeSearch () { + return this.pluginType === PluginType.THEME + } + async install (plugin: PeerTubePluginIndex) { if (this.installing[plugin.npmName]) return