diff --git a/mongo/max_resource_per_eos.sh b/mongo/max_resource_per_eos.sh index 016a7c8..8f8c89a 100644 --- a/mongo/max_resource_per_eos.sh +++ b/mongo/max_resource_per_eos.sh @@ -1,21 +1,21 @@ -#!/bin/bash - -url=https://api.eosnewyork.io -if [ "$1" = "" ]; then - url=$1 -fi - -account_name='eosnewyorkio' -content=$(cleos -u https://api.eosnewyork.io get account ${account_name} --json) -cpu_max=$(jq -r '.cpu_limit.max' <<< "${content}") -net_max=$(jq -r '.net_limit.max' <<< "${content}") -net_weight=$(jq -r '.net_weight' <<< "${content}") -cpu_weight=$(jq -r '.cpu_weight' <<< "${content}") - -cpu_weight_eos=`echo - | awk '{print '"$cpu_weight"' / 10000}'` -net_weight_eos=`echo - | awk '{print '"$net_weight"' / 10000}'` - -max_cpu_per_eos=`echo - | awk '{print '"$cpu_max"' / '"$cpu_weight_eos"'}'` -max_net_per_eos=`echo - | awk '{print '"$net_max"' / '"$net_weight_eos"'}'` - +#!/bin/bash + +url=https://api.eosnewyork.io +if [ "$1" = "" ]; then + url=$1 +fi + +account_name='eosnewyorkio' +content=$(cleos -u https://api.eosnewyork.io get account ${account_name} --json) +cpu_max=$(jq -r '.cpu_limit.max' <<< "${content}") +net_max=$(jq -r '.net_limit.max' <<< "${content}") +net_weight=$(jq -r '.net_weight' <<< "${content}") +cpu_weight=$(jq -r '.cpu_weight' <<< "${content}") + +cpu_weight_eos=`echo - | awk '{print '"$cpu_weight"' / 10000}'` +net_weight_eos=`echo - | awk '{print '"$net_weight"' / 10000}'` + +max_cpu_per_eos=`echo - | awk '{print '"$cpu_max"' / '"$cpu_weight_eos"'}'` +max_net_per_eos=`echo - | awk '{print '"$net_max"' / '"$net_weight_eos"'}'` + mongo EOS --eval 'db.max_resource_per_eos.insert({"date": ISODate(), "max_cpu_per_eos": '"$max_cpu_per_eos"', "max_net_per_eos": '"$max_net_per_eos"'})' \ No newline at end of file diff --git a/src/containers/Account.js b/src/containers/Account.js index e1be0c4..d3d230c 100644 --- a/src/containers/Account.js +++ b/src/containers/Account.js @@ -1,11 +1,11 @@ -import React, { Component } from 'react' -import { Provider } from "mobx-react" -import AccountStore from '../stores/AccountStore' -import AccountForm from './AccountForm' -import AccountResources from './AccountResources' -import withStyles from '@material-ui/core/styles/withStyles' -import Typography from '@material-ui/core/Typography' -import { withNamespaces } from 'react-i18next' +import React, { Component } from "react"; +import { Provider } from "mobx-react"; +import AccountStore from "../stores/AccountStore"; +import AccountForm from "./AccountForm"; +import AccountResources from "./AccountResources"; +import withStyles from "@material-ui/core/styles/withStyles"; +import Typography from "@material-ui/core/Typography"; +import { withNamespaces } from "react-i18next"; const styles = theme => ({ heroButtons: { @@ -14,20 +14,39 @@ const styles = theme => ({ acctWrapper: { marginBottom: theme.spacing.unit * 4 } -}) - -class Account extends Component { +}); +class Account extends Component { render() { - const {classes, t} = this.props + const { classes, t } = this.props; return (
- - {t('TAKE_CHARGE')} + + {t("UNDER_CONSTRUCTION")} + + + {t("TAKE_CHARGE")} - - {t('ENTER_YOUR_ACCOUNT', {currency: this.props.network.toUpperCase()})} + + {t("ENTER_YOUR_ACCOUNT", { + currency: this.props.network.toUpperCase() + })}
@@ -38,13 +57,8 @@ class Account extends Component {
- ) + ); } } -export default -withNamespaces()( - withStyles(styles)( - Account - ) -) +export default withNamespaces()(withStyles(styles)(Account)); diff --git a/src/containers/App.js b/src/containers/App.js index 3c6641a..7451a0b 100644 --- a/src/containers/App.js +++ b/src/containers/App.js @@ -1,97 +1,98 @@ -import React, { Component } from 'react' -import CssBaseline from '@material-ui/core/CssBaseline' -import Header from './Header' -import Footer from './Footer' -import Home from './Home' -import Faq from './Faq' -import Disclaimer from './Disclaimer' -import Links from './Links' -import { MuiThemeProvider, createMuiTheme } from '@material-ui/core/styles' -import { Route } from 'react-router-dom' -import { WWW_STR, EOS_NETWORK } from '../config.js' +import React, { Component } from "react"; +import CssBaseline from "@material-ui/core/CssBaseline"; +import Header from "./Header"; +import Footer from "./Footer"; +import Home from "./Home"; +import Faq from "./Faq"; +import Disclaimer from "./Disclaimer"; +import Links from "./Links"; +import { MuiThemeProvider, createMuiTheme } from "@material-ui/core/styles"; +import { Route } from "react-router-dom"; +import { WWW_STR, EOS_NETWORK } from "../config.js"; const theme = createMuiTheme({ typography: { - fontFamily: [ - '"Barlow Semi Condensed"', - 'sans-serif' - ].join(','), + fontFamily: ['"Barlow Semi Condensed"', "sans-serif"].join(",") }, palette: { primary: { - light: '#A4BDC3', - main: '#1B5A6C', - dark: '#3a93a5' + light: "#A4BDC3", + main: "#1B5A6C", + dark: "#3a93a5" }, secondary: { - main: '#A4BDC3' + main: "#A4BDC3" }, text: { - primary: '#323233', - secondary: '#7B7D7D' + primary: "#323233", + secondary: "#7B7D7D" }, background: { - paper: '#FFFFFF', - default: '#EDEDED' + paper: "#FFFFFF", + default: "#EDEDED" } } -}) +}); class App extends Component { - constructor(props) { super(props); let net = EOS_NETWORK; let hostName = window.location.host.toLowerCase().replace(WWW_STR, ""); let subdomain = hostName.split(".")[0]; - console.info(subdomain) - if(! subdomain.startsWith(net) && ! subdomain.startsWith("localhost")) { + console.info(subdomain); + if (!subdomain.startsWith(net) && !subdomain.startsWith("localhost")) { net = subdomain; } this.state = { - network: net, + network: net }; this.handleNetworkChange = this.handleNetworkChange.bind(this); } handleNetworkChange(network) { let urlPrefix = window.location.protocol + "//" + WWW_STR; - // remove www. from host - let hostName = window.location.host.toLowerCase().replace(WWW_STR, ""); - let urlSuffix = hostName + window.location.pathname + window.location.search; + // remove www. from host + let hostName = window.location.host.toLowerCase().replace(WWW_STR, ""); + let urlSuffix = + hostName + window.location.pathname + window.location.search; let url = urlPrefix + urlSuffix; - if ( network !== EOS_NETWORK) { + if (network !== EOS_NETWORK) { url = urlPrefix + network + "." + urlSuffix; - } - else { + } else { // remove subdomain if network is eos - url = url.replace(this.state.network + ".", "") + url = url.replace(this.state.network + ".", ""); } this.setState({ - network: network, + network: network }); window.location.replace(url); } render() { - - document.title = `${this.state.network.toUpperCase()} Charge` + document.title = `${this.state.network.toUpperCase()} Charge (Under Construction)`; return ( - -
-
- } /> + +
+
+ } + />
-