diff --git a/neo3-gui/neo3-gui/ClientApp/package-lock.json b/neo3-gui/neo3-gui/ClientApp/package-lock.json index cff176a1..ef741481 100644 --- a/neo3-gui/neo3-gui/ClientApp/package-lock.json +++ b/neo3-gui/neo3-gui/ClientApp/package-lock.json @@ -1,6 +1,6 @@ { "name": "neo-gui", - "version": "1.0.6", + "version": "1.0.7", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/neo3-gui/neo3-gui/ClientApp/package.json b/neo3-gui/neo3-gui/ClientApp/package.json index 738ec4f4..74cde797 100644 --- a/neo3-gui/neo3-gui/ClientApp/package.json +++ b/neo3-gui/neo3-gui/ClientApp/package.json @@ -1,6 +1,6 @@ { "name": "neo-gui", - "version": "1.0.6", + "version": "1.0.7", "private": true, "main": "main.js", "homepage": "./", diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/vote.js b/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/vote.js index 5fc5a9ea..f8edec9e 100644 --- a/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/vote.js +++ b/neo3-gui/neo3-gui/ClientApp/src/components/Advanced/vote.js @@ -18,7 +18,7 @@ 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 { withTranslation, Trans } from "react-i18next"; import "../../static/css/advanced.css"; import { shell } from "electron"; import {post} from '../../core/request'; @@ -50,6 +50,10 @@ class Advancedvote extends React.Component { }) }); } + clickToCopy = (text) => { + navigator.clipboard.writeText(text) + message.success(common.copied) + } listCandidate = callback => { const { t } = this.props; post("GetValidators",{}).then(function (response) { @@ -81,6 +85,7 @@ class Advancedvote extends React.Component { onVote = values =>{ const { t } = this.props; let {value} = this.state; + const _this = this; if(!value) { message.error(t('advanced.vote fail info')); return; @@ -93,15 +98,32 @@ class Advancedvote extends React.Component { var _data = response.data; if (_data.msgType === -1) { let res = _data.error; - Modal.error({ - title: t('advanced.vote fail'), - width: 400, - content: ( + let title = t('advanced.vote fail') + let content = ( +
+

{t('error code')}: {res.code}

+

{t('error msg')}: {res.message}

+
+ ); + if (res.code === 20014) { + content = (
-

{t('error code')}: {res.code}

-

{t('error msg')}: {res.message}

+
+                    { JSON.stringify(JSON.parse(res.message), null, 2) }
+                
+

+ +

- ), + ); + } + Modal.error({ + title: title, + centered: true, + width: 650, + content: content, okText: t("button.ok") }); return; diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/multitomulti.js b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/multitomulti.js index c32c55e2..19f0e97c 100644 --- a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/multitomulti.js +++ b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/multitomulti.js @@ -75,28 +75,41 @@ class Multitomulti extends React.Component{ if(_data.msgType === -1){ let res = _data.error; - const errorTitle = res.code === 20014 ? ( - t('wallet.transfer send error 20014') - ) : ( - t('wallet.transfer send error') + let title = (wallet.transfer send error); + let content = ( +
+

blockchain.transaction hash: {res.code}

+

error msg: {res.message}

+
); - Modal.warning({ - title: errorTitle, - width: 650, - centered: true, - content: ( + + if (res.code === 20014) { + title = (wallet.transfer send error 20014); + content = (
                                 { JSON.stringify(JSON.parse(res.message), null, 2) }
                             

- +

- ), - okText:t("button.confirm") - }); + ); + } + const args = { + title: title, + width: 650, + centered: true, + content: content, + okText: (button.confirm) + }; + if (res.code === 20014) { + Modal.warning(args); + } else { + Modal.error(args); + } return; }else{ Modal.success({ diff --git a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/onetomulti.js b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/onetomulti.js index 2a581975..3a43b2ab 100644 --- a/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/onetomulti.js +++ b/neo3-gui/neo3-gui/ClientApp/src/components/Transaction/onetomulti.js @@ -15,7 +15,7 @@ import { } from 'antd'; import { Layout } from 'antd'; import '../../static/css/wallet.css' -import { withTranslation } from "react-i18next"; +import { withTranslation, Trans } from "react-i18next"; import { post } from "../../core/request"; const { Option } = Select; @@ -39,6 +39,10 @@ class Onetomulti extends React.Component{ selectadd: _detail }) } + clickToCopy = (text) => { + navigator.clipboard.writeText(text) + message.success(common.copied) + } transfer = values =>{ var _this = this; const {t}=this.props; @@ -67,23 +71,47 @@ class Onetomulti extends React.Component{ }; post("SendToMultiAddress",params).then(res =>{ - var _data = res.data; - var result = res.data.result; - if(_data.msgType === -1){ + const _data = res.data; + const result = res.data.result; + if (_data.msgType === -1) { let res = _data.error; - Modal.error({ - title: t('wallet.transfer send error'), - width: 400, - content: ( + let title = (wallet.transfer send error); + let content = (
-

{t("error code")}: {res.code}

-

{t("error msg")}: {res.message}

+

blockchain.transaction hash: {res.code}

+

error msg: {res.message}

- ), - okText:t("button.confirm") - }); + ); + + if (res.code === 20014) { + title = (wallet.transfer send error 20014); + content = ( +
+
+                                { JSON.stringify(JSON.parse(res.message), null, 2) }
+                            
+

+ +

+
+ ); + } + const args = { + title: title, + width: 650, + centered: true, + content: content, + okText: (button.confirm) + }; + if (res.code === 20014) { + Modal.warning(args); + } else { + Modal.error(args); + } return; - }else{ + } else { Modal.success({ title: t('wallet.transfer send success'), content: (