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..."/>
|
<input type="text" (input)="onSearchChange($event.target.value)" i18n-placeholder placeholder="Search..."/>
|
||||||
</div>
|
</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">
|
<div class="result-title" *ngIf="!isSearching">
|
||||||
<ng-container *ngIf="!search">
|
<ng-container *ngIf="!search">
|
||||||
<my-global-icon iconName="trending"></my-global-icon>
|
<my-global-icon iconName="trending"></my-global-icon>
|
||||||
|
@ -32,6 +36,8 @@
|
||||||
<span class="plugin-name">{{ plugin.name }}</span>
|
<span class="plugin-name">{{ plugin.name }}</span>
|
||||||
|
|
||||||
<span class="plugin-version">{{ plugin.latestVersion }}</span>
|
<span class="plugin-version">{{ plugin.latestVersion }}</span>
|
||||||
|
|
||||||
|
<span *ngIf="plugin.installed" class="badge badge-success">Installed</span>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="second-row">
|
<div class="second-row">
|
||||||
|
|
|
@ -21,3 +21,9 @@
|
||||||
margin-right: 5px;
|
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 { Component, OnInit } from '@angular/core'
|
||||||
import { Notifier } from '@app/core'
|
import { Notifier, ServerService } from '@app/core'
|
||||||
import { ConfirmService } from '../../../core'
|
import { ConfirmService } from '../../../core'
|
||||||
import { I18n } from '@ngx-translate/i18n-polyfill'
|
import { I18n } from '@ngx-translate/i18n-polyfill'
|
||||||
import { PluginType } from '@shared/models/plugins/plugin.type'
|
import { PluginType } from '@shared/models/plugins/plugin.type'
|
||||||
|
@ -34,10 +34,12 @@ export class PluginSearchComponent implements OnInit {
|
||||||
|
|
||||||
plugins: PeerTubePluginIndex[] = []
|
plugins: PeerTubePluginIndex[] = []
|
||||||
installing: { [name: string]: boolean } = {}
|
installing: { [name: string]: boolean } = {}
|
||||||
|
pluginInstalled = false
|
||||||
|
|
||||||
private searchSubject = new Subject<string>()
|
private searchSubject = new Subject<string>()
|
||||||
|
|
||||||
constructor (
|
constructor (
|
||||||
|
private server: ServerService,
|
||||||
private i18n: I18n,
|
private i18n: I18n,
|
||||||
private pluginService: PluginApiService,
|
private pluginService: PluginApiService,
|
||||||
private notifier: Notifier,
|
private notifier: Notifier,
|
||||||
|
@ -121,6 +123,7 @@ export class PluginSearchComponent implements OnInit {
|
||||||
.subscribe(
|
.subscribe(
|
||||||
() => {
|
() => {
|
||||||
this.installing[plugin.npmName] = false
|
this.installing[plugin.npmName] = false
|
||||||
|
this.pluginInstalled = true
|
||||||
|
|
||||||
this.notifier.success(this.i18n('{{pluginName}} installed.', { pluginName: plugin.name }))
|
this.notifier.success(this.i18n('{{pluginName}} installed.', { pluginName: plugin.name }))
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user