pull/1/head
yann300 6 years ago
parent 4525875e99
commit 0dabf0f7eb
  1. 19
      src/app/components/plugin-manager-component.js
  2. 7
      src/universal-dapp.js

@ -57,37 +57,38 @@ class PluginManagerComponent {
} }
render () { render () {
let pluginManagerDiv = yo` this.views.root = yo`
<div id='pluginManager' class=${css.plugins} > <div id='pluginManager' class=${css.plugins} >
<h2>Plugin Manager</h2> <h2>Plugin Manager</h2>
</div> </div>
` `
var modules = this.store.getAll() var modules = this.store.getAll()
modules.forEach((mod) => { modules.forEach((mod) => {
pluginManagerDiv.appendChild(this.renderItem(mod.profile.name)) this.views.root.appendChild(this.renderItem(mod.profile.name))
}) })
return pluginManagerDiv return this.views.root
} }
renderItem (item) { renderItem (item) {
let ctrBtns let ctrBtns
const mod = this.store.getOne(item)
if (!mod) return
let action = () => { this.store.isActive(item) ? this.appManager.doDeactivate(item) : this.appManager.doActivate(item) } let action = () => { this.store.isActive(item) ? this.appManager.doDeactivate(item) : this.appManager.doActivate(item) }
ctrBtns = yo`<div id='${item}Activation'> ctrBtns = yo`<div id='${item}Activation'>
<button onclick=${(event) => { action(event) }} >${this.store.isActive(item) ? 'deactivate' : 'activate'}</button> <button onclick=${(event) => { action(event) }} >${this.store.isActive(item) ? 'deactivate' : 'activate'}</button>
</div>` </div>`
this.views.items[item] = ctrBtns this.views.items[item] = yo`
this.views.root = yo`
<div id='pluginManager' class=${css.plugin} > <div id='pluginManager' class=${css.plugin} >
<h3>${this.modulesDefinition[item].name}</h3> <h3>${mod.profile.name}</h3>
${this.modulesDefinition[item].description} ${mod.profile.description}
${ctrBtns} ${ctrBtns}
</div> </div>
` `
return this.views.root
return this.views.items[item]
} }
} }

@ -36,13 +36,6 @@ UniversalDApp.prototype.profile = function () {
} }
} }
UniversalDApp.prototype.profile = function () {
return {
type: 'udapp',
methods: ['runTestTx', 'getAccounts', 'createVMAccount']
}
}
UniversalDApp.prototype.resetEnvironment = function () { UniversalDApp.prototype.resetEnvironment = function () {
this.accounts = {} this.accounts = {}
if (executionContext.isVM()) { if (executionContext.isVM()) {

Loading…
Cancel
Save