mirror of
https://github.com/filecoin-project/slate.git
synced 2024-11-27 10:52:41 +03:00
Merge pull request #157 from filecoin-project/@colin/analytics-api-integration
Analytics API integration
This commit is contained in:
commit
41ef4c3e2f
@ -2,6 +2,7 @@ export const POLLING_RATE = 5000;
|
||||
export const POWERGATE_HOST = "https://grpcweb.slate.textile.io";
|
||||
export const FILE_STORAGE_URL = "./public/static/files/";
|
||||
export const GITHUB_URL = "https://github.com/filecoin-project/slate";
|
||||
export const ANALYTICS_URL = "https://slate-stats-dev.azurewebsites.net/";
|
||||
|
||||
// NOTE(jim): 1 GB from Ignacio
|
||||
export const TEXTILE_ACCOUNT_BYTE_LIMIT = 1073741824;
|
||||
|
@ -4,8 +4,11 @@ import * as Powergate from "~/node_common/powergate";
|
||||
import * as Constants from "~/node_common/constants";
|
||||
|
||||
export const get = async () => {
|
||||
const analytics = {};
|
||||
|
||||
// Current endpoints available for consumption
|
||||
// Endpoints: blocks, blockParents, blockRewards, blockMessages, receipts, messages
|
||||
const endpoint = "blocks";
|
||||
const response = await fetch(Constants.ANALYTICS_URL + endpoint);
|
||||
const analytics = response.json();
|
||||
// TODO(colin): We can bind Analytics here on the server.
|
||||
return analytics;
|
||||
};
|
||||
|
@ -10,6 +10,11 @@ export const getServerSideProps = async ({ query }) => {
|
||||
|
||||
export default class ApplicationPage extends React.Component {
|
||||
render() {
|
||||
return <Application viewer={this.props.viewer} analytics={this.props.analytics} />;
|
||||
return (
|
||||
<Application
|
||||
viewer={this.props.viewer}
|
||||
analytics={this.props.analytics}
|
||||
/>
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user