diff --git a/.gitignore b/.gitignore index 94f16f36..de73ec7f 100644 --- a/.gitignore +++ b/.gitignore @@ -11,5 +11,6 @@ package-lock.json *.ntvs* *.njsproj *.sln -v0.*.js -v0.*.js.gz \ No newline at end of file +v0.*.*.js +v0.*.*.js.gz +dist/ace/ diff --git a/Changelog.md b/Changelog.md index d994eb6e..6d6ffed3 100644 --- a/Changelog.md +++ b/Changelog.md @@ -1,3 +1,23 @@ + +### v1.5.2(2021-07-16) + +**Add** +- 优化合约Java项目导出功能,支持批量编译合约,支持多用户与channel端口检查 +- 合约仓库新增资产合约模板 +- 优化交易弹窗,支持无私钥用户时直接创建私钥 +- 支持开发者导出私钥、支持合约IDE绑定合约地址 + +**Fix** +- 修复异常合约列表排序 +- 修复权限管理页面切换群组问题 + +**兼容性** +- 支持FISCO-BCOS v2.4.x 及以上版本 +- WeBASE-Node-Manager v1.5.2+ + +详细了解,请阅读[**技术文档**](https://webasedoc.readthedocs.io/zh_CN/latest/)。 + + ### v1.5.1(2021-05-28) **Add** diff --git a/config/index.js b/config/index.js index 07d6f112..0e97035d 100755 --- a/config/index.js +++ b/config/index.js @@ -12,9 +12,9 @@ module.exports = { assetsPublicPath: '/', proxyTable: { '/mgr': { - target: 'http://127.0.0.1/', + target: 'http://127.0.0.1/', changeOrigin: true, - pathRewrite: { + pathRewrite: { '^/mgr': '' } }, diff --git a/dist/index.html b/dist/index.html index 5948c326..d7a2973c 100644 --- a/dist/index.html +++ b/dist/index.html @@ -21,7 +21,7 @@ height: 100%; margin: 0px; padding: 0px; - }
diff --git a/src/views/abiList/index.vue b/src/views/abiList/index.vue index 00362c80..54277455 100644 --- a/src/views/abiList/index.vue +++ b/src/views/abiList/index.vue @@ -38,14 +38,14 @@ - + - + - + diff --git a/src/views/blockInfo/blockInfo.vue b/src/views/blockInfo/blockInfo.vue index 0b9e6b7c..a6b9a48b 100755 --- a/src/views/blockInfo/blockInfo.vue +++ b/src/views/blockInfo/blockInfo.vue @@ -181,6 +181,8 @@ export default { clearText: function () { this.getBlockList() + this.$route.query.blockNumber="" + this.searchKey.value="" }, copyPubilcKey(val) { if (!val) { diff --git a/src/views/chaincode/components/code.vue b/src/views/chaincode/components/code.vue index e50c682d..ac213e0d 100755 --- a/src/views/chaincode/components/code.vue +++ b/src/views/chaincode/components/code.vue @@ -62,6 +62,7 @@ +
@@ -91,7 +92,7 @@
{{successInfo}}
-
+
contractAddress @@ -101,6 +102,11 @@ {{$t('text.register')}}
+
+ contractAddress + + {{$t('text.addContractAddress')}} +
contractName @@ -138,6 +144,17 @@ + + + + + + +
+ {{$t('dialog.cancel')}} + {{$t('dialog.confirm')}} +
+
@@ -197,6 +214,8 @@ export default { code: "", status: 0, abiFile: "", + // abi is empty list + abiEmpty: true, bin: "", contractAddress: "", contractName: "", @@ -235,12 +254,38 @@ export default { mgmtCnsVisible: false, mgmtCnsItem: {}, activeNames: ['0'], - isDeployedModifyEnable: false + isDeployedModifyEnable: false, + isFinishComplie: false, + addContractAddressVisible: false, + contractForm: { + contractAddress: "" + }, + rules: { + contractAddress: [ + { + required: true, + message: this.$t("rule.contractAddress"), + trigger: "blur", + }, + { + pattern: /^[0x|0X]+[A-Fa-f0-9]+$/, + message: this.$t("rule.contractAddressHex"), + trigger: "blur", + }, + { + min: 42, + max: 42, + message: this.$t("rule.contractAddressLong"), + trigger: "blur", + }, + ] + } }; }, beforeDestroy: function () { Bus.$off("select") Bus.$off("noData") + Bus.$off("javaProjectComplie") }, beforeMount() { @@ -260,6 +305,7 @@ export default { this.version = ""; this.status = null; this.abiFile = ""; + this.abiEmpty = true; this.contractAddress = ""; this.errorMessage = ""; this.contractName = ""; @@ -271,6 +317,9 @@ export default { this.aceEditor.setValue(this.content); this.status = data.contractStatus; this.abiFile = data.contractAbi; + if (this.abiFile && this.abiFile != '[]') { + this.abiEmpty = false + } this.contractAddress = data.contractAddress; this.errorMessage = data.description || ""; this.contractName = data.contractName; @@ -291,12 +340,31 @@ export default { this.version = ""; this.status = null; this.abiFile = ""; + this.abiEmpty = true; this.contractAddress = ""; this.errorMessage = ""; this.contractName = ""; this.content = ""; this.bin = ""; }) + Bus.$on('javaProjectComplie', data=>{ + this.contractName = data.contractName + this.content = Base64.decode(data.contractSource); + console.log(this.code) + this.abiFile = data.contractAbi; + this.bin = data.contractBin; + this.data.contractVersion = data.contractVersion; + this.data.contractAddress = data.contractAddress; + this.data.contractName = data.contractName; + this.data.contractAbi = data.contractAbi; + this.data.bytecodeBin = data.bytecodeBin; + this.data.contractBin = data.contractBin; + this.data.contractId = data.contractId; + this.data.contractPath = data.contractPath; + this.data.contractSource = data.contractSource; + localStorage.setItem("isFinishCompile", "no") + this.compile() + }) }, watch: { content: function (val) { @@ -549,11 +617,11 @@ export default { } } }, - compile() { + compile() { this.loading = true; let version = this.$store.state.versionData; if (version && version.net !== 0) { - this.compileHighVersion() + this.compileHighVersion() } else { setTimeout(() => { this.compileLowVersion() @@ -561,7 +629,7 @@ export default { } }, - compileHighVersion() { + compileHighVersion(callback) { let that = this this.refreshMessage(); this.contractList = this.$store.state.contractDataList @@ -605,7 +673,8 @@ export default { that.errorMessage = output.errors; that.errorInfo = that.$t("contracts.contractCompileFail"); that.loading = false; - } + } + } else { console.log(ev.data); console.log(JSON.parse(ev.data.data)) @@ -616,7 +685,7 @@ export default { that.errorMessage = ev; that.compileShow = true; that.loading = false; - }) + }) console.log('wwww:', w) }, compileLowVersion: function () { @@ -685,6 +754,9 @@ export default { this.successInfo = this.$t("contracts.compileSuccess"); this.abiFile = compiledMap.abi; this.abiFile = JSON.stringify(this.abiFile); + if (this.abiFile && this.abiFile != '[]') { + this.abiEmpty = false + } this.bin = compiledMap.evm.deployedBytecode.object; this.bytecodeBin = compiledMap.evm.bytecode.object; this.data.contractAbi = this.abiFile; @@ -694,6 +766,7 @@ export default { this.loading = false; Bus.$emit("compile", this.data); this.setMethod(); + localStorage.setItem("isFinishCompile", "yes") } else { this.$message({ type: "error", @@ -713,6 +786,50 @@ export default { exportJava() { this.$store.dispatch('set_exportProject_show_action', true) }, + addContractAddress(){ + this.contractForm.contractAddress = ""; + this.addContractAddressVisible = true; + }, + closeContractAddress() { + this.addContractAddressVisible = false; + this.contractForm.contractAddress = ""; + }, + sureContractAddress(formName) { + this.$refs[formName].validate(valid => { + if (valid) { + if (this.contractForm.contractAddress=='' || this.contractForm.contractAddress==null) { + this.$message({ + type: "error", + message: this.$t('contracts.contractAddressInput') + }); + } else { + this.addContractAddressVisible = false; + this.addContract() + } + } else { + return false; + } + }); + }, + // todo add contract address all hex string and start with 0x + // 正则判断 + // todo 保存后加一个Close函数 刷新当前的ID数据 + addContract: function () { + let reqData = { + groupId: localStorage.getItem("groupId"), + contractName: this.data.contractName, + contractPath: this.data.contractPath, + contractSource: this.data.contractSource, + contractAbi: this.data.contractAbi, + contractBin: this.data.contractBin, + bytecodeBin: this.data.bytecodeBin, + contractAddress : this.contractForm.contractAddress + }; + if (this.data.contractId) { + reqData.contractId = this.data.contractId; + } + Bus.$emit("save", reqData); + }, refreshMessage: function () { this.abiFileShow = false; this.errorInfo = ""; @@ -721,10 +838,18 @@ export default { this.contractAddress = ""; }, deploying: function () { + if (!this.bytecodeBin) { + this.$message({ + type: 'warning', + message: this.$t('text.notHaveBin'), + duration: 2000 + }) + return; + } if (JSON.parse(this.abiFile).length == 0 || !this.abiFile) { this.$message({ type: 'error', - message: this.$t('text.haveAbi') + message: this.$t('text.notHaveAbi') }) } else { if (this.data.contractStatus && this.data && this.data.contractStatus == 2) { @@ -920,7 +1045,7 @@ export default { if(JSON.parse(this.abiFile).length == 0 || !this.abiFile){ this.$message({ type: 'error', - message: this.$t('text.haveAbi') + message: this.$t('text.notHaveAbi') }) }else { this.dialogVisible = true; @@ -1037,7 +1162,7 @@ export default { }, handleChange(val) { console.log(val); - } + } } }; diff --git a/src/views/chaincode/components/contractCatalog.vue b/src/views/chaincode/components/contractCatalog.vue index 63652888..15cbd30f 100644 --- a/src/views/chaincode/components/contractCatalog.vue +++ b/src/views/chaincode/components/contractCatalog.vue @@ -87,7 +87,7 @@ - +
diff --git a/src/views/chaincode/contract.vue b/src/views/chaincode/contract.vue index b090badd..65eb364c 100755 --- a/src/views/chaincode/contract.vue +++ b/src/views/chaincode/contract.vue @@ -97,6 +97,13 @@ export default { } }, mounted: function () { + if(localStorage.getItem("dataFrom") === "transactionDetail"){ + localStorage.setItem("dataFrom","") + this.$message({ + type: "warning", + message: this.$t('text.importContractTip') + }); + } this.allVersion = [ { solcName: "v0.4.25", @@ -142,7 +149,7 @@ export default { } ]; this.initWorker() - this.getEncryption(this.querySolcList); + this.getEncryption(this.querySolcList); }, methods: { initWorker() { diff --git a/src/views/chaincode/dialog/addFile.vue b/src/views/chaincode/dialog/addFile.vue index 1f7f1cac..8d6fb4fb 100644 --- a/src/views/chaincode/dialog/addFile.vue +++ b/src/views/chaincode/dialog/addFile.vue @@ -26,6 +26,9 @@ +
@@ -38,14 +41,19 @@ }}
+ - diff --git a/src/views/chaincode/dialog/addFolder.vue b/src/views/chaincode/dialog/addFolder.vue index 7844e29d..67818c7b 100644 --- a/src/views/chaincode/dialog/addFolder.vue +++ b/src/views/chaincode/dialog/addFolder.vue @@ -36,7 +36,7 @@ import { addContractPath } from "@/util/api" export default { name: "addFolder", - props: ['foldershow'], + props: ['foldershow','isAddFile'], computed: { rules() { let data = { @@ -70,7 +70,7 @@ export default { dialogVisible: this.foldershow, folderList: [], userFolader: "", - pathList: [] + pathList: [], } }, mounted: function () { @@ -99,7 +99,8 @@ export default { } addContractPath(reqData).then(res => { if (res.data.code === 0) { - this.$emit("success") + // this.$emit("success") + this.modelClose(); } else { this.$message({ type: "error", @@ -114,8 +115,19 @@ export default { }); }); }, + // modelClose: function () { + // // this.$emit("close") + // }, modelClose: function () { - this.$emit("close") + this.folderFrom = { + folderName: "" + } + if(this.isAddFile == 'isAddFile'){ + this.$emit("folderClose"); + }else{ + this.$emit("close"); + } + // this.dialogVisible = false; }, handleFolder() { console.log('enter') diff --git a/src/views/chaincode/dialog/changeUser.vue b/src/views/chaincode/dialog/changeUser.vue index 49b97dd1..d8bf9cb9 100755 --- a/src/views/chaincode/dialog/changeUser.vue +++ b/src/views/chaincode/dialog/changeUser.vue @@ -17,7 +17,7 @@
- + + - + @@ -84,17 +89,27 @@ {{this.$t("text.cancel")}}{{this.$t("text.sure")}} + + + + diff --git a/src/views/chaincode/dialog/exportProject.vue b/src/views/chaincode/dialog/exportProject.vue index 0939b66b..21a96004 100644 --- a/src/views/chaincode/dialog/exportProject.vue +++ b/src/views/chaincode/dialog/exportProject.vue @@ -1,6 +1,6 @@ diff --git a/src/views/chaincode/dialog/mgmtCns.vue b/src/views/chaincode/dialog/mgmtCns.vue index 03e35aae..73442392 100644 --- a/src/views/chaincode/dialog/mgmtCns.vue +++ b/src/views/chaincode/dialog/mgmtCns.vue @@ -1,23 +1,32 @@ diff --git a/src/views/chaincode/dialog/selectCatalog.vue b/src/views/chaincode/dialog/selectCatalog.vue index f82de2a5..a4e4c729 100644 --- a/src/views/chaincode/dialog/selectCatalog.vue +++ b/src/views/chaincode/dialog/selectCatalog.vue @@ -23,6 +23,9 @@ + + {{this.$t('contracts.createFolder')}} + @@ -31,19 +34,24 @@ 确 定 + diff --git a/src/views/chaincode/index.vue b/src/views/chaincode/index.vue index 5b1e4d5c..4240367f 100644 --- a/src/views/chaincode/index.vue +++ b/src/views/chaincode/index.vue @@ -3,10 +3,10 @@ - + - + @@ -26,7 +26,8 @@ export default { }, data() { return { - activeName: null + activeName: null, + } }, created() { diff --git a/src/views/chaincode/oldContract.vue b/src/views/chaincode/oldContract.vue index e9443397..c6520448 100644 --- a/src/views/chaincode/oldContract.vue +++ b/src/views/chaincode/oldContract.vue @@ -81,7 +81,7 @@ - + @@ -618,7 +618,7 @@ export default { }, contractStatusZh(val) { switch (val) { - case '0': + case '0': return this.$t('contracts.normal') break; case '1': diff --git a/src/views/chaincode/totalContract.vue b/src/views/chaincode/totalContract.vue index b298b2f7..0015c654 100644 --- a/src/views/chaincode/totalContract.vue +++ b/src/views/chaincode/totalContract.vue @@ -59,7 +59,7 @@ - + diff --git a/src/views/committeeMgmt/index.vue b/src/views/committeeMgmt/index.vue index 340d9355..f5a952dc 100644 --- a/src/views/committeeMgmt/index.vue +++ b/src/views/committeeMgmt/index.vue @@ -30,7 +30,7 @@ - + + + {{this.$t("privateKey.addUser")}} + @@ -65,7 +68,7 @@ {{this.$t('text.sure')}} - + @@ -90,7 +93,7 @@ {{this.$t('text.sure')}} - + @@ -118,7 +121,7 @@ {{this.$t('text.sure')}} - + @@ -210,17 +213,22 @@ + + + diff --git a/src/views/configManagement/components/systemConfig.vue b/src/views/configManagement/components/systemConfig.vue index 12bf8808..fe8b692f 100644 --- a/src/views/configManagement/components/systemConfig.vue +++ b/src/views/configManagement/components/systemConfig.vue @@ -11,6 +11,9 @@ {{item.address | splitString}}... + + {{this.$t("privateKey.addUser")}} + @@ -20,15 +23,21 @@ {{this.$t('text.cancel')}} {{this.$t('text.sure')}} + + + + diff --git a/src/views/configManagement/index.vue b/src/views/configManagement/index.vue index 22a667e7..5dc52a82 100644 --- a/src/views/configManagement/index.vue +++ b/src/views/configManagement/index.vue @@ -32,7 +32,7 @@ - + diff --git a/src/views/developerMgmt/components/developerDialog.vue b/src/views/developerMgmt/components/developerDialog.vue index 5f024400..c425fe8b 100644 --- a/src/views/developerMgmt/components/developerDialog.vue +++ b/src/views/developerMgmt/components/developerDialog.vue @@ -8,14 +8,17 @@ {{item.address | splitString}}... - + + {{this.$t("privateKey.addUser")}} + + {{item.userName}} {{item.address | splitString}}... - - + + @@ -26,15 +29,20 @@ {{this.$t('text.cancel')}} {{this.$t('text.sure')}} + + + diff --git a/src/views/onlineTools/index.vue b/src/views/onlineTools/index.vue index ba5408ee..22045486 100644 --- a/src/views/onlineTools/index.vue +++ b/src/views/onlineTools/index.vue @@ -7,7 +7,7 @@
- +
@@ -23,7 +23,7 @@
- +
@@ -54,28 +54,31 @@
- - + + {{$t('onlineTools.sign')}}

{{$t('onlineTools.result')}}

-
    -
  • +
      +
    • - {{key}}: + {{value}}: - {{value}} - + {{inputSign[value]}} +
+ + +
@@ -83,14 +86,16 @@ diff --git a/src/views/parseAbi/index.vue b/src/views/parseAbi/index.vue index d57dadb3..b9ac0842 100644 --- a/src/views/parseAbi/index.vue +++ b/src/views/parseAbi/index.vue @@ -1,6 +1,6 @@ diff --git a/src/views/privateKeyManagement/components/creatUser.vue b/src/views/privateKeyManagement/components/creatUser.vue index 9887ef87..cacb438c 100644 --- a/src/views/privateKeyManagement/components/creatUser.vue +++ b/src/views/privateKeyManagement/components/creatUser.vue @@ -18,7 +18,7 @@
{{this.$t("privateKey.privateKeyUser")}} - {{this.$t('privateKey.publicKeyUser')}} + {{this.$t('privateKey.publicKeyUser')}}
@@ -50,8 +50,14 @@ export default { address: { type: String, default: null - } + }, + disablePub: { + type: Boolean, + require: true, + default: false + }, }, + data: function () { return { loading: false, @@ -63,7 +69,7 @@ export default { publicKey: "" }, timeGranularity: "RIV", - groupId: localStorage.getItem("groupId") + groupId: localStorage.getItem("groupId"), }; }, computed: { @@ -105,6 +111,7 @@ export default { this.changeKey(); this.userForm.publicKey = this.address; } + }, methods: { changeKey: function () { @@ -159,7 +166,7 @@ export default { } }); }, - addUser: function () { + addUser() { let reqData = { groupId: this.groupId, userName: this.userForm.name, @@ -171,11 +178,11 @@ export default { this.loading = false; if (res.data.code === 0) { this.$emit("success"); + this.$emit("creatUserClose"); this.$message({ type: "success", message: this.$t("privateKey.addUserSuccess") }); - this.$emit("creatUserClose"); this.modelClose(); } else { this.modelClose(); @@ -207,11 +214,11 @@ export default { .then(res => { this.loading = false; if (res.data.code == 0) { + this.$emit("bindUserClose"); this.$message({ type: "success", message: this.$t("privateKey.addUserSuccess") }); - this.$emit("bindUserClose"); this.modelClose(); } else { this.modelClose(); diff --git a/src/views/privateKeyManagement/privateKeyManagement.vue b/src/views/privateKeyManagement/privateKeyManagement.vue index 1577fa09..16b973c9 100644 --- a/src/views/privateKeyManagement/privateKeyManagement.vue +++ b/src/views/privateKeyManagement/privateKeyManagement.vue @@ -205,12 +205,12 @@ export default { this.currentPage = 1; this.getUserInfoData(); }, - handleSizeChange: function (val) { + handleSizeChange(val) { this.pageSize = val; this.currentPage = 1; this.getUserInfoData(); }, - handleCurrentChange: function (val) { + handleCurrentChange(val) { this.currentPage = val; this.getUserInfoData(); }, @@ -218,10 +218,10 @@ export default { creatUserClose() { this.getUserInfoData(); }, - importPrivateKeySuccess() { + bindUserClose() { this.getUserInfoData(); }, - bindUserClose() { + importPrivateKeySuccess() { this.getUserInfoData(); }, handleClose: function () { diff --git a/src/views/privateKeyManagement/totalPrivateKey.vue b/src/views/privateKeyManagement/totalPrivateKey.vue index 16ae754d..c4545a82 100644 --- a/src/views/privateKeyManagement/totalPrivateKey.vue +++ b/src/views/privateKeyManagement/totalPrivateKey.vue @@ -41,7 +41,7 @@ @@ -85,6 +87,9 @@ + @@ -93,13 +98,15 @@ import contentHead from "@/components/contentHead"; import transactionDetail from "@/components/transactionDetail"; import { unusualContractList, getAllContractList } from "@/util/api"; import importAbi from "../abiList/components/importAbi" +import freezeThaw from "../chaincode/dialog/freezeThaw" import { getDate } from "@/util/util" export default { - name: "unusualContract", + name: "unusualContract", components: { contentHead, transactionDetail, - importAbi + importAbi, + freezeThaw }, data() { return { @@ -126,7 +133,8 @@ export default { } ], type: 1, - importVisibility: false + importVisibility: false, + freezeThawVisible: false }; }, computed: { @@ -304,6 +312,34 @@ export default { contractAddress: val.contractAddress } }) + }, + freezeThawBtn(val) { + switch (val.handleType) { + case '0': + return this.$t('contracts.freeze') + break; + case '1': + return this.$t('contracts.unfreeze') + break; + } + }, + + // handleStatusBtn(val) { + // this.freezeThawVisible = true + // this.contractInfo = val + // if (val.handleType == 0) { + // this.handleFreezeThawType = 'freeze' + // } + // else if (val.handleType == 1) { + // this.handleFreezeThawType = 'unfreeze' + // } + + // }, + // freezeThawClose() { + // this.freezeThawVisible = false + // }, + generateContract(){ + this.$router.push("/contract") } } }; diff --git a/src/views/unusualUser/unusualUser.vue b/src/views/unusualUser/unusualUser.vue index 2efbbc10..ab7b52ab 100755 --- a/src/views/unusualUser/unusualUser.vue +++ b/src/views/unusualUser/unusualUser.vue @@ -77,7 +77,7 @@ - +
{{this.$t('contracts.user')}}:{{this.$t('contracts.user')}}: @@ -26,9 +26,14 @@ + + {{this.$t("privateKey.addUser")}} + +
CNS:CNS: