Browse Source

Storage: add size

Joystream Stats 3 years ago
parent
commit
a6bc8cf665
2 changed files with 14 additions and 3 deletions
  1. 0 1
      src/components/Storage/Ranking.tsx
  2. 14 2
      src/components/Storage/index.tsx

+ 0 - 1
src/components/Storage/Ranking.tsx

@@ -36,7 +36,6 @@ const Ranking = (props: { location: string; providers: any[] }) => {
   const { location, providers } = props;
   const { location, providers } = props;
   const speeds = providers.map((provider) => calculateSpeed(provider));
   const speeds = providers.map((provider) => calculateSpeed(provider));
   const sorted = speeds.sort((a, b) => b.speed - a.speed);
   const sorted = speeds.sort((a, b) => b.speed - a.speed);
-  //console.log(location, sorted);
   return (
   return (
     <div className="col-3 mb-3">
     <div className="col-3 mb-3">
       <h3>{location}</h3>
       <h3>{location}</h3>

+ 14 - 2
src/components/Storage/index.tsx

@@ -10,6 +10,9 @@ import axios from "axios";
 interface IProps {
 interface IProps {
   assets: string[];
   assets: string[];
   providers: any[];
   providers: any[];
+  tokenomics: {
+    media: { channels: number; size: number; media_files: number };
+  };
 }
 }
 interface IState {}
 interface IState {}
 
 
@@ -121,12 +124,21 @@ class Storage extends React.Component<IProps, IState> {
       loading,
       loading,
       showTest,
       showTest,
     } = this.state;
     } = this.state;
-    const { providers, assets } = this.props;
+    const { providers, assets, tokenomics } = this.props;
 
 
     return (
     return (
       <div className="m-2 p-2 bg-light">
       <div className="m-2 p-2 bg-light">
-        <h2>Storage Providers Ranking</h2>
+        <h2>Storage Providers</h2>
+        {tokenomics ? (
+          <div className="m-2 p-2">
+            <div>Files: {tokenomics.media.media_files}</div>
+            <div>Size: {(tokenomics.media.size / 1000000000).toFixed()} GB</div>
+          </div>
+        ) : (
+          <div />
+        )}
 
 
+        <h3>Ranking</h3>
         {showTest ? (
         {showTest ? (
           <Test
           <Test
             handleChange={this.handleChange}
             handleChange={this.handleChange}