Add ability to install a plugin from the admin page
This commit is contained in:
parent
6702a1b2cc
commit
89c344dba4
|
@ -6,6 +6,10 @@
|
|||
<input type="text" (input)="onSearchChange($event.target.value)" i18n-placeholder placeholder="Search..."/>
|
||||
</div>
|
||||
|
||||
<div class="alert alert-info" i18n *ngIf="pluginInstalled">
|
||||
To load your new installed plugins or themes, refresh the page.
|
||||
</div>
|
||||
|
||||
<div class="result-title" *ngIf="!isSearching">
|
||||
<ng-container *ngIf="!search">
|
||||
<my-global-icon iconName="trending"></my-global-icon>
|
||||
|
@ -32,6 +36,8 @@
|
|||
<span class="plugin-name">{{ plugin.name }}</span>
|
||||
|
||||
<span class="plugin-version">{{ plugin.latestVersion }}</span>
|
||||
|
||||
<span *ngIf="plugin.installed" class="badge badge-success">Installed</span>
|
||||
</div>
|
||||
|
||||
<div class="second-row">
|
||||
|
|
|
@ -21,3 +21,9 @@
|
|||
margin-right: 5px;
|
||||
}
|
||||
}
|
||||
|
||||
.badge {
|
||||
font-size: 13px;
|
||||
font-weight: $font-semibold;
|
||||
margin-left: 5px;
|
||||
}
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { Component, OnInit } from '@angular/core'
|
||||
import { Notifier } from '@app/core'
|
||||
import { Notifier, ServerService } from '@app/core'
|
||||
import { ConfirmService } from '../../../core'
|
||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||
import { PluginType } from '@shared/models/plugins/plugin.type'
|
||||
|
@ -34,10 +34,12 @@ export class PluginSearchComponent implements OnInit {
|
|||
|
||||
plugins: PeerTubePluginIndex[] = []
|
||||
installing: { [name: string]: boolean } = {}
|
||||
pluginInstalled = false
|
||||
|
||||
private searchSubject = new Subject<string>()
|
||||
|
||||
constructor (
|
||||
private server: ServerService,
|
||||
private i18n: I18n,
|
||||
private pluginService: PluginApiService,
|
||||
private notifier: Notifier,
|
||||
|
@ -121,6 +123,7 @@ export class PluginSearchComponent implements OnInit {
|
|||
.subscribe(
|
||||
() => {
|
||||
this.installing[plugin.npmName] = false
|
||||
this.pluginInstalled = true
|
||||
|
||||
this.notifier.success(this.i18n('{{pluginName}} installed.', { pluginName: plugin.name }))
|
||||
|
||||
|
|
Loading…
Reference in New Issue