Skip to content

Commit

Permalink
Merge pull request #26 from neo-ngd/dev-front
Browse files Browse the repository at this point in the history
Dev front
  • Loading branch information
longfeiWan9 committed Apr 3, 2020
2 parents 002ffea + 6250f91 commit e33fe82
Show file tree
Hide file tree
Showing 22 changed files with 994 additions and 1,252 deletions.
34 changes: 28 additions & 6 deletions neo3-gui/neo3-gui/ClientApp/public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,24 +28,39 @@
"next": "Next",
"ok": "OK",
"prev": "Prev",
"send": "Send"
"send": "Send",
"search":"Search"
},
"input":{
"required":"This input is required.",
"checked":"Please confirm all input."
},
"address book":"Address",
"byte": "Byte",
"bytes": "Bytes",
"confirm count": "Confirmations",
"contract": "Contract",
"contract page": {
"deploy contract": "Deploy Contract",
"deploy contract nav": "Deploy Contract",
"deploy contract nav": "Deploy",
"deploy success": "Deploy successfully, please wait for confirmation",
"invoke contract nav": "Invoke Contract",
"invoke contract": "Invoke Contract",
"invoke contract nav": "Invoke",
"invoke fail title": "Invoke failed, please check and retry",
"invoke result": "Invoke Result",
"please select file path": "Please select file path",
"search contract": "Search Contract",
"search contract nav": "Search Contract",
"search contract nav": "Search",
"select {file} path title": "Select {{file}} file",
"test invoke": "Test Invoke"
"test deploy": "Test Deploy",
"test invoke": "Test Invoke",
"test result": "Test Result",
"search fail": "Please check the hash and try again",
"search input check": "Please fill the hash",
"choose account":"Choose account",
"cosigners":"Cosigners",
"invoke method":"Invoke method",
"select method":"Select method",
"parameters":"Parameters"
},
"copyright": "Copyright",
"count": "Count",
Expand Down Expand Up @@ -90,6 +105,7 @@
"unconfirmed transactions": "Unconfirmed Transactions",
"verification script": "Verification Script",
"wallet": "Wallet",
"open wallet first": "Please open wallet",
"wallet page": {
"accounts nav": "Accounts",
"assets": "Assets",
Expand Down Expand Up @@ -134,8 +150,14 @@
"transfer asset": "Asset",
"transfer nav": "Transfer",
"transfer send success": "Send Success",
"transfer send error":"Send failed, please try again later",
"transfer warning": "Safety tip: Do not transfer money to strangers easily.Please confirm the receiving account, transfer amount and asset type carefully.Please carefully identify assets with the same name to avoid being cheated.Do not transfer money to the receiving account (address) of other blockchain.",
"wallet opened": "Wallet is opened"
},
"transaction page":{
"confirmed":"Confirmed",
"unconfirmed":"Unconfirmed"
},
"transaction list":"Transaction list",
"witness": "Witness"
}
30 changes: 26 additions & 4 deletions neo3-gui/neo3-gui/ClientApp/public/locales/zh/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,14 @@
"next": "下一步",
"ok": "确认",
"prev": "上一步",
"send": "发送"
"send": "发送",
"search":"搜索"
},
"input":{
"required":"该输入框为必填项",
"checked":"请确认已经输入完毕"
},
"address book":"地址簿",
"byte": "字节",
"bytes": "字节",
"confirm count": "确认数",
Expand All @@ -38,14 +44,23 @@
"deploy contract": "部署合约",
"deploy contract nav": "部署合约",
"deploy success": "交易发送成功,请等待区块确认",
"invoke contract": "调用合约",
"invoke contract nav": "调用合约",
"invoke fail title": "运行失败,请检查后再尝试",
"invoke result": "运行结果",
"please select file path": "请选择文件后再试",
"search contract": "搜索合约",
"search contract nav": "搜索合约",
"select {file} path title": "选择需要的{{file}}文件",
"test invoke": "试运行"
"test deploy": "试运行",
"test invoke": "试运行",
"test result": "运行结果",
"search fail": "请正确输入需要查找的hash",
"search input check": "请输入后再试",
"choose account":"选择账户",
"cosigners":"附加签名",
"fail title": "运行失败,请检查后再尝试",
"invoke method":"调用方法",
"select method":"选择方法",
"parameters":"参数列表"
},
"copyright": "保留所有权利",
"count": "数量",
Expand Down Expand Up @@ -90,6 +105,7 @@
"unconfirmed transactions": "待确认交易",
"verification script": "验证脚本",
"wallet": "钱包",
"open wallet first": "请先打开钱包",
"wallet page": {
"accounts nav": "账户列表",
"assets": "资产列表",
Expand Down Expand Up @@ -134,8 +150,14 @@
"transfer asset": "发送资产",
"transfer nav": "转账",
"transfer send success": "交易发送成功",
"transfer send error":"交易发送失败,请检查后再试",
"transfer warning": "安全提示:请勿轻易向陌生人转账。请仔细确认收款账户、转账金额、资产类型。请仔细辨别相同资产名称的资产,避免被骗。请勿向其它区块链的收款账户(地址)转账。",
"wallet opened": "钱包文件已打开"
},
"transaction page":{
"confirmed":"已完成",
"unconfirmed":"待确认"
},
"transaction list":"交易列表",
"witness": "见证人"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
/* eslint-disable */
import React from 'react';
import 'antd/dist/antd.css';
import '../../static/css/menu.css'
import '../../static/css/wallet.css'
import { Layout, Menu, Icon } from 'antd';
import { Link } from 'react-router-dom';
import MenuDown from '../Common/menudown'
import {
HomeOutlined,
RadiusUpleftOutlined
} from '@ant-design/icons';
import { withTranslation } from 'react-i18next';



const { Sider } = Layout;
const { SubMenu } = Menu;

@withTranslation()
class Advancedlayout extends React.Component {
constructor(props) {
super(props);
this.state = {
size: 'default'
};
}
render = () => {
const { t } = this.props;
return (
<div style={{ height: '100%' }}>
<Sider style={{ height: '100%' }} >
<Menu
className="menu-scroll"
theme="light"
defaultSelectedKeys={['1']}
defaultOpenKeys={['sub1']}
mode="inline"
>
<Menu.Item>
<Link to="/"><HomeOutlined />{t("home page")}</Link>
</Menu.Item>
<SubMenu
key="sub1"
title={
<span>
<RadiusUpleftOutlined />
<span>{t("blockchain")}</span>
</span>
}
>
<Menu.Item key="1" ><Link to="/advanced">{t("blockchain page.blocks nav")}</Link></Menu.Item>
<Menu.Item key="2" ><Link to="/advanced/transaction">{t("blockchain page.transactions nav")}</Link></Menu.Item>
<Menu.Item key="3" ><Link to="/advanced/asset">{t("blockchain page.asset nav")}</Link></Menu.Item>
</SubMenu>
</Menu>
<MenuDown />
</Sider>
</div>
);
}
}

export default Advancedlayout;
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,11 @@ import axios from 'axios';
import Intitle from '../Common/intitle';
import Transaction from '../Transaction/transaction';
import Sync from '../sync';
import { withTranslation } from 'react-i18next';

const { Content } = Layout;

@withTranslation()
class Assetdetail extends React.Component{
constructor(props){
super(props);
Expand All @@ -28,7 +30,7 @@ class Assetdetail extends React.Component{
})
}
getAsset = () =>{
console.log("数据暂无")
// console.log("数据暂无")
// var _this = this;
// let _height = this.state.height;
// axios.post('http://localhost:8081', {
Expand Down Expand Up @@ -66,6 +68,7 @@ class Assetdetail extends React.Component{
}
render(){
const {blockdetail,witness,nonce} = this.state;
const { t } = this.props;
return (
<Layout className="gui-container">
<Sync/>
Expand Down Expand Up @@ -98,7 +101,7 @@ class Assetdetail extends React.Component{
</div>
</Col>
</Row> */}
<Transaction content="交易列表" page="assetdetail"/>
<Transaction content={t("transaction list")} page="assetdetail"/>
</Content>
</Layout>
);
Expand Down
92 changes: 27 additions & 65 deletions neo3-gui/neo3-gui/ClientApp/src/components/Common/addressdetail.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,20 +2,28 @@
//just test replace wallet//
import React from 'react';
import axios from 'axios';

import { observer, inject } from "mobx-react";
import { withRouter } from "react-router-dom";
import {Link} from 'react-router-dom';
import { Layout, Row, Col, Modal,List, Button,Typography, message } from 'antd';
import Sync from '../sync';
import Intitle from '../Common/intitle';
import Transaction from '../Transaction/transaction';
import '../../static/css/wallet.css';
import Topath from '../Common/topath';
import { withTranslation } from 'react-i18next';
import {
CloseCircleOutlined
} from '@ant-design/icons';

const { confirm } = Modal;
const { Content } = Layout;

@withTranslation()
@inject("walletStore")
@observer
@withRouter
class Addressdetail extends React.Component{
constructor(props){
super(props);
Expand All @@ -28,74 +36,28 @@ class Addressdetail extends React.Component{
};
}
componentDidMount() {
this.checkAddress();
this.getBalances();
}
checkAddress = () =>{
let _add = location.pathname.split(":").pop();
this.setState({address:_add})
}
getBalances = () =>{
var _this = this;
let _add = location.pathname.split(":").pop();
axios.post('http://localhost:8081', {
"id":"51",
"method": "GetAddressBalance",
"params":{
// "addresses":[_add]
}
})
.then(function (response) {
var _data = response.data;
console.log(_data);
console.log(response);
if(_data.msgType === -1){
console.log(_data);
return;
}else{
if(_data.result.length>0){
_this.setState({
addresslist:_data.result,
})
}
}
console.log(_this.state)
})
.catch(function (error) {
console.log(error);
console.log("error");
});
}
render = () =>{
const { addresslist,address } = this.state;
const accounts = this.props.walletStore.accountlist;
const { t } = this.props;
return (
<Layout className="gui-container wa-detail">
<Topath topath={this.state.topath}></Topath>
<Sync />
<Content className="mt3">
<Row gutter={[30, 0]}>
<Col span={24} className="bg-white pv4">
<Intitle content="账户列表"/>
<List
header={<div>{address}</div>}
footer={<span></span>}
itemLayout="horizontal"
dataSource={addresslist.balances}
renderItem={item => (
<List.Item className="wa-half">
<Typography.Text className="font-s">
<span className="upcase">{item.symbol}</span>
<span>{item.balance}</span>
</Typography.Text>
</List.Item>
)}
/>
<div className="mb4 text-r"></div>
</Col>
</Row>
<Transaction page="walletdetail" content="交易列表"/>
</Content>
</Layout>
<div>
<h4>{t("address book")}</h4>
<ul className="add-mark">
{accounts.map((item,index)=>{
return(
<li key={index}>
{item.address} <span className="float-r mr2 small">NEO {item.neo}</span>
{/* <span className="mr2 small">NEO {item.neo}</span>
<span className="small">GAS {item.gas}</span> */}
</li>
)
})}
</ul>
<div className="mt1 mb3 text-c small">
<p className="mb5 t-light">NeoGUI @ 2020 Neo-Project {t("copyright")}</p>
</div>
</div>
);
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class DataConverter {
*/
toScriptHash(address){
var bytes= bs58check.decode(address);
return "0x"+ this.reverseHexString(Buffer.from(bytes).toString("hex").slice(2));
return "0x"+ Buffer.from(bytes).toString("hex").slice(2);
}


Expand All @@ -42,8 +42,6 @@ class DataConverter {
}
return hexString.match(/../g).reverse().join("");
}

}


export default DataConverter;
Loading

0 comments on commit e33fe82

Please sign in to comment.