Browse Source

Add basic website template switching

pull/1/head
webworker01 6 years ago
parent
commit
260e440139
No known key found for this signature in database GPG Key ID: 7C4B4F666DB24C9F
  1. 1
      .gitignore
  2. 2
      README.md
  3. 3
      config_example.json
  4. 7
      libs/website.js
  5. 6
      package-lock.json
  6. 7
      package.json
  7. 0
      website/default/index.html
  8. 0
      website/default/key.html
  9. 0
      website/default/pages/admin.html
  10. 0
      website/default/pages/api.html
  11. 0
      website/default/pages/getting_started.html
  12. 0
      website/default/pages/home.html
  13. 0
      website/default/pages/miner_stats.html
  14. 0
      website/default/pages/mining_key.html
  15. 0
      website/default/pages/payments.html
  16. 0
      website/default/pages/stats.html
  17. 0
      website/default/pages/tbs.html
  18. 0
      website/default/pages/workers.html
  19. 0
      website/default/static/admin.js
  20. 0
      website/default/static/favicon.png
  21. 0
      website/default/static/kmdfavicon.svg
  22. 0
      website/default/static/komodo-logo-horizontal-01.png
  23. 0
      website/default/static/logo.svg
  24. 0
      website/default/static/main.js
  25. 0
      website/default/static/miner_stats.js
  26. 0
      website/default/static/nvd3.css
  27. 0
      website/default/static/nvd3.js
  28. 0
      website/default/static/stats.js
  29. 0
      website/default/static/style.css

1
.gitignore

@ -3,3 +3,4 @@ node_modules/
config.json
pool_configs/*.json
!pool_configs/zclassic_example.json
coins/

2
README.md

@ -65,4 +65,4 @@ Forked from ComputerGenie repo (deleted)
Released under the GNU General Public License v2
http://www.gnu.org/licenses/gpl-2.0.html
_Forked from [z-classic/z-nomp](https://github.com/z-classic/z-nomp) which is licensed under MIT License (See Old/LICENSE file)_
_Forked from [z-classic/z-nomp](https://github.com/z-classic/z-nomp) which is incorrectly licensed under MIT License - see [zone117x/node-open-mining-portal](https://github.com/zone117x/node-open-mining-portal)_

3
config_example.json

@ -34,7 +34,8 @@
"enabled": false,
"host": "0.0.0.0",
"port": 8080,
"stratumHost": "cryppit.com",
"stratumHost": "stratum.piratepool.io",
"template": "default",
"stats": {
"updateInterval": 30,
"historicalRetention": 14400,

7
libs/website.js

@ -24,6 +24,7 @@ module.exports = function(logger){
var poolConfigs = JSON.parse(process.env.pools);
var websiteConfig = portalConfig.website;
var websiteTemplate = './website/' + (typeof websiteConfig.template !== 'undefined' && websiteConfig.template ? websiteConfig.template : 'default');
var portalApi = new api(logger, portalConfig, poolConfigs);
var portalStats = portalApi.stats;
@ -75,7 +76,7 @@ module.exports = function(logger){
var readPageFiles = function(files){
async.each(files, function(fileName, callback){
var filePath = 'website/' + (fileName === 'index.html' ? '' : 'pages/') + fileName;
var filePath = websiteTemplate + (fileName === 'index.html' ? '/' : '/pages/') + fileName;
fs.readFile(filePath, 'utf8', function(err, data){
var pTemp = dot.template(data);
pageTemplates[pageFiles[fileName]] = pTemp
@ -92,7 +93,7 @@ module.exports = function(logger){
// if an html file was changed reload it
/* requires node-watch 0.5.0 or newer */
watch(['./website', './website/pages'], function(evt, filename){
watch([websiteTemplate, websiteTemplate+'/pages'], function(evt, filename){
var basename;
// support older versions of node-watch automatically
if (!filename && evt)
@ -234,7 +235,7 @@ module.exports = function(logger){
*/
app.use(compress());
app.use('/static', express.static('website/static'));
app.use('/static', express.static(websiteTemplate + '/static'));
app.use(function(err, req, res, next){
console.error(err.stack);

6
package-lock.json

@ -1,6 +1,6 @@
{
"name": "knomp",
"version": "0.0.1",
"version": "0.1.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1653,9 +1653,7 @@
"from": "git+https://github.com/webworker01/equihashverify.git#7a7403b229477d7cef5735a54e223c72cee5bcdf",
"requires": {
"bindings": "*",
"libsodium": "^0.7.3",
"nan": "*",
"node-gyp": "*"
"nan": "*"
}
}
}

7
package.json

@ -1,7 +1,7 @@
{
"name": "knomp",
"version": "0.0.1",
"description": "High performance Stratum poolserver in Node.js",
"version": "0.1.0",
"description": "High performance Stratum poolserver for the Komodo ecosystem in Node.js",
"keywords": [
"stratum",
"mining",
@ -17,7 +17,8 @@
"author": "webworker01",
"contributors": [
"z-classic",
"ComputerGenie"
"ComputerGenie",
"webworker01"
],
"main": "init.js",
"bin": {

0
website/index.html → website/default/index.html

0
website/key.html → website/default/key.html

0
website/pages/admin.html → website/default/pages/admin.html

0
website/pages/api.html → website/default/pages/api.html

0
website/pages/getting_started.html → website/default/pages/getting_started.html

0
website/pages/home.html → website/default/pages/home.html

0
website/pages/miner_stats.html → website/default/pages/miner_stats.html

0
website/pages/mining_key.html → website/default/pages/mining_key.html

0
website/pages/payments.html → website/default/pages/payments.html

0
website/pages/stats.html → website/default/pages/stats.html

0
website/pages/tbs.html → website/default/pages/tbs.html

0
website/pages/workers.html → website/default/pages/workers.html

0
website/static/admin.js → website/default/static/admin.js

0
website/static/favicon.png → website/default/static/favicon.png

Before

Width:  |  Height:  |  Size: 413 B

After

Width:  |  Height:  |  Size: 413 B

0
website/static/kmdfavicon.svg → website/default/static/kmdfavicon.svg

Before

Width:  |  Height:  |  Size: 797 B

After

Width:  |  Height:  |  Size: 797 B

0
website/static/komodo-logo-horizontal-01.png → website/default/static/komodo-logo-horizontal-01.png

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 5.7 KiB

0
website/static/logo.svg → website/default/static/logo.svg

Before

Width:  |  Height:  |  Size: 1.2 KiB

After

Width:  |  Height:  |  Size: 1.2 KiB

0
website/static/main.js → website/default/static/main.js

0
website/static/miner_stats.js → website/default/static/miner_stats.js

0
website/static/nvd3.css → website/default/static/nvd3.css

0
website/static/nvd3.js → website/default/static/nvd3.js

0
website/static/stats.js → website/default/static/stats.js

0
website/static/style.css → website/default/static/style.css

Loading…
Cancel
Save