mirror of
https://github.com/Qortal/qortal-ui.git
synced 2025-05-29 20:56:59 +00:00
added become a minter route
This commit is contained in:
parent
4dd62f9eb6
commit
82406bd2e4
@ -1,137 +1,141 @@
|
|||||||
require('events').EventEmitter.defaultMaxListeners = 0
|
require('events').EventEmitter.defaultMaxListeners = 0;
|
||||||
const path = require("path");
|
const path = require('path');
|
||||||
const { nodeResolve } = require("@rollup/plugin-node-resolve");
|
const { nodeResolve } = require('@rollup/plugin-node-resolve');
|
||||||
const progress = require("rollup-plugin-progress");
|
const progress = require('rollup-plugin-progress');
|
||||||
const replace = require('@rollup/plugin-replace');
|
const replace = require('@rollup/plugin-replace');
|
||||||
const globals = require("rollup-plugin-node-globals");
|
const globals = require('rollup-plugin-node-globals');
|
||||||
const commonjs = require("@rollup/plugin-commonjs");
|
const commonjs = require('@rollup/plugin-commonjs');
|
||||||
const alias = require("@rollup/plugin-alias");
|
const alias = require('@rollup/plugin-alias');
|
||||||
const { terser } = require('rollup-plugin-terser');
|
const { terser } = require('rollup-plugin-terser');
|
||||||
const babel = require("@rollup/plugin-babel");
|
const babel = require('@rollup/plugin-babel');
|
||||||
|
|
||||||
const aliases = {};
|
const aliases = {};
|
||||||
|
|
||||||
const generateRollupConfig = (inputFile, outputFile) => {
|
const generateRollupConfig = (inputFile, outputFile) => {
|
||||||
return {
|
return {
|
||||||
inputOptions: {
|
inputOptions: {
|
||||||
onwarn: (warning, rollupWarn) => {
|
onwarn: (warning, rollupWarn) => {
|
||||||
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
|
if (warning.code !== 'CIRCULAR_DEPENDENCY') {
|
||||||
rollupWarn(warning)
|
rollupWarn(warning);
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
input: inputFile,
|
input: inputFile,
|
||||||
plugins: [
|
plugins: [
|
||||||
alias({
|
alias({
|
||||||
entries: Object.keys(aliases).map((find) => {
|
entries: Object.keys(aliases).map((find) => {
|
||||||
return {
|
return {
|
||||||
find,
|
find,
|
||||||
replacement: aliases[find],
|
replacement: aliases[find],
|
||||||
};
|
};
|
||||||
}),
|
}),
|
||||||
}),
|
}),
|
||||||
nodeResolve({
|
nodeResolve({
|
||||||
preferBuiltins: false,
|
preferBuiltins: false,
|
||||||
mainFields: ['module', 'browser']
|
mainFields: ['module', 'browser'],
|
||||||
}),
|
}),
|
||||||
replace({
|
replace({
|
||||||
preventAssignment: true,
|
preventAssignment: true,
|
||||||
"process.env.NODE_ENV": JSON.stringify("production"),
|
'process.env.NODE_ENV': JSON.stringify('production'),
|
||||||
}),
|
}),
|
||||||
commonjs(),
|
commonjs(),
|
||||||
globals(),
|
globals(),
|
||||||
progress(),
|
progress(),
|
||||||
babel.babel({
|
babel.babel({
|
||||||
babelHelpers: 'bundled',
|
babelHelpers: 'bundled',
|
||||||
exclude: "node_modules/**",
|
exclude: 'node_modules/**',
|
||||||
}),
|
}),
|
||||||
terser({
|
terser({
|
||||||
compress: true,
|
compress: true,
|
||||||
output: {
|
output: {
|
||||||
comments: false,
|
comments: false,
|
||||||
},
|
},
|
||||||
})
|
}),
|
||||||
],
|
],
|
||||||
},
|
},
|
||||||
outputOptions: {
|
outputOptions: {
|
||||||
file: outputFile,
|
file: outputFile,
|
||||||
format: "umd",
|
format: 'umd',
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
const generateForPlugins = () => {
|
const generateForPlugins = () => {
|
||||||
const configs = [
|
const configs = [
|
||||||
{
|
{
|
||||||
in: "plugins/core/main.src.js",
|
in: 'plugins/core/main.src.js',
|
||||||
out: "plugins/core/main.js",
|
out: 'plugins/core/main.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/trade-portal/trade-portal.src.js",
|
in: 'plugins/core/trade-portal/trade-portal.src.js',
|
||||||
out: "plugins/core/trade-portal/trade-portal.js",
|
out: 'plugins/core/trade-portal/trade-portal.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/wallet/wallet-app.src.js",
|
in: 'plugins/core/wallet/wallet-app.src.js',
|
||||||
out: "plugins/core/wallet/wallet-app.js",
|
out: 'plugins/core/wallet/wallet-app.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/reward-share/reward-share.src.js",
|
in: 'plugins/core/reward-share/reward-share.src.js',
|
||||||
out: "plugins/core/reward-share/reward-share.js",
|
out: 'plugins/core/reward-share/reward-share.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/node-management/node-management.src.js",
|
in: 'plugins/core/node-management/node-management.src.js',
|
||||||
out: "plugins/core/node-management/node-management.js",
|
out: 'plugins/core/node-management/node-management.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/group-management/group-management.src.js",
|
in: 'plugins/core/group-management/group-management.src.js',
|
||||||
out: "plugins/core/group-management/group-management.js",
|
out: 'plugins/core/group-management/group-management.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/name-registration/name-registration.src.js",
|
in: 'plugins/core/name-registration/name-registration.src.js',
|
||||||
out: "plugins/core/name-registration/name-registration.js",
|
out: 'plugins/core/name-registration/name-registration.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/qdn/websites.src.js",
|
in: 'plugins/core/qdn/websites.src.js',
|
||||||
out: "plugins/core/qdn/websites.js",
|
out: 'plugins/core/qdn/websites.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/qdn/publish/publish.src.js",
|
in: 'plugins/core/qdn/publish/publish.src.js',
|
||||||
out: "plugins/core/qdn/publish/publish.js",
|
out: 'plugins/core/qdn/publish/publish.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/qdn/browser/browser.src.js",
|
in: 'plugins/core/qdn/browser/browser.src.js',
|
||||||
out: "plugins/core/qdn/browser/browser.js",
|
out: 'plugins/core/qdn/browser/browser.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/qdn/data-management/data-management.src.js",
|
in: 'plugins/core/qdn/data-management/data-management.src.js',
|
||||||
out: "plugins/core/qdn/data-management/data-management.js",
|
out: 'plugins/core/qdn/data-management/data-management.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/messaging/messaging.src.js",
|
in: 'plugins/core/messaging/messaging.src.js',
|
||||||
out: "plugins/core/messaging/messaging.js",
|
out: 'plugins/core/messaging/messaging.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/messaging/chain-messaging/chain-messaging.src.js",
|
in: 'plugins/core/messaging/chain-messaging/chain-messaging.src.js',
|
||||||
out: "plugins/core/messaging/chain-messaging/chain-messaging.js",
|
out: 'plugins/core/messaging/chain-messaging/chain-messaging.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/messaging/q-chat/q-chat.src.js",
|
in: 'plugins/core/messaging/q-chat/q-chat.src.js',
|
||||||
out: "plugins/core/messaging/q-chat/q-chat.js",
|
out: 'plugins/core/messaging/q-chat/q-chat.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/minting/minting-info.src.js",
|
in: 'plugins/core/minting/minting-info.src.js',
|
||||||
out: "plugins/core/minting/minting-info.js",
|
out: 'plugins/core/minting/minting-info.js',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
in: "plugins/core/puzzles/puzzles.src.js",
|
in: 'plugins/core/become-minter/become-minter.src.js',
|
||||||
out: "plugins/core/puzzles/puzzles.js",
|
out: 'plugins/core/become-minter/become-minter.js',
|
||||||
}
|
},
|
||||||
].map((file) => {
|
{
|
||||||
return generateRollupConfig(
|
in: 'plugins/core/puzzles/puzzles.src.js',
|
||||||
path.join(__dirname, file.in),
|
out: 'plugins/core/puzzles/puzzles.js',
|
||||||
path.join(__dirname, file.out)
|
},
|
||||||
);
|
].map((file) => {
|
||||||
});
|
return generateRollupConfig(
|
||||||
return configs;
|
path.join(__dirname, file.in),
|
||||||
|
path.join(__dirname, file.out)
|
||||||
|
);
|
||||||
|
});
|
||||||
|
return configs;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = generateForPlugins;
|
module.exports = generateForPlugins;
|
||||||
|
@ -1,132 +1,143 @@
|
|||||||
import { parentEpml } from './connect.js'
|
import { parentEpml } from './connect.js';
|
||||||
import './streams/streams.js'
|
import './streams/streams.js';
|
||||||
|
|
||||||
let config = {}
|
|
||||||
let haveRegisteredNodeManagement = false
|
|
||||||
|
|
||||||
|
let config = {};
|
||||||
|
let haveRegisteredNodeManagement = false;
|
||||||
|
|
||||||
parentEpml.ready().then(() => {
|
parentEpml.ready().then(() => {
|
||||||
// pluginUrlsConf
|
// pluginUrlsConf
|
||||||
let pluginUrlsConf = [
|
let pluginUrlsConf = [
|
||||||
{
|
{
|
||||||
url: 'minting',
|
url: 'minting',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'minting/index.html',
|
page: 'minting/index.html',
|
||||||
title: 'Minting Details',
|
title: 'Minting Details',
|
||||||
icon: 'vaadin:info-circle',
|
icon: 'vaadin:info-circle',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'wallet',
|
url: 'become-minter',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'wallet/index.html',
|
page: 'become-minter/index.html',
|
||||||
title: 'Wallet',
|
title: 'Become a Minter',
|
||||||
icon: 'vaadin:wallet',
|
icon: 'vaadin:info-circle',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'trade-portal',
|
url: 'wallet',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'trade-portal/index.html',
|
page: 'wallet/index.html',
|
||||||
title: 'Trade Portal',
|
title: 'Wallet',
|
||||||
icon: 'vaadin:bullets',
|
icon: 'vaadin:wallet',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'reward-share',
|
url: 'trade-portal',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'reward-share/index.html',
|
page: 'trade-portal/index.html',
|
||||||
title: 'Reward Share',
|
title: 'Trade Portal',
|
||||||
icon: 'vaadin:share-square',
|
icon: 'vaadin:bullets',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'name-registration',
|
url: 'reward-share',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'name-registration/index.html',
|
page: 'reward-share/index.html',
|
||||||
title: 'Name Registration',
|
title: 'Reward Share',
|
||||||
icon: 'vaadin:user-check',
|
icon: 'vaadin:share-square',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'websites',
|
url: 'name-registration',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'qdn/index.html',
|
page: 'name-registration/index.html',
|
||||||
title: 'Websites',
|
title: 'Name Registration',
|
||||||
icon: 'vaadin:desktop',
|
icon: 'vaadin:user-check',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'data-management',
|
url: 'websites',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'qdn/data-management/index.html',
|
page: 'qdn/index.html',
|
||||||
title: 'Data Management',
|
title: 'Websites',
|
||||||
icon: 'vaadin:database',
|
icon: 'vaadin:desktop',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'q-chat',
|
url: 'data-management',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'messaging/q-chat/index.html',
|
page: 'qdn/data-management/index.html',
|
||||||
title: 'Q-Chat',
|
title: 'Data Management',
|
||||||
icon: 'vaadin:chat',
|
icon: 'vaadin:database',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'group-management',
|
url: 'q-chat',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'group-management/index.html',
|
page: 'messaging/q-chat/index.html',
|
||||||
title: 'Group Management',
|
title: 'Q-Chat',
|
||||||
icon: 'vaadin:group',
|
icon: 'vaadin:chat',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
url: 'puzzles',
|
url: 'group-management',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'puzzles/index.html',
|
page: 'group-management/index.html',
|
||||||
title: 'Puzzles',
|
title: 'Group Management',
|
||||||
icon: 'vaadin:puzzle-piece',
|
icon: 'vaadin:group',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
}
|
},
|
||||||
]
|
{
|
||||||
|
url: 'puzzles',
|
||||||
|
domain: 'core',
|
||||||
|
page: 'puzzles/index.html',
|
||||||
|
title: 'Puzzles',
|
||||||
|
icon: 'vaadin:puzzle-piece',
|
||||||
|
menus: [],
|
||||||
|
parent: false,
|
||||||
|
},
|
||||||
|
];
|
||||||
|
|
||||||
const registerPlugins = (pluginInfo) => {
|
const registerPlugins = (pluginInfo) => {
|
||||||
parentEpml.request('registerUrl', pluginInfo)
|
parentEpml.request('registerUrl', pluginInfo);
|
||||||
}
|
};
|
||||||
|
|
||||||
const checkNode = window.parent.reduxStore.getState().app.nodeConfig.knownNodes[window.parent.reduxStore.getState().app.nodeConfig.node]
|
const checkNode =
|
||||||
|
window.parent.reduxStore.getState().app.nodeConfig.knownNodes[
|
||||||
|
window.parent.reduxStore.getState().app.nodeConfig.node
|
||||||
|
];
|
||||||
|
|
||||||
parentEpml.subscribe('config', c => {
|
parentEpml.subscribe('config', (c) => {
|
||||||
config = JSON.parse(c)
|
config = JSON.parse(c);
|
||||||
|
|
||||||
// Only register node management if node management is enabled and it hasn't already been registered
|
// Only register node management if node management is enabled and it hasn't already been registered
|
||||||
if (!haveRegisteredNodeManagement && checkNode.enableManagement) {
|
if (!haveRegisteredNodeManagement && checkNode.enableManagement) {
|
||||||
haveRegisteredNodeManagement = true
|
haveRegisteredNodeManagement = true;
|
||||||
|
|
||||||
let nodeManagementConf = {
|
let nodeManagementConf = {
|
||||||
url: 'node-management',
|
url: 'node-management',
|
||||||
domain: 'core',
|
domain: 'core',
|
||||||
page: 'node-management/index.html',
|
page: 'node-management/index.html',
|
||||||
title: 'Node Management',
|
title: 'Node Management',
|
||||||
icon: 'vaadin:cloud',
|
icon: 'vaadin:cloud',
|
||||||
menus: [],
|
menus: [],
|
||||||
parent: false
|
parent: false,
|
||||||
}
|
};
|
||||||
|
|
||||||
let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf]
|
let _pluginUrlsConf = [...pluginUrlsConf, nodeManagementConf];
|
||||||
registerPlugins(_pluginUrlsConf)
|
registerPlugins(_pluginUrlsConf);
|
||||||
} else {
|
} else {
|
||||||
registerPlugins(pluginUrlsConf)
|
registerPlugins(pluginUrlsConf);
|
||||||
}
|
}
|
||||||
})
|
});
|
||||||
})
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user