From 89c344dba4ae2fca39cf636c3c6f09f31a339493 Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 16 Jul 2019 11:48:52 +0200 Subject: [PATCH] Add ability to install a plugin from the admin page --- .../plugins/plugin-search/plugin-search.component.html | 6 ++++++ .../plugins/plugin-search/plugin-search.component.scss | 6 ++++++ .../+admin/plugins/plugin-search/plugin-search.component.ts | 5 ++++- 3 files changed, 16 insertions(+), 1 deletion(-) 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 7dd103979..5247d8d2e 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 @@ -6,6 +6,10 @@ +
+ To load your new installed plugins or themes, refresh the page. +
+
@@ -32,6 +36,8 @@ {{ plugin.name }} {{ plugin.latestVersion }} + + Installed
diff --git a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss index ad6ff89da..ed06825c8 100644 --- a/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss +++ b/client/src/app/+admin/plugins/plugin-search/plugin-search.component.scss @@ -21,3 +21,9 @@ margin-right: 5px; } } + +.badge { + font-size: 13px; + font-weight: $font-semibold; + margin-left: 5px; +} 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 935e11362..0058fa691 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 @@ -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() 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 })) -- 2.25.1