Skip to content

Commit

Permalink
add under construction
Browse files Browse the repository at this point in the history
  • Loading branch information
Buddy Deck committed Nov 7, 2019
1 parent 4451846 commit efbcc35
Show file tree
Hide file tree
Showing 4 changed files with 105 additions and 91 deletions.
40 changes: 20 additions & 20 deletions mongo/max_resource_per_eos.sh
Original file line number Diff line number Diff line change
@@ -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"'})'
60 changes: 37 additions & 23 deletions src/containers/Account.js
Original file line number Diff line number Diff line change
@@ -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: {
Expand All @@ -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 (
<div className={classes.acctWrapper}>
<Typography variant="display3" align="center" color="textPrimary" gutterBottom>
{t('TAKE_CHARGE')}
<Typography
variant="display3"
align="center"
color="yellow"
gutterBottom
>
{t("UNDER_CONSTRUCTION")}
</Typography>
<Typography
variant="display3"
align="center"
color="textPrimary"
gutterBottom
>
{t("TAKE_CHARGE")}
</Typography>
<Typography variant="title" align="center" color="textSecondary" paragraph>
{t('ENTER_YOUR_ACCOUNT', {currency: this.props.network.toUpperCase()})}
<Typography
variant="title"
align="center"
color="textSecondary"
paragraph
>
{t("ENTER_YOUR_ACCOUNT", {
currency: this.props.network.toUpperCase()
})}
</Typography>
<div className={classes.heroButtons}>
<Provider store={AccountStore}>
Expand All @@ -38,13 +57,8 @@ class Account extends Component {
</Provider>
</div>
</div>
)
);
}
}

export default
withNamespaces()(
withStyles(styles)(
Account
)
)
export default withNamespaces()(withStyles(styles)(Account));
93 changes: 47 additions & 46 deletions src/containers/App.js
Original file line number Diff line number Diff line change
@@ -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 (
<MuiThemeProvider theme={theme}>
<CssBaseline />
<Header handleNetworkChange={this.handleNetworkChange} network={this.state.network}/>
<main>
<Route path="/" exact
render={(props) => <Home {...props} network={this.state.network} />} />
<CssBaseline />
<Header
handleNetworkChange={this.handleNetworkChange}
network={this.state.network}
/>
<main>
<Route
path="/"
exact
render={props => <Home {...props} network={this.state.network} />}
/>
<Route path="/faq" component={Faq} />
<Route path="/disclaimer" component={Disclaimer} />
<Route path="/links" component={Links} />
</main>
<Footer />
<Footer />
</MuiThemeProvider>
)
);
}
}

export default App
export default App;
3 changes: 1 addition & 2 deletions src/locales/en/translation.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"UNDER_CONSTRUCTION": "Under Construction",
"TAKE_CHARGE": "Take Charge of Your Account",
"FREQ_ASKED_QUES": "Frequently Asked Questions",
"ENTER_YOUR_ACCOUNT": "Enter your {{currency}} Account below to receive a custom report of how many actions you can perform on the {{currency}} Mainnet",
Expand Down Expand Up @@ -39,6 +40,4 @@
"DISCLAIMER_PARA_2": "We do not use cookies nor do we store your account name nor any personal information at EOSCharge.io. Your account name is stored locally on your computer to quickly allow you to reenter it on your next visit.",
"LINKS_DISCLAIMER": "When visiting websites outside of EOS Charge, we cannot guarantee safety or validity of who they represent. Please exercise caution and be dilligent with the security of your account keys and information. Only share information with websites that you have validated for yourself.",
"MADE_WITH_LOVE": "Made with <span role='img' aria-label='heart' aria-labelledby='heart'>❤️</span> by <a target='_blank' rel='noopener noreferrer' href='https://www.eosnewyork.io/'>EOS New York</a>"


}

0 comments on commit efbcc35

Please sign in to comment.