Permalink
Browse files

Big bad commit

  • Loading branch information...
Shaabi
Shaabi committed Feb 14, 2017
0 parents commit 7d37fa70283f40c0d29261c312ba1e6e340b5fa5
@@ -0,0 +1,3 @@
{
"directory": "app/vendor"
}
@@ -0,0 +1,9 @@
logs/*
!.gitkeep
node_modules/
vendor/
tmp
.DS_Store
.idea
app/vendor/
build/
21 LICENSE
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2017 Snipa22 <Alexander Blair, alex@snipanet.com>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,175 @@
/*** Global Styles ***/
html, body {
font-family: 'Source Sans Pro', sans-serif;
font-size:14px;
height:100%;
margin: 0px;
padding: 0px;
}
a {
transition: color .4s;
color: #3287b3;
}
a:link { text-decoration: none; },
a:visited { color: #3b98c8; }
a:hover { color: #3b98c8; }
a:active {
transition: color .3s;
color: #007BE6;
}
/*** Material Styles ***/
md-card {
overflow: hidden;
}
#main {
background: #f3f5f7;
}
.maintoolbar {
background-color: #fff;
}
.statsbar md-card-title-text{
text-align: right;
}
.statsbar md-card md-card-title {
padding: 12px ;
}
.md-menu-toolbar {
background: #00796B;
}
.sidenav {
background-color: #2b333e;
}
.sidenav ul{
list-style: none;
}
.sidenav md-list-item {
padding: 0px;
}
.sidenav a {
width: 100%;
text-align: left;
color: #fff;
margin: 0px;
}
.sidebar {
display: flex;
flex-wrap: nowrap;
box-sizing: border-box;
}
.sidebar a {
color: rgb(66,66,66);
text-decoration: none;
margin: 0;
font-size: 14px;
font-weight: 400;
line-height: 24px;
letter-spacing: 0;
opacity: 0.87; }
.sidebar md-icon {
vertical-align: middle;
padding-left: 40px;
}
#content {
padding: 40px;
}
.logo {
background: #333d4b !important;
color: #fff !important;
}
.logo i {
color: #00b0ff;
font-weight: 700;
}
/* HELPERS */
.text-left {
text-align: left;
}
.text-right {
text-align: right;
}
.truncate{
width:30%;
white-space:nowrap;
overflow:hidden;
text-overflow:ellipsis
}
.hide-error-msg .md-errors-spacer{
display: none
}
.menu-item {
position: relative;
width: 72px;
height: 72px;
display: inline-block;
overflow: hidden;
margin: 0px;
vertical-align: middle;
zoom:0.6;
transform: translateZ(0);
-webkit-transform: scale(0.60);
-moz-transform:scale(0.60);
font-size: 72px !important;
color: #aeb7c2;
}
.chartcontainer {
width: 100% !important;
max-width: 1000px;
height: 400px;
}
.valid {
color: green !important;
}
.invalid {
color: red !important;
}
.avatar {
position: relative;
width: 128px;
height: 128px;
border: 1px solid #ddd;
border-radius: 50%;
display: inline-block;
overflow: hidden;
margin: 0px;
vertical-align: middle;
zoom:0.70;
transform: translateZ(0);
-webkit-transform: scale(0.70);
-moz-transform:scale(0.70);
}
.metric md-icon {
font-size: 32px;
}
@@ -0,0 +1,177 @@
'use strict';
// Declare app level module which depends on views, and components
var app = angular.module('poolui', [
'ngRoute',
'ngMaterial',
'md.data.table',
'angularMoment',
'ngStorage',
'ngAudio',
'utils.strings',
'utils.services',
'n3-line-chart',
'angular-page-visibility'
]).config(['$locationProvider', '$routeProvider', '$mdThemingProvider', function($locationProvider, $routeProvider, $mdThemingProvider) {
$locationProvider.hashPrefix('');
// $mdIconProvider.defaultIconSet("https://rawgit.com/angular/material-start/es5-tutorial/app/assets/svg/avatars.svg", 128)
$mdThemingProvider.theme('default')
.primaryPalette('grey')
.accentPalette('light-blue');
$routeProvider
.when('/home', {
templateUrl: 'home/home.html',
controller: 'HomeCtrl',
activetab: 'home'
})
.when('/dashboard', {
templateUrl: 'dashboard/dashboard.html',
controller: 'DashboardCtrl',
activetab: 'dashboard'
})
.when('/blocks', {
templateUrl: 'blocks/blocks.html',
controller: 'BlocksCtrl',
activetab: 'blocks'
})
.when('/payments', {
templateUrl: 'payments/payments.html',
controller: 'PaymentsCtrl',
activetab: 'payments'
})
.when('/network', {
templateUrl: 'network/network.html',
controller: 'NetworkCtrl',
activetab: 'network'
})
.when('/help/chat', {
templateUrl: 'help/chat.html',
controller: 'ChatCtrl',
activetab: 'support'
})
.when('/help/getting_started', {
templateUrl: 'help/getting_started.html',
controller: 'GettingStartedCtrl',
activetab: 'help'
})
.when('/help/faq', {
templateUrl: 'help/faq.html',
controller: 'FAQCtrl',
activetab: 'help'
});
$routeProvider.otherwise({redirectTo: '/home'});
}]);
app.controller('AppCtrl', function($scope, $window, $route, dataService, timerService, addressService, $mdSidenav, $mdMedia, $localStorage, ngAudio){
var appCache = window.applicationCache;
$scope.$storage = $localStorage;
$scope.poolList = ["pplns", "pps", "solo"];
$scope.poolStats = {}; // All Pool stats
$scope.addrStats = {}; // All tracked addresses
$scope.lastBlock = {};
// for miner tracking
$scope.yourTotalHashRate = 0;
// Hashrate Alarm
$scope.globalSiren = false;
$scope.sirenAudio = ngAudio.load("assets/ding.wav");
// Update global hashrate and set off alarm if any of the tracked addresses fall below the threshold
var updateHashRate = function (addrStats){
var totalHashRate = 0;
var siren = false;
_.each(addrStats, function(addr,index) {
totalHashRate += addr.hash;
if (addr.alarm && addr.hash < addr.alarmLimit) {
siren=true;
}
});
$scope.globalSiren=siren;
$scope.yourTotalHashRate = totalHashRate;
}
var playSiren = function (){
($scope.globalSiren) ? $scope.sirenAudio.play() : $scope.sirenAudio.stop();
}
var loadData = function () {
dataService.getData("/pool/stats", function(data){
$scope.poolList = data.pool_list;
$scope.poolStats.global = data.pool_statistics;
});
dataService.getData("/network/stats", function(data){
$scope.network = data;
});
}
var loadOnce = function () {
dataService.getData("/config", function(data){
$scope.config = data;
});
}
// Start the timer and register global requests
timerService.startTimer(5000);
timerService.register(loadData, 'global');
// Start address tracking servuce after starting timer, only one callback supported at a time
addressService.start(function(addrStats) {
$scope.addrStats = addrStats;
updateHashRate(addrStats);
playSiren();
}
);
// ------- UI HELPERS
$scope.menuOpen = $mdMedia('gt-md');
$scope.$watch(function() { return $mdMedia('gt-md'); }, function(big) {
$scope.menuOpen = $mdMedia('gt-md');
});
$scope.toggleSidenav = function (){
if (!$mdMedia('gt-md')) {
$mdSidenav('left').toggle();
} else {
// toggle boolean
$scope.menuOpen = !$scope.menuOpen;
}
}
// ------- App Update
var update = function() {
if (appCache.status == window.applicationCache.UPDATEREADY) {
appCache.swapCache(); // The fetch was successful, swap in the new cache.
$window.location.reload();
}
}
appCache.addEventListener("updateready", function(event) {
console.log("UpdateReady Event Caught");
update();
}, false);
var updateCache = function () {
var appCache = window.applicationCache;
update();
// appCache.update(); Attempt to update the user's cache.
}
// Start doing things
loadOnce();
loadData();
updateCache();
});
BIN +1.25 MB app/assets/ding.wav
Binary file not shown.
Oops, something went wrong.

0 comments on commit 7d37fa7

Please sign in to comment.