diff options
Diffstat (limited to 'client/src')
5 files changed, 22 insertions, 6 deletions
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 919b5d26d..82a965313 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 | |||
@@ -18,7 +18,7 @@ | |||
18 | <my-global-icon iconName="home"></my-global-icon> | 18 | <my-global-icon iconName="home"></my-global-icon> |
19 | </a> | 19 | </a> |
20 | 20 | ||
21 | <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)"> | 21 | <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin homepage (new window)"> |
22 | <my-global-icon iconName="npm"></my-global-icon> | 22 | <my-global-icon iconName="npm"></my-global-icon> |
23 | </a> | 23 | </a> |
24 | 24 | ||
diff --git a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts index 1ffd001c6..c78b19585 100644 --- a/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts +++ b/client/src/app/+admin/plugins/plugin-list-installed/plugin-list-installed.component.ts | |||
@@ -149,6 +149,10 @@ export class PluginListInstalledComponent implements OnInit { | |||
149 | return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, plugin.type) ] | 149 | return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, plugin.type) ] |
150 | } | 150 | } |
151 | 151 | ||
152 | getPluginOrThemeHref (name: string) { | ||
153 | return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name) | ||
154 | } | ||
155 | |||
152 | private getUpdatingKey (plugin: PeerTubePlugin) { | 156 | private getUpdatingKey (plugin: PeerTubePlugin) { |
153 | return plugin.name + plugin.type | 157 | return plugin.name + plugin.type |
154 | } | 158 | } |
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 d3333a370..1b5fe45c6 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 | |||
@@ -41,7 +41,7 @@ | |||
41 | <my-global-icon iconName="home"></my-global-icon> | 41 | <my-global-icon iconName="home"></my-global-icon> |
42 | </a> | 42 | </a> |
43 | 43 | ||
44 | <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)"> | 44 | <a class="plugin-icon" target="_blank" rel="noopener noreferrer" [href]="getPluginOrThemeHref(plugin.name)" i18n-title title="Plugin npm package (new window)"> |
45 | <my-global-icon iconName="npm"></my-global-icon> | 45 | <my-global-icon iconName="npm"></my-global-icon> |
46 | </a> | 46 | </a> |
47 | 47 | ||
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 1a6b4eba3..4c571dee4 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 | |||
@@ -39,13 +39,13 @@ export class PluginSearchComponent implements OnInit { | |||
39 | private searchSubject = new Subject<string>() | 39 | private searchSubject = new Subject<string>() |
40 | 40 | ||
41 | constructor ( | 41 | constructor ( |
42 | private pluginService: PluginApiService, | 42 | private pluginApiService: PluginApiService, |
43 | private notifier: Notifier, | 43 | private notifier: Notifier, |
44 | private confirmService: ConfirmService, | 44 | private confirmService: ConfirmService, |
45 | private router: Router, | 45 | private router: Router, |
46 | private route: ActivatedRoute | 46 | private route: ActivatedRoute |
47 | ) { | 47 | ) { |
48 | this.pluginTypeOptions = this.pluginService.getPluginTypeOptions() | 48 | this.pluginTypeOptions = this.pluginApiService.getPluginTypeOptions() |
49 | } | 49 | } |
50 | 50 | ||
51 | ngOnInit () { | 51 | ngOnInit () { |
@@ -83,7 +83,7 @@ export class PluginSearchComponent implements OnInit { | |||
83 | loadMorePlugins () { | 83 | loadMorePlugins () { |
84 | this.isSearching = true | 84 | this.isSearching = true |
85 | 85 | ||
86 | this.pluginService.searchAvailablePlugins(this.pluginType, this.pagination, this.sort, this.search) | 86 | this.pluginApiService.searchAvailablePlugins(this.pluginType, this.pagination, this.sort, this.search) |
87 | .subscribe( | 87 | .subscribe( |
88 | res => { | 88 | res => { |
89 | this.isSearching = false | 89 | this.isSearching = false |
@@ -115,6 +115,10 @@ export class PluginSearchComponent implements OnInit { | |||
115 | return !!this.installing[plugin.npmName] | 115 | return !!this.installing[plugin.npmName] |
116 | } | 116 | } |
117 | 117 | ||
118 | getPluginOrThemeHref (name: string) { | ||
119 | return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name) | ||
120 | } | ||
121 | |||
118 | async install (plugin: PeerTubePluginIndex) { | 122 | async install (plugin: PeerTubePluginIndex) { |
119 | if (this.installing[plugin.npmName]) return | 123 | if (this.installing[plugin.npmName]) return |
120 | 124 | ||
@@ -126,7 +130,7 @@ export class PluginSearchComponent implements OnInit { | |||
126 | 130 | ||
127 | this.installing[plugin.npmName] = true | 131 | this.installing[plugin.npmName] = true |
128 | 132 | ||
129 | this.pluginService.install(plugin.npmName) | 133 | this.pluginApiService.install(plugin.npmName) |
130 | .subscribe( | 134 | .subscribe( |
131 | () => { | 135 | () => { |
132 | this.installing[plugin.npmName] = false | 136 | this.installing[plugin.npmName] = false |
diff --git a/client/src/app/+admin/plugins/shared/plugin-api.service.ts b/client/src/app/+admin/plugins/shared/plugin-api.service.ts index b28d46df4..fad30576b 100644 --- a/client/src/app/+admin/plugins/shared/plugin-api.service.ts +++ b/client/src/app/+admin/plugins/shared/plugin-api.service.ts | |||
@@ -134,6 +134,14 @@ export class PluginApiService { | |||
134 | .pipe(catchError(res => this.restExtractor.handleError(res))) | 134 | .pipe(catchError(res => this.restExtractor.handleError(res))) |
135 | } | 135 | } |
136 | 136 | ||
137 | getPluginOrThemeHref (type: PluginType, name: string) { | ||
138 | const typeString = type === PluginType.PLUGIN | ||
139 | ? 'plugin' | ||
140 | : 'theme' | ||
141 | |||
142 | return `https://www.npmjs.com/package/peertube-${typeString}-${name}` | ||
143 | } | ||
144 | |||
137 | private translateSettingsLabel (npmName: string, res: RegisteredServerSettings): Observable<RegisteredServerSettings> { | 145 | private translateSettingsLabel (npmName: string, res: RegisteredServerSettings): Observable<RegisteredServerSettings> { |
138 | return this.pluginService.translationsObservable | 146 | return this.pluginService.translationsObservable |
139 | .pipe( | 147 | .pipe( |