Show "indexing in progress" in fee/reward charts during block indexing
This commit is contained in:
		
							parent
							
								
									53bb16465e
								
							
						
					
					
						commit
						bfda414aae
					
				@ -288,7 +288,6 @@ class BlocksRepository {
 | 
			
		||||
      LIMIT 10`;
 | 
			
		||||
 | 
			
		||||
    try {
 | 
			
		||||
      console.log(query, params);
 | 
			
		||||
      const [rows] = await DB.query(query, params);
 | 
			
		||||
 | 
			
		||||
      const blocks: BlockExtended[] = [];
 | 
			
		||||
 | 
			
		||||
@ -100,7 +100,21 @@ export class BlockFeesGraphComponent implements OnInit {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  prepareChartOptions(data) {
 | 
			
		||||
    let title: object;
 | 
			
		||||
    if (data.blockFees.length === 0) {
 | 
			
		||||
      title = {
 | 
			
		||||
        textStyle: {
 | 
			
		||||
          color: 'grey',
 | 
			
		||||
          fontSize: 15
 | 
			
		||||
        },
 | 
			
		||||
        text: $localize`:@@23555386d8af1ff73f297e89dd4af3f4689fb9dd:Indexing blocks`,
 | 
			
		||||
        left: 'center',
 | 
			
		||||
        top: 'center'
 | 
			
		||||
      };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    this.chartOptions = {
 | 
			
		||||
      title: title,
 | 
			
		||||
      color: [
 | 
			
		||||
        new graphic.LinearGradient(0, 0, 0, 1, [
 | 
			
		||||
          { offset: 0, color: '#FDD835' },
 | 
			
		||||
@ -159,7 +173,7 @@ export class BlockFeesGraphComponent implements OnInit {
 | 
			
		||||
          hideOverlap: true,
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      legend: {
 | 
			
		||||
      legend: data.blockFees.length === 0 ? undefined : {
 | 
			
		||||
        data: [
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Fees BTC',
 | 
			
		||||
@ -179,7 +193,7 @@ export class BlockFeesGraphComponent implements OnInit {
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      yAxis: [
 | 
			
		||||
      yAxis: data.blockFees.length === 0 ? undefined : [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'value',
 | 
			
		||||
          axisLabel: {
 | 
			
		||||
@ -210,7 +224,7 @@ export class BlockFeesGraphComponent implements OnInit {
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
      series: [
 | 
			
		||||
      series: data.blockFees.length === 0 ? undefined : [
 | 
			
		||||
        {
 | 
			
		||||
          legendHoverLink: false,
 | 
			
		||||
          zlevel: 0,
 | 
			
		||||
@ -240,7 +254,7 @@ export class BlockFeesGraphComponent implements OnInit {
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
      dataZoom: [{
 | 
			
		||||
      dataZoom: data.blockFees.length === 0 ? undefined : [{
 | 
			
		||||
        type: 'inside',
 | 
			
		||||
        realtime: true,
 | 
			
		||||
        zoomLock: true,
 | 
			
		||||
 | 
			
		||||
@ -98,9 +98,23 @@ export class BlockRewardsGraphComponent implements OnInit {
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  prepareChartOptions(data) {
 | 
			
		||||
    let title: object;
 | 
			
		||||
    if (data.blockRewards.length === 0) {
 | 
			
		||||
      title = {
 | 
			
		||||
        textStyle: {
 | 
			
		||||
          color: 'grey',
 | 
			
		||||
          fontSize: 15
 | 
			
		||||
        },
 | 
			
		||||
        text: $localize`:@@23555386d8af1ff73f297e89dd4af3f4689fb9dd:Indexing blocks`,
 | 
			
		||||
        left: 'center',
 | 
			
		||||
        top: 'center'
 | 
			
		||||
      };
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    const scaleFactor = 0.1;
 | 
			
		||||
 | 
			
		||||
    this.chartOptions = {
 | 
			
		||||
      title: title,
 | 
			
		||||
      animation: false,
 | 
			
		||||
      color: [
 | 
			
		||||
        new graphic.LinearGradient(0, 0, 0, 1, [
 | 
			
		||||
@ -159,7 +173,7 @@ export class BlockRewardsGraphComponent implements OnInit {
 | 
			
		||||
          hideOverlap: true,
 | 
			
		||||
        }
 | 
			
		||||
      },
 | 
			
		||||
      legend: {
 | 
			
		||||
      legend: data.blockRewards.length === 0 ? undefined : {
 | 
			
		||||
        data: [
 | 
			
		||||
          {
 | 
			
		||||
            name: 'Rewards BTC',
 | 
			
		||||
@ -179,7 +193,7 @@ export class BlockRewardsGraphComponent implements OnInit {
 | 
			
		||||
          },
 | 
			
		||||
        ],
 | 
			
		||||
      },
 | 
			
		||||
      yAxis: [
 | 
			
		||||
      yAxis: data.blockRewards.length === 0 ? undefined : [
 | 
			
		||||
        {
 | 
			
		||||
          type: 'value',
 | 
			
		||||
          axisLabel: {
 | 
			
		||||
@ -222,7 +236,7 @@ export class BlockRewardsGraphComponent implements OnInit {
 | 
			
		||||
          },
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
      series: [
 | 
			
		||||
      series: data.blockRewards.length === 0 ? undefined : [
 | 
			
		||||
        {
 | 
			
		||||
          legendHoverLink: false,
 | 
			
		||||
          zlevel: 0,
 | 
			
		||||
@ -251,7 +265,7 @@ export class BlockRewardsGraphComponent implements OnInit {
 | 
			
		||||
          }
 | 
			
		||||
        },
 | 
			
		||||
      ],
 | 
			
		||||
      dataZoom: [{
 | 
			
		||||
      dataZoom: data.blockRewards.length === 0 ? undefined : [{
 | 
			
		||||
        type: 'inside',
 | 
			
		||||
        realtime: true,
 | 
			
		||||
        zoomLock: true,
 | 
			
		||||
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user