diff --git a/src/common/lang/en.js b/src/common/lang/en.js index 5aab708..97bb5c5 100644 --- a/src/common/lang/en.js +++ b/src/common/lang/en.js @@ -114,7 +114,9 @@ export default { passError: 'Password error', ontidNotExist: 'The ONT ID to import does not exist on the blockchain', keystoreImport: 'ONT ID Keystore Import', - invalidKeystore: 'The keysotre you input is invalid.' + invalidKeystore: 'The keystore you input is invalid.', + ontidExist: 'The identity already exists in local.', + importSuccess: 'Import Identity succeessfully!' }, wallets: { @@ -626,7 +628,9 @@ Within their 50% share each consensus node will receive their share according to initPosInLock: "Locked", initPosRedeemable: 'Claimable', noClaimbleInitPos: 'No claimble ONT.', - redeemInitPosOk: 'Redeem' + redeemInitPosOk: 'Redeem', + hasClaimableInitPos: 'You have redeemable init pos. Plase redeem this part first.', + noClaimbleToRefund: 'No redeemable ONT to refund.' }, exchange: { exchange: 'Exchange', diff --git a/src/common/lang/zh.js b/src/common/lang/zh.js index da53f65..e7331b5 100644 --- a/src/common/lang/zh.js +++ b/src/common/lang/zh.js @@ -114,7 +114,9 @@ export default { passError: '密码错误', ontidNotExist: '要导入的ONT ID不存在于区块链上', keystoreImport: '导入ONT ID Keystore', - invalidKeystore: '您输入的keystore不正确。' + invalidKeystore: '您输入的keystore不正确。', + ontidExist: '要导入的ONT ID本地已存在。', + importSuccess: '导入ONT ID成功。' }, wallets: { @@ -621,7 +623,9 @@ export default { initPosInLock: "锁定中", initPosRedeemable: '可提取', noClaimbleInitPos: '没有可提取的初始质押。', - redeemInitPosOk: '确认提取' + redeemInitPosOk: '确认提取', + hasClaimableInitPos: '您还有可提取的初始质押。请先提取该部分ONT。', + noClaimbleToRefund: '没有可提取的ONT。无法提款。' }, exchange: { exchange: 'Exchange', diff --git a/src/core/utils.js b/src/core/utils.js index e48e661..d3cefff 100644 --- a/src/core/utils.js +++ b/src/core/utils.js @@ -187,13 +187,13 @@ export function getTokenBalanceUrl(token_type, address) { export function validateKeystorePath(path) { const system = os.platform(); - if(system.indexOf('win') > -1) { + if(system.indexOf('win') > -1 && system !== 'darwin') { const files = fs.readdirSync(path) if(files && files.indexOf('resources') > -1 && files.indexOf('OWallet.exe') > -1) { return false; } const cwd = process.cwd(); - if(path && (path === cwd || path.indexOf(cwd) > -1)) { + if(path && cwd !== '/' && (path === cwd || path.indexOf(cwd) > -1)) { return false; } } diff --git a/src/renderer/components/Identitys.vue b/src/renderer/components/Identitys.vue index b3ef9f0..38941f3 100644 --- a/src/renderer/components/Identitys.vue +++ b/src/renderer/components/Identitys.vue @@ -109,7 +109,8 @@ import IdentityView from './Identitys/IdentityView' .div-create-wallet { width: 24.63rem; height: 13.19rem; - margin-right: 3.75rem; + margin-right: 1.75rem; + margin-left:1.75rem; margin-bottom: 2.75rem; } diff --git a/src/renderer/components/Identitys/Import/BasicInfo.vue b/src/renderer/components/Identitys/Import/BasicInfo.vue index 5da6d89..34fb9b3 100644 --- a/src/renderer/components/Identitys/Import/BasicInfo.vue +++ b/src/renderer/components/Identitys/Import/BasicInfo.vue @@ -139,12 +139,12 @@ import { getRestClient, formatScryptParams } from '../../../../core/utils'; dbService.insert(wallet, function (err, newDoc) { if (err) { console.log(err) - that.$message.warning('The identity already exists in local.') + that.$message.warning(that.$t('importIdentity.ontidExist')) that.$store.dispatch('hideLoadingModals') return; } - that.$message.success('Import Identity succeessfully!') + that.$message.success(that.$t('importIdentity.importSuccess')) that.$router.push({name: 'Identitys'}) }) }, diff --git a/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue b/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue index 8b58b56..1bbc7e1 100644 --- a/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue +++ b/src/renderer/components/Node/NodeStake/NodeStakeInfo.vue @@ -114,8 +114,8 @@

{{$t('nodeStake.stakeQuantity')}}

{{current_peer.initPos}}

- -
+ +
{{$t('nodeMgmt.addInitPos')}} {{$t('nodeStake.refund')}} {{$t('nodeStake.quitNode')}} {{$t('nodeStake.newStake')}} - +
@@ -441,17 +441,27 @@ export default { }, handleRefund() { + if(this.authorizationInfo && this.authorizationInfo.claimableVal === 0) { + this.$message.warning(this.$t('nodeMgmt.noClaimbleToRefund')) + return; + } const userAddr = new Crypto.Address(this.stakeWallet.address); const peerPubkeys = [this.detail.publickey] // const withdrawList = [this.detail.stakequantity] // Fix:节点质押部分可能会增加或减少,退款应该用initPos; - const withdrawList = [this.current_peer.initPos] + // Fix2: 退款都可以用可提取部分 + const withdrawList = [this.authorizationInfo.claimableVal] const payer = userAddr const tx = GovernanceTxBuilder.makeWithdrawTx(userAddr, peerPubkeys, withdrawList, payer, GAS_PRICE, GAS_LIMIT) this.tx = tx; this.walletPassModal = true; }, handleQuitNode() { + //Fixme:退出节点前先把可提取初始质押提取出来。 + if(this.authorizationInfo && this.authorizationInfo.claimableVal > 0) { + this.$message.warning(this.$t('nodeMgmt.hasClaimableInitPos')) + return; + } const userAddr = new Crypto.Address(this.stakeWallet.address); const peerPubkey = this.detail.publickey; const payer = userAddr; diff --git a/src/renderer/components/Wallets.vue b/src/renderer/components/Wallets.vue index ab45157..6874f82 100644 --- a/src/renderer/components/Wallets.vue +++ b/src/renderer/components/Wallets.vue @@ -198,9 +198,10 @@ .normalWallet, .div-create-wallet { - width: 23.63rem; + width: 24.63rem; height: 13.19rem; - margin-right: 3.75rem; + margin-right: 1.75rem; + margin-left:1.75rem; margin-bottom: 2.75rem; } diff --git a/src/renderer/store/modules/NodeAuthorization.js b/src/renderer/store/modules/NodeAuthorization.js index f463ffc..fd3651b 100644 --- a/src/renderer/store/modules/NodeAuthorization.js +++ b/src/renderer/store/modules/NodeAuthorization.js @@ -375,6 +375,7 @@ const actions = { item.detailUrl = NODE_DETAIL + item.peerPubkey; // matchNodeName(item) }) + console.log(JSON.stringify(list)) commit('UPDATE_NODE_LIST', {list}); dispatch('hideLoadingModals')