22
Gruntfile.js
@ -1,12 +1,12 @@
|
||||
var src = 'public/';
|
||||
var src = 'src/';
|
||||
var dest = 'dist/';
|
||||
|
||||
var scripts = [
|
||||
'public/js/app.js',
|
||||
'public/js/controllers.js',
|
||||
'public/js/filters.js',
|
||||
'public/js/directives.js',
|
||||
'public/js/script.js'
|
||||
'src/js/app.js',
|
||||
'src/js/controllers.js',
|
||||
'src/js/filters.js',
|
||||
'src/js/directives.js',
|
||||
'src/js/script.js'
|
||||
];
|
||||
|
||||
var vendor = [
|
||||
@ -49,7 +49,7 @@ module.exports = function(grunt) {
|
||||
}
|
||||
},
|
||||
files: {
|
||||
'dist/index.html': 'views/index.jade'
|
||||
'dist/index.html': 'src/views/index.jade'
|
||||
}
|
||||
}
|
||||
},
|
||||
@ -58,28 +58,28 @@ module.exports = function(grunt) {
|
||||
files: [
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'public/fonts/',
|
||||
cwd: 'src/fonts/',
|
||||
src: ['minimal-*.*'],
|
||||
dest: 'dist/fonts/',
|
||||
filter: 'isFile'
|
||||
},
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'public/images/',
|
||||
cwd: 'src/images/',
|
||||
src: ['*.ico'],
|
||||
dest: 'dist/',
|
||||
filter: 'isFile'
|
||||
},
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'public/css/',
|
||||
cwd: 'src/css/',
|
||||
src: styles,
|
||||
dest: 'dist/css/',
|
||||
filter: 'isFile'
|
||||
},
|
||||
{
|
||||
expand: true,
|
||||
cwd: 'public/js/lib/',
|
||||
cwd: 'src/js/lib/',
|
||||
src: ['*.*'],
|
||||
dest: 'dist/js/lib'
|
||||
}
|
||||
|
3
app.js
@ -19,11 +19,10 @@ if( process.env.NODE_ENV !== 'production' )
|
||||
var express = require('express');
|
||||
var app = express();
|
||||
var path = require('path');
|
||||
var favicon = require('serve-favicon');
|
||||
var bodyParser = require('body-parser');
|
||||
|
||||
// view engine setup
|
||||
app.set('views', path.join(__dirname, 'views'));
|
||||
app.set('views', path.join(__dirname, 'src/views'));
|
||||
app.set('view engine', 'jade');
|
||||
app.use(bodyParser.json());
|
||||
app.use(bodyParser.urlencoded({ extended: false }));
|
||||
|
2
dist/index.html
vendored
2
dist/js/netstats.min.js
vendored
2
dist/js/netstats.min.js.map
vendored
@ -21,7 +21,6 @@
|
||||
"primus": "3.0.2",
|
||||
"primus-emit": "0.1.2",
|
||||
"primus-spark-latency": "0.1.1",
|
||||
"serve-favicon": "2.2.1",
|
||||
"ws": "0.7.2"
|
||||
},
|
||||
"repository": {
|
||||
|
Before Width: | Height: | Size: 14 KiB After Width: | Height: | Size: 14 KiB |
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 574 B After Width: | Height: | Size: 574 B |
Before Width: | Height: | Size: 442 KiB After Width: | Height: | Size: 442 KiB |
Before Width: | Height: | Size: 722 KiB After Width: | Height: | Size: 722 KiB |
Before Width: | Height: | Size: 881 KiB After Width: | Height: | Size: 881 KiB |
Before Width: | Height: | Size: 1.1 MiB After Width: | Height: | Size: 1.1 MiB |
@ -50,6 +50,46 @@ angular.module('netStatsApp.directives', [])
|
||||
// };
|
||||
// }])
|
||||
|
||||
.directive('minerblock', function ($compile) {
|
||||
return {
|
||||
restrict: 'E',
|
||||
template: '<div></div>',
|
||||
replace: true,
|
||||
link: function (scope, element, attrs)
|
||||
{
|
||||
var makeClass = function (value)
|
||||
{
|
||||
if(value <= 6)
|
||||
return 'success';
|
||||
|
||||
if(value <= 12)
|
||||
return 'info';
|
||||
|
||||
if(value <= 18)
|
||||
return 'warning';
|
||||
|
||||
if(value <= 24)
|
||||
return 'orange';
|
||||
|
||||
return 'danger';
|
||||
}
|
||||
|
||||
attrs.$observe("blocks", function (newValue)
|
||||
{
|
||||
var content = '';
|
||||
var blockClass = 'bg-' + makeClass(newValue);
|
||||
|
||||
for(var i = 0; i < newValue; i++)
|
||||
{
|
||||
content += '<div class="block ' + blockClass + '"></div>';
|
||||
}
|
||||
|
||||
element.empty();
|
||||
element.html(content);
|
||||
});
|
||||
}
|
||||
};
|
||||
})
|
||||
.directive('sparkchart', function () {
|
||||
return {
|
||||
restrict: 'E',
|
@ -542,15 +542,17 @@ angular.module('netStatsApp.filters', [])
|
||||
};
|
||||
});
|
||||
|
||||
function compareVersions(v1, comparator, v2) {
|
||||
"use strict";
|
||||
console.log(v1, comparator, v2);
|
||||
function compareVersions(v1, comparator, v2)
|
||||
{
|
||||
comparator = comparator == '=' ? '==' : comparator;
|
||||
|
||||
var v1parts = v1.split('.'), v2parts = v2.split('.');
|
||||
var maxLen = Math.max(v1parts.length, v2parts.length);
|
||||
var part1, part2;
|
||||
var cmp = 0;
|
||||
for(var i = 0; i < maxLen && !cmp; i++) {
|
||||
|
||||
for(var i = 0; i < maxLen && !cmp; i++)
|
||||
{
|
||||
part1 = parseInt(v1parts[i], 10) || 0;
|
||||
part2 = parseInt(v2parts[i], 10) || 0;
|
||||
if(part1 < part2)
|
||||
@ -558,6 +560,7 @@ function compareVersions(v1, comparator, v2) {
|
||||
if(part1 > part2)
|
||||
cmp = -1;
|
||||
}
|
||||
|
||||
return eval('0' + comparator + cmp);
|
||||
}
|
||||
|
0
public/js/lib/d3.js → src/js/lib/d3.js
vendored
@ -113,10 +113,10 @@ block content
|
||||
div.col-xs-3.stat-holder.pull-right
|
||||
div.big-info.chart.double-chart
|
||||
span.small-title last blocks miners
|
||||
div.blocks-holder(ng-repeat='miner in miners', data-toggle="tooltip", data-placement="right", title="{{miner.blocks}}")
|
||||
div.blocks-holder(ng-repeat='miner in miners track by miner.miner', data-toggle="tooltip", data-placement="right", data-original-title="{{miner.blocks}}")
|
||||
div.block-count(class="{{miner.blocks | minerBlocksClass : 'text-'}}") {{miner.blocks}}
|
||||
div.small-title-miner {{miner.miner | minerNameFilter : miner.name}}
|
||||
div.block(ng-repeat="i in getNumber(miner.blocks) track by $index", class="{{miner.blocks | minerBlocksClass}}")
|
||||
minerblock(blocks="{{miner.blocks}}")
|
||||
div.clearfix
|
||||
|
||||
div.col-xs-3.stat-holder
|