diff --git a/www/i18n/locale-en-GB.json b/www/i18n/locale-en-GB.json index ad3892b0b2a9e58c73ea594965f22ba76f433743..25e1ac73b9c123b8183a68b5767b8009a3258a3f 100644 --- a/www/i18n/locale-en-GB.json +++ b/www/i18n/locale-en-GB.json @@ -47,7 +47,7 @@ "UNIVERSAL_DIVIDEND": "Universal dividend", "UD": "UD", "DATE_PATTERN": "DD/MM/YYYY HH:mm", - "DATE_SHORT_PATTERN": "DD/MM/YYYY", + "DATE_SHORT_PATTERN": "DD/MM/YY", "DATE_MONTH_YEAR_PATTERN": "MM/YYYY", "EMPTY_PARENTHESIS": "(empty)", "UID": "Pseudonym", diff --git a/www/i18n/locale-en.json b/www/i18n/locale-en.json index f20b1eb0b212d6c45abea93da2a4de0e0177e028..4db87770d8d822e2b9b6ed1993bef9a3fb58a536 100644 --- a/www/i18n/locale-en.json +++ b/www/i18n/locale-en.json @@ -47,7 +47,7 @@ "UNIVERSAL_DIVIDEND": "Universal dividend", "UD": "UD", "DATE_PATTERN": "MM/DD/YYYY HH:mm", - "DATE_SHORT_PATTERN": "MM/DD/YYYY", + "DATE_SHORT_PATTERN": "MM/DD/YY", "DATE_MONTH_YEAR_PATTERN": "MM/YYYY", "EMPTY_PARENTHESIS": "(empty)", "UID": "Pseudonym", diff --git a/www/i18n/locale-es-ES.json b/www/i18n/locale-es-ES.json index eb516e7355ae4ea13ce16ee2258b075f0647787e..5ebb46e6ae0fd0088627ee1acfcdb589ef061146 100644 --- a/www/i18n/locale-es-ES.json +++ b/www/i18n/locale-es-ES.json @@ -47,7 +47,8 @@ "UNIVERSAL_DIVIDEND": "Dividendo universal", "UD": "DU", "DATE_PATTERN": "DD/MM/YYYY HH:mm", - "DATE_SHORT_PATTERN": "DD/MM/YYYY", + "DATE_SHORT_PATTERN": "DD/MM/YY", + "DATE_MONTH_YEAR_PATTERN": "MM/YYYY", "EMPTY_PARENTHESIS": "(vacÃo)", "UID": "Seudónimo", "ENABLE": "Activado", @@ -453,6 +454,7 @@ "FIELD_ACCENT": "Carácteres acentuados y comas no autorizados", "FIELD_NOT_NUMBER": "Valor numérica esperada", "FIELD_NOT_INT": "Valor entera esperada", + "FIELD_NOT_EMAIL": "Email no es válida", "PASSWORD_NOT_CONFIRMED": "No corresponde a la contraseña.", "SALT_NOT_CONFIRMED": "No corresponde al identificador secreto.", "SEND_IDENTITY_FAILED": "Fracaso de la inscripción.", diff --git a/www/i18n/locale-fr-FR.json b/www/i18n/locale-fr-FR.json index e78725b01449fbdc1e459ede7492dcf433a7b029..5355b1124a814d6216b2d5069a07b3358cce2e36 100644 --- a/www/i18n/locale-fr-FR.json +++ b/www/i18n/locale-fr-FR.json @@ -46,8 +46,8 @@ "LANGUAGE": "Langue", "UNIVERSAL_DIVIDEND": "Dividende universel", "UD": "DU", - "DATE_PATTERN": "DD/MM/YYYY HH:mm", - "DATE_SHORT_PATTERN": "DD/MM/YYYY", + "DATE_PATTERN": "DD/MM/YY HH:mm", + "DATE_SHORT_PATTERN": "DD/MM/YY", "DATE_MONTH_YEAR_PATTERN": "MM/YYYY", "EMPTY_PARENTHESIS": "(vide)", "UID": "Pseudonyme", @@ -216,7 +216,7 @@ "SIG_STOCK": "Nombre maximal de certifications émises par membre", "SIG_PERIOD": "Délai minimal d'attente entre 2 certifications successives émises par une même personne", "SIG_WINDOW": "Délai limite de prise en compte d'une certification", - "STEP_MAX": "Distance maximale entre un nouvel entrant et les membres référents", + "STEP_MAX": "Distance maximale, par les certifications, entre un nouvel entrant et les membres référents", "WOT_RULES_DIVIDER": "Règles de la toile de confiance", "SENTRIES": "Nombre de certifications requises pour être membre référent", "SENTRIES_FORMULA": "Nombre de certification requises pour être un membre référent (formule)", diff --git a/www/i18n/locale-nl-NL.json b/www/i18n/locale-nl-NL.json index 710b957e35b6275cd954aafb0c43c1cb8076ae32..5e4b1199b7214c5bceaab19c86a3ab885de8f695 100644 --- a/www/i18n/locale-nl-NL.json +++ b/www/i18n/locale-nl-NL.json @@ -29,14 +29,17 @@ "BTN_DELETE": "Wissen", "BTN_ADD": "Toevoegen", "BTN_SEARCH": "Zoeken", + "BTN_REFRESH": "Verwezenlijken", "BTN_CONTINUE": "Doorgaan", "BTN_UNDERSTOOD": "Ik heb het begrepen", "BTN_OPTIONS": "Opties", "BTN_HELP_TOUR": "Rondleiding", "BTN_HELP_TOUR_SCREEN": "Ontdek dit scherm", + "DAYS": "dagen", "NO_ACCOUNT_QUESTION": "Nog geen lid? Registreer nu!", "SEARCH_NO_RESULT": "Geen resultaten", "LOADING": "Even geduld...", + "SEARCHING": "Zoeken...", "FROM": "Van", "TO": "Aan", "COPY": "Kopieren", @@ -44,14 +47,18 @@ "UNIVERSAL_DIVIDEND": "Universeel dividend", "UD": "UD", "DATE_PATTERN": "DD-MM-YYYY HH:mm", - "DATE_SHORT_PATTERN": "DD-MM-YYYY", + "DATE_SHORT_PATTERN": "DD-MM-YY", + "DATE_MONTH_YEAR_PATTERN": "MM-YYYY", "EMPTY_PARENTHESIS": "(leeg)", "UID": "Pseudoniem", "ENABLE": "Geactiveerd", "DISABLE": "Gedeactiveerd", "RESULTS_LIST": "Resultaten:", + "RESULTS_COUNT": "{{count}} uitslagen", + "EXECUTION_TIME": "uitgevoerd in {{duration|formatDurationMs}}", "SHOW_VALUES": "Toon waarden openlijk?", "POPOVER_ACTIONS_TITLE": "Opties", + "POPOVER_FILTER_TITLE": "Filters", "SHOW_MORE": "Toon meer", "SHOW_MORE_COUNT": "(huidig limiet op {{limit}})", "POPOVER_SHARE": { @@ -78,7 +85,8 @@ "TRANSFER": "Overmaken", "SCAN": "Scannen", "SETTINGS": "Instellingen", - "NETWORK": "Netwerk" + "NETWORK": "Netwerk", + "TRANSACTIONS": "Mijn transacties" }, "ABOUT": { "TITLE": "Over", @@ -109,17 +117,69 @@ "PEER": "Duniter knooppunt adres", "USE_LOCAL_STORAGE": "Lokale opslag inschakelen", "ENABLE_HELPTIP": "Contextgebonden hulp inschakelen", + "ENABLE_UI_EFFECTS": "Schakel visuele effecten", "HISTORY_SETTINGS": "Mijn rekening", "DISPLAY_UD_HISTORY": "Toon geproduceerde dividenden?", "AUTHENTICATION_SETTINGS": "Authentificatie", "REMEMBER_ME": "Onthoud mij", "PLUGINS_SETTINGS": "Uitbreidingen", "BTN_RESET": "Herstel standaardinstellingen", - "EXPERT_MODE": "Geavanceerde modus inschakelen <span class=\"hidden-xs\">(toon meer details)</span>", + "EXPERT_MODE": "Geavanceerde modus inschakelen", + "EXPERT_MODE_HELP": "Toon meer details", "POPUP_PEER": { "TITLE" : "Duniter Knooppunt", "HELP" : "Stel het adres van het knooppunt in:", - "PEER_HELP": "server.domein.com:poort" + "PEER_HELP": "server.domein.com:poort", + "BTN_SHOW_LIST_HELP" : "Voer bovenstaande bij <b>{{'SETTINGS.POPUP_PEER.PEER_HELP'|translate}}</b> indeling of klik op de knop hieronder:", + "BTN_SHOW_LIST" : "Lijst van knooppunten" + } + }, + "BLOCKCHAIN": { + "HASH": "Hachee : {{hash}}", + "VIEW": { + "HEADER_TITLE": "Blok #{{number}}-{{hash|formatHash}}", + "TITLE_CURRENT": "Huidige blok", + "TITLE": "Blok #{{number}}", + "COMPUTED_BY": "Berekend door het knooppunt", + "SHOW_RAW": "Bekijk RAW-bestand", + "TECHNICAL_DIVIDER": "Technische informatie", + "VERSION": "Format versie", + "HASH": "Hash berekend", + "UNIVERSAL_DIVIDEND_HELP": "Munt gecoproduceerd door elk van de {{membersCount}} ledental", + "EMPTY": "Er zijn geen gegevens in dit blok", + "POW_MIN": "Mminimum moeilijkheid", + "POW_MIN_HELP": "Moeilijkheid opgelegd hash te berekenen", + "DATA_DIVIDER": "Gegevens", + "IDENTITIES_COUNT": "Nieuwe identiteiten", + "JOINERS_COUNT": "Nieuwe leden", + "ACTIVES_COUNT": "Verlengingen", + "ACTIVES_COUNT_HELP": "Leden die hun lidmaatschap te vernieuwen", + "LEAVERS_COUNT": "Verlaters", + "LEAVERS_COUNT_HELP": "Leden die niet langer wenst certificering", + "EXCLUDED_COUNT": "Uitgesloten leden", + "EXCLUDED_COUNT_HELP": "Oud-leden uitgesloten door niet-verlenging of gebrek aan certificeringen", + "REVOKED_COUNT": "Identiteiten ingetrokken", + "REVOKED_COUNT_HELP": "Deze rekeningen zullen niet langer leden", + "TX_COUNT": "Transacties", + "CERT_COUNT": "Certificeringen", + "TX_TO_HIMSELF": "Ruil deal", + "TX_OUTPUT_UNLOCK_CONDITIONS": "Omstandigheden van de introductie", + "TX_OUTPUT_OPERATOR": { + "AND": "en", + "OR": "of" + }, + "TX_OUTPUT_FUNCTION": { + "SIG": "<b>handtekening</b> ", + "XHX": "<b>Wachtwoord</b>, wiens SHA256 =", + "CSV": "Geblokkeerd", + "CLTV": "Opgesloten" + } + }, + "LOOKUP": { + "TITLE": "Blokken", + "NO_BLOCK": "Geen blok", + "LAST_BLOCKS": "Recente blokken :", + "BTN_COMPACT": "Compact" } }, "CURRENCY": { diff --git a/www/plugins/es/js/controllers/blockchain-controllers.js b/www/plugins/es/js/controllers/blockchain-controllers.js index e381c5808160aa3e6735fc8f9a329fa97f5a366f..72180130b0ca57eee162764bc92549f0800f834f 100644 --- a/www/plugins/es/js/controllers/blockchain-controllers.js +++ b/www/plugins/es/js/controllers/blockchain-controllers.js @@ -122,7 +122,7 @@ function ESBlockLookupController($scope, $state, $controller, $ionicPopover, UIU else { // default sort request.sort = "number:desc"; } - request.excludeCurrent = true; + request.excludeCurrent = false; promise = esBlockchain.block.searchText($scope.currency, $scope.search.text, request); } diff --git a/www/plugins/graph/i18n/locale-en-GB.json b/www/plugins/graph/i18n/locale-en-GB.json new file mode 100644 index 0000000000000000000000000000000000000000..bb4df7efbda5552c2c1fd446dbba77e34814562c --- /dev/null +++ b/www/plugins/graph/i18n/locale-en-GB.json @@ -0,0 +1,37 @@ +{ + "NETWORK": { + "VIEW": { + "BTN_GRAPH": "Statistics" + } + }, + "GRAPH": { + "COMMON": { + "LINEAR_SCALE" : "Linear scale", + "LOGARITHMIC_SCALE" : "Logarithmic scale", + "BTN_SHOW_STATS": "See statistics" + }, + "BLOCKCHAIN": { + "TITLE": "Statistics", + "BLOCKS_ISSUERS_DIVIDER": "Written blocks by members", + "BLOCKS_ISSUERS_HELP": "<b>{{issuerCount|formatInteger}} members</b> calculated <b>{{blockCount|formatInteger}} blocks</b>", + "BLOCKS_ISSUERS_TITLE": "Number of blocks calculated per member", + "BLOCKS_ISSUERS_LABEL": "Number of blocks", + "TX_DIVIDER": "Analysis of transactions", + "TX_COUNT_TITLE": "Number of written transactions", + "TX_COUNT_LABEL": "Number of transactions", + "TX_AVG_BY_BLOCK": "Average per block", + "TX_RANGE_DURATION": { + "HOUR": "Group by <b>hour</b>", + "DAY": "Group by <b>day</b>", + "MONTH": "Group by <b>month</b>" + } + }, + "CURRENCY": { + "MEMBERS_COUNT_TITLE": "Evolution of the number of members", + "MEMBERS_COUNT_LABEL": "Number of members", + "MONETARY_MASS_TITLE": "Evolution of the monetary mass ({{currency | currencySymbolNoHtml: false }})", + "MONETARY_MASS_TITLE_RELATIVE": "Evolution of the monetary mass ({{currency | currencySymbolNoHtml: true }})", + "MONETARY_MASS_LABEL": "Monetary mass" + } + } +} diff --git a/www/plugins/graph/i18n/locale-en.json b/www/plugins/graph/i18n/locale-en.json index 071dfbbb36febb021eed9a760bfe6ff9809db378..bb4df7efbda5552c2c1fd446dbba77e34814562c 100644 --- a/www/plugins/graph/i18n/locale-en.json +++ b/www/plugins/graph/i18n/locale-en.json @@ -1,20 +1,37 @@ { "NETWORK": { "VIEW": { - "BTN_GRAPH": "Stats" + "BTN_GRAPH": "Statistics" } }, "GRAPH": { + "COMMON": { + "LINEAR_SCALE" : "Linear scale", + "LOGARITHMIC_SCALE" : "Logarithmic scale", + "BTN_SHOW_STATS": "See statistics" + }, "BLOCKCHAIN": { "TITLE": "Statistics", "BLOCKS_ISSUERS_DIVIDER": "Written blocks by members", - "BLOCKS_ISSUERS_TITLE": "{{issuerCount}} members has written {{blockCount}} blocks", - "TX_COUNT_TITLE": "Number of written transactions" + "BLOCKS_ISSUERS_HELP": "<b>{{issuerCount|formatInteger}} members</b> calculated <b>{{blockCount|formatInteger}} blocks</b>", + "BLOCKS_ISSUERS_TITLE": "Number of blocks calculated per member", + "BLOCKS_ISSUERS_LABEL": "Number of blocks", + "TX_DIVIDER": "Analysis of transactions", + "TX_COUNT_TITLE": "Number of written transactions", + "TX_COUNT_LABEL": "Number of transactions", + "TX_AVG_BY_BLOCK": "Average per block", + "TX_RANGE_DURATION": { + "HOUR": "Group by <b>hour</b>", + "DAY": "Group by <b>day</b>", + "MONTH": "Group by <b>month</b>" + } }, "CURRENCY": { "MEMBERS_COUNT_TITLE": "Evolution of the number of members", + "MEMBERS_COUNT_LABEL": "Number of members", "MONETARY_MASS_TITLE": "Evolution of the monetary mass ({{currency | currencySymbolNoHtml: false }})", "MONETARY_MASS_TITLE_RELATIVE": "Evolution of the monetary mass ({{currency | currencySymbolNoHtml: true }})", + "MONETARY_MASS_LABEL": "Monetary mass" } } } diff --git a/www/plugins/graph/i18n/locale-es-ES.json b/www/plugins/graph/i18n/locale-es-ES.json new file mode 100644 index 0000000000000000000000000000000000000000..9cfd28983659cbf60cf50fea45c7e6ff84ae0573 --- /dev/null +++ b/www/plugins/graph/i18n/locale-es-ES.json @@ -0,0 +1,37 @@ +{ + "NETWORK": { + "VIEW": { + "BTN_GRAPH": "EstadÃstica" + } + }, + "GRAPH": { + "COMMON": { + "LINEAR_SCALE" : "Escala lineal", + "LOGARITHMIC_SCALE" : "Escala logarÃtmica", + "BTN_SHOW_STATS": "Ver estadÃsticas" + }, + "BLOCKCHAIN": { + "TITLE": "EstadÃstica", + "BLOCKS_ISSUERS_DIVIDER": "Bloques escritos por los miembros", + "BLOCKS_ISSUERS_HELP": "<b>{{issuerCount|formatInteger}} members</b> has computed <b>{{blockCount|formatInteger}} blocks</b>", + "BLOCKS_ISSUERS_TITLE": "Número de bloques miembro calculado", + "BLOCKS_ISSUERS_LABEL": "Número de bloques", + "TX_DIVIDER": "Análisis de transacciones", + "TX_COUNT_TITLE": "Número de transacciones escritas", + "TX_COUNT_LABEL": "Número de transacciones", + "TX_AVG_BY_BLOCK": "Promedio por bloque", + "TX_RANGE_DURATION": { + "HOUR": "Grupo por <b>hora</b>", + "DAY": "Grupo por <b>dÃa</b>", + "MONTH": "Grupo por <b>mes</b>" + } + }, + "CURRENCY": { + "MEMBERS_COUNT_TITLE": "Evolución del número de miembros", + "MEMBERS_COUNT_LABEL": "Número de miembros", + "MONETARY_MASS_TITLE": "Evolución de la masa monetaria ({{currency | currencySymbolNoHtml: false }})", + "MONETARY_MASS_TITLE_RELATIVE": "Evolución de la masa monetaria ({{currency | currencySymbolNoHtml: true }})", + "MONETARY_MASS_LABEL": "Masa monetaria" + } + } +} diff --git a/www/plugins/graph/i18n/locale-fr-FR.json b/www/plugins/graph/i18n/locale-fr-FR.json index 32b2ddcee275ea3247df7329b7c3d9e76f95cc3d..c72aad2992c2ec7093fa96f830e626a8fe629f0b 100644 --- a/www/plugins/graph/i18n/locale-fr-FR.json +++ b/www/plugins/graph/i18n/locale-fr-FR.json @@ -1,20 +1,37 @@ { "NETWORK": { "VIEW": { - "BTN_GRAPH": "Stats" + "BTN_GRAPH": "Statistiques" } }, "GRAPH": { + "COMMON": { + "LINEAR_SCALE" : "Echelle linéaire", + "LOGARITHMIC_SCALE" : "Echelle logarithmique", + "BTN_SHOW_STATS": "Voir les statistiques" + }, "BLOCKCHAIN": { "TITLE": "Statistiques", - "BLOCKS_ISSUERS_DIVIDER": "Répartition du calcul des blocs par membre", - "BLOCKS_ISSUERS_TITLE": "{{issuerCount}} membres ont calculé {{blockCount}} blocs", - "TX_COUNT_TITLE": "Nombre de transactions écrites" + "BLOCKS_ISSUERS_DIVIDER": "Analyse de la répartition du calcul", + "BLOCKS_ISSUERS_HELP": "<b>{{issuerCount|formatInteger}} membres</b> ont calculé <b>{{blockCount|formatInteger}} blocs</b>", + "BLOCKS_ISSUERS_TITLE": "Nombre de blocs calculés par membre", + "BLOCKS_ISSUERS_LABEL": "Nombre de blocs", + "TX_DIVIDER": "Analyse des transactions", + "TX_COUNT_TITLE": "Nombre de transactions écrites", + "TX_COUNT_LABEL": "Nombre de transactions", + "TX_AVG_BY_BLOCK": "Moyenne par bloc", + "TX_RANGE_DURATION": { + "HOUR": "Regrouper par <b>heure</b>", + "DAY": "Regrouper par <b>jour</b>", + "MONTH": "Regrouper par <b>mois</b>" + } }, "CURRENCY": { "MEMBERS_COUNT_TITLE": "Evolution du nombre de membres", + "MEMBERS_COUNT_LABEL": "Nombre de membres", "MONETARY_MASS_TITLE": "Evolution de la masse monétaire ({{currency | currencySymbolNoHtml: false }})", "MONETARY_MASS_TITLE_RELATIVE": "Evolution de la masse monétaire ({{currency | currencySymbolNoHtml: true }})", + "MONETARY_MASS_LABEL": "Masse monétaire" } } } diff --git a/www/plugins/graph/i18n/locale-nl-NL.json b/www/plugins/graph/i18n/locale-nl-NL.json new file mode 100644 index 0000000000000000000000000000000000000000..ac392df47e15ee32e4967adf9762713d722f9128 --- /dev/null +++ b/www/plugins/graph/i18n/locale-nl-NL.json @@ -0,0 +1,37 @@ +{ + "NETWORK": { + "VIEW": { + "BTN_GRAPH": "Statistieken" + } + }, + "GRAPH": { + "COMMON": { + "LINEAR_SCALE" : "Lineaire schaal", + "LOGARITHMIC_SCALE" : "Logaritmische schaal", + "BTN_SHOW_STATS": "Zie statistieken" + }, + "BLOCKCHAIN": { + "TITLE": "Statistieken", + "BLOCKS_ISSUERS_DIVIDER": "Schriftelijke blokken door leden", + "BLOCKS_ISSUERS_HELP": "<b>{{issuerCount|formatInteger}} leden</b> berekend <b>{{blockCount|formatInteger}} blokken</b>", + "BLOCKS_ISSUERS_TITLE": "Aantal blokken berekend per lid", + "BLOCKS_ISSUERS_LABEL": "Aantal blokken", + "TX_DIVIDER": "Analyse van transacties", + "TX_COUNT_TITLE": "Aantal schriftelijke transacties", + "TX_COUNT_LABEL": "Aantal transacties", + "TX_AVG_BY_BLOCK": "Gemiddeld per blok", + "TX_RANGE_DURATION": { + "HOUR": "Groep per <b>uur</b>", + "DAY": "Groep per <b>dag</b>", + "MONTH": "Groep per <b>maand</b>" + } + }, + "CURRENCY": { + "MEMBERS_COUNT_TITLE": "Evolutie van het aantal leden", + "MEMBERS_COUNT_LABEL": "Aantal leden", + "MONETARY_MASS_TITLE": "Evolutie van de monetaire massa ({{currency | currencySymbolNoHtml: false }})", + "MONETARY_MASS_TITLE_RELATIVE": "Evolutie van de monetaire massa ({{currency | currencySymbolNoHtml: true }})", + "MONETARY_MASS_LABEL": "Monetaire massa" + } + } +} diff --git a/www/plugins/graph/js/controllers/blockchain-controllers.js b/www/plugins/graph/js/controllers/blockchain-controllers.js index ccd604529384cc193f24162234bc02be7361d29e..b2411ccb854845343fc84d1bf9cab4795b788d1e 100644 --- a/www/plugins/graph/js/controllers/blockchain-controllers.js +++ b/www/plugins/graph/js/controllers/blockchain-controllers.js @@ -10,8 +10,7 @@ angular.module('cesium.graph.blockchain.controllers', ['chart.js', 'cesium.servi url: "/blockchain/stats?currency", views: { 'menuContent': { - templateUrl: "plugins/graph/templates/blockchain/view_stats.html", - controller: 'GpBlockchainCtrl' + templateUrl: "plugins/graph/templates/blockchain/view_stats.html" } } }) @@ -20,24 +19,22 @@ angular.module('cesium.graph.blockchain.controllers', ['chart.js', 'cesium.servi url: "/:currency/blockchain/stats", views: { 'menuContent': { - templateUrl: "plugins/graph/templates/blockchain/view_stats.html", - controller: 'GpBlockchainCtrl' + templateUrl: "plugins/graph/templates/blockchain/view_stats.html" } } }) ; - }) - .controller('GpBlockchainCtrl', GpBlockchainController) + .controller('GpBlockchainTxCountCtrl', GpBlockchainTxCountController) + + .controller('GpBlockchainIssuersCtrl', GpBlockchainIssuersController) ; -function GpBlockchainController($scope, $q, $state, $translate, csCurrency, gpData, $filter) { +function GpBlockchainIssuersController($scope, $q, $translate, csCurrency, gpData) { 'ngInject'; - $scope.loading = true; - $scope.blocksByIssuer = {}; $scope.enter = function(e, state) { if ($scope.loading) { @@ -55,117 +52,240 @@ function GpBlockchainController($scope, $q, $state, $translate, csCurrency, gpDa }); } - $scope.load(); + $scope.load() + .then(function() { + $scope.loading = false; + }); } - }; - $scope.$on('$ionicView.enter', $scope.enter); + $scope.$on('$ionicParentView.enter', $scope.enter); $scope.load = function() { - return $q.all([ - $scope.loadBlocksByIssuer() - .then(function(res) { - $scope.blocksByIssuer = res; - }) - , $scope.loadTxCount() - .then(function(res) { - $scope.txCount = res; - }) - ]) - .then(function() { - $scope.loading = false; - }); - - }; - - $scope.loadBlocksByIssuer = function() { - return gpData.blockchain.countByIssuer($scope.currency) + $translate([ + 'GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_TITLE', + 'GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_LABEL' + ]), + gpData.blockchain.countByIssuer($scope.currency) + ]) .then(function(result) { + var translations = result[0]; + result = result[1]; if (!result || !result.data) return; - // Block by issuer - result.bar = { - options: { - title: { - display: true - }, - scales: { - yAxes: [{ - ticks: { - beginAtZero:true - } - }] - } + // Data + $scope.data = result.data; + $scope.blockCount = result.blockCount; + $scope.labels = result.labels; + + // Options + $scope.barOptions = { + responsive: true, + maintainAspectRatio: true, + title: { + display: true, + text: translations['GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_TITLE'] + }, + scales: { + yAxes: [{ + type: 'linear', + ticks: { + beginAtZero: true + } + }] } }; - // Compute color - if (result.data.length) { - result.colors = gpData.util.colors.custom(result.data.length); - } + // Colors + $scope.colors = gpData.util.colors.custom(result.data.length); - // Compute graph title - return $translate('GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_TITLE', { - issuerCount: result.data.length, - blockCount: result.blockCount - }) - .then(function(title) { - result.bar.options.title.text = title; - return result; - }); }); + }; + + $scope.setSize = function(height, width) { + $scope.height = height; + $scope.width = width; + }; +} +function GpBlockchainTxCountController($scope, $q, $state, $translate, $ionicPopover, csCurrency, BMA, esHttp, gpData) { + 'ngInject'; + + $scope.loading = true; + $scope.formData = { + timePct: 100 + }; + + // Default TX range duration + $scope.txOptions = { + rangeDuration: 'day' + }; + + $scope.enter = function(e, state) { + if ($scope.loading) { + + if (state && state.stateParams && state.stateParams.currency) { // Currency parameter + $scope.currency = state.stateParams.currency; + } + + // Make sure there is currency, or load it not + if (!$scope.currency) { + return csCurrency.default() + .then(function(currency) { + $scope.currency = currency ? currency.name : null; + return $scope.enter(e, state); + }); + } + + $scope.load() + .then(function() { + $scope.loading = false; + }); + } }; + $scope.$on('$ionicParentView.enter', $scope.enter); + + $scope.load = function(updateTimePct) { + + updateTimePct = angular.isDefined(updateTimePct) ? updateTimePct : true; + + var truncDate = function(time) { + return moment.unix(time).utc().startOf($scope.txOptions.rangeDuration).unix(); + }; - $scope.loadTxCount = function(from, size) { - from = from || 0; - size = size || 10000; + var txOptions = $scope.txOptions; - return gpData.blockchain.txCount($scope.currency, { - from: from, - size: size - }) + return $q.all([ + + // translate i18n keys + $translate(['GRAPH.BLOCKCHAIN.TX_COUNT_TITLE', + 'GRAPH.BLOCKCHAIN.TX_COUNT_LABEL', + 'GRAPH.BLOCKCHAIN.TX_AVG_BY_BLOCK', + 'COMMON.DATE_PATTERN', + 'COMMON.DATE_SHORT_PATTERN', + 'COMMON.DATE_MONTH_YEAR_PATTERN']), + + // get block #0 + $scope.firstBlockTime ? + $q.when({medianTime: $scope.firstBlockTime}) : + BMA.blockchain.block({block: 0}) + .catch(function(err) { + if (err && err.ucode == BMA.errorCodes.BLOCK_NOT_FOUND) { + return {medianTime: esHttp.date.now()}; + } + }), + + // get data + gpData.blockchain.txCount($scope.currency, txOptions) + ]) .then(function(result) { + var translations = result[0]; + $scope.firstBlockTime = $scope.firstBlockTime || result[1].medianTime; + $scope.formData.firstBlockTime = $scope.formData.firstBlockTime || truncDate($scope.firstBlockTime); + $scope.formData.currencyAge = truncDate(esHttp.date.now()) - $scope.formData.firstBlockTime; + result = result[2]; + + if (!result || !result.times) return; // no data + $scope.times = result.times; + + // Data + if ($scope.txOptions.rangeDuration != 'hour') { + $scope.data = [ + result.count, + result.avgByBlock + ]; + } + else { + $scope.data = [ + result.count + ]; + } - if (!result || !result.data) return; + // Labels + $scope.labels = result.labels; - // Block by issuer - result.options = { - title: { - display: true - }, - scales: { - yAxes: [{ - ticks: { - beginAtZero:true - } - }] - } + var displayFormats = { + hour: translations['COMMON.DATE_PATTERN'], + day: translations['COMMON.DATE_SHORT_PATTERN'], + month: translations['COMMON.DATE_MONTH_YEAR_PATTERN'] }; - - // Format time - var formDateFilter = $filter('formatDateShort'); - result.labels = result.labels.reduce(function(res, time) { - return res.concat(formDateFilter(time)); + var displayFormat = displayFormats[$scope.txOptions.rangeDuration]; + // Labels + $scope.labels = result.times.reduce(function(res, time) { + return res.concat(moment.unix(time).local().format(displayFormat)); }, []); - result.colors = result.labels.reduce(function(res) { + // Colors + $scope.colors = result.times.reduce(function(res) { return res.concat('rgba(17,193,243,0.5)'); }, []); + // Update options with received values + $scope.txOptions.startTime = result.times[0]; + $scope.txOptions.endTime = result.times[result.times.length-1]; + $scope.formData.timeWindow = $scope.formData.timeWindow || $scope.txOptions.endTime - $scope.txOptions.startTime; + $scope.formData.rangeDuration = $scope.formData.rangeDuration || $scope.formData.timeWindow / result.times.length; - // Compute graph title - return $translate('GRAPH.BLOCKCHAIN.TX_COUNT_TITLE', { - issuerCount: result.data.length, - blockCount: result.blockCount - }) - .then(function(title) { - result.options.title.text = title; - return result; - }); + if (updateTimePct) { + $scope.formData.timePct = Math.ceil(($scope.txOptions.startTime - $scope.formData.firstBlockTime) * 100 / + ($scope.formData.currencyAge - $scope.formData.timeWindow)); + } + + // Options + $scope.options = { + responsive: true, + maintainAspectRatio: true, + title: { + display: true, + text: translations['GRAPH.BLOCKCHAIN.TX_COUNT_TITLE'] + }, + scales: { + yAxes: [ + { + id: 'y-axis-1', + type: 'linear', + position: 'left', + ticks: { + beginAtZero:true + } + }, + { + id: 'y-axis-2', + display: false, + type: 'linear', + position: 'right', + ticks: { + beginAtZero:true + } + } + ] + } + }; + + $scope.datasetOverride = [ + { + yAxisID: 'y-axis-1', + type: 'bar', + label: translations['GRAPH.BLOCKCHAIN.TX_COUNT_LABEL'] + }, + { + yAxisID: 'y-axis-2', + type: 'line', + display: false, + label: translations['GRAPH.BLOCKCHAIN.TX_AVG_BY_BLOCK'], + backgroundColor: 'rgba(17,193,243,0)', + borderColor: 'rgba(100,100,100,0.5)', + pointBackgroundColor: 'rgba(100,100,100,0.6)', + pointBorderColor: 'rgba(200,200,200,0.6)', + pointHoverBackgroundColor: 'rgba(17,193,243,0.8)' + } + ]; }); + }; + $scope.setSize = function(height, width) { + $scope.height = height; + $scope.width = width; }; $scope.showBlockIssuer = function(data, e, item) { @@ -174,9 +294,81 @@ function GpBlockchainController($scope, $q, $state, $translate, csCurrency, gpDa $state.go('app.wot_identity', issuer); }; - /* -- popups -- */ + $scope.showTxRange = function(data, e, item) { + if (!item) return + var from = $scope.times[item._index]; + var to = moment.unix(from).utc().add(1, $scope.txOptions.rangeDuration).unix(); + $state.go('app.blockchain_search', { + q: '_exists_:transactions AND medianTime:>={0} AND medianTime:<{1}'.format(from, to) + }); + }; + + $scope.setTxRangeDuration = function(txRangeDuration) { + $scope.hideActionsPopover(); + if ($scope.txOptions && txRangeDuration == $scope.txOptions.rangeDuration) return; + + $scope.txOptions.rangeDuration = txRangeDuration; + // Restore default values + delete $scope.txOptions.startTime; + delete $scope.txOptions.endTime; + $scope.formData = { + timePct: 100 + }; + // Reload TX data + $scope.load(); + }; + + $scope.loadPreviousTx = function() { + $scope.txOptions.startTime -= $scope.times.length * $scope.formData.rangeDuration; + if ($scope.txOptions.startTime < $scope.firstBlockTime) { + $scope.txOptions.startTime = $scope.firstBlockTime; + } + $scope.txOptions.endTime = $scope.txOptions.startTime + $scope.times.length * $scope.formData.rangeDuration; + // Reload TX data + $scope.load(); + }; + + $scope.loadNextTx = function() { + $scope.txOptions.startTime += $scope.times.length * $scope.formData.rangeDuration; + if ($scope.txOptions.startTime > $scope.firstBlockTime + $scope.formData.currencyAge - $scope.formData.timeWindow) { + $scope.txOptions.startTime = $scope.firstBlockTime + $scope.formData.currencyAge - $scope.formData.timeWindow; + } + $scope.txOptions.endTime = $scope.txOptions.startTime + $scope.times.length * $scope.formData.rangeDuration; + // Reload TX data + $scope.load(); + }; + + $scope.onTxTimeChanged = function() { + $scope.txOptions.startTime = $scope.firstBlockTime + (parseFloat($scope.formData.timePct) / 100) * ($scope.formData.currencyAge - $scope.formData.timeWindow) ; + $scope.txOptions.endTime = $scope.txOptions.startTime + $scope.times.length * $scope.formData.rangeDuration; + + // Reload TX data + $scope.load(false); + }; + + /* -- Popover -- */ + + $scope.showTxActionsPopover = function(event) { + $scope.hideActionsPopover(); + $ionicPopover.fromTemplateUrl('plugins/graph/templates/blockchain/popover_tx_actions.html', { + scope: $scope + }).then(function(popover) { + $scope.actionsPopover = popover; + //Cleanup the popover when we're done with it! + $scope.$on('$destroy', function() { + $scope.actionsPopover.remove(); + }); + $scope.actionsPopover.show(event); + }); + }; + + $scope.hideActionsPopover = function() { + if ($scope.actionsPopover) { + $scope.actionsPopover.hide(); + } + }; } diff --git a/www/plugins/graph/js/controllers/currency-controllers.js b/www/plugins/graph/js/controllers/currency-controllers.js index 4a98e1a3af0034a110c5c96d9b51c00f694317cd..db91b54f6bc071cc2f9285b7613171a7267603c0 100644 --- a/www/plugins/graph/js/controllers/currency-controllers.js +++ b/www/plugins/graph/js/controllers/currency-controllers.js @@ -1,12 +1,46 @@ -angular.module('cesium.graph.currency.controllers', ['chart.js', 'cesium.graph.services']) +angular.module('cesium.graph.currency.controllers', ['chart.js', 'cesium.graph.services', 'cesium.graph.blockchain.controllers']) .config(function($stateProvider, PluginServiceProvider, csConfig) { 'ngInject'; $stateProvider - .state('app.currency_stats', { - url: "/currency/stats", + .state('app.currency.tab_parameters_stats', { + url: "/parameters/stats", + views: { + 'tab-parameters': { + templateUrl: "plugins/graph/templates/currency/tabs/tab_parameters_stats.html", + controller: 'GpCurrencyMonetaryMassCtrl' + } + } + }) + .state('app.currency.tab_wot_stats', { + url: "/community/stats", + views: { + 'tab-wot': { + templateUrl: "plugins/graph/templates/currency/tabs/tab_wot_stats.html", + controller: 'GpCurrencyMembersCountCtrl' + } + } + }) + .state('app.currency.tab_network_stats', { + url: "/network/stats", + views: { + 'tab-network': { + templateUrl: "plugins/graph/templates/currency/tabs/tab_network_stats.html" + } + } + }) + .state('app.currency.tab_blocks_stats', { + url: "/blocks/stats", + views: { + 'tab-blocks': { + templateUrl: "plugins/graph/templates/currency/tabs/tab_blocks_stats.html" + } + } + }) + .state('app.currency_stats_lg', { + url: "/currency/stats/lg", views: { 'menuContent': { templateUrl: "plugins/graph/templates/currency/view_stats.html" @@ -26,39 +60,55 @@ angular.module('cesium.graph.currency.controllers', ['chart.js', 'cesium.graph.s 'wot-actual': { templateUrl: "plugins/graph/templates/currency/view_currency_extend.html", controller: 'GpCurrencyViewExtendCtrl' + }, + 'network-actual': { + templateUrl: "plugins/graph/templates/currency/view_currency_extend.html", + controller: 'GpCurrencyViewExtendCtrl' + } + } + }) + .extendStates(['app.currency.tab_blocks'], { + points: { + 'buttons': { + templateUrl: "plugins/graph/templates/currency/tab_blocks_extend.html", + controller: 'GpCurrencyViewExtendCtrl' } } }) ; - - } }) .controller('GpCurrencyViewExtendCtrl', GpCurrencyViewExtendController) - .controller('GpGraphMonetaryMassCtrl', GpGraphMonetaryMassController) + .controller('GpCurrencyMonetaryMassCtrl', GpCurrencyMonetaryMassController) + + .controller('GpCurrencyMembersCountCtrl', GpCurrencyMembersCountController) ; -function GpCurrencyViewExtendController($scope, PluginService, esSettings) { +function GpCurrencyViewExtendController($scope, PluginService, UIUtils, esSettings) { 'ngInject'; $scope.extensionPoint = PluginService.extensions.points.current.get(); $scope.enable = esSettings.isEnable(); + $scope.smallscreen = UIUtils.screen.isSmall(); esSettings.api.state.on.changed($scope, function(enable) { $scope.enable = enable; }); } - -function GpGraphMonetaryMassController($scope, $q, $state, $translate, csCurrency, gpData, $filter, csSettings) { +function GpCurrencyMonetaryMassController($scope, $q, $translate, $ionicPopover, csCurrency, gpData, $filter, csSettings) { 'ngInject'; $scope.loading = true; $scope.formData = $scope.formData || {}; - $scope.formData.useRelative = angular.isDefined($scope.formData.useRelative) ? $scope.formData.useRelative : + $scope.formData.useRelative = angular.isDefined($scope.formData.useRelative) ? + $scope.formData.useRelative : csSettings.data.useRelative; + $scope.height = undefined; + $scope.width = undefined; + $scope.scale = 'linear'; $scope.enter = function(e, state) { if ($scope.loading) { @@ -76,134 +126,301 @@ function GpGraphMonetaryMassController($scope, $q, $state, $translate, csCurrenc }); } - $scope.load(); + $scope.load() + .then(function() { + $scope.loading = false; + }); } - }; - $scope.$on('$ionicView.enter', $scope.enter); $scope.$on('$csExtension.enter', $scope.enter); - + $scope.$on('$ionicParentView.enter', $scope.enter); $scope.onUseRelativeChanged = function() { - if (!$scope.loading) $scope.load(); + if (!$scope.loading) { + $scope.load(); + } }; $scope.$watch('formData.useRelative', $scope.onUseRelativeChanged); - $scope.load = function(from, size) { from = from || 0; size = size || 10000; - return gpData.blockchain.withDividend($scope.formData.currency, { - from: from, - size: size - }) + return $q.all([ + $translate(['GRAPH.CURRENCY.MONETARY_MASS_LABEL']), + $translate($scope.formData.useRelative ? + 'GRAPH.CURRENCY.MONETARY_MASS_TITLE_RELATIVE' : + 'GRAPH.CURRENCY.MONETARY_MASS_TITLE', { + currency: $scope.formData.currency + }), + gpData.blockchain.withDividend($scope.formData.currency, { + from: from, + size: size + }) + ]) .then(function(result) { + var translations = result[0]; + var title = result[1]; + result = result[2]; if (!result || !result.blocks) return; - // Choose a date formatter, depending on the blocks period var blocksPeriod = result.blocks[result.blocks.length-1].medianTime - result.blocks[0].medianTime; - var dateFormat; + var dateFilter; if (blocksPeriod < 15778800/* less than 6 months*/) { - dateFormat = $filter('formatDateShort'); + dateFilter = $filter('formatDateShort'); } else { - dateFormat = $filter('formatDateMonth'); + dateFilter = $filter('formatDateMonth'); } // Format time - var labels = result.labels.reduce(function(res, time) { - return res.concat(dateFormat(time)); + $scope.labels = result.labels.reduce(function(res, time) { + return res.concat(dateFilter(time)); }, []); - // Members count graph: ------------------------- - var membersCount = { - options: { - title: { - display: true - }, - scales: { - yAxes: [{ - ticks: { - beginAtZero:false - } - }] - } - }, - colors: ['rgba(17,193,243,0.5)'] - }; - membersCount.data = result.blocks.reduce(function(res, block) { - return res.concat(block.membersCount); + // Colors + $scope.colors = result.blocks.reduce(function(res) { + return res.concat('rgba(17,193,243,0.5)'); }, []); - // Monetary mass graph: ------------------------- - var monetaryMass = { - options: { - title: { - display: true - }, - scales: { - yAxes: [{ - ticks: { - beginAtZero:true - } - }] - } + // Options + $scope.options = { + responsive: true, + maintainAspectRatio: true, + title: { + display: true, + text: title }, - colors: ['rgba(255,201,0,0.5)'] + scales: { + yAxes: [{ + id: 'y-axis-1' + }] + } }; + $scope.setScale($scope.scale); + + $scope.datasetOverride = [{ + yAxisID: 'y-axis-1', + type: 'bar', + label: translations['GRAPH.CURRENCY.MONETARY_MASS_LABEL'] + }]; + + // Data if($scope.formData.useRelative) { // If relative, divide by UD - monetaryMass.data = result.blocks.reduce(function(res, block) { - return res.concat(block.monetaryMass / block.dividend); - }, []); + $scope.data = [ + result.blocks.reduce(function(res, block) { + return res.concat(block.monetaryMass / block.dividend); + }, []) + ]; } else { - monetaryMass.data = result.blocks.reduce(function(res, block) { - return res.concat(block.monetaryMass); - }, []); + $scope.data = [ + result.blocks.reduce(function(res, block) { + return res.concat(block.monetaryMass/100); + }, []) + ]; } // Keep only block number (need for click) - var blocks = result.blocks.reduce(function(res, block) { + $scope.blocks = result.blocks.reduce(function(res, block) { return res.concat(block.number); }, []); - - // Compute color - //var colors = gpData.util.colors.custom(result.data.length); - - // Compute graph title - return $q.all([ - $translate('GRAPH.CURRENCY.MEMBERS_COUNT_TITLE'), - $translate($scope.formData.useRelative ? - 'GRAPH.CURRENCY.MONETARY_MASS_TITLE_RELATIVE' : - 'GRAPH.CURRENCY.MONETARY_MASS_TITLE', { - currency: $scope.formData.currency - }) - ]) - .then(function(titles) { - membersCount.options.title.text = titles[0]; - monetaryMass.options.title.text = titles[1]; - $scope.monetaryMass = monetaryMass; - $scope.membersCount = membersCount; - $scope.blocks = blocks; - $scope.labels = labels; - $scope.loading=false; - }); }); }; + $scope.setMonetaryMassScale = function(scaleType) { + $scope.hideActionsPopover(); + $scope.options.scales.yAxes[0].type = scaleType; + if (scaleType == 'linear') { + $scope.options.scales.yAxes[0].ticks = { + beginAtZero: true + }; + } + else { + $scope.options.scales.yAxes[0].ticks = { + min: 0 + }; + } + }; + $scope.showBlock = function(data, e, item) { - if (!item) return + if (!item) return; var number = $scope.blocks[item._index]; $state.go('app.view_block', {number: number}); }; - /* -- popups -- */ + $scope.setSize = function(height, width) { + $scope.height = height; + $scope.width = width; + }; + $scope.setScale = function(scaleType) { + $scope.hideActionsPopover(); + $scope.scale = scaleType; + $scope.options.scales.yAxes[0].type = scaleType; + if (scaleType == 'linear') { + $scope.options.scales.yAxes[0].ticks = { + beginAtZero: true + }; + } + else { + $scope.options.scales.yAxes[0].ticks = { + min: 0 + }; + } + }; + /* -- Popover -- */ + + $scope.showActionsPopover = function(event) { + $scope.hideActionsPopover(); + $ionicPopover.fromTemplateUrl('plugins/graph/templates/currency/popover_monetary_mass_actions.html', { + scope: $scope + }).then(function(popover) { + $scope.actionsPopover = popover; + //Cleanup the popover when we're done with it! + $scope.$on('$destroy', function() { + $scope.actionsPopover.remove(); + }); + $scope.actionsPopover.show(event); + }); + }; + $scope.hideActionsPopover = function() { + if ($scope.actionsPopover) { + $scope.actionsPopover.hide(); + } + }; } +function GpCurrencyMembersCountController($scope, $q, $state, $translate, csCurrency, gpData, $filter) { + 'ngInject'; + + $scope.loading = true; + $scope.formData = $scope.formData || {}; + $scope.height = undefined; + $scope.width = undefined; + + $scope.enter = function(e, state) { + if ($scope.loading) { + + if (!$scope.formData.currency && state && state.stateParams && state.stateParams.currency) { // Currency parameter + $scope.formData.currency = state.stateParams.currency; + } + + // Make sure there is currency, or load it not + if (!$scope.formData.currency) { + return csCurrency.default() + .then(function(currency) { + $scope.formData.currency = currency ? currency.name : null; + return $scope.enter(e, state); + }); + } + + $scope.load() + .then(function() { + $scope.loading = false; + }); + } + }; + $scope.$on('$csExtension.enter', $scope.enter); + $scope.$on('$ionicParentView.enter', $scope.enter); + + $scope.load = function(from, size) { + from = from || 0; + size = size || 10000; + + return $q.all([ + $translate(['GRAPH.CURRENCY.MEMBERS_COUNT_TITLE', 'GRAPH.CURRENCY.MEMBERS_COUNT_LABEL']), + gpData.blockchain.withDividend($scope.formData.currency, { + from: from, + size: size + }) + ]) + .then(function(result) { + var translations = result[0]; + result = result[1]; + if (!result || !result.blocks) return; + + // Choose a date formatter, depending on the blocks period + var blocksPeriod = result.blocks[result.blocks.length-1].medianTime - result.blocks[0].medianTime; + var dateFormat; + if (blocksPeriod < 15778800/* less than 6 months*/) { + dateFormat = $filter('formatDateShort'); + } + else { + dateFormat = $filter('formatDateMonth'); + } + + // Format time + $scope.labels = result.labels.reduce(function(res, time) { + return res.concat(dateFormat(time)); + }, []); + + // Members count graph: ------------------------- + $scope.options = { + responsive: true, + maintainAspectRatio: true, + title: { + display: true, + text: translations['GRAPH.CURRENCY.MEMBERS_COUNT_TITLE'] + }, + scales: { + xAxes: [{ + position: 'bottom' + }], + yAxes: [{ + id: 'y-axis-1', + ticks: { + beginAtZero: false + } + }] + } + }; + $scope.datasetOverride = [{ + yAxisID: 'y-axis-1', + type: 'bar', + label: translations['GRAPH.CURRENCY.MEMBERS_COUNT_LABEL'] + }]; + + // Data + $scope.data = [ + result.blocks.reduce(function(res, block) { + return res.concat(block.membersCount); + }, []) + ]; + + // Colors + $scope.colors = result.blocks.reduce(function(res) { + return res.concat('rgba(17,193,243,0.5)'); + }, []); + + // Keep times (need for click) + $scope.blockTimes = result.blocks.reduce(function(res, block) { + return res.concat(block.medianTime); + }, []); + }); + }; + + $scope.showBlock = function(data, e, item) { + if (!item) return; + if (!item._index) { + $state.go('app.view_block', {number: 0}); + return; + } + var from = $scope.blockTimes[item._index-1]; + var to = moment.unix(from).utc().add(1, 'day').unix(); + $state.go('app.blockchain_search', { + q: '(_exists_:joiners OR _exists_:leavers OR _exists_:revoked OR _exists_:excluded) AND medianTime:>{0} AND medianTime:<={1}'.format(from, to) + }); + }; + + $scope.setSize = function(height, width) { + $scope.height = height; + $scope.width = width; + }; + +} diff --git a/www/plugins/graph/js/controllers/network-controllers.js b/www/plugins/graph/js/controllers/network-controllers.js index 877c5c735833c595fdb090d11b6a98c31868dd9c..d7b949bbdd6eecac2a3aa52006078c5c4be460cd 100644 --- a/www/plugins/graph/js/controllers/network-controllers.js +++ b/www/plugins/graph/js/controllers/network-controllers.js @@ -6,14 +6,15 @@ angular.module('cesium.graph.network.controllers', ['chart.js', 'cesium.graph.se var enable = csConfig.plugins && csConfig.plugins.es; if (enable) { - PluginServiceProvider.extendState('app.network', { - points: { - 'buttons': { - templateUrl: "plugins/graph/templates/network/view_network_extend.html", - controller: 'GpNetworkViewExtendCtrl' + PluginServiceProvider + .extendState('app.network', { + points: { + 'buttons': { + templateUrl: "plugins/graph/templates/network/view_network_extend.html", + controller: 'GpNetworkViewExtendCtrl' + } } - } - }) + }) ; } }) diff --git a/www/plugins/graph/js/services/data-services.js b/www/plugins/graph/js/services/data-services.js index b3a32870d1627ddee41455a234ac5539758a4d04..c7afcb6d88bef6f43f16a4b0bbe0040f89e18303 100644 --- a/www/plugins/graph/js/services/data-services.js +++ b/www/plugins/graph/js/services/data-services.js @@ -13,7 +13,7 @@ angular.module('cesium.graph.data.services', ['cesium.wot.services', 'cesium.es. }, raw: { block: { - search: esHttp.post('/:currency/block/_search') + search: esHttp.post('/:currency/block/_search?pretty') } }, regex: { @@ -46,7 +46,7 @@ angular.module('cesium.graph.data.services', ['cesium.wot.services', 'cesium.es. // From [0,1] opacity = opacity || '0.55'; - var defaultStateSize = Math.round(count / 4/*=4 states max*/); + var defaultStateSize = Math.round(count / 2.5/*=4 states max*/); // Start color [r,v,b] var color = startColor ? angular.copy(startColor) : [255,0,0]; // Red @@ -173,7 +173,7 @@ angular.module('cesium.graph.data.services', ['cesium.wot.services', 'cesium.es. if (!result.blocks) { var deferred = $q.defer(); result.then(function(res) { - console.debug("[graph] monetaryMass for [" + currency + "] waiting previous call", res); + //console.debug("[graph] Detected a duplicated request on monetaryMass [" + currency + "]: will use same request result"); deferred.resolve(res); return res; }); @@ -235,56 +235,106 @@ angular.module('cesium.graph.data.services', ['cesium.wot.services', 'cesium.es. * @returns {*} */ exports.blockchain.txCount = function(currency, options) { + + var maxRangeSize = 30; + var defaultTotalRangeCount = maxRangeSize*2; + + options = options || {}; + options.rangeDuration = options.rangeDuration || 'day'; + options.endTime = options.endTime || moment.unix(esHttp.date.now()).utc().add(1, options.rangeDuration).unix(); + options.startTime = options.startTime || + moment.unix(options.endTime).utc().subtract(defaultTotalRangeCount, options.rangeDuration).unix(); + + var jobs = []; + + var from = moment.unix(options.startTime).utc().startOf(options.rangeDuration); var ranges = []; - var sliceSize = 24*60*60*2; - var now = esHttp.date.now(); - var start = now - (30.4375 * sliceSize); - for (var i = start; i <= now; i=i+sliceSize) { + while(from.unix() < options.endTime) { + ranges.push({ - from: i, - to: i + sliceSize + from: from.unix(), + to: from.add(1, options.rangeDuration).unix() }); - } - var request = { - size: 0, - aggs: { - txCount: { - range: { - field: "medianTime", - ranges: ranges - }, + // Do not exceed max range count + if (ranges.length == maxRangeSize) { + var request = { + size: 0, aggs: { - tx_stats : { - stats: { - script : { - inline: "txcount", - lang: "native" + txCount: { + range: { + field: "medianTime", + ranges: ranges + }, + aggs: { + tx_stats : { + stats: { + script : { + inline: "txcount", + lang: "native" + } + } } } + } } - + }; + // prepare next loop + ranges = []; + + if (jobs.length < 10) { + + jobs.push( + exports.raw.block.search(request, {currency: currency}) + .then(function (res) { + var aggs = res.aggregations; + if (!aggs.txCount || !aggs.txCount.buckets || !aggs.txCount.buckets.length) return; + //var started = false; + return (aggs.txCount.buckets || []).reduce(function (res, agg) { + /*if (!started) { + started = agg.tx_stats.count > 0; + }*/ + return /*!started ? res : */res.concat({ + from: agg.from, + to: agg.to, + count: agg.tx_stats.sum, + avgByBlock: Math.round(agg.tx_stats.avg * 100) / 100, + maxByBlock: agg.tx_stats.max + }); + }, []); + }) + ); + } + else { + console.error('Too many cal of txCount request ! '); + from = moment.unix(options.endTime).utc(); } - } - }; + } + } - return exports.raw.block.search(request, {currency: currency}) + return $q.all(jobs) .then(function(res) { - var aggs = res.aggregations; - if (!aggs.txCount || !aggs.txCount.buckets || !aggs.txCount.buckets.length) return; + res = res.reduce(function(res, hits){ + if (!hits || !hits.length) return res; + return res.concat(hits); + }, []); + + res = _.sortBy(res, 'from'); var result = {}; - var started = false; - result.data = (aggs.txCount.buckets || []).reduce(function(res, agg) { - if (!started) { - started = agg.tx_stats.count > 0; - } - return started ? res.concat(agg.tx_stats.sum) : res; + result.count = res.reduce(function(res, hit){ + return res.concat(hit.count); + }, []); + result.avgByBlock = res.reduce(function(res, hit){ + return res.concat(hit.avgByBlock); + }, []); + result.maxByBlock = res.reduce(function(res, hit){ + return res.concat(hit.maxByBlock); }, []); - result.labels = (aggs.txCount.buckets || []).reduce(function(res, agg) { - return res.concat(agg.to); + result.times = res.reduce(function(res, hit){ + return res.concat(hit.from); }, []); return result; }); diff --git a/www/plugins/graph/templates/blockchain/graph_block_issuers.html b/www/plugins/graph/templates/blockchain/graph_block_issuers.html new file mode 100644 index 0000000000000000000000000000000000000000..5824e6de778fbdb5cb9e9228f0b2f1e7426ef29f --- /dev/null +++ b/www/plugins/graph/templates/blockchain/graph_block_issuers.html @@ -0,0 +1,30 @@ + + <div class="row responsive-lg"> + + <!-- bar --> + <div class="col col-75"> + <canvas id="bar" class="chart-bar" + height="{{height}}" width="{{width}}" + chart-data="data" + chart-labels="labels" + chart-colors="colors" + chart-options="barOptions" + chart-click="showBlockIssuer"> + </canvas> + </div> + + <!-- pie --> + <div class="col col-25 padding-top"> + <canvas id="blocksByIssuer-pie" class="chart-pie" + style="max-height: 300px; max-width: 300px;" + chart-data="data" + chart-labels="labels" + chart-colors="colors" + chart-click="showBlockIssuer"> + </canvas> + + <div class="gray padding-top text-center"> + <small ng-bind-html="'GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_HELP'| translate:{issuerCount: data.length, blockCount: blockCount }"></small> + </div> + </div> + </div> diff --git a/www/plugins/graph/templates/blockchain/graph_tx_count.html b/www/plugins/graph/templates/blockchain/graph_tx_count.html new file mode 100644 index 0000000000000000000000000000000000000000..3c3f7a261709341e868111bffca8799275b3c391 --- /dev/null +++ b/www/plugins/graph/templates/blockchain/graph_tx_count.html @@ -0,0 +1,40 @@ + + <!-- button bar --> + <div class="button-bar-inline " + style="top: 33px; margin-top:-33px; position: relative;"> + <button + class="button button-stable button-clear no-padding-xs pull-right" + ng-click="showTxActionsPopover($event)"> + <i class="icon ion-navicon-round"></i> + </button> + </div> + + <canvas id="tx-line" class="chart-bar" height="300" width="1000" + height="{{height}}" width="{{width}}" + chart-data="data" + chart-dataset-override="datasetOverride" + chart-colors="colors" + chart-options="options" + chart-labels="labels" + chart-click="showTxRange"> + </canvas> + + <div class="range range-positive padding"> + <a + class="button button-stable button-clear no-padding pull-left" + ng-click="loadPreviousTx()"> + <i class="icon ion-chevron-left"></i> + </a> + <input type="range" + ng-model="formData.timePct" + name="timePct" + min="0" max="100" + value="{{formData.timePct}}" + ng-change="onTxTimeChanged();" + ng-model-options="{ debounce: 250 }"> + <a + class="button button-stable button-clear no-padding pull-right" + ng-click="loadNextTx($event)"> + <i class="icon ion-chevron-right"></i> + </a> + </div> diff --git a/www/plugins/graph/templates/blockchain/popover_tx_actions.html b/www/plugins/graph/templates/blockchain/popover_tx_actions.html new file mode 100644 index 0000000000000000000000000000000000000000..970a901d9fa6602797c1b0a03d18d280b2cb6aa3 --- /dev/null +++ b/www/plugins/graph/templates/blockchain/popover_tx_actions.html @@ -0,0 +1,31 @@ +<ion-popover-view class="fit has-header"> + <ion-header-bar> + <h1 class="title" translate>COMMON.POPOVER_ACTIONS_TITLE</h1> + </ion-header-bar> + <ion-content scroll="false"> + <div class="list item-text-wrap"> + + <!-- duration: hour --> + <a class="item item-icon-right ink" + ng-click="setTxRangeDuration('hour')"> + <span ng-bind-html="'GRAPH.BLOCKCHAIN.TX_RANGE_DURATION.HOUR' | translate"></span> + <i class="icon ion-ios-checkmark-empty" ng-show="txOptions.rangeDuration=='hour'"></i> + </a> + + <!-- duration: day --> + <a class="item item-icon-right ink" + ng-click="setTxRangeDuration('day')"> + <span ng-bind-html="'GRAPH.BLOCKCHAIN.TX_RANGE_DURATION.DAY' | translate"></span> + <i class="icon ion-ios-checkmark-empty" ng-show="txOptions.rangeDuration=='day'"></i> + </a> + + <!-- duration: month --> + <a class="item item-icon-right ink" + ng-click="setTxRangeDuration('month')"> + <span ng-bind-html="'GRAPH.BLOCKCHAIN.TX_RANGE_DURATION.MONTH' | translate"></span> + <i class="icon ion-ios-checkmark-empty" ng-show="txOptions.rangeDuration=='month'"></i> + </a> + + </div> + </ion-content> +</ion-popover-view> diff --git a/www/plugins/graph/templates/blockchain/view_stats.html b/www/plugins/graph/templates/blockchain/view_stats.html index 730515cd9aae196e26b81c86a24910f760861245..e7887857f69588b31c9ea35b576d43c2c8706864 100644 --- a/www/plugins/graph/templates/blockchain/view_stats.html +++ b/www/plugins/graph/templates/blockchain/view_stats.html @@ -6,52 +6,35 @@ <ion-content scroll="true" class="no-padding"> - <!-- Blocks per issuer --> - <div class="item item-divider" translate> - GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_DIVIDER - </div> - - <div class="center" ng-if="loading"> + <div class="center padding" ng-if="loading"> <ion-spinner icon="android"></ion-spinner> </div> - <div class="row responsive-lg" ng-if="!loading"> + <div class="list" ng-if="!loading"> - <!-- bar --> - <div class="col col-75"> - <canvas id="bar" class="chart chart-bar" - chart-data="blocksByIssuer.data" chart-labels="blocksByIssuer.labels" - chart-colors="blocksByIssuer.colors" - chart-options="blocksByIssuer.bar.options" - chart-click="showBlockIssuer"> - </canvas> + <!-- - - - - TX divider - - - - --> + <div class="item item-divider" translate> + GRAPH.BLOCKCHAIN.TX_DIVIDER </div> - <!-- pie --> - <div class="col col-25 padding-top"> - <canvas id="blocksByIssuer-pie" class="chart chart-pie" - style="max-height: 300px; max-width: 300px;" - chart-data="blocksByIssuer.data" - chart-labels="blocksByIssuer.labels" - chart-colors="blocksByIssuer.colors" - chart-click="showBlockIssuer"> - </canvas> + <div class="item no-padding-xs" + ng-include="'plugins/graph/templates/blockchain/graph_tx_count.html'" + ng-controller="GpBlockchainTxCountCtrl" + ng-init="setSize(350, 1000)"> </div> - </div> - <!-- tx count --> - <div class="row responsive-lg" ng-if="!loading"> - - <!-- bar --> - <div class="col col-75"> - <canvas id="txCount-line" class="chart chart-bar" - chart-data="txCount.data" - chart-colors="txCount.colors" - chart-options="txCount.options" - chart-labels="txCount.labels"> - </canvas> + <!-- Blocks issuer --> + <div class="item item-divider" translate> + GRAPH.BLOCKCHAIN.BLOCKS_ISSUERS_DIVIDER </div> - </div> + + <div class="item no-padding-xs" + ng-include="'plugins/graph/templates/blockchain/graph_block_issuers.html'" + ng-controller="GpBlockchainIssuersCtrl" + ng-init="setSize(300, 750)"> + </div> + + </ion-content> </ion-view> diff --git a/www/plugins/graph/templates/currency/graph_members_count.html b/www/plugins/graph/templates/currency/graph_members_count.html index ab8e3adccb980055ef7b4cdf5da404349d77d6a0..d9ae958df6e5a7c61f82e05d1fdb933dade2884e 100644 --- a/www/plugins/graph/templates/currency/graph_members_count.html +++ b/www/plugins/graph/templates/currency/graph_members_count.html @@ -1,9 +1,10 @@ -<div class="padding-left padding-right"> - <canvas id="membersCount-line" class="chart chart-line" - chart-data="membersCount.data" + <canvas id="membersCount-bar" class="chart-bar" + height="{{height}}" + width="{{width}}" + chart-data="data" chart-labels="labels" - chart-options="membersCount.options" - chart-colors="membersCount.colors" + chart-colors="colors" + chart-options="options" + chart-dataset-override="datasetOverride" chart-click="showBlock"> </canvas> -</div> diff --git a/www/plugins/graph/templates/currency/graph_monetary_mass.html b/www/plugins/graph/templates/currency/graph_monetary_mass.html index 0660cb0b40a9185f443c5a37cb72f66e405622e5..2b34a02ac999b5c537c9ce34b5e15ea3bd8dd750 100644 --- a/www/plugins/graph/templates/currency/graph_monetary_mass.html +++ b/www/plugins/graph/templates/currency/graph_monetary_mass.html @@ -1,9 +1,21 @@ -<div class="padding-left padding-right"> - <canvas id="monetaryMass-line" class="chart chart-line" - chart-data="monetaryMass.data" + + <!-- graphs button bar --> + <div class="button-bar-inline " + style="top: 33px; margin-top:-33px; position: relative;"> + <button + class="button button-stable button-clear no-padding-xs pull-right" + ng-click="showActionsPopover($event)"> + <i class="icon ion-navicon-round"></i> + </button> + </div> + + <canvas id="monetaryMass-bar" class="chart-bar" + height="{{height}}" + width="{{width}}" + chart-data="data" chart-labels="labels" - chart-options="monetaryMass.options" - chart-colors="monetaryMass.colors" + chart-colors="colors" + chart-dataset-override="datasetOverride" + chart-options="options" chart-click="showBlock"> </canvas> -</div> diff --git a/www/plugins/graph/templates/currency/popover_monetary_mass_actions.html b/www/plugins/graph/templates/currency/popover_monetary_mass_actions.html new file mode 100644 index 0000000000000000000000000000000000000000..785dfa0e38733ecc2f5d9c91933933cff7199eae --- /dev/null +++ b/www/plugins/graph/templates/currency/popover_monetary_mass_actions.html @@ -0,0 +1,24 @@ +<ion-popover-view class="fit has-header"> + <ion-header-bar> + <h1 class="title" translate>COMMON.POPOVER_ACTIONS_TITLE</h1> + </ion-header-bar> + <ion-content scroll="false"> + <div class="list item-text-wrap"> + + <!-- scale: linear --> + <a class="item item-icon-right ink" + ng-click="setScale('linear')"> + <span ng-bind-html="'GRAPH.COMMON.LINEAR_SCALE' | translate"></span> + <i class="icon ion-ios-checkmark-empty" ng-show="scale=='linear'"></i> + </a> + + <!-- duration: day --> + <a class="item item-icon-right ink" + ng-click="setScale('logarithmic')"> + <span ng-bind-html="'GRAPH.COMMON.LOGARITHMIC_SCALE' | translate"></span> + <i class="icon ion-ios-checkmark-empty" ng-show="scale=='logarithmic'"></i> + </a> + + </div> + </ion-content> +</ion-popover-view> diff --git a/www/plugins/graph/templates/currency/tab_blocks_extend.html b/www/plugins/graph/templates/currency/tab_blocks_extend.html new file mode 100644 index 0000000000000000000000000000000000000000..f6c4c5e197c22beda5bf1bfe24a7312a37138833 --- /dev/null +++ b/www/plugins/graph/templates/currency/tab_blocks_extend.html @@ -0,0 +1,9 @@ +<!-- buttons --> +<ng-if ng-if="enable && extensionPoint === 'buttons'"> + <div class="item item-divider"> + <a class="badge button button-text button-small button-small-padding ink" ui-sref="app.currency.tab_blocks_stats"> + <i class="icon ion-stats-bars"></i> + <span translate>GRAPH.COMMON.BTN_SHOW_STATS</span> + </a> + </div> +</ng-if> diff --git a/www/plugins/graph/templates/currency/tabs/tab_blocks_stats.html b/www/plugins/graph/templates/currency/tabs/tab_blocks_stats.html new file mode 100644 index 0000000000000000000000000000000000000000..a3f252debf0af6fc948243aef1b1c6631ed42e1f --- /dev/null +++ b/www/plugins/graph/templates/currency/tabs/tab_blocks_stats.html @@ -0,0 +1,12 @@ +<ion-view> + <ion-content> + + <div class="list"> + <div class="item" + ng-include="'plugins/graph/templates/blockchain/graph_tx_count.html'" + ng-controller="GpBlockchainTxCountCtrl" + ng-init="setSize(undefined,undefined)"> + </div> + </div> + </ion-content> +</ion-view> diff --git a/www/plugins/graph/templates/currency/tabs/tab_network_stats.html b/www/plugins/graph/templates/currency/tabs/tab_network_stats.html new file mode 100644 index 0000000000000000000000000000000000000000..83c89d95d376beb495bc368f436923bf8095b58c --- /dev/null +++ b/www/plugins/graph/templates/currency/tabs/tab_network_stats.html @@ -0,0 +1,12 @@ +<ion-view> + <ion-content> + + <div class="list"> + <div class="item" + ng-include="'plugins/graph/templates/blockchain/graph_block_issuers.html'" + ng-controller="GpBlockchainIssuersCtrl" + ng-init="setSize(undefined,undefined)"> + </div> + </div> + </ion-content> +</ion-view> diff --git a/www/plugins/graph/templates/currency/tabs/tab_parameters_stats.html b/www/plugins/graph/templates/currency/tabs/tab_parameters_stats.html new file mode 100644 index 0000000000000000000000000000000000000000..582fba188ae42c67df8449dd59128c38195ee0cb --- /dev/null +++ b/www/plugins/graph/templates/currency/tabs/tab_parameters_stats.html @@ -0,0 +1,13 @@ +<ion-view> + <ion-content> + <div class="center padding" ng-if="loading"> + <ion-spinner icon="android"></ion-spinner> + </div> + + <div class="list"> + <div class="item" + ng-include="'plugins/graph/templates/currency/graph_monetary_mass.html'"> + </div> + </div> + </ion-content> +</ion-view> diff --git a/www/plugins/graph/templates/currency/tabs/tab_wot_stats.html b/www/plugins/graph/templates/currency/tabs/tab_wot_stats.html new file mode 100644 index 0000000000000000000000000000000000000000..825bbf0398890ea6d2161ffc360304c2b677e93d --- /dev/null +++ b/www/plugins/graph/templates/currency/tabs/tab_wot_stats.html @@ -0,0 +1,13 @@ +<ion-view> + <ion-content> + <div class="center padding" ng-if="loading"> + <ion-spinner icon="android"></ion-spinner> + </div> + + <div class="list"> + <div class="item" + ng-include="'plugins/graph/templates/currency/graph_members_count.html'"> + </div> + </div> + </ion-content> +</ion-view> diff --git a/www/plugins/graph/templates/currency/view_currency_extend.html b/www/plugins/graph/templates/currency/view_currency_extend.html index 19b8b560e1fd7773c8aa5c8f2021dd921c5f7a48..858755f1953bcbcc29cb3ac54ac15f118639d486 100644 --- a/www/plugins/graph/templates/currency/view_currency_extend.html +++ b/www/plugins/graph/templates/currency/view_currency_extend.html @@ -1,21 +1,55 @@ -<!-- Buttons section --> -<ng-if ng-if="enable && extensionPoint === 'nav-buttons'"> - - <button class="button button-icon button-clear icon ion-podium visible-xs visible-sm" - ui-sref="app.currency_stats"> - </button> -</ng-if> <!-- section actual parameters --> <ng-if ng-if="enable && extensionPoint === 'parameters-actual'" > - <ng-include src="'plugins/graph/templates/currency/graph_monetary_mass.html'" ng-controller="GpGraphMonetaryMassCtrl"></ng-include> + <div class="item padding-left padding-right no-padding-xs" + ng-if="!smallscreen" + ng-include="'plugins/graph/templates/currency/graph_monetary_mass.html'" + ng-controller="GpCurrencyMonetaryMassCtrl"> + </div> + + <div class="item item-divider" + ng-if="smallscreen"> + <a class="badge button button-text button-small button-small-padding ink" ui-sref="app.currency.tab_parameters_stats"> + <i class="icon ion-stats-bars"></i> + <span translate>GRAPH.COMMON.BTN_SHOW_STATS</span> + </a> + </div> +</ng-if> + +<!-- section Wot --> +<ng-if ng-if="enable && extensionPoint === 'wot-actual'" > + + <div class="item padding-left padding-right no-padding-xs" + ng-if="!smallscreen" + ng-include="'plugins/graph/templates/currency/graph_members_count.html'" + ng-controller="GpCurrencyMembersCountCtrl"> + </div> + <div class="item item-divider" + ng-if="smallscreen"> + <a class="badge button button-text button-small button-small-padding ink" ui-sref="app.currency.tab_wot_stats"> + <i class="icon ion-stats-bars"></i> + <span translate>GRAPH.COMMON.BTN_SHOW_STATS</span> + </a> + </div> </ng-if> <!-- section Wot --> -<ng-if ng-if="enable && extensionPoint === 'wot-actual'"> +<ng-if ng-if="enable && extensionPoint === 'network-actual'" > + + <div class="item padding-left padding-right no-padding-xs" + ng-if="!smallscreen" + ng-include="'plugins/graph/templates/blockchain/graph_block_issuers.html'" + ng-controller="GpBlockchainIssuersCtrl"> + </div> - <ng-include src="'plugins/graph/templates/currency/graph_members_count.html'" ng-controller="GpGraphMonetaryMassCtrl"></ng-include> + <div class="item item-divider" + ng-if="smallscreen"> + <a class="badge button button-text button-small button-small-padding ink" ui-sref="app.currency.tab_network_stats"> + <i class="icon ion-stats-bars"></i> + <span translate>GRAPH.COMMON.BTN_SHOW_STATS</span> + </a> + </div> </ng-if> diff --git a/www/plugins/graph/templates/currency/view_parameters_stats.html b/www/plugins/graph/templates/currency/view_parameters_stats.html new file mode 100644 index 0000000000000000000000000000000000000000..3c88780c5cd62f39f0980da00dfd1883a40c5ad1 --- /dev/null +++ b/www/plugins/graph/templates/currency/view_parameters_stats.html @@ -0,0 +1,12 @@ +<ion-view left-buttons="leftButtons" + cache-view="false"> + + <ion-content scroll="true" > + + <div class="center padding" ng-if="loading"> + <ion-spinner icon="android"></ion-spinner> + </div> + + <ng-include src="'plugins/graph/templates/currency/graph_monetary_mass.html'" ></ng-include> + </ion-content> +</ion-view> diff --git a/www/plugins/graph/templates/currency/view_stats.html b/www/plugins/graph/templates/currency/view_stats.html index 77c9145333499108ce4605fb3a2e33d099452422..26cc7efd77af44b852de9b40137225ee35bd6c93 100644 --- a/www/plugins/graph/templates/currency/view_stats.html +++ b/www/plugins/graph/templates/currency/view_stats.html @@ -1,33 +1,36 @@ <ion-view left-buttons="leftButtons" cache-view="false"> <ion-nav-title> - {{'GRAPH.BLOCKCHAIN.TITLE' | translate}}{{id}} + {{'GRAPH.BLOCKCHAIN.TITLE' | translate}} </ion-nav-title> - <ion-content scroll="true" class="padding"> + <ion-content scroll="true" class="padding" > - <div class="center" ng-if="loading"> - <ion-spinner icon="android"></ion-spinner> - </div> + <div class="list" > + <ng-controller ng-controller="GpCurrencyMonetaryMassCtrl" + ng-init="setSize(300, 1000)"> + <div class="item no-padding-xs" + ng-include="'plugins/graph/templates/currency/graph_monetary_mass.html'"> + </div> - <ng-controller ng-controller="GpGraphMonetaryMassCtrl"> - <div class="row list"> - <ng-include src="'plugins/graph/templates/currency/graph_monetary_mass.html'" ></ng-include> - </div> + <div class="item item-toggle dark no-border text-right"> + <span class="" translate>COMMON.BTN_RELATIVE_UNIT</span> + <label class="toggle toggle-royal" id="helptip-currency-change-unit"> + <input type="checkbox" ng-model="formData.useRelative"> + <div class="track"> + <div class="handle"></div> + </div> + </label> + </div> + </ng-controller> - <div class="row list"> - <ng-include src="'plugins/graph/templates/currency/graph_members_count.html'" ></ng-include> + <div class="item no-padding-xs" + ng-include="'plugins/graph/templates/currency/graph_members_count.html'" + ng-controller="GpCurrencyMembersCountCtrl" + ng-init="setSize(300, 1000)"> </div> - </ng-controller> - - <div class="item item-toggle dark no-border text-right"> - <span class="" translate>COMMON.BTN_RELATIVE_UNIT</span> - <label class="toggle toggle-royal" id="helptip-currency-change-unit"> - <input type="checkbox" ng-model="formData.useRelative"> - <div class="track"> - <div class="handle"></div> - </div> - </label> + + </div> </ion-content> diff --git a/www/plugins/graph/templates/currency/view_wot_stats.html b/www/plugins/graph/templates/currency/view_wot_stats.html new file mode 100644 index 0000000000000000000000000000000000000000..41c583327a7b103aed26e6c420006ba54a21a6cf --- /dev/null +++ b/www/plugins/graph/templates/currency/view_wot_stats.html @@ -0,0 +1,12 @@ +<ion-view left-buttons="leftButtons" + cache-view="false"> + + <ion-content scroll="true" > + + <div class="center padding" ng-if="loading"> + <ion-spinner icon="android"></ion-spinner> + </div> + + <ng-include src="'plugins/graph/templates/currency/graph_members_count.html'" ></ng-include> + </ion-content> + </ion-view> diff --git a/www/plugins/graph/templates/network/view_network_extend.html b/www/plugins/graph/templates/network/view_network_extend.html index de5930f4f04980b1e1cb3a60f329ca265715815b..60ecb297c5808645048990ec9c18ffd8124b388a 100644 --- a/www/plugins/graph/templates/network/view_network_extend.html +++ b/www/plugins/graph/templates/network/view_network_extend.html @@ -2,7 +2,7 @@ <ng-if ng-if="enable && extensionPoint === 'buttons'"> <a class="button button-text button-small ink" ui-sref="app.blockchain_stats" > - <i class="icon ion-podium"></i> + <i class="icon ion-stats-bars"></i> <span>{{'NETWORK.VIEW.BTN_GRAPH'|translate}}</span> </a> </ng-if> diff --git a/www/templates/currency/items_network.html b/www/templates/currency/items_network.html index 8c7e34c02c8ce8cb6e1173335a37c63a58fb28d2..ec7cb255481ec9b8e7bb1aa84bd31d4e7c9c2ce8 100644 --- a/www/templates/currency/items_network.html +++ b/www/templates/currency/items_network.html @@ -13,6 +13,9 @@ <span class="badge badge-stable">{{formData.difficulty | formatInteger}}</span> </ion-item> + <!-- Allow extension here --> + <cs-extension-point name="network-actual"></cs-extension-point> + <div class="item item-divider"> <span translate>CURRENCY.VIEW.NETWORK_RULES_DIVIDER</span> </div> @@ -46,6 +49,7 @@ ng-if="!search.loading" ng-click="showActionsPopover($event)"> </a> + </div> </div> diff --git a/www/templates/currency/items_parameters.html b/www/templates/currency/items_parameters.html index 35eeed832f9c52988f55936b56bfa1662fd518ba..548c1a977850c51040d5d4db2e1e0f6e27c5f67a 100644 --- a/www/templates/currency/items_parameters.html +++ b/www/templates/currency/items_parameters.html @@ -32,6 +32,9 @@ </span> </ion-item> + <!-- Allow extension here --> + <cs-extension-point name="parameters-actual"></cs-extension-point> + <ion-item class="item-icon-left item-text-wrap"> <i class="icon ion-load-c"></i> <div class="col col-60"> @@ -68,9 +71,6 @@ </label> </div> - <!-- Allow extension here --> - <cs-extension-point name="parameters-actual"></cs-extension-point> - <a nam="helptip-currency-rules-anchor"></a> <div id="helptip-currency-rules" class="item item-divider"> diff --git a/www/templates/currency/tabs/tab_blocks.html b/www/templates/currency/tabs/tab_blocks.html index a00b5fd20e3e80c26237d353d04dc3396305e242..dc7e4c0fada74dbde7efc9ec68213750a17302f7 100644 --- a/www/templates/currency/tabs/tab_blocks.html +++ b/www/templates/currency/tabs/tab_blocks.html @@ -16,7 +16,11 @@ </ion-nav-buttons> <ion-content> - <div class="item item-divider" translate>BLOCKCHAIN.LOOKUP.LAST_BLOCKS</div> + <div class="item item-divider"> + <span translate>BLOCKCHAIN.LOOKUP.LAST_BLOCKS</span> + </div> + + <cs-extension-point name="buttons"></cs-extension-point> <ng-include src="'templates/blockchain/list_blocks.html'"></ng-include> </ion-content>