mirror of https://github.com/Chocobozzz/PeerTube
Fix theme npm link
parent
fcb7712228
commit
078b4716cd
|
@ -18,7 +18,7 @@
|
||||||
<my-global-icon iconName="home"></my-global-icon>
|
<my-global-icon iconName="home"></my-global-icon>
|
||||||
</a>
|
</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>
|
<my-global-icon iconName="npm"></my-global-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
@ -149,6 +149,10 @@ export class PluginListInstalledComponent implements OnInit {
|
||||||
return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, plugin.type) ]
|
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) {
|
private getUpdatingKey (plugin: PeerTubePlugin) {
|
||||||
return plugin.name + plugin.type
|
return plugin.name + plugin.type
|
||||||
}
|
}
|
||||||
|
|
|
@ -41,7 +41,7 @@
|
||||||
<my-global-icon iconName="home"></my-global-icon>
|
<my-global-icon iconName="home"></my-global-icon>
|
||||||
</a>
|
</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>
|
<my-global-icon iconName="npm"></my-global-icon>
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
|
|
|
@ -39,13 +39,13 @@ export class PluginSearchComponent implements OnInit {
|
||||||
private searchSubject = new Subject<string>()
|
private searchSubject = new Subject<string>()
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
private pluginService: PluginApiService,
|
private pluginApiService: PluginApiService,
|
||||||
private notifier: Notifier,
|
private notifier: Notifier,
|
||||||
private confirmService: ConfirmService,
|
private confirmService: ConfirmService,
|
||||||
private router: Router,
|
private router: Router,
|
||||||
private route: ActivatedRoute
|
private route: ActivatedRoute
|
||||||
) {
|
) {
|
||||||
this.pluginTypeOptions = this.pluginService.getPluginTypeOptions()
|
this.pluginTypeOptions = this.pluginApiService.getPluginTypeOptions()
|
||||||
}
|
}
|
||||||
|
|
||||||
ngOnInit () {
|
ngOnInit () {
|
||||||
|
@ -83,7 +83,7 @@ export class PluginSearchComponent implements OnInit {
|
||||||
loadMorePlugins () {
|
loadMorePlugins () {
|
||||||
this.isSearching = true
|
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(
|
.subscribe(
|
||||||
res => {
|
res => {
|
||||||
this.isSearching = false
|
this.isSearching = false
|
||||||
|
@ -115,6 +115,10 @@ export class PluginSearchComponent implements OnInit {
|
||||||
return !!this.installing[plugin.npmName]
|
return !!this.installing[plugin.npmName]
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getPluginOrThemeHref (name: string) {
|
||||||
|
return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name)
|
||||||
|
}
|
||||||
|
|
||||||
async install (plugin: PeerTubePluginIndex) {
|
async install (plugin: PeerTubePluginIndex) {
|
||||||
if (this.installing[plugin.npmName]) return
|
if (this.installing[plugin.npmName]) return
|
||||||
|
|
||||||
|
@ -126,7 +130,7 @@ export class PluginSearchComponent implements OnInit {
|
||||||
|
|
||||||
this.installing[plugin.npmName] = true
|
this.installing[plugin.npmName] = true
|
||||||
|
|
||||||
this.pluginService.install(plugin.npmName)
|
this.pluginApiService.install(plugin.npmName)
|
||||||
.subscribe(
|
.subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.installing[plugin.npmName] = false
|
this.installing[plugin.npmName] = false
|
||||||
|
|
|
@ -134,6 +134,14 @@ export class PluginApiService {
|
||||||
.pipe(catchError(res => this.restExtractor.handleError(res)))
|
.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> {
|
private translateSettingsLabel (npmName: string, res: RegisteredServerSettings): Observable<RegisteredServerSettings> {
|
||||||
return this.pluginService.translationsObservable
|
return this.pluginService.translationsObservable
|
||||||
.pipe(
|
.pipe(
|
||||||
|
|
Loading…
Reference in New Issue