diff --git a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug index d050900f..555acfb5 100644 --- a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug +++ b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.pug @@ -14,7 +14,7 @@ h3 Installed .d-flex.w-100 .mr-auto.d-flex.flex-column strong {{plugin.name}} - small.text-muted.mb-0 {{plugin.description}} + small.text-muted.mb-0((click)='showPluginInfo(plugin)') {{plugin.description}} .d-flex.flex-column.align-items-end.mr-3 div {{plugin.version}} small.text-muted {{plugin.author}} @@ -32,7 +32,8 @@ h3 Installed .d-flex.w-100 .mr-auto.d-flex.flex-column strong {{plugin.name}} - small.text-muted.mb-0 {{plugin.description}} + a.text-muted.mb-0((click)='showPluginInfo(plugin)') + small {{plugin.description}} .d-flex.flex-column.align-items-end.mr-3 div {{plugin.version}} small.text-muted {{plugin.author}} diff --git a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts index 82683e71..2b6004ea 100644 --- a/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts +++ b/terminus-plugin-manager/src/components/pluginsSettingsTab.component.ts @@ -2,7 +2,7 @@ import { BehaviorSubject, Observable } from 'rxjs' import * as semver from 'semver' import { Component, Input } from '@angular/core' -import { ConfigService, HostAppService } from 'terminus-core' +import { ConfigService, HostAppService, ElectronService } from 'terminus-core' import { IPluginInfo, PluginManagerService } from '../services/pluginManager.service' enum BusyState { Installing, Uninstalling } @@ -24,6 +24,7 @@ export class PluginsSettingsTabComponent { @Input() npmMissing = false constructor ( + private electron: ElectronService, private config: ConfigService, private hostApp: HostAppService, public pluginManager: PluginManagerService @@ -100,4 +101,8 @@ export class PluginsSettingsTabComponent { async upgradePlugin (plugin: IPluginInfo): Promise { return this.installPlugin(this.knownUpgrades[plugin.name]) } + + showPluginInfo (plugin: IPluginInfo) { + this.electron.shell.openExternal('https://www.npmjs.com/package/' + plugin.packageName) + } } diff --git a/terminus-plugin-manager/src/services/pluginManager.service.ts b/terminus-plugin-manager/src/services/pluginManager.service.ts index 14d78d77..ce76ec34 100644 --- a/terminus-plugin-manager/src/services/pluginManager.service.ts +++ b/terminus-plugin-manager/src/services/pluginManager.service.ts @@ -71,7 +71,6 @@ export class PluginManagerService { .fromPromise( axios.get(`https://www.npmjs.com/-/search?text=keywords:${KEYWORD}+${encodeURIComponent(query || '')}&from=0&size=1000`) ) - .do(response => console.log(response.data.objects)) .map(response => response.data.objects.map(item => ({ name: item.package.name.substring(NAME_PREFIX.length), packageName: item.package.name, @@ -85,8 +84,7 @@ export class PluginManagerService { } async installPlugin (plugin: IPluginInfo) { - let result = await exec(`${this.npmPath} --prefix "${this.userPluginsPath}" install ${plugin.packageName}@${plugin.version}`) - console.log(result) + await exec(`${this.npmPath} --prefix "${this.userPluginsPath}" install ${plugin.packageName}@${plugin.version}`) this.installedPlugins = this.installedPlugins.filter(x => x.packageName !== plugin.packageName) this.installedPlugins.push(plugin) }