Merge pull request #11 from PeterTheOne/frontend-config

add frontend config file
This commit is contained in:
5chdn 2019-02-19 09:00:10 +01:00 committed by GitHub
commit d5e31a4cc8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 19 additions and 4 deletions

View File

@ -31,6 +31,8 @@ var styles = [
];
module.exports = function(grunt) {
scripts.unshift(grunt.option('configPath') || 'src/js/defaultConfig.js');
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
clean: {

View File

@ -33,6 +33,12 @@ In order to build the static files you have to run grunt tasks which will genera
grunt poa
```
To build the static files for a network other than Ethereum copy and change src/js/defaultConfig.js and run the following command.
```bash
grunt poa --configPath="src/js/someOtherConfig.js"
```
#### Run
Start a node process and pass the websocket secret to it.

View File

@ -4,6 +4,11 @@
var netStatsApp = angular.module('netStatsApp', ['netStatsApp.filters', 'netStatsApp.directives', 'ngStorage']);
netStatsApp.run(function($rootScope) {
$rootScope.networkName = networkName || 'Ethereum';
$rootScope.faviconPath = faviconPath || '/favicon.ico';
});
/* Services */

2
src/js/defaultConfig.js Normal file
View File

@ -0,0 +1,2 @@
var networkName = 'Ethereum';
var faviconPath = '/favicon.ico';

View File

@ -3,12 +3,12 @@ doctype html
html(ng-app="netStatsApp")
head
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0")
title Ethereum Network Status
title {{ $root.networkName }} Network Status
style(type="text/css") [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
link(rel='stylesheet', href='/css/netstats.min.css')
meta(name='robots', content='index,follow')
meta(name='googlebot', content='index,follow')
link(rel='shortcut icon', type="image/x-icon", href="/favicon.ico")
link(rel='shortcut icon', type="image/x-icon", href="{{$root.faviconPath}}")
body
block content
script(src="/js/netstats.min.js")

View File

@ -3,12 +3,12 @@ doctype html
html(ng-app="netStatsApp")
head
meta(name="viewport", content="width=device-width, initial-scale=1.0, maximum-scale=1.0")
title Testnet Network Status
title {{ $root.networkName }} Network Status
style(type="text/css") [ng\:cloak], [ng-cloak], [data-ng-cloak], [x-ng-cloak], .ng-cloak, .x-ng-cloak { display: none !important; }
link(rel='stylesheet', href='/css/netstats.min.css')
meta(name='robots', content='index,follow')
meta(name='googlebot', content='index,follow')
link(rel='shortcut icon', type="image/x-icon", href="/favicon.ico")
link(rel='shortcut icon', type="image/x-icon", href="{{$root.faviconPath}}")
body
block content
script(src="/js/netstats.min.js")