Skip to content
This repository has been archived by the owner on Dec 19, 2020. It is now read-only.

Commit

Permalink
show rank
Browse files Browse the repository at this point in the history
  • Loading branch information
MicrowaveDev committed Jun 16, 2019
1 parent e10cd02 commit 42bfbf5
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ <h2>Search Content</h2>
<div v-else>
<div v-for="item in searchResults" style="margin-top: 15px;">
<a :href="'https://cloudflare-ipfs.com/ipfs/' + item.cid" target="_blank"><pretty-hex :hex="item.cid"></pretty-hex></a>
<span style="margin-left: 5px;">({{item.rank}})</span>
</div>
</div>
</div>
5 changes: 5 additions & 0 deletions src/popup/router/pages/Cabinet/CyberDCabinet/Search/Search.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import { AppWallet, CoinType, getIpfsHash, StorageVars } from '../../../../../../services/data';
import { CyberD } from '../../../../../../services/cyberd';
import EthData from '@galtproject/frontend-core/libs/EthData';

const _ = require('lodash');
const pIteration = require('p-iteration');
Expand All @@ -22,6 +23,10 @@ export default {
return;
}
this.searchResults = await CyberD.search(await getIpfsHash(this.search));
this.searchResults = this.searchResults.map(item => {
item.rank = EthData.roundToDecimal(item.rank, 6);
return item;
});
this.loading = false;
},
},
Expand Down

0 comments on commit 42bfbf5

Please sign in to comment.