|
|
@ -87,7 +87,11 @@ class PluginManagerComponent extends ViewPlugin { |
|
|
|
this.appManager.event.on('added', () => { this.reRender() }) |
|
|
|
this.appManager.event.on('added', () => { this.reRender() }) |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
renderItem (profile, isActive) { |
|
|
|
isActive (name) { |
|
|
|
|
|
|
|
return this.appManager.actives.includes(name) |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
renderItem (profile) { |
|
|
|
const displayName = (profile.displayName) ? profile.displayName : profile.name |
|
|
|
const displayName = (profile.displayName) ? profile.displayName : profile.name |
|
|
|
|
|
|
|
|
|
|
|
// Check version of the plugin
|
|
|
|
// Check version of the plugin
|
|
|
@ -101,11 +105,12 @@ class PluginManagerComponent extends ViewPlugin { |
|
|
|
versionWarning = yo`<small title="Version Beta" class="${css.versionWarning} plugin-version">beta</small>` |
|
|
|
versionWarning = yo`<small title="Version Beta" class="${css.versionWarning} plugin-version">beta</small>` |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
const activationButton = isActive |
|
|
|
const activationButton = this.isActive(profile.name) |
|
|
|
? yo` |
|
|
|
? yo` |
|
|
|
<button onclick="${_ => this.appManager.deactivatePlugin(profile.name)}" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton${name}"> |
|
|
|
<button onclick="${_ => this.appManager.deactivatePlugin(profile.name)}" class="btn btn-secondary btn-sm" data-id="pluginManagerComponentDeactivateButton${name}"> |
|
|
|
Deactivate |
|
|
|
Deactivate |
|
|
|
</button>` |
|
|
|
</button> |
|
|
|
|
|
|
|
` |
|
|
|
: yo` |
|
|
|
: yo` |
|
|
|
<button onclick="${_ => this.appManager.activatePlugin(profile.name)}" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton${name}"> |
|
|
|
<button onclick="${_ => this.appManager.activatePlugin(profile.name)}" class="btn btn-success btn-sm" data-id="pluginManagerComponentActivateButton${name}"> |
|
|
|
Activate |
|
|
|
Activate |
|
|
@ -161,7 +166,7 @@ class PluginManagerComponent extends ViewPlugin { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Filter all active and inactive modules that are not required
|
|
|
|
// Filter all active and inactive modules that are not required
|
|
|
|
const isActive = (name) => { return this.appManager.actives.includes(name) } |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const {actives, inactives} = this.appManager.getAll() |
|
|
|
const {actives, inactives} = this.appManager.getAll() |
|
|
|
.filter(isFiltered) |
|
|
|
.filter(isFiltered) |
|
|
@ -169,7 +174,8 @@ class PluginManagerComponent extends ViewPlugin { |
|
|
|
.filter(isNotHome) |
|
|
|
.filter(isNotHome) |
|
|
|
.sort(sortByName) |
|
|
|
.sort(sortByName) |
|
|
|
.reduce(({actives, inactives}, profile) => { |
|
|
|
.reduce(({actives, inactives}, profile) => { |
|
|
|
return isActive(profile.name) ? { actives: [...actives, profile], inactives } |
|
|
|
return this.isActive(profile.name) |
|
|
|
|
|
|
|
? { actives: [...actives, profile], inactives } |
|
|
|
: { inactives: [...inactives, profile], actives } |
|
|
|
: { inactives: [...inactives, profile], actives } |
|
|
|
}, { actives: [], inactives: [] }) |
|
|
|
}, { actives: [], inactives: [] }) |
|
|
|
|
|
|
|
|
|
|
@ -201,11 +207,11 @@ class PluginManagerComponent extends ViewPlugin { |
|
|
|
<section data-id="pluginManagerComponentPluginManagerSection"> |
|
|
|
<section data-id="pluginManagerComponentPluginManagerSection"> |
|
|
|
${activeTile} |
|
|
|
${activeTile} |
|
|
|
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile"> |
|
|
|
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentActiveTile"> |
|
|
|
${actives.map(profile => this.renderItem(profile, isActive(profile.name)))} |
|
|
|
${actives.map(profile => this.renderItem(profile))} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
${inactiveTile} |
|
|
|
${inactiveTile} |
|
|
|
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentInactiveTile"> |
|
|
|
<div class="list-group list-group-flush plugins-list-group" data-id="pluginManagerComponentInactiveTile"> |
|
|
|
${inactives.map(profile => this.renderItem(profile, isActive(profile.name)))} |
|
|
|
${inactives.map(profile => this.renderItem(profile))} |
|
|
|
</div> |
|
|
|
</div> |
|
|
|
</section> |
|
|
|
</section> |
|
|
|
${settings} |
|
|
|
${settings} |
|
|
|