Merge pull request #158 from cubedro/develop

Performance improvements
pull/5/head
Marian OANCΞA 10 years ago
commit e6f34a963e
  1. 22
      Gruntfile.js
  2. 3
      app.js
  3. 2
      dist/index.html
  4. 2
      dist/js/netstats.min.js
  5. 2
      dist/js/netstats.min.js.map
  6. 1
      package.json
  7. 0
      src/css/animation.css
  8. 0
      src/css/bootstrap.min.css
  9. 0
      src/css/minimal-icons-codes.css
  10. 0
      src/css/minimal-icons-embedded.css
  11. 0
      src/css/minimal-icons-ie7-codes.css
  12. 0
      src/css/minimal-icons-ie7.css
  13. 0
      src/css/minimal-icons.css
  14. 0
      src/css/style.css
  15. 0
      src/css/toastr.min.css
  16. 0
      src/fonts/Simple-Line-Icons.ttf
  17. 0
      src/fonts/minimal-icons.eot
  18. 0
      src/fonts/minimal-icons.svg
  19. 0
      src/fonts/minimal-icons.ttf
  20. 0
      src/fonts/minimal-icons.woff
  21. 0
      src/images/favicon.ico
  22. 0
      src/images/favicon.png
  23. 0
      src/images/screenshot-v0.0.1.jpg
  24. 0
      src/images/screenshot-v0.0.2.jpg
  25. 0
      src/images/screenshot-v0.0.5.jpg
  26. 0
      src/images/screenshot.jpg
  27. 0
      src/js/app.js
  28. 0
      src/js/controllers.js
  29. 40
      src/js/directives.js
  30. 11
      src/js/filters.js
  31. 0
      src/js/lib/angular.js
  32. 0
      src/js/lib/angular.min.js
  33. 0
      src/js/lib/angular.min.js.map
  34. 0
      src/js/lib/bootstrap.min.js
  35. 0
      src/js/lib/d3.js
  36. 0
      src/js/lib/d3.min.js
  37. 0
      src/js/lib/d3.tip.min.js
  38. 0
      src/js/lib/datamaps.min.js
  39. 0
      src/js/lib/jquery-1.11.3.js
  40. 0
      src/js/lib/jquery-1.11.3.min.js
  41. 0
      src/js/lib/jquery-1.11.3.min.js.map
  42. 0
      src/js/lib/jquery.sparkline.js
  43. 0
      src/js/lib/jquery.sparkline.min.js
  44. 0
      src/js/lib/lodash.js
  45. 0
      src/js/lib/lodash.min.js
  46. 0
      src/js/lib/moment.en.min.js
  47. 0
      src/js/lib/moment.js
  48. 0
      src/js/lib/moment.min.js
  49. 0
      src/js/lib/primus.min.js
  50. 0
      src/js/lib/toastr.min.js
  51. 0
      src/js/lib/topojson.min.js
  52. 0
      src/js/script.js
  53. 0
      src/views/error.jade
  54. 4
      src/views/index.jade
  55. 0
      src/views/layout.jade

@ -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'
}

@ -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

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

@ -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);
}

@ -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
Loading…
Cancel
Save