diff options
author | Chocobozzz <me@florianbigard.com> | 2021-04-12 10:24:16 +0200 |
---|---|---|
committer | Chocobozzz <me@florianbigard.com> | 2021-04-12 11:19:15 +0200 |
commit | c96e457bde8495cf9103bf819f887f341a528543 (patch) | |
tree | 2460bdc1c8e955fb0f093e528280c33a96115dc5 /client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts | |
parent | 40a5242168a9f8cad4984c770673883a64e73569 (diff) | |
download | PeerTube-c96e457bde8495cf9103bf819f887f341a528543.tar.gz PeerTube-c96e457bde8495cf9103bf819f887f341a528543.tar.zst PeerTube-c96e457bde8495cf9103bf819f887f341a528543.zip |
Add settings button after plugin install
Diffstat (limited to 'client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts')
-rw-r--r-- | client/src/app/+admin/plugins/plugin-search/plugin-search.component.ts | 11 |
1 files changed, 10 insertions, 1 deletions
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' | |||
3 | import { Component, OnInit } from '@angular/core' | 3 | import { Component, OnInit } from '@angular/core' |
4 | import { ActivatedRoute, Router } from '@angular/router' | 4 | import { ActivatedRoute, Router } from '@angular/router' |
5 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' | 5 | import { PluginApiService } from '@app/+admin/plugins/shared/plugin-api.service' |
6 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier } from '@app/core' | 6 | import { ComponentPagination, ConfirmService, hasMoreItems, Notifier, PluginService } from '@app/core' |
7 | import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' | 7 | import { PeerTubePluginIndex } from '@shared/models/plugins/peertube-plugin-index.model' |
8 | import { PluginType } from '@shared/models/plugins/plugin.type' | 8 | import { PluginType } from '@shared/models/plugins/plugin.type' |
9 | 9 | ||
@@ -39,6 +39,7 @@ 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: PluginService, | ||
42 | private pluginApiService: PluginApiService, | 43 | private pluginApiService: PluginApiService, |
43 | private notifier: Notifier, | 44 | private notifier: Notifier, |
44 | private confirmService: ConfirmService, | 45 | private confirmService: ConfirmService, |
@@ -119,6 +120,14 @@ export class PluginSearchComponent implements OnInit { | |||
119 | return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name) | 120 | return this.pluginApiService.getPluginOrThemeHref(this.pluginType, name) |
120 | } | 121 | } |
121 | 122 | ||
123 | getShowRouterLink (plugin: PeerTubePluginIndex) { | ||
124 | return [ '/admin', 'plugins', 'show', this.pluginService.nameToNpmName(plugin.name, this.pluginType) ] | ||
125 | } | ||
126 | |||
127 | isThemeSearch () { | ||
128 | return this.pluginType === PluginType.THEME | ||
129 | } | ||
130 | |||
122 | async install (plugin: PeerTubePluginIndex) { | 131 | async install (plugin: PeerTubePluginIndex) { |
123 | if (this.installing[plugin.npmName]) return | 132 | if (this.installing[plugin.npmName]) return |
124 | 133 | ||