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 | |
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')
-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 | 11 |
2 files changed, 12 insertions, 1 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 8edf03a89..727633399 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 | |||
@@ -48,6 +48,8 @@ | |||
48 | <span *ngIf="plugin.installed" class="badge badge-success">Installed</span> | 48 | <span *ngIf="plugin.installed" class="badge badge-success">Installed</span> |
49 | 49 | ||
50 | <div class="buttons"> | 50 | <div class="buttons"> |
51 | <my-edit-button *ngIf="plugin.installed === true && !isThemeSearch()" [routerLink]="getShowRouterLink(plugin)" label="Settings" i18n-label></my-edit-button> | ||
52 | |||
51 | <my-button class="update-button" *ngIf="plugin.installed === false" (click)="install(plugin)" [loading]="isInstalling(plugin)" | 53 | <my-button class="update-button" *ngIf="plugin.installed === false" (click)="install(plugin)" [loading]="isInstalling(plugin)" |
52 | label="Install" icon="cloud-download" [attr.disabled]="isInstalling(plugin)" | 54 | label="Install" icon="cloud-download" [attr.disabled]="isInstalling(plugin)" |
53 | ></my-button> | 55 | ></my-button> |
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 | ||