mirror of
https://github.com/Eugeny/tabby.git
synced 2025-08-26 11:11:52 +00:00
tweaked plugins ui
This commit is contained in:
@@ -2,7 +2,6 @@
|
|||||||
strong Error in {{erroredPlugin}}:
|
strong Error in {{erroredPlugin}}:
|
||||||
pre {{errorMessage}}
|
pre {{errorMessage}}
|
||||||
|
|
||||||
|
|
||||||
.d-flex
|
.d-flex
|
||||||
h3.mb-1 Installed
|
h3.mb-1 Installed
|
||||||
button.btn.btn-outline-secondary.btn-sm.ml-auto((click)='openPluginsFolder()')
|
button.btn.btn-outline-secondary.btn-sm.ml-auto((click)='openPluginsFolder()')
|
||||||
@@ -11,11 +10,16 @@
|
|||||||
|
|
||||||
.list-group.list-group-flush.mt-2
|
.list-group.list-group-flush.mt-2
|
||||||
.list-group-item.d-flex.align-items-center(*ngFor='let plugin of pluginManager.installedPlugins')
|
.list-group-item.d-flex.align-items-center(*ngFor='let plugin of pluginManager.installedPlugins')
|
||||||
|
toggle(
|
||||||
|
[ngModel]='isPluginEnabled(plugin)',
|
||||||
|
(ngModelChange)='togglePlugin(plugin)'
|
||||||
|
)
|
||||||
|
|
||||||
.mr-auto.d-flex.flex-column
|
.mr-auto.d-flex.flex-column
|
||||||
div
|
div
|
||||||
strong {{plugin.name}}
|
strong {{plugin.name}}
|
||||||
small.text-muted.ml-1(*ngIf='!plugin.isBuiltin') {{plugin.version}} / {{plugin.author}}
|
small.text-muted.ml-1(*ngIf='!plugin.isBuiltin') {{plugin.version}} / {{plugin.author}}
|
||||||
small.text-warning.ml-1(*ngIf='config.store.pluginBlacklist.includes(plugin.name)') Disabled
|
small.text-warning.ml-1(*ngIf='!isPluginEnabled(plugin)') Disabled
|
||||||
a.text-muted.mb-0((click)='showPluginInfo(plugin)')
|
a.text-muted.mb-0((click)='showPluginInfo(plugin)')
|
||||||
small {{plugin.description}}
|
small {{plugin.description}}
|
||||||
|
|
||||||
@@ -28,18 +32,6 @@
|
|||||||
i.fas.fa-fw.fa-circle-notch.fa-spin(*ngIf='busy.get(plugin.name) == BusyState.Installing')
|
i.fas.fa-fw.fa-circle-notch.fa-spin(*ngIf='busy.get(plugin.name) == BusyState.Installing')
|
||||||
span Upgrade ({{knownUpgrades[plugin.name].version}})
|
span Upgrade ({{knownUpgrades[plugin.name].version}})
|
||||||
|
|
||||||
button.btn.btn-link.text-primary.ml-2(
|
|
||||||
*ngIf='config.store.pluginBlacklist.includes(plugin.name)',
|
|
||||||
(click)='enablePlugin(plugin)'
|
|
||||||
)
|
|
||||||
i.fas.fa-fw.fa-play
|
|
||||||
|
|
||||||
button.btn.btn-link.ml-2(
|
|
||||||
*ngIf='!config.store.pluginBlacklist.includes(plugin.name)',
|
|
||||||
(click)='disablePlugin(plugin)'
|
|
||||||
)
|
|
||||||
i.fas.fa-fw.fa-pause
|
|
||||||
|
|
||||||
button.btn.btn-link.text-danger.ml-2(
|
button.btn.btn-link.text-danger.ml-2(
|
||||||
(click)='uninstallPlugin(plugin)',
|
(click)='uninstallPlugin(plugin)',
|
||||||
*ngIf='!plugin.isBuiltin',
|
*ngIf='!plugin.isBuiltin',
|
||||||
|
@@ -102,6 +102,18 @@ export class PluginsSettingsTabComponent {
|
|||||||
this.electron.shell.openExternal('https://www.npmjs.com/package/' + plugin.packageName)
|
this.electron.shell.openExternal('https://www.npmjs.com/package/' + plugin.packageName)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
isPluginEnabled (plugin: PluginInfo) {
|
||||||
|
return !this.config.store.pluginBlacklist.includes(plugin.name)
|
||||||
|
}
|
||||||
|
|
||||||
|
togglePlugin (plugin: PluginInfo) {
|
||||||
|
if (this.isPluginEnabled(plugin)) {
|
||||||
|
this.disablePlugin(plugin)
|
||||||
|
} else {
|
||||||
|
this.enablePlugin(plugin)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
enablePlugin (plugin: PluginInfo) {
|
enablePlugin (plugin: PluginInfo) {
|
||||||
this.config.store.pluginBlacklist = this.config.store.pluginBlacklist.filter(x => x !== plugin.name)
|
this.config.store.pluginBlacklist = this.config.store.pluginBlacklist.filter(x => x !== plugin.name)
|
||||||
this.config.save()
|
this.config.save()
|
||||||
|
@@ -3,6 +3,7 @@ import { BrowserModule } from '@angular/platform-browser'
|
|||||||
import { FormsModule } from '@angular/forms'
|
import { FormsModule } from '@angular/forms'
|
||||||
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
import { NgbModule } from '@ng-bootstrap/ng-bootstrap'
|
||||||
|
|
||||||
|
import TerminusCorePlugin from 'terminus-core'
|
||||||
import { SettingsTabProvider } from 'terminus-settings'
|
import { SettingsTabProvider } from 'terminus-settings'
|
||||||
|
|
||||||
import { PluginsSettingsTabComponent } from './components/pluginsSettingsTab.component'
|
import { PluginsSettingsTabComponent } from './components/pluginsSettingsTab.component'
|
||||||
@@ -14,6 +15,7 @@ import { PluginsSettingsTabProvider } from './settings'
|
|||||||
BrowserModule,
|
BrowserModule,
|
||||||
FormsModule,
|
FormsModule,
|
||||||
NgbModule,
|
NgbModule,
|
||||||
|
TerminusCorePlugin,
|
||||||
],
|
],
|
||||||
providers: [
|
providers: [
|
||||||
{ provide: SettingsTabProvider, useClass: PluginsSettingsTabProvider, multi: true },
|
{ provide: SettingsTabProvider, useClass: PluginsSettingsTabProvider, multi: true },
|
||||||
|
Reference in New Issue
Block a user