Qortal UI - Main Code Repository A User Interface for the Qortal Blockchain Project. Truly decentralized web hosting, application hosting, communications, data storage, and full infrastructure for the future global decentralized digital world.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

133 lines
3.7 KiB

3 years ago
import { parentEpml } from './connect.js'
import './streams/streams.js'
let config = {}
let haveRegisteredNodeManagement = false
parentEpml.ready().then(() => {
// pluginUrlsConf
let pluginUrlsConf = [
{
url: 'minting',
domain: 'core',
page: 'minting/index.html',
title: 'Minting Details',
3 years ago
icon: 'vaadin:info-circle',
3 years ago
menus: [],
parent: false
},
{
url: 'wallet',
domain: 'core',
page: 'wallet/index.html',
title: 'Wallet',
3 years ago
icon: 'vaadin:wallet',
3 years ago
menus: [],
parent: false
},
{
url: 'trade-portal',
domain: 'core',
page: 'trade-portal/index.html',
title: 'Trade Portal',
3 years ago
icon: 'vaadin:bullets',
3 years ago
menus: [],
parent: false
},
{
url: 'reward-share',
domain: 'core',
page: 'reward-share/index.html',
title: 'Reward Share',
3 years ago
icon: 'vaadin:share-square',
3 years ago
menus: [],
parent: false
},
{
url: 'name-registration',
domain: 'core',
page: 'name-registration/index.html',
title: 'Name Registration',
3 years ago
icon: 'vaadin:user-check',
3 years ago
menus: [],
parent: false
},
3 years ago
{
url: 'websites',
domain: 'core',
page: 'qdn/index.html',
title: 'Websites',
3 years ago
icon: 'vaadin:desktop',
3 years ago
menus: [],
parent: false
},
{
url: 'data-management',
domain: 'core',
page: 'qdn/data-management/index.html',
title: 'Data Management',
3 years ago
icon: 'vaadin:database',
3 years ago
menus: [],
parent: false
},
3 years ago
{
url: 'q-chat',
domain: 'core',
page: 'messaging/q-chat/index.html',
title: 'Q-Chat',
3 years ago
icon: 'vaadin:chat',
3 years ago
menus: [],
parent: false
},
{
url: 'group-management',
domain: 'core',
page: 'group-management/index.html',
title: 'Group Management',
3 years ago
icon: 'vaadin:group',
3 years ago
menus: [],
parent: false
3 years ago
},
{
3 years ago
url: 'puzzles',
domain: 'core',
page: 'puzzles/index.html',
title: 'Puzzles',
3 years ago
icon: 'vaadin:puzzle-piece',
3 years ago
menus: [],
parent: false
}
3 years ago
]
const registerPlugins = (pluginInfo) => {
parentEpml.request('registerUrl', pluginInfo)
}
const checkNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
3 years ago
parentEpml.subscribe('config', c => {
config = JSON.parse(c)
// Only register node management if node management is enabled and it hasn't already been registered
if (!haveRegisteredNodeManagement && checkNode.enableManagement) {
3 years ago
haveRegisteredNodeManagement = true
let nodeManagementConf = {
url: 'node-management',
domain: 'core',
page: 'node-management/index.html',
title: 'Node Management',
3 years ago
icon: 'vaadin:cloud',
3 years ago
menus: [],
parent: false
}
let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf]
registerPlugins(_pluginUrlsConf)
} else {
registerPlugins(pluginUrlsConf)
}
})
})