Skip to content

Commit

Permalink
Merge pull request #143 from Ashuaidehao/dev-back
Browse files Browse the repository at this point in the history
v1.4.4
  • Loading branch information
Ashuaidehao committed Sep 23, 2022
2 parents 0cd1fdf + b3ec0c8 commit 6b9598d
Show file tree
Hide file tree
Showing 50 changed files with 1,153 additions and 1,394 deletions.
2 changes: 1 addition & 1 deletion neo3-gui/neo3-gui/ClientApp/gui-config.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"Host": "localhost",
"Port": 8081,
"RPCURL": "http://localhost:8081",
"Language": "",
"Network": "mainnet"
}
4 changes: 2 additions & 2 deletions neo3-gui/neo3-gui/ClientApp/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion neo3-gui/neo3-gui/ClientApp/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "neo-gui",
"version": "1.4.3",
"version": "1.4.4",
"private": true,
"main": "main.js",
"homepage": "./",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
"transaction info": "Transaction Info",
"transactions": "Transactions",
"unconfirmed transactions": "Unconfirmed Transactions",
"witness": "Witness"
"witness": "Witness",
"search input-invalid": "input block is not exist"
},
"button": {
"cancel": "Cancel",
Expand Down Expand Up @@ -194,11 +195,12 @@
"please input password": "Please input password",
"please select file location": "Please select file location",
"search": {
"chain-hint": "Pelese input height",
"chain-hint": "Please input height or hash",
"check again": "Please check input",
"hash unexist": "The hash not exist,please check again",
"hash-hint": "Pelese input hash",
"height unexist": "The height not exist,please check again"
"height unexist": "The height not exist,please check again",
"asset-search-hint": "please input asset hash"
},
"select account": "Select Address",
"select path": "Select Path",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,8 @@
"transaction info": "交易信息",
"transactions": "交易列表",
"unconfirmed transactions": "待确认交易",
"witness": "见证人"
"witness": "见证人",
"search input-invalid": "查询的区块不存在"
},
"button": {
"cancel": "取消",
Expand Down Expand Up @@ -194,11 +195,12 @@
"please input password": "请输入密码",
"please select file location": "请选择文件存储位置",
"search": {
"chain-hint": "输入需要查找的 height",
"chain-hint": "输入需要查找的高度或Hash",
"check again": "请检查输入是否正确",
"hash unexist": "该合约hash不存在,请查证后再输入",
"hash-hint": "输入需要查找的脚本散列",
"height unexist": "该高度不存在,请查证后再输入"
"height unexist": "该高度不存在,请查证后再输入",
"asset-search-hint": "请输入资产Hash"
},
"select account": "选择地址",
"select path": "选择路径",
Expand Down
137 changes: 55 additions & 82 deletions neo3-gui/neo3-gui/ClientApp/src/components/Advanced/candidate.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
/* eslint-disable */
import React from "react";
import "antd/dist/antd.css";
import axios from "axios";
import {
Checkbox,
PageHeader,
Expand All @@ -20,6 +19,7 @@ import { observer, inject } from "mobx-react";
import { withRouter } from "react-router-dom";
import { withTranslation } from "react-i18next";
import "../../static/css/advanced.css";
import { postAsync } from "../../core/request";

const { Option } = Select;

Expand All @@ -45,92 +45,65 @@ class Advancedcandidate extends React.Component {
});
});
}
listPublicKey = (callback) => {
listPublicKey = async (callback) => {
const { t } = this.props;
axios
.post("http://localhost:8081", {
id: "1",
method: "ListCandidatePublicKey",
})
.then(function (response) {
var _data = response.data;
console.log(_data);
if (_data.msgType === -1) {
let res = _data.error;
Modal.error({
title: t("contract.fail title"),
width: 400,
content: (
<div className="show-pri">
<p>
{t("error code")}: {res.code}
</p>
<p>
{t("error msg")}: {res.message}
</p>
</div>
),
okText: t("button.ok"),
});
return;
} else if (_data.msgType === 3) {
callback(_data);
}
})
.catch(function (error) {
console.log(error);
console.log("error");
let response = await postAsync("ListCandidatePublicKey");
if (response.msgType === -1) {
let res = response.error;
Modal.error({
title: t("contract.fail title"),
width: 400,
content: (
<div className="show-pri">
<p>
{t("error code")}: {res.code}
</p>
<p>
{t("error msg")}: {res.message}
</p>
</div>
),
okText: t("button.ok"),
});
return;
}
callback(response);
};
onCandidate = (fieldsValue) => {
onCandidate = async (fieldsValue) => {
const { t } = this.props;
axios
.post("http://localhost:8081", {
id: "1",
method: "ApplyForValidator",
params: {
pubkey: fieldsValue.pubkey,
},
})
.then(function (response) {
var _data = response.data;
console.log(_data);
if (_data.msgType === -1) {
let res = _data.error;
Modal.error({
title: t("advanced.candidate fail"),
width: 400,
content: (
<div className="show-pri">
<p>
{t("error code")}: {res.code}
</p>
<p>
{t("error msg")}: {res.message}
</p>
</div>
),
okText: t("button.ok"),
});
return;
} else if (_data.msgType === 3) {
Modal.success({
title: t("advanced.candidate success"),
width: 400,
content: (
<div className="show-pri">
<p>TxID : {_data.result.txId ? _data.result.txId : "--"}</p>
</div>
),
okText: t("button.ok"),
});
return;
}
})
.catch(function (error) {
console.log(error);
console.log("error");
let response = await postAsync("ApplyForValidator", {
pubkey: fieldsValue.pubkey,
});
if (response.msgType === -1) {
let res = response.error;
Modal.error({
title: t("advanced.candidate fail"),
width: 400,
content: (
<div className="show-pri">
<p>
{t("error code")}: {res.code}
</p>
<p>
{t("error msg")}: {res.message}
</p>
</div>
),
okText: t("button.ok"),
});
return;
}

Modal.success({
title: t("advanced.candidate success"),
width: 400,
content: (
<div className="show-pri">
<p>TxID : {response.result.txId ? response.result.txId : "--"}</p>
</div>
),
okText: t("button.ok"),
});
};
render = () => {
const { t } = this.props;
Expand Down
104 changes: 47 additions & 57 deletions neo3-gui/neo3-gui/ClientApp/src/components/Advanced/designrole.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,14 +11,16 @@ import {
Col,
Form,
Select,
Button,
message} from 'antd';
Button,
message
} from 'antd';
import { Layout } from 'antd';
import Sync from '../sync';
import { observer, inject } from "mobx-react";
import { withRouter } from "react-router-dom";
import { withTranslation } from "react-i18next";
import "../../static/css/advanced.css";
import { postAsync } from '../../core/request';

const { Option } = Select;
const { Content } = Layout;
Expand All @@ -31,27 +33,15 @@ class Advanceddesignrole extends React.Component {
super(props);
this.state = {
size: 'default',
rolelist: [{type:4,role:"StateValidator"},{type:8,role:"Oracle"}],
rolelist: [{ type: 4, role: "StateValidator" }, { type: 8, role: "Oracle" }],
};
}
onRole = fieldsValue =>{
onRole = async (fieldsValue) => {
const { t } = this.props;
axios.post('http://localhost:8081', {
"id": "1",
"method": "GetNodesByRole",
"params":{
"role":fieldsValue.role
}
})
.then(function (response) {
var _data = response.data;
console.log(_data);
return;
})
.catch(function (error) {
console.log(error);
console.log("error");
let response = await postAsync("GetNodesByRole", {
"role": fieldsValue.role
});
console.log(response);
}
render = () => {
const { t } = this.props;
Expand All @@ -62,44 +52,44 @@ class Advanceddesignrole extends React.Component {
<Content className="mt3">
<Row gutter={[30, 0]} style={{ 'minHeight': 'calc( 100vh - 120px )' }}>
<Col span={24} className="bg-white pv4">
<PageHeader title={t('指派节点角色')}></PageHeader>
<div className="pa3">
<Alert
className="mt3 mb3"
type="warning"
message="我也不知道该写什么,就先这么写吧"
showIcon
/>
<Form ref="formRef" onFinish={this.onRole}>
<h4 className="bolder mb4">{t('advanced.be candidate')}</h4>
<Form.Item
name="节点角色类型"
className="select-role"
rules={[
{
required: true,
message: t("必须选择想要查询的节点"),
},
]}
>
<Select
placeholder={t("advanced.select address")}
style={{ width: '100%' }}
onChange={this.setAddress}>
{rolelist.map((item)=>{
return(
<Option key={item.role}>{item.name}</Option>
)
})}
</Select>
</Form.Item>
<p className="text-c mt3">
<Button type="primary" htmlType="submit" disabled={disabled} loading={this.state.iconLoading}>
{t("button.confirm")}
</Button>
</p>
</Form>
<PageHeader title={t('指派节点角色')}></PageHeader>

<div className="pa3">
<Alert
className="mt3 mb3"
type="warning"
message="我也不知道该写什么,就先这么写吧"
showIcon
/>
<Form ref="formRef" onFinish={this.onRole}>
<h4 className="bolder mb4">{t('advanced.be candidate')}</h4>
<Form.Item
name="节点角色类型"
className="select-role"
rules={[
{
required: true,
message: t("必须选择想要查询的节点"),
},
]}
>
<Select
placeholder={t("advanced.select address")}
style={{ width: '100%' }}
onChange={this.setAddress}>
{rolelist.map((item) => {
return (
<Option key={item.role}>{item.name}</Option>
)
})}
</Select>
</Form.Item>
<p className="text-c mt3">
<Button type="primary" htmlType="submit" disabled={disabled} loading={this.state.iconLoading}>
{t("button.confirm")}
</Button>
</p>
</Form>
</div>
</Col>
</Row>
Expand Down
Loading

0 comments on commit 6b9598d

Please sign in to comment.