<my-global-icon iconName="home"></my-global-icon>
</a>
- <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="'https://www.npmjs.com/package/peertube-plugin-' + plugin.name" i18n-title title="Plugin homepage (new window)">
+ <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin homepage (new window)">
<my-global-icon iconName="npm"></my-global-icon>
</a>
return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, plugin.type) ]
}
+ getPluginOrThemeHref (name: string) {
+ return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name)
+ }
+
private getUpdatingKey (plugin: PeerTubePlugin) {
return plugin.name + plugin.type
}
<my-global-icon iconName="home"></my-global-icon>
</a>
- <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="'https://www.npmjs.com/package/peertube-plugin-' + plugin.name" i18n-title title="Plugin npm package (new window)">
+ <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin npm package (new window)">
<my-global-icon iconName="npm"></my-global-icon>
</a>
private searchSubject = new Subject<string>()
constructor (
- private pluginService: PluginApiService,
+ private pluginApiService: PluginApiService,
private notifier: Notifier,
private confirmService: ConfirmService,
private router: Router,
private route: ActivatedRoute
) {
- this.pluginTypeOptions = this.pluginService.getPluginTypeOptions()
+ this.pluginTypeOptions = this.pluginApiService.getPluginTypeOptions()
}
ngOnInit () {
loadMorePlugins () {
this.isSearching = true
- this.pluginService.searchAvailablePlugins(this.pluginType, this.pagination, this.sort, this.search)
+ this.pluginApiService.searchAvailablePlugins(this.pluginType, this.pagination, this.sort, this.search)
.subscribe(
res => {
this.isSearching = false
return !!this.installing[plugin.npmName]
}
+ getPluginOrThemeHref (name: string) {
+ return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name)
+ }
+
async install (plugin: PeerTubePluginIndex) {
if (this.installing[plugin.npmName]) return
this.installing[plugin.npmName] = true
- this.pluginService.install(plugin.npmName)
+ this.pluginApiService.install(plugin.npmName)
.subscribe(
() => {
this.installing[plugin.npmName] = false
.pipe(catchError(res => this.restExtractor.handleError(res)))
}
+ getPluginOrThemeHref (type: PluginType, name: string) {
+ const typeString = type === PluginType.PLUGIN
+ ? 'plugin'
+ : 'theme'
+
+ return `https://www.npmjs.com/package/peertube-${typeString}-${name}`
+ }
+
private translateSettingsLabel (npmName: string, res: RegisteredServerSettings): Observable<RegisteredServerSettings> {
return this.pluginService.translationsObservable
.pipe(