diff options
author | Chocobozzz <me@florianbigard.com> | 2021-01-11 10:46:02 +0100 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-01-11 10:46:02 +0100 |
commit | 078b4716cdd4dbf1b15c1a864ccab999ed3d0e8e (patch) | |
tree | de9f00d823e5fcdcf5b6ae9492d0ae868673cac1 /client/src/app/+admin/plugins/plugin-search | |
parent | fcb771222854d4239f97b60969e3f11e434a2239 (diff) | |
download | PeerTube-078b4716cdd4dbf1b15c1a864ccab999ed3d0e8e.tar.gz PeerTube-078b4716cdd4dbf1b15c1a864ccab999ed3d0e8e.tar.zst PeerTube-078b4716cdd4dbf1b15c1a864ccab999ed3d0e8e.zip |
Fix theme npm link
Diffstat (limited to 'client/src/app/+admin/plugins/plugin-search')
-rw-r--r-- | client/src/app/+admin/plugins/plugin-search/plugin-search.component.html | 2 | ||||
-rw-r--r-- | client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts | 12 |
2 files changed, 9 insertions, 5 deletions
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 |