Skip to content
Snippets Groups Projects
Select Git revision
  • 00985037f44a19726805c483a3bd28bafa071876
  • master default protected
  • fix_picked_up_file_in_runtime_release
  • network/gtest-1000 protected
  • upgradable-multisig
  • runtime/gtest-1000
  • network/gdev-800 protected
  • cgeek/issue-297-cpu
  • gdev-800-tests
  • update-docker-compose-rpc-squid-names
  • fix-252
  • 1000i100-test
  • hugo/tmp-0.9.1
  • network/gdev-803 protected
  • hugo/endpoint-gossip
  • network/gdev-802 protected
  • hugo/distance-precompute
  • network/gdev-900 protected
  • tuxmain/anonymous-tx
  • debug/podman
  • hugo/195-doc
  • gtest-1000-0.11.1 protected
  • gtest-1000-0.11.0 protected
  • gtest-1000 protected
  • gdev-900-0.10.1 protected
  • gdev-900-0.10.0 protected
  • gdev-900-0.9.2 protected
  • gdev-800-0.8.0 protected
  • gdev-900-0.9.1 protected
  • gdev-900-0.9.0 protected
  • gdev-803 protected
  • gdev-802 protected
  • runtime-801 protected
  • gdev-800 protected
  • runtime-800-bis protected
  • runtime-800 protected
  • runtime-800-backup protected
  • runtime-701 protected
  • runtime-700 protected
  • runtime-600 protected
  • runtime-500 protected
41 results

pallet_conventions.md

Blame
    • Benjamin Gallois's avatar
      6cf445b5
      Harmonize and document events errors and calls (!200) · 6cf445b5
      Benjamin Gallois authored and Hugo Trentesaux's avatar Hugo Trentesaux committed
      * fix clippy errors
      
      * add Invalid case in distance status
      
      * fix events pallet-membership
      
      * fix events pallet-certification
      
      * update docs
      
      * update metadata and docs
      
      * refactor errors pallet-distance
      
      * fix distance error naming pallet duniter-wot
      
      * add pallet membership documentation
      
      * refactor acquisition and renewal pallet-membership
      
      * refactor expiration and revokation pallet-membership
      
      * refactor calls pallet-identity
      
      * add pallet standard guidelines
      
      * refactor events struct pallet-membership
      
      * add events pallet-distance
      
      * refactor documentation pallet-quota
      
      * fix pallet-quota features
      
      * refactor documentation pallet-provide-randomness
      
      * refactor documentation pallet-oneshot-account
      
      * refactor documentation pallet-offences
      
      * refactor documentation pallet-membership
      
      * refactor documentation pallet-identity
      
      * refactor documentation pallet-duniter-wot
      
      * refactor documentation pallet-duniter-account
      
      * refactor documentation pallet-distance
      
      * refactor documentation pallet-certification
      
      * refactor documentation pallet-authority-members
      
      * refactor error naming pallet-provide-randomness
      
      * remove unused errors pallet-membership
      
      * remove unused errors pallet-identity
      
      * refactor events and errors pallet-distance
      
      * refactor events and errors pallet-authority-members
      6cf445b5
      History
      Harmonize and document events errors and calls (!200)
      Benjamin Gallois authored and Hugo Trentesaux's avatar Hugo Trentesaux committed
      * fix clippy errors
      
      * add Invalid case in distance status
      
      * fix events pallet-membership
      
      * fix events pallet-certification
      
      * update docs
      
      * update metadata and docs
      
      * refactor errors pallet-distance
      
      * fix distance error naming pallet duniter-wot
      
      * add pallet membership documentation
      
      * refactor acquisition and renewal pallet-membership
      
      * refactor expiration and revokation pallet-membership
      
      * refactor calls pallet-identity
      
      * add pallet standard guidelines
      
      * refactor events struct pallet-membership
      
      * add events pallet-distance
      
      * refactor documentation pallet-quota
      
      * fix pallet-quota features
      
      * refactor documentation pallet-provide-randomness
      
      * refactor documentation pallet-oneshot-account
      
      * refactor documentation pallet-offences
      
      * refactor documentation pallet-membership
      
      * refactor documentation pallet-identity
      
      * refactor documentation pallet-duniter-wot
      
      * refactor documentation pallet-duniter-account
      
      * refactor documentation pallet-distance
      
      * refactor documentation pallet-certification
      
      * refactor documentation pallet-authority-members
      
      * refactor error naming pallet-provide-randomness
      
      * remove unused errors pallet-membership
      
      * remove unused errors pallet-identity
      
      * refactor events and errors pallet-distance
      
      * refactor events and errors pallet-authority-members
    docstats-controllers.js NaN GiB
    
    angular.module('cesium.graph.docstats.controllers', ['chart.js', 'cesium.graph.services', 'cesium.graph.common.controllers'])
    
      .config(function($stateProvider, PluginServiceProvider, csConfig) {
        'ngInject';
    
        $stateProvider
          .state('app.doc_stats_lg', {
            url: "/data/stats?stepUnit&t&hide&scale",
            views: {
              'menuContent': {
                templateUrl: "plugins/graph/templates/docstats/view_stats.html",
                controller: 'GpDocStatsCtrl'
              }
            }
          });
    
        var enable = csConfig.plugins && csConfig.plugins.es;
        if (enable) {
          // TODO: add buttons to link with doc stats
        }
      })
    
    
      .controller('GpDocStatsCtrl', GpDocStatsController)
    ;
    
    function GpDocStatsController($scope, $controller, $q, $translate, gpColor, gpData, $filter) {
      'ngInject';
    
      // Initialize the super class and extend it.
      angular.extend(this, $controller('GpCurrencyAbstractCtrl', {$scope: $scope}));
    
      $scope.hiddenDatasets = [];
    
      $scope.charts = [
    
        // User count
        {
          id: 'user',
          title: 'GRAPH.DOC_STATS.USER.TITLE',
          series: [
            {
              key: 'user_profile',
              label: 'GRAPH.DOC_STATS.USER.USER_PROFILE',
              color: gpColor.rgba.royal(1),
              pointHoverBackgroundColor: gpColor.rgba.royal(1)
            },
            {
              key: 'user_settings',
              label: 'GRAPH.DOC_STATS.USER.USER_SETTINGS',
              color: gpColor.rgba.gray(0.5),
              pointHoverBackgroundColor: gpColor.rgba.gray(1)
            }
          ]
        },
    
        // Message & Co.
        {
          id: 'message',
          title: 'GRAPH.DOC_STATS.MESSAGE.TITLE',
          series: [
            {
              key: 'message_inbox',
              label: 'GRAPH.DOC_STATS.MESSAGE.MESSAGE_INBOX',
              color: gpColor.rgba.royal(1),
              pointHoverBackgroundColor: gpColor.rgba.royal(1)
            },
            {
              key: 'message_outbox',
              label: 'GRAPH.DOC_STATS.MESSAGE.MESSAGE_OUTBOX',
              color: gpColor.rgba.calm(1),
              pointHoverBackgroundColor: gpColor.rgba.calm(1)
            },
            {
              key: 'invitation_certification',
              label: 'GRAPH.DOC_STATS.MESSAGE.INVITATION_CERTIFICATION',
              color: gpColor.rgba.gray(0.5),
              pointHoverBackgroundColor: gpColor.rgba.gray(1)
            }
          ]
        },
    
        // Social Page & group
        {
          id: 'social',
          title: 'GRAPH.DOC_STATS.SOCIAL.TITLE',
          series: [
            {
              key: 'page_record',
              label: 'GRAPH.DOC_STATS.SOCIAL.PAGE_RECORD',
              color: gpColor.rgba.royal(1),
              pointHoverBackgroundColor: gpColor.rgba.royal(1)
            },
            {
              key: 'group_record',
              label: 'GRAPH.DOC_STATS.SOCIAL.GROUP_RECORD',
              color: gpColor.rgba.calm(1),
              pointHoverBackgroundColor: gpColor.rgba.calm(1)
            },
            {
              key: 'page_comment',
              label: 'GRAPH.DOC_STATS.SOCIAL.PAGE_COMMENT',
              color: gpColor.rgba.gray(0.5),
              pointHoverBackgroundColor: gpColor.rgba.gray(1)
            }
          ]
        },
    
        // Other: deletion, doc, etc.
        {
          id: 'other',
          title: 'GRAPH.DOC_STATS.OTHER.TITLE',
          series: [
            {
              key: 'history_delete',
              label: 'GRAPH.DOC_STATS.OTHER.HISTORY_DELETE',
              color: gpColor.rgba.gray(0.5),
              pointHoverBackgroundColor: gpColor.rgba.gray(1)
            }
          ]
        }
      ];
    
      var formatInteger = $filter('formatInteger');
    
      $scope.defaultChartOptions = {
        responsive: true,
        maintainAspectRatio: $scope.maintainAspectRatio,
        title: {
          display: true
        },
        legend: {
          display: true,
          onClick: $scope.onLegendClick
        },
        scales: {
          yAxes: [
            {
              stacked: true,
              id: 'y-axis'
            }
          ]
        },
        tooltips: {
          enabled: true,
          mode: 'index',
          callbacks: {
            label: function(tooltipItems, data) {
              return data.datasets[tooltipItems.datasetIndex].label +
                ': ' + formatInteger(tooltipItems.yLabel);
            }
          }
        }
      };
    
      $scope.init = function(e, state) {
        if (state && state.stateParams) {
          // Manage URL parameters
        }
      };
    
      $scope.load = function(updateTimePct) {
    
        return $q.all([
          // Get i18n keys (chart title, series labels, date patterns)
          $translate($scope.charts.reduce(function(res, chart) {
            return res.concat(chart.series.reduce(function(res, serie) {
              return res.concat(serie.label);
            }, [chart.title]));
          }, [
            'COMMON.DATE_PATTERN',
            'COMMON.DATE_SHORT_PATTERN',
            'COMMON.DATE_MONTH_YEAR_PATTERN'
          ])),
    
          // get Data
          gpData.docstat.get($scope.formData)
        ])
        .then(function(result) {
          var translations = result[0];
          var datePatterns = {
            hour: translations['COMMON.DATE_PATTERN'],
            day: translations['COMMON.DATE_SHORT_PATTERN'],
            month: translations['COMMON.DATE_MONTH_YEAR_PATTERN']
          };
    
          result = result[1];
          if (!result || !result.times) return; // no data
          $scope.times = result.times;
    
          // Labels
          var labelPattern = datePatterns[$scope.formData.rangeDuration];
          $scope.labels = result.times.reduce(function(res, time) {
            return res.concat(moment.unix(time).local().format(labelPattern));
          }, []);
    
          // Update range options with received values
          $scope.updateRange(result.times[0], result.times[result.times.length-1], updateTimePct);
    
          $scope.setScale($scope.scale);
    
          // For each chart
          _.forEach($scope.charts, function(chart){
    
            // Data
            chart.data = [];
            _.forEach(chart.series, function(serie){
              chart.data.push(result[serie.key]||[]);
            });
    
            // Options (with title)
            chart.options = angular.copy($scope.defaultChartOptions);
            chart.options.title.text = translations[chart.title];
    
            // Series datasets
            chart.datasetOverride = chart.series.reduce(function(res, serie) {
              return res.concat({
                yAxisID: 'y-axis',
                type: 'line',
                label: translations[serie.label],
                fill: true,
                borderColor: serie.color,
                borderWidth: 2,
                backgroundColor: serie.color,
                pointBackgroundColor: serie.color,
                pointBorderColor: gpColor.rgba.white(),
                pointHoverBackgroundColor: serie.pointHoverBackgroundColor||serie.color,
                pointHoverBorderColor: gpColor.rgba.translucent(),
                pointRadius: 3
              });
            }, []);
          });
        });
    
      };
    
      $scope.onChartClick = function(data, e, item) {
        if (!item) return;
        console.log('Click on item index='+ item._index);
        var from = $scope.times[item._index];
        var to = moment.unix(from).utc().add(1, $scope.formData.rangeDuration).unix();
      };
    
    
    }