OSDN Git Service

update to production mode.
authorZhiting Lin <zlin035@uottawa.ca>
Mon, 16 Sep 2019 01:35:09 +0000 (09:35 +0800)
committerZhiting Lin <zlin035@uottawa.ca>
Mon, 16 Sep 2019 01:35:09 +0000 (09:35 +0800)
package.json
src/assets/img/icon/veto.svg [deleted file]
src/assets/img/icon/vote-record.svg [deleted file]
src/assets/img/icon/vote-regulation.svg [deleted file]
src/assets/language/en.js
src/models/account.js
src/models/bytom.js
src/views/assetList.vue
src/views/home.vue
src/views/sideMenu/menuSettings.vue
src/views/welcome/creation.vue

index 83d68fa..61e0736 100644 (file)
@@ -1,7 +1,7 @@
 {
     "name": "Byone",
     "description": "Bytom Chrome Extension Wallet",
-    "version": "2.0.1",
+    "version": "2.1.0",
     "author": "zhiting.fly@8btc.com",
     "license": "MIT",
     "private": true,
diff --git a/src/assets/img/icon/veto.svg b/src/assets/img/icon/veto.svg
deleted file mode 100755 (executable)
index 60c5268..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path d="M5 34V19L9 12.944H11V5.67004H29V12.944H31L35 19V34H5ZM33.049 32.05V20.95H25.949V26.95H14.066L14.015 20.95H6.95V32.05H33.049ZM12.8 19H15.948L16 25H24V19H27.186V7.46104H12.8V19ZM29 19H32.661L29.95 14.894H29V19ZM11 19V14.894H10.049L7.337 19H11Z" fill="black"/>
-<path d="M21.5167 12.5422L23.1098 10.9491C23.3379 10.721 23.3379 10.3512 23.1098 10.1232C22.8818 9.89509 22.512 9.89509 22.2839 10.1232L20.6908 11.7163C20.4627 11.9443 20.4627 12.3141 20.6908 12.5422C20.9189 12.7702 21.2887 12.7702 21.5167 12.5422Z" fill="#035BD4"/>
-<path d="M17.6984 10.2285L23.0045 15.5346C23.2325 15.7627 23.2325 16.1325 23.0045 16.3605C22.7764 16.5886 22.4066 16.5886 22.1786 16.3605L19.9385 14.1204L17.6984 16.3605C17.4703 16.5886 17.1005 16.5886 16.8725 16.3605C16.6444 16.1325 16.6444 15.7627 16.8725 15.5346L19.1126 13.2945L16.8725 11.0544C16.6444 10.8263 16.6444 10.4566 16.8725 10.2285C17.1005 10.0004 17.4703 10.0004 17.6984 10.2285Z" fill="black"/>
-</svg>
diff --git a/src/assets/img/icon/vote-record.svg b/src/assets/img/icon/vote-record.svg
deleted file mode 100755 (executable)
index 0edf344..0000000
+++ /dev/null
@@ -1,7 +0,0 @@
-<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
-<path fill-rule="evenodd" clip-rule="evenodd" d="M32 22.0703V5H8V34H21.7546C23.2207 35.8289 25.4736 37 28 37C32.4183 37 36 33.4183 36 29C36 26.0389 34.3912 23.4535 32 22.0703ZM30.2 6.8H9.8V32.2H20.6657C20.2375 31.2201 20 30.1378 20 29C20 24.5817 23.5817 21 28 21C28.763 21 29.501 21.1068 30.2 21.3063V6.8ZM34.2 29C34.2 32.4242 31.4242 35.2 28 35.2C24.5758 35.2 21.8 32.4242 21.8 29C21.8 25.5758 24.5758 22.8 28 22.8C31.4242 22.8 34.2 25.5758 34.2 29Z" fill="black"/>
-<path d="M14 14.4C13.6686 14.4 13.4 14.6686 13.4 15C13.4 15.3314 13.6686 15.6 14 15.6V14.4ZM26 15.6C26.3314 15.6 26.6 15.3314 26.6 15C26.6 14.6686 26.3314 14.4 26 14.4V15.6ZM14 15.6H26V14.4H14V15.6Z" fill="black"/>
-<path d="M14 10.4C13.6686 10.4 13.4 10.6686 13.4 11C13.4 11.3314 13.6686 11.6 14 11.6V10.4ZM26 11.6C26.3314 11.6 26.6 11.3314 26.6 11C26.6 10.6686 26.3314 10.4 26 10.4V11.6ZM14 11.6H26V10.4H14V11.6Z" fill="black"/>
-<path d="M28.6 25C28.6 24.6686 28.3314 24.4 28 24.4C27.6686 24.4 27.4 24.6686 27.4 25H28.6ZM28 29H27.4C27.4 29.3314 27.6686 29.6 28 29.6V29ZM31.5 29.6C31.8314 29.6 32.1 29.3314 32.1 29C32.1 28.6686 31.8314 28.4 31.5 28.4V29.6ZM27.4 25V29H28.6V25H27.4ZM28 29.6H31.5V28.4H28V29.6Z" fill="#035BD4"/>
-<path d="M14 18.4C13.6686 18.4 13.4 18.6686 13.4 19C13.4 19.3314 13.6686 19.6 14 19.6V18.4ZM20 19.6C20.3314 19.6 20.6 19.3314 20.6 19C20.6 18.6686 20.3314 18.4 20 18.4V19.6ZM14 19.6H20V18.4H14V19.6Z" fill="#035BD4"/>
-</svg>
diff --git a/src/assets/img/icon/vote-regulation.svg b/src/assets/img/icon/vote-regulation.svg
deleted file mode 100755 (executable)
index aacdfa0..0000000
+++ /dev/null
@@ -1,16 +0,0 @@
-<svg width="40" height="40" viewBox="0 0 40 40" fill="none" xmlns="http://www.w3.org/2000/svg">
-<rect x="4.9" y="7.4" width="30.2" height="22.2" stroke="black" stroke-width="1.8"/>
-<mask id="path-2-inside-1" fill="white">
-<rect x="9" y="10.5" width="7" height="7" rx="1"/>
-</mask>
-<rect x="9" y="10.5" width="7" height="7" rx="1" stroke="black" stroke-width="2.4" mask="url(#path-2-inside-1)"/>
-<mask id="path-3-inside-2" fill="white">
-<rect x="9" y="19.5" width="7" height="7" rx="1"/>
-</mask>
-<rect x="9" y="19.5" width="7" height="7" rx="1" stroke="#035BD4" stroke-width="2.4" mask="url(#path-3-inside-2)"/>
-<path d="M19 11.9C18.6686 11.9 18.4 12.1686 18.4 12.5C18.4 12.8314 18.6686 13.1 19 13.1V11.9ZM30 13.1C30.3314 13.1 30.6 12.8314 30.6 12.5C30.6 12.1686 30.3314 11.9 30 11.9V13.1ZM19 13.1H30V11.9H19V13.1Z" fill="black"/>
-<path d="M19 14.9C18.6686 14.9 18.4 15.1686 18.4 15.5C18.4 15.8314 18.6686 16.1 19 16.1V14.9ZM24 16.1C24.3314 16.1 24.6 15.8314 24.6 15.5C24.6 15.1686 24.3314 14.9 24 14.9V16.1ZM19 16.1H24V14.9H19V16.1Z" fill="#035BD4"/>
-<path d="M19 20.9C18.6686 20.9 18.4 21.1686 18.4 21.5C18.4 21.8314 18.6686 22.1 19 22.1V20.9ZM30 22.1C30.3314 22.1 30.6 21.8314 30.6 21.5C30.6 21.1686 30.3314 20.9 30 20.9V22.1ZM19 22.1H30V20.9H19V22.1Z" fill="black"/>
-<path d="M19 23.9C18.6686 23.9 18.4 24.1686 18.4 24.5C18.4 24.8314 18.6686 25.1 19 25.1V23.9ZM24 25.1C24.3314 25.1 24.6 24.8314 24.6 24.5C24.6 24.1686 24.3314 23.9 24 23.9V25.1ZM19 25.1H24V23.9H19V25.1Z" fill="black"/>
-<path d="M6 33H34" stroke="black" stroke-width="1.5"/>
-</svg>
index 7b3ec0b..a6a0cbc 100644 (file)
@@ -62,9 +62,9 @@ const en = {
     title:'Block Producer Voting',
     myVote:'My votes',
     totalVote:'All votes',
-    voteRecord:'voting history',
-    voteRules:'voting rules',
-    cancelVote:'veto',
+    voteRecord:'Voting History',
+    voteRules:'Voting Rules',
+    cancelVote:'Veto',
     bp:'BP',
     standbyBP:'Standby BP',
     bpName:'BP name',
index 086d775..6819fb8 100644 (file)
@@ -44,6 +44,20 @@ account.copy = function(guid) {
   return retPromise
 }
 
+account.listVapor = function(guid) {
+  let retPromise = new Promise((resolve, reject) => {
+    bytom.accounts
+      .listVaporAccountUseServer(guid)
+      .then(ret => {
+        resolve(ret)
+      })
+      .catch(error => {
+        reject(error)
+      })
+  })
+  return retPromise
+}
+
 account.balance = function(guid) {
   let retPromise = new Promise((resolve, reject) => {
     bytom.accounts
index a1ef96b..7392d7c 100644 (file)
@@ -1,8 +1,6 @@
 import Bytom from 'bytom-js-sdk'
 
 var networks = {
-  solonetvapor: 'http://52.82.55.145:3000/api/v1/vapor/',
-  solonet: 'http://52.82.55.145:3000/api/v1/btm/',
   testnetvapor: 'http://app.bycoin.io:3020/api/v1/vapor/',
   testnet: 'http://app.bycoin.io:3020/api/v1/btm/',
   mainnet: 'https://api.bycoin.im:8000/api/v1/btm/',
index 061620b..0467b53 100644 (file)
@@ -209,7 +209,8 @@ export default {
         ]),
         ...mapGetters([
           'currentAccount',
-          'currency'
+          'currency',
+          'netType'
         ])
     },
     methods: {
@@ -329,7 +330,7 @@ export default {
         this.refreshTransactions( this.start, this.limit).then(transactions => {
           this.transactions = transactions
         });
-        if(this.listVote.length == 0){
+        if(this.listVote.length == 0 && this.netType === 'vapor'){
           query.chainStatus().then(resp => {
             if(resp){
               const votes =  resp.consensus_nodes.map( (item, index) => {
index 8a3ff85..3eead09 100644 (file)
@@ -82,7 +82,7 @@
 }
 .transactions {
   font-size: 15px;
-  height: 340px;
+  height: 283px;
   overflow: auto;
 }
 .list-item {
@@ -404,8 +404,6 @@ export default {
         netTypeToggle: function (event) {
             const newNetType = event.target.value  ==='bytom'? '' :event.target.value;
 
-            console.log(newNetType)
-          console.log(this.netType)
             if( newNetType !== this.netType){
               const bytom = this.bytom.clone();
 
@@ -422,6 +420,19 @@ export default {
                   bytom.accountList[objectIndex].vpAddress = accounts.vpAddress
 
                   this[Actions.UPDATE_STORED_BYTOM](bytom)
+                }).catch(e =>{
+                  if(e.message == 'Error: wallet has exist'){
+                    account.listVapor(this.currentAccount.guid).then(accounts => {
+                      //update currentAccount
+                      bytom.currentAccount = accounts
+
+                      const objectIndex = bytom.accountList.findIndex(a => a.guid == this.currentAccount.guid)
+                      bytom.accountList[objectIndex].vpAddress = accounts.vpAddress
+
+                      this[Actions.UPDATE_STORED_BYTOM](bytom)
+                    })
+
+                  }
                 })
               }else{
                 this[Actions.UPDATE_STORED_BYTOM](bytom)
index 4a3173b..2490d01 100644 (file)
@@ -79,7 +79,6 @@ export default {
             networks: [
               { label: this.$t('main.mainNet'), value: "mainnet" },
               { label: this.$t('main.testNet'), value: "testnet" },
-              { label: this.$t('main.soloNet'), value: "solonet" }
             ],
             selected: { label: "中文", value: "cn" },
             hashVersion: "",
@@ -183,9 +182,6 @@ export default {
               case 'testnet':
                 network = this.networks[1]
                 break;
-              case 'solonet':
-                network = this.networks[2]
-                break;
             }
             this.setupNetwork(network);
           }
index 953df2b..c9479ad 100644 (file)
@@ -197,8 +197,6 @@ import * as Actions from '@/store/constants';
 
 let mainNet = null;
 let testNet = null;
-let soloNet = null;
-let vaporTestnet = null;
 export default {
     name: "",
     data() {
@@ -334,21 +332,13 @@ export default {
     mounted() {
         mainNet = { label: this.$t('main.mainNet'), value: "mainnet" };
         testNet = { label: this.$t('main.testNet'), value: "testnet" };
-        soloNet = { label: this.$t('main.soloNet'), value: "solonet" };
-        // vaporTestnet = { label: this.$t('main.vaporTestnet'), value: "vaporTestnet" };
-        this.nets = [mainNet, testNet,soloNet];
+        this.nets = [mainNet, testNet];
         if (this.net != undefined) {
             if (this.net == "mainnet") {
                 this.selected = mainNet;
             } else if (this.net == "testnet") {
                 this.selected = testNet;
-            } else if (this.net == "solonet") {
-                this.selected = soloNet;
             }
-
-            // else if (this.net == "vaporTestnet") {
-            //     this.selected = vaporTestnet;
-            // }
         } else {
             this.selected = mainNet;
         }