From ca743505a4209ab48719a678bba14343a764aa74 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Tue, 9 May 2023 15:11:01 +0800 Subject: [PATCH 01/16] Add script for generating commit timestamp --- web/generate_timestamp.sh | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 web/generate_timestamp.sh diff --git a/web/generate_timestamp.sh b/web/generate_timestamp.sh new file mode 100644 index 00000000..9fede00e --- /dev/null +++ b/web/generate_timestamp.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") +echo "Commit timestamp: $TIMESTAMP" > commit_timestamp.txt \ No newline at end of file From ea5134711206d09e2eeb4c9e3ca761ef9dac12e3 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Tue, 9 May 2023 15:40:01 +0800 Subject: [PATCH 02/16] Add generate_timestamp.sh --- web/buildVue/webpack.prod.conf.js | 14 +- web/config/dev.env.js | 4 +- web/config/index.js | 16 +- web/package.json | 1 - web/src/components/popups.1.vue | 3475 +++++++++++++++++++++++++++++ web/src/components/popups.vue | 4 +- web/src/main.js | 2 +- web/src/utils/ERC721.json | 941 ++++++++ web/src/views/space/index.vue | 20 +- 9 files changed, 4446 insertions(+), 31 deletions(-) create mode 100644 web/src/components/popups.1.vue create mode 100644 web/src/utils/ERC721.json diff --git a/web/buildVue/webpack.prod.conf.js b/web/buildVue/webpack.prod.conf.js index 502ae614..17d7ab0a 100644 --- a/web/buildVue/webpack.prod.conf.js +++ b/web/buildVue/webpack.prod.conf.js @@ -11,8 +11,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin') const MiniCssExtractPlugin = require('mini-css-extract-plugin') const OptimizeCSSPlugin = require('optimize-css-assets-webpack-plugin') const UglifyJsPlugin = require('uglifyjs-webpack-plugin') -const GitRevisionPlugin = require('git-revision-webpack-plugin') -const gitRevision = new GitRevisionPlugin() +// const GitRevisionPlugin = require('git-revision-webpack-plugin') +// const gitRevision = new GitRevisionPlugin() const env = require('../config/' + process.env.env_config + '.env') @@ -87,13 +87,13 @@ const webpackConfig = merge(baseWebpackConfig, { chunkFilename: utils.assetsPath('js/[id].[chunkhash].js') }, plugins: [ - gitRevision, + // gitRevision, // http://vuejs.github.io/vue-loader/en/workflow/production.html new webpack.DefinePlugin({ - 'process.env': env, - 'process.env.VERSION': JSON.stringify(gitRevision.version()), - 'process.env.COMMITHASH': JSON.stringify(gitRevision.commithash()), - 'process.env.BRANCH': JSON.stringify(gitRevision.branch()) + 'process.env': env + // 'process.env.VERSION': JSON.stringify(gitRevision.version()), + // 'process.env.COMMITHASH': JSON.stringify(gitRevision.commithash()), + // 'process.env.BRANCH': JSON.stringify(gitRevision.branch()) }), // new UglifyJsPlugin({ // uglifyOptions: { diff --git a/web/config/dev.env.js b/web/config/dev.env.js index 24c2b29f..629d13f9 100644 --- a/web/config/dev.env.js +++ b/web/config/dev.env.js @@ -4,6 +4,6 @@ const prodEnv = require('./calibration.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"', - BASE_METASPACE: '"https://test-meta-xieyi.nbai.io/"', - BASE_PAYMENT_GATEWAY_API: '"https://test-mcs-xieyi.nbai.io/"' + // BASE_METASPACE: '"https://test-meta-xieyi.nbai.io/"', + // BASE_PAYMENT_GATEWAY_API: '"https://test-mcs-xieyi.nbai.io/"' }) diff --git a/web/config/index.js b/web/config/index.js index c362572d..c8f42195 100644 --- a/web/config/index.js +++ b/web/config/index.js @@ -3,16 +3,16 @@ // see http://vuejs-templates.github.io/webpack for documentation. const path = require('path') -const GitRevisionPlugin = require('git-revision-webpack-plugin') +// const GitRevisionPlugin = require('git-revision-webpack-plugin') module.exports = { - 'chainWebpack': config => { - config.plugin('define').tap(args => { - const gitRevisionPlugin = new GitRevisionPlugin() - args[0]['process.env']['COMMIT_HASH'] = JSON.stringify(gitRevisionPlugin.commithash()) - return args - }) - }, + // 'chainWebpack': config => { + // config.plugin('define').tap(args => { + // const gitRevisionPlugin = new GitRevisionPlugin() + // args[0]['process.env']['COMMIT_HASH'] = JSON.stringify(gitRevisionPlugin.commithash()) + // return args + // }) + // }, dev: { // Paths diff --git a/web/package.json b/web/package.json index 3ed9be38..6fe0c5fb 100644 --- a/web/package.json +++ b/web/package.json @@ -70,7 +70,6 @@ "eslint-plugin-vue": "^4.0.0", "file-loader": "^1.1.4", "friendly-errors-webpack-plugin": "^1.6.1", - "git-revision-webpack-plugin": "^2.5.1", "html-webpack-plugin": "^3.2.0", "mini-css-extract-plugin": "^0.4.0", "node-notifier": "^5.1.2", diff --git a/web/src/components/popups.1.vue b/web/src/components/popups.1.vue new file mode 100644 index 00000000..257a7356 --- /dev/null +++ b/web/src/components/popups.1.vue @@ -0,0 +1,3475 @@ + + + + + diff --git a/web/src/components/popups.vue b/web/src/components/popups.vue index 828d843a..5f8231b9 100644 --- a/web/src/components/popups.vue +++ b/web/src/components/popups.vue @@ -96,7 +96,7 @@ {{areaBody.size | formatbytes}} - + {{$t('metaSpace.Close')}} diff --git a/web/src/main.js b/web/src/main.js index 8394cf7b..86e0da72 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-4-28', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-9', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { diff --git a/web/src/utils/ERC721.json b/web/src/utils/ERC721.json new file mode 100644 index 00000000..68a54750 --- /dev/null +++ b/web/src/utils/ERC721.json @@ -0,0 +1,941 @@ +[{ + "inputs": [], + "name": "ApprovalCallerNotOwnerNorApproved", + "type": "error" +}, { + "inputs": [], + "name": "ApprovalQueryForNonexistentToken", + "type": "error" +}, { + "inputs": [], + "name": "ApprovalToCurrentOwner", + "type": "error" +}, { + "inputs": [], + "name": "ApproveToCaller", + "type": "error" +}, { + "inputs": [], + "name": "BalanceQueryForZeroAddress", + "type": "error" +}, { + "inputs": [], + "name": "MintToZeroAddress", + "type": "error" +}, { + "inputs": [], + "name": "MintZeroQuantity", + "type": "error" +}, { + "inputs": [{ + "internalType": "address", + "name": "operator", + "type": "address" + }], + "name": "OperatorNotAllowed", + "type": "error" +}, { + "inputs": [], + "name": "OwnerIndexOutOfBounds", + "type": "error" +}, { + "inputs": [], + "name": "OwnerQueryForNonexistentToken", + "type": "error" +}, { + "inputs": [], + "name": "TokenIndexOutOfBounds", + "type": "error" +}, { + "inputs": [], + "name": "TransferCallerNotOwnerNorApproved", + "type": "error" +}, { + "inputs": [], + "name": "TransferFromIncorrectOwner", + "type": "error" +}, { + "inputs": [], + "name": "TransferToNonERC721ReceiverImplementer", + "type": "error" +}, { + "inputs": [], + "name": "TransferToZeroAddress", + "type": "error" +}, { + "inputs": [], + "name": "URIQueryForNonexistentToken", + "type": "error" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }], + "name": "ActivateWhitelist", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, { + "indexed": true, + "internalType": "address", + "name": "approved", + "type": "address" + }, { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "Approval", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "owner", + "type": "address" + }, { + "indexed": true, + "internalType": "address", + "name": "operator", + "type": "address" + }, { + "indexed": false, + "internalType": "bool", + "name": "approved", + "type": "bool" + }], + "name": "ApprovalForAll", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }], + "name": "DeactivateWhitelist", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "uint256", + "name": "oldMaxMintedPresalePerAddress", + "type": "uint256" + }, { + "indexed": false, + "internalType": "uint256", + "name": "newMaxMintedPresalePerAddress", + "type": "uint256" + }], + "name": "MaxMintedPresalePerAddress", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "uint256", + "name": "oldValue", + "type": "uint256" + }, { + "indexed": false, + "internalType": "uint256", + "name": "newValue", + "type": "uint256" + }], + "name": "MaxTokensPerTransaction", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "previousOwner", + "type": "address" + }, { + "indexed": true, + "internalType": "address", + "name": "newOwner", + "type": "address" + }], + "name": "OwnershipTransferred", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }], + "name": "Paused", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "from", + "type": "address" + }, { + "indexed": true, + "internalType": "address", + "name": "to", + "type": "address" + }, { + "indexed": true, + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "Transfer", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": false, + "internalType": "address", + "name": "account", + "type": "address" + }], + "name": "Unpaused", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "bytes32", + "name": "oldMerkleRoot", + "type": "bytes32" + }, { + "indexed": false, + "internalType": "bytes32", + "name": "newMerkleRoot", + "type": "bytes32" + }], + "name": "UpdateMerkleRoot", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "uint256", + "name": "oldTokenPrice", + "type": "uint256" + }, { + "indexed": false, + "internalType": "uint256", + "name": "newTokenPrice", + "type": "uint256" + }], + "name": "UpdateTokenPrice", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "uint256", + "name": "oldTokenPrice", + "type": "uint256" + }, { + "indexed": false, + "internalType": "uint256", + "name": "newTokenPrice", + "type": "uint256" + }], + "name": "UpdateTokenPricePresale", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "string", + "name": "oldURI", + "type": "string" + }, { + "indexed": false, + "internalType": "string", + "name": "newURI", + "type": "string" + }], + "name": "UpdateURI", + "type": "event" +}, { + "anonymous": false, + "inputs": [{ + "indexed": true, + "internalType": "address", + "name": "sender", + "type": "address" + }, { + "indexed": false, + "internalType": "address", + "name": "saleToken", + "type": "address" + }, { + "indexed": false, + "internalType": "uint256", + "name": "totalWithdrawn", + "type": "uint256" + }], + "name": "Withdraw", + "type": "event" +}, { + "inputs": [], + "name": "MAX_NFT", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "OPERATOR_FILTER_REGISTRY", + "outputs": [{ + "internalType": "contract IOperatorFilterRegistry", + "name": "", + "type": "address" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "TOKEN_PRICE", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "TOKEN_PRICE_PRESALE", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "activateWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "operator", + "type": "address" + }, { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "approve", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "owner", + "type": "address" + }], + "name": "balanceOf", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "baseURI", + "outputs": [{ + "internalType": "string", + "name": "", + "type": "string" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "tokensNumber", + "type": "uint256" + }, { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }], + "name": "buyNFTsPresale", + "outputs": [], + "stateMutability": "payable", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "tokensNumber", + "type": "uint256" + }], + "name": "buyNFTsPublic", + "outputs": [], + "stateMutability": "payable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "account", + "type": "address" + }, { + "internalType": "bytes32[]", + "name": "proof", + "type": "bytes32[]" + }], + "name": "checkWhitelisted", + "outputs": [{ + "internalType": "bool", + "name": "", + "type": "bool" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "deactivateWhitelist", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [], + "name": "factory", + "outputs": [{ + "internalType": "contract IRFOXFactory", + "name": "", + "type": "address" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "getApproved", + "outputs": [{ + "internalType": "address", + "name": "", + "type": "address" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "components": [{ + "internalType": "string", + "name": "name", + "type": "string" + }, { + "internalType": "string", + "name": "symbol", + "type": "string" + }, { + "internalType": "string", + "name": "baseURI", + "type": "string" + }, { + "internalType": "contract IERC20", + "name": "saleToken", + "type": "address" + }, { + "internalType": "uint256", + "name": "price", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "maxNft", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "maxTokensPerTransaction", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "saleStartTime", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "saleEndTime", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "publicSaleStartTime", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "maxMintedPresalePerAddress", + "type": "uint256" + }, { + "internalType": "uint256", + "name": "pricePresale", + "type": "uint256" + }, { + "internalType": "address", + "name": "owner", + "type": "address" + }], + "internalType": "struct ParamStructs.WhitelistParams", + "name": "params", + "type": "tuple" + }], + "name": "initialize", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "owner", + "type": "address" + }, { + "internalType": "address", + "name": "operator", + "type": "address" + }], + "name": "isApprovedForAll", + "outputs": [{ + "internalType": "bool", + "name": "", + "type": "bool" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "isWhitelistActivated", + "outputs": [{ + "internalType": "bool", + "name": "", + "type": "bool" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "maxMintedPresalePerAddress", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "maxTokensPerTransaction", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "merkleRoot", + "outputs": [{ + "internalType": "bytes32", + "name": "", + "type": "bytes32" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "name", + "outputs": [{ + "internalType": "string", + "name": "", + "type": "string" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "owner", + "outputs": [{ + "internalType": "address", + "name": "", + "type": "address" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "ownerOf", + "outputs": [{ + "internalType": "address", + "name": "", + "type": "address" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "pause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [], + "name": "paused", + "outputs": [{ + "internalType": "bool", + "name": "", + "type": "bool" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "publicSaleStartTime", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "renounceOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "to", + "type": "address" + }], + "name": "safeMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "from", + "type": "address" + }, { + "internalType": "address", + "name": "to", + "type": "address" + }, { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "from", + "type": "address" + }, { + "internalType": "address", + "name": "to", + "type": "address" + }, { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }, { + "internalType": "bytes", + "name": "data", + "type": "bytes" + }], + "name": "safeTransferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [], + "name": "saleEndTime", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "saleStartTime", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "saleToken", + "outputs": [{ + "internalType": "contract IERC20", + "name": "", + "type": "address" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "operator", + "type": "address" + }, { + "internalType": "bool", + "name": "approved", + "type": "bool" + }], + "name": "setApprovalForAll", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "string", + "name": "newBaseURIPrefix", + "type": "string" + }], + "name": "setBaseURI", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "newMaxTokensPerTransaction", + "type": "uint256" + }], + "name": "setMaxTokensPerTransaction", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "newTokenPrice", + "type": "uint256" + }], + "name": "setTokenPrice", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "newTokenPricePresale", + "type": "uint256" + }], + "name": "setTokenPricePresale", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "bytes4", + "name": "interfaceId", + "type": "bytes4" + }], + "name": "supportsInterface", + "outputs": [{ + "internalType": "bool", + "name": "", + "type": "bool" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "symbol", + "outputs": [{ + "internalType": "string", + "name": "", + "type": "string" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "index", + "type": "uint256" + }], + "name": "tokenByIndex", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "owner", + "type": "address" + }, { + "internalType": "uint256", + "name": "index", + "type": "uint256" + }], + "name": "tokenOfOwnerByIndex", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "tokenURI", + "outputs": [{ + "internalType": "string", + "name": "", + "type": "string" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [], + "name": "totalSupply", + "outputs": [{ + "internalType": "uint256", + "name": "", + "type": "uint256" + }], + "stateMutability": "view", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "from", + "type": "address" + }, { + "internalType": "address", + "name": "to", + "type": "address" + }, { + "internalType": "uint256", + "name": "tokenId", + "type": "uint256" + }], + "name": "transferFrom", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "address", + "name": "newOwner", + "type": "address" + }], + "name": "transferOwnership", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [], + "name": "unpause", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "uint256", + "name": "_maxMintedPresalePerAddress", + "type": "uint256" + }], + "name": "updateMaxMintedPresalePerAddress", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [{ + "internalType": "bytes32", + "name": "_merkleRoot", + "type": "bytes32" + }], + "name": "updateMerkleRoot", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}, { + "inputs": [], + "name": "withdraw", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" +}] diff --git a/web/src/views/space/index.vue b/web/src/views/space/index.vue index d95c9dff..00053abf 100644 --- a/web/src/views/space/index.vue +++ b/web/src/views/space/index.vue @@ -136,16 +136,16 @@ export default { that.backupLoad = true that.dialogFun('detail', row) let bucketDetail = row - // const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_METASPACE}api/v3/backup/stat/${row.id}`, 'get') - // if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') - // else { - // bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' - // bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' - // bucketDetail.miner_count = backupRes.data.miner_count || 0 - // bucketDetail.piece_cid = backupRes.data.piece_cid || '' - // bucketDetail.payload_cid = backupRes.data.payload_cid || '' - // bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 - // } + const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') + if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') + else { + bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' + bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' + bucketDetail.miner_count = backupRes.data.miner_count || 0 + bucketDetail.piece_cid = backupRes.data.piece_cid || '' + bucketDetail.payload_cid = backupRes.data.payload_cid || '' + bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 + } that.dialogFun('detail', bucketDetail) that.backupLoad = false }, From c0afc50b8b1c1162eb02a2a2d4670b8460de7af8 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Tue, 9 May 2023 15:50:46 +0800 Subject: [PATCH 03/16] Add pre-commit --- web/src/components/Sidebar.vue | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/web/src/components/Sidebar.vue b/web/src/components/Sidebar.vue index 5169e3d7..84ffef2a 100644 --- a/web/src/components/Sidebar.vue +++ b/web/src/components/Sidebar.vue @@ -160,9 +160,7 @@ export default { } }, created () { - if (process.env.COMMITHASH) { - this.git_version = process.env.COMMITHASH.slice(0, 8) - } + if (process.env.COMMITHASH) this.git_version = process.env.COMMITHASH.slice(0, 8) this.getListBuckets() }, methods: { From 3a9799959bc6d83c3c0069bba10440fdf17138a8 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Wed, 10 May 2023 09:15:35 +0800 Subject: [PATCH 04/16] Add gennerate_timestamp.sh --- web/generate_timestamp.sh => generate_timestamp.sh | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename web/generate_timestamp.sh => generate_timestamp.sh (100%) diff --git a/web/generate_timestamp.sh b/generate_timestamp.sh similarity index 100% rename from web/generate_timestamp.sh rename to generate_timestamp.sh From ba6b0c3a1c3106f11dac71b09df121001b0f58bc Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Wed, 10 May 2023 09:20:44 +0800 Subject: [PATCH 05/16] Add generate_timestamp.sh --- generate_timestamp.sh | 2 +- web/src/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/generate_timestamp.sh b/generate_timestamp.sh index 9fede00e..150fcca9 100644 --- a/generate_timestamp.sh +++ b/generate_timestamp.sh @@ -1,4 +1,4 @@ -#!/bin/bash +#!/bin/sh TIMESTAMP=$(date +"%Y-%m-%d %H:%M:%S") echo "Commit timestamp: $TIMESTAMP" > commit_timestamp.txt \ No newline at end of file diff --git a/web/src/main.js b/web/src/main.js index 86e0da72..5b54d2a1 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-9', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-10', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { From e70f613d714fe1d2bede520fe35270a54672469e Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Wed, 10 May 2023 09:23:20 +0800 Subject: [PATCH 06/16] date --- web/src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/main.js b/web/src/main.js index 5b54d2a1..48edf0b1 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-10', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-10.', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { From bd3e22808f58f5bdc460d874c4533ae36579745a Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Wed, 10 May 2023 09:34:37 +0800 Subject: [PATCH 07/16] main.js --- web/src/main.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/web/src/main.js b/web/src/main.js index 48edf0b1..5b54d2a1 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-10.', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-10', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { From 99344735ccdcfed686d7e584f04e3021a2e78f27 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Wed, 10 May 2023 09:41:47 +0800 Subject: [PATCH 08/16] main.js --- commit_timestamp.txt | 1 + web/src/main.js | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) create mode 100644 commit_timestamp.txt diff --git a/commit_timestamp.txt b/commit_timestamp.txt new file mode 100644 index 00000000..dabb2e0c --- /dev/null +++ b/commit_timestamp.txt @@ -0,0 +1 @@ +Commit timestamp: 2023-05-10 09:41:47 diff --git a/web/src/main.js b/web/src/main.js index 5b54d2a1..e0e173da 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-10', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-10..', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { @@ -82,7 +82,7 @@ new Vue({ router, store, i18n, - metaInfo () { + metaInfo() { return { title: this.$store.getters.metaInfo.title, meta: [{ From da723f80a207edc02dd501bfe26aeac7f375ba59 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Thu, 11 May 2023 17:50:59 +0800 Subject: [PATCH 09/16] Update backup --- commit_timestamp.txt | 2 +- web/src/components/popups.vue | 119 ++++++++++++++++++++------------- web/src/main.js | 4 +- web/src/views/space/detail.vue | 10 +++ 4 files changed, 85 insertions(+), 50 deletions(-) diff --git a/commit_timestamp.txt b/commit_timestamp.txt index dabb2e0c..caf57dee 100644 --- a/commit_timestamp.txt +++ b/commit_timestamp.txt @@ -1 +1 @@ -Commit timestamp: 2023-05-10 09:41:47 +Commit timestamp: 2023-05-11 17:50:59 diff --git a/web/src/components/popups.vue b/web/src/components/popups.vue index 5f8231b9..08f3f8af 100644 --- a/web/src/components/popups.vue +++ b/web/src/components/popups.vue @@ -126,6 +126,78 @@ +
+
+ +
+ {{$t('metaSpace.ob_detail_title')}} +
+ + + {{areaBody.name}} + + + {{areaBody.object_name}} + + + {{momentFun(areaBody.created_at)}} + + + {{areaBody.size | formatbytes}} + + + + + {{areaBody.ipfs_url}} + + + + {{areaBody.payload_cid}} + + + +
+ {{$t('metaSpace.detail_StorageProvider')}}({{areaBody.miner_count}}) + + + + + +
+
+ +
+ {{areaBody.piece_cid}} + +
+
+ + {{areaBody.remaining_service_days}} + + + {{$t('metaSpace.Close')}} + +
+
+
+
+ + + +

+ {{$t('uploadFile.payment_tip_deal')}} + {{$t('metaSpace.try_again')}} +

+
+
+
+
+
@@ -184,53 +256,6 @@
-
-
- -
- {{$t('metaSpace.ob_detail_title')}} -
- - - {{areaBody.name}} - - - {{areaBody.object_name}} - - - {{momentFun(areaBody.created_at)}} - - - {{areaBody.size | formatbytes}} - - - - - {{areaBody.ipfs_url}} - - - - {{areaBody.payload_cid}} - - - {{$t('metaSpace.Close')}} - - -
-
-
- - - -

- {{$t('uploadFile.payment_tip_deal')}} - {{$t('metaSpace.try_again')}} -

-
-
-
-
-
diff --git a/web/src/main.js b/web/src/main.js index e0e173da..e3144508 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-10..', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-11', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { @@ -82,7 +82,7 @@ new Vue({ router, store, i18n, - metaInfo() { + metaInfo () { return { title: this.$store.getters.metaInfo.title, meta: [{ diff --git a/web/src/views/space/detail.vue b/web/src/views/space/detail.vue index 03e73d38..01b12bdb 100644 --- a/web/src/views/space/detail.vue +++ b/web/src/views/space/detail.vue @@ -205,6 +205,16 @@ export default { bucketDetail.ipfs_url = `https://${that.$route.query.domain}/ipfs/${infoRes.data.payload_cid}${row.type === 2 ? '?filename=' + infoRes.data.name : ''}` bucketDetail.payload_cid = infoRes.data.payload_cid } + + const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') + if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') + else { + bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' + bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' + bucketDetail.miner_count = backupRes.data.miner_count || 0 + bucketDetail.piece_cid = backupRes.data.piece_cid || '' + bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 + } } else { const domainRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/gateway/get_gateway`, 'get') if (!domainRes || domainRes.status !== 'success') that.$message.error(domainRes ? domainRes.message : 'Fail') From 2aa4049f89e76e0922ef99eda9349fc195c63609 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Fri, 12 May 2023 17:27:15 +0800 Subject: [PATCH 10/16] Update mint process --- commit_timestamp.txt | 2 +- web/src/components/mintTip.vue | 74 ++++++++++++++----- web/src/components/popups.vue | 29 +------- web/src/main.js | 2 +- web/src/views/space/detail.vue | 10 --- web/src/views/space/index.vue | 20 ++--- web/src/views/uploadFiles/dashboard/index.vue | 2 +- 7 files changed, 70 insertions(+), 69 deletions(-) diff --git a/commit_timestamp.txt b/commit_timestamp.txt index caf57dee..97a10a3e 100644 --- a/commit_timestamp.txt +++ b/commit_timestamp.txt @@ -1 +1 @@ -Commit timestamp: 2023-05-11 17:50:59 +Commit timestamp: 2023-05-12 17:27:15 diff --git a/web/src/components/mintTip.vue b/web/src/components/mintTip.vue index afcbae3c..d90eb2cb 100644 --- a/web/src/components/mintTip.vue +++ b/web/src/components/mintTip.vue @@ -29,7 +29,10 @@
{{nftView.nft_collection_name||nftView.nft_collection_address || nftView.mint_address || '-'}}
- + + {{ $t('uploadFile.mint_view') }} + + {{ $t('uploadFile.mint_view') }} @@ -263,24 +266,57 @@ export default { }) } else { that.isloadText = that.$t('uploadFile.payment_tip_deal01') - await that.mintContract(CollectionFactory, that.mintCollectionAddress.address, nftUrl) - if (that.tokenId) { - console.log('totalSupply success', that.tokenId) - let mintInfoJson = { - source_file_upload_id: that.mintRow.source_file_upload_id, - payload_cid: that.mintRow.payload_cid, - tx_hash: that.nftHash, - nft_collection_id: that.mintCollectionAddress.id, - token_id: parseInt(that.tokenId), - mint_address: that.mintCollectionAddress.address, - name: that.ruleForm.name, - description: that.ruleForm.description - } - const mintInfoResponse = await that.sendPostRequest(`${that.baseAPIURL}api/v1/storage/mint/info`, mintInfoJson) - if (mintInfoResponse) that.$emit('getMintDialog', false, mintInfoJson) + let payObject = { + gasPrice: await that.$web3Init.eth.getGasPrice() } - that.hashload = false - that.isload = false + CollectionFactory.methods + .mint(that.mintCollectionAddress.address, that.metaAddress, that.ruleForm.amount || 1, nftUrl) + .send(payObject) + .on('transactionHash', async function (hash) { + that.nftHash = hash + that.isloadText = that.$t('uploadFile.payment_tip_deal02') + let mintInfoJson = { + source_file_upload_id: that.mintRow.source_file_upload_id, + payload_cid: that.mintRow.payload_cid, + tx_hash: hash, + nft_collection_id: that.mintCollectionAddress.id, + mint_address: that.mintCollectionAddress.address, + name: that.ruleForm.name, + description: that.ruleForm.description + } + await that.sendPostRequest(`${that.baseAPIURL}api/v1/storage/mint/info`, mintInfoJson) + + that.mintCollectionAddress = {} + that.mintIndex = 'list' + that.hashload = false + that.isload = false + that.init() + }) + .on('confirmation', function (confirmationNumber, receipt) { + // console.log('confirmationNumber console:', confirmationNumber, receipt) + }) + .on('receipt', function (receipt) { + // receipt example + console.log('mint receipt console:', receipt) + }) + // await that.mintContract(CollectionFactory, that.mintCollectionAddress.address, nftUrl) + // if (that.tokenId) { + // console.log('totalSupply success', that.tokenId) + // let mintInfoJson = { + // source_file_upload_id: that.mintRow.source_file_upload_id, + // payload_cid: that.mintRow.payload_cid, + // tx_hash: that.nftHash, + // nft_collection_id: that.mintCollectionAddress.id, + // token_id: parseInt(that.tokenId), + // mint_address: that.mintCollectionAddress.address, + // name: that.ruleForm.name, + // description: that.ruleForm.description + // } + // const mintInfoResponse = await that.sendPostRequest(`${that.baseAPIURL}api/v1/storage/mint/info`, mintInfoJson) + // if (mintInfoResponse) that.$emit('getMintDialog', false, mintInfoJson) + // } + // that.hashload = false + // that.isload = false } } } else { @@ -298,7 +334,7 @@ export default { const transaction = await CollectionFactory.methods .mint(collectAddress, that.metaAddress, that.ruleForm.amount || 1, nftUrl) .send(payObject) - .on('transactionHash', function (hash) { + .on('transactionHash', async function (hash) { that.nftHash = hash that.isloadText = that.$t('uploadFile.payment_tip_deal02') console.log('transactionHash console:', that.nftHash) diff --git a/web/src/components/popups.vue b/web/src/components/popups.vue index 08f3f8af..c62ffb32 100644 --- a/web/src/components/popups.vue +++ b/web/src/components/popups.vue @@ -95,7 +95,7 @@ {{areaBody.size | formatbytes}} - + {{$t('metaSpace.Close')}} @@ -154,31 +154,6 @@ {{areaBody.payload_cid}} - - -
- {{$t('metaSpace.detail_StorageProvider')}}({{areaBody.miner_count}}) - - - - - -
-
- -
- {{areaBody.piece_cid}} - -
-
- - {{areaBody.remaining_service_days}} - {{$t('metaSpace.Close')}} diff --git a/web/src/main.js b/web/src/main.js index e3144508..ecd545bb 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-11', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-12', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { diff --git a/web/src/views/space/detail.vue b/web/src/views/space/detail.vue index 01b12bdb..03e73d38 100644 --- a/web/src/views/space/detail.vue +++ b/web/src/views/space/detail.vue @@ -205,16 +205,6 @@ export default { bucketDetail.ipfs_url = `https://${that.$route.query.domain}/ipfs/${infoRes.data.payload_cid}${row.type === 2 ? '?filename=' + infoRes.data.name : ''}` bucketDetail.payload_cid = infoRes.data.payload_cid } - - const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') - if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') - else { - bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' - bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' - bucketDetail.miner_count = backupRes.data.miner_count || 0 - bucketDetail.piece_cid = backupRes.data.piece_cid || '' - bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 - } } else { const domainRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/gateway/get_gateway`, 'get') if (!domainRes || domainRes.status !== 'success') that.$message.error(domainRes ? domainRes.message : 'Fail') diff --git a/web/src/views/space/index.vue b/web/src/views/space/index.vue index 00053abf..ab117937 100644 --- a/web/src/views/space/index.vue +++ b/web/src/views/space/index.vue @@ -136,16 +136,16 @@ export default { that.backupLoad = true that.dialogFun('detail', row) let bucketDetail = row - const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') - if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') - else { - bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' - bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' - bucketDetail.miner_count = backupRes.data.miner_count || 0 - bucketDetail.piece_cid = backupRes.data.piece_cid || '' - bucketDetail.payload_cid = backupRes.data.payload_cid || '' - bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 - } + // const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') + // if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') + // else { + // bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' + // bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' + // bucketDetail.miner_count = backupRes.data.miner_count || 0 + // bucketDetail.piece_cid = backupRes.data.piece_cid || '' + // bucketDetail.payload_cid = backupRes.data.payload_cid || '' + // bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 + // } that.dialogFun('detail', bucketDetail) that.backupLoad = false }, diff --git a/web/src/views/uploadFiles/dashboard/index.vue b/web/src/views/uploadFiles/dashboard/index.vue index d7371785..ef7e9183 100644 --- a/web/src/views/uploadFiles/dashboard/index.vue +++ b/web/src/views/uploadFiles/dashboard/index.vue @@ -695,7 +695,7 @@ export default { size: _this.payRow.file_size, copyLimit: 5 } - console.log(lockObj) + // console.log(lockObj) contractInstance.methods.lockTokenPayment(lockObj) .send(payObject) .on('transactionHash', function (hash) { From f4acbf0971d60cec130ac5158a59363d7e35041f Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Mon, 15 May 2023 14:54:03 +0800 Subject: [PATCH 11/16] API rollback --- commit_timestamp.txt | 2 +- web/src/components/Header.vue | 2 +- web/src/components/mintTip.vue | 72 +++++++++------------------------- web/src/main.js | 2 +- web/src/views/space/detail.vue | 2 +- web/src/views/space/index.vue | 2 +- 6 files changed, 23 insertions(+), 59 deletions(-) diff --git a/commit_timestamp.txt b/commit_timestamp.txt index 97a10a3e..6e7908b9 100644 --- a/commit_timestamp.txt +++ b/commit_timestamp.txt @@ -1 +1 @@ -Commit timestamp: 2023-05-12 17:27:15 +Commit timestamp: 2023-05-15 14:54:03 diff --git a/web/src/components/Header.vue b/web/src/components/Header.vue index 6373135b..6f83de03 100644 --- a/web/src/components/Header.vue +++ b/web/src/components/Header.vue @@ -560,7 +560,7 @@ export default { }) }, commonParam () { - let commonApi = `${that.baseAPIURL}api/v1/config/params?limit=20&wallet_address=${that.metaAddress}` + let commonApi = `${that.baseAPIURL}api/v1/common/system/params?limit=20&wallet_address=${that.metaAddress}` axios.get(commonApi, { headers: { diff --git a/web/src/components/mintTip.vue b/web/src/components/mintTip.vue index d90eb2cb..afba693d 100644 --- a/web/src/components/mintTip.vue +++ b/web/src/components/mintTip.vue @@ -29,10 +29,7 @@ {{nftView.nft_collection_name||nftView.nft_collection_address || nftView.mint_address || '-'}} - - {{ $t('uploadFile.mint_view') }} - - + {{ $t('uploadFile.mint_view') }} @@ -266,57 +263,24 @@ export default { }) } else { that.isloadText = that.$t('uploadFile.payment_tip_deal01') - let payObject = { - gasPrice: await that.$web3Init.eth.getGasPrice() + await that.mintContract(CollectionFactory, that.mintCollectionAddress.address, nftUrl) + if (that.tokenId) { + console.log('totalSupply success', that.tokenId) + let mintInfoJson = { + source_file_upload_id: that.mintRow.source_file_upload_id, + payload_cid: that.mintRow.payload_cid, + tx_hash: that.nftHash, + nft_collection_id: that.mintCollectionAddress.id, + token_id: parseInt(that.tokenId), + mint_address: that.mintCollectionAddress.address, + name: that.ruleForm.name, + description: that.ruleForm.description + } + const mintInfoResponse = await that.sendPostRequest(`${that.baseAPIURL}api/v1/storage/mint/info`, mintInfoJson) + if (mintInfoResponse) that.$emit('getMintDialog', false, mintInfoJson) } - CollectionFactory.methods - .mint(that.mintCollectionAddress.address, that.metaAddress, that.ruleForm.amount || 1, nftUrl) - .send(payObject) - .on('transactionHash', async function (hash) { - that.nftHash = hash - that.isloadText = that.$t('uploadFile.payment_tip_deal02') - let mintInfoJson = { - source_file_upload_id: that.mintRow.source_file_upload_id, - payload_cid: that.mintRow.payload_cid, - tx_hash: hash, - nft_collection_id: that.mintCollectionAddress.id, - mint_address: that.mintCollectionAddress.address, - name: that.ruleForm.name, - description: that.ruleForm.description - } - await that.sendPostRequest(`${that.baseAPIURL}api/v1/storage/mint/info`, mintInfoJson) - - that.mintCollectionAddress = {} - that.mintIndex = 'list' - that.hashload = false - that.isload = false - that.init() - }) - .on('confirmation', function (confirmationNumber, receipt) { - // console.log('confirmationNumber console:', confirmationNumber, receipt) - }) - .on('receipt', function (receipt) { - // receipt example - console.log('mint receipt console:', receipt) - }) - // await that.mintContract(CollectionFactory, that.mintCollectionAddress.address, nftUrl) - // if (that.tokenId) { - // console.log('totalSupply success', that.tokenId) - // let mintInfoJson = { - // source_file_upload_id: that.mintRow.source_file_upload_id, - // payload_cid: that.mintRow.payload_cid, - // tx_hash: that.nftHash, - // nft_collection_id: that.mintCollectionAddress.id, - // token_id: parseInt(that.tokenId), - // mint_address: that.mintCollectionAddress.address, - // name: that.ruleForm.name, - // description: that.ruleForm.description - // } - // const mintInfoResponse = await that.sendPostRequest(`${that.baseAPIURL}api/v1/storage/mint/info`, mintInfoJson) - // if (mintInfoResponse) that.$emit('getMintDialog', false, mintInfoJson) - // } - // that.hashload = false - // that.isload = false + that.hashload = false + that.isload = false } } } else { diff --git a/web/src/main.js b/web/src/main.js index ecd545bb..fab2c92e 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-12', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-15', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { diff --git a/web/src/views/space/detail.vue b/web/src/views/space/detail.vue index 03e73d38..03032de2 100644 --- a/web/src/views/space/detail.vue +++ b/web/src/views/space/detail.vue @@ -209,7 +209,7 @@ export default { const domainRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/gateway/get_gateway`, 'get') if (!domainRes || domainRes.status !== 'success') that.$message.error(domainRes ? domainRes.message : 'Fail') else { - bucketDetail.ipfs_url_domain = domainRes.data[0] || '' + bucketDetail.ipfs_url_domain = domainRes.data ? domainRes.data[0] : '' bucketDetail.options = [] domainRes.data.forEach((element, i) => { bucketDetail.options.push({ diff --git a/web/src/views/space/index.vue b/web/src/views/space/index.vue index ab117937..964b79ad 100644 --- a/web/src/views/space/index.vue +++ b/web/src/views/space/index.vue @@ -261,7 +261,7 @@ export default { data: [] } } else { - that.domain.value = domainRes.data[0] || '' + that.domain.value = domainRes.data ? domainRes.data[0] : '' that.domain.data = domainRes.data || [] } From bb7823eaad63f6d33b3cc5af8481910bc538c91d Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Mon, 15 May 2023 18:13:20 +0800 Subject: [PATCH 12/16] Fix domain error --- web/src/views/space/detail.vue | 2 +- web/src/views/space/index.vue | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/web/src/views/space/detail.vue b/web/src/views/space/detail.vue index f73bb5aa..d1a49695 100644 --- a/web/src/views/space/detail.vue +++ b/web/src/views/space/detail.vue @@ -209,7 +209,7 @@ export default { const domainRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/gateway/get_gateway`, 'get') if (!domainRes || domainRes.status !== 'success') that.$message.error(domainRes ? domainRes.message : 'Fail') else { - bucketDetail.ipfs_url_domain = domainRes.data[0] || '' + bucketDetail.ipfs_url_domain = domainRes.data ? domainRes.data[0] : '' bucketDetail.options = [] domainRes.data.forEach((element, i) => { bucketDetail.options.push({ diff --git a/web/src/views/space/index.vue b/web/src/views/space/index.vue index 7a75963d..f2e17ea2 100644 --- a/web/src/views/space/index.vue +++ b/web/src/views/space/index.vue @@ -261,7 +261,7 @@ export default { data: [] } } else { - that.domain.value = domainRes.data[0] || '' + that.domain.value = domainRes.data ? domainRes.data[0] : '' that.domain.data = domainRes.data || [] } From a4b955440b7bafe4997e4ada7f3de03a2a37c5f0 Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Tue, 16 May 2023 14:03:06 +0800 Subject: [PATCH 13/16] Update environment variables --- web/config/calibration.env.js | 7 ++++++- web/config/dev.env.js | 8 ++++---- web/config/prod.env.js | 9 +++++++-- web/config/semi_prod.env.js | 9 +++++++-- web/config/test.env.js | 7 ++++++- web/config/test_prod.env.js | 7 ++++++- web/src/components/Sidebar.vue | 19 ++++++++++++------- web/src/components/footHome.vue | 15 ++++++++++----- web/src/components/pricing.vue | 11 ++++++----- web/src/main.js | 2 +- 10 files changed, 65 insertions(+), 29 deletions(-) diff --git a/web/config/calibration.env.js b/web/config/calibration.env.js index ca8e1406..d170fbe9 100644 --- a/web/config/calibration.env.js +++ b/web/config/calibration.env.js @@ -12,5 +12,10 @@ module.exports = { BASE_POLYGON_ADDRESS: '"https://polygonscan.com/"', BASE_ECO_API: '"https://calibration-eco-api.filswan.com/"', BASE_METASPACE: '"https://calibration-mybucket-api.filswan.com/"', - BASE_ENV: 'false' + BASE_ENV: 'false', + MEDIUM_LINK: '"https://filswan.medium.com/"', + DISCORD_LINK: '"https://discord.com/invite/KKGhy8ZqzK"', + TWITTER_LINK: '"https://twitter.com/0xfilswan"', + GITHUB_LINK: '"https://github.com/filswan"', + TELEGRAM_LINK: '"https://t.me/filswan"' } diff --git a/web/config/dev.env.js b/web/config/dev.env.js index 24c2b29f..1dcbce1f 100644 --- a/web/config/dev.env.js +++ b/web/config/dev.env.js @@ -1,9 +1,9 @@ 'use strict' const merge = require('webpack-merge') -const prodEnv = require('./calibration.env') +const prodEnv = require('./prod.env') module.exports = merge(prodEnv, { - NODE_ENV: '"development"', - BASE_METASPACE: '"https://test-meta-xieyi.nbai.io/"', - BASE_PAYMENT_GATEWAY_API: '"https://test-mcs-xieyi.nbai.io/"' + NODE_ENV: '"development"' + // BASE_METASPACE: '"https://test-meta-xieyi.nbai.io/"', + // BASE_PAYMENT_GATEWAY_API: '"https://test-mcs-xieyi.nbai.io/"' }) diff --git a/web/config/prod.env.js b/web/config/prod.env.js index f126b50d..abeeac60 100644 --- a/web/config/prod.env.js +++ b/web/config/prod.env.js @@ -1,5 +1,5 @@ 'use strict' -module.exports = {   +module.exports = { NODE_ENV: '"production"', BASE_API: '"https://api.filswan.com/"', BASE_PAYMENT_GATEWAY_API: '"https://api.multichain.storage/"', @@ -12,5 +12,10 @@ module.exports = {   BASE_POLYGON_ADDRESS: '"https://polygonscan.com/"', BASE_ECO_API: '"https://ecosystem-api.multichain.storage/"', BASE_METASPACE: '"https://meta-api.multichain.storage/"', - BASE_ENV: 'true' + BASE_ENV: 'true', + MEDIUM_LINK: '"https://filswan.medium.com/"', + DISCORD_LINK: '"https://discord.com/invite/KKGhy8ZqzK"', + TWITTER_LINK: '"https://twitter.com/0xfilswan"', + GITHUB_LINK: '"https://github.com/filswan"', + TELEGRAM_LINK: '"https://t.me/filswan"' } diff --git a/web/config/semi_prod.env.js b/web/config/semi_prod.env.js index ff3f2301..2a56b7f8 100644 --- a/web/config/semi_prod.env.js +++ b/web/config/semi_prod.env.js @@ -1,5 +1,5 @@ 'use strict' -module.exports = {   +module.exports = { NODE_ENV: '"production"', BASE_API: '"https://api.filswan.com/"', BASE_PAYMENT_GATEWAY_API: '"https://mcs-api.filswan.com/"', @@ -12,5 +12,10 @@ module.exports = {   BASE_POLYGON_ADDRESS: '"https://polygonscan.com/"', BASE_ECO_API: '"https://ecosystem-api.multichain.storage/"', BASE_METASPACE: '"https://meta-api.multichain.storage/"', - BASE_ENV: 'true' + BASE_ENV: 'true', + MEDIUM_LINK: '"https://filswan.medium.com/"', + DISCORD_LINK: '"https://discord.com/invite/KKGhy8ZqzK"', + TWITTER_LINK: '"https://twitter.com/0xfilswan"', + GITHUB_LINK: '"https://github.com/filswan"', + TELEGRAM_LINK: '"https://t.me/filswan"' } diff --git a/web/config/test.env.js b/web/config/test.env.js index 35760342..fc838be1 100644 --- a/web/config/test.env.js +++ b/web/config/test.env.js @@ -12,5 +12,10 @@ module.exports = { BASE_POLYGON_ADDRESS: '"https://polygonscan.com/"', BASE_ECO_API: '"http://192.168.88.216:5005/"', BASE_METASPACE: '"http://192.168.88.41:5212/"', - BASE_ENV: 'false' + BASE_ENV: 'false', + MEDIUM_LINK: '"https://filswan.medium.com/"', + DISCORD_LINK: '"https://discord.com/invite/KKGhy8ZqzK"', + TWITTER_LINK: '"https://twitter.com/0xfilswan"', + GITHUB_LINK: '"https://github.com/filswan"', + TELEGRAM_LINK: '"https://t.me/filswan"' } diff --git a/web/config/test_prod.env.js b/web/config/test_prod.env.js index a4cab7f6..7a2b8448 100644 --- a/web/config/test_prod.env.js +++ b/web/config/test_prod.env.js @@ -12,5 +12,10 @@ module.exports = { BASE_POLYGON_ADDRESS: '"https://polygonscan.com/"', BASE_ECO_API: '"http://192.168.88.216:5005/"', BASE_METASPACE: '"http://192.168.88.41:5212/"', - BASE_ENV: 'true' + BASE_ENV: 'true', + MEDIUM_LINK: '"https://filswan.medium.com/"', + DISCORD_LINK: '"https://discord.com/invite/KKGhy8ZqzK"', + TWITTER_LINK: '"https://twitter.com/0xfilswan"', + GITHUB_LINK: '"https://github.com/filswan"', + TELEGRAM_LINK: '"https://t.me/filswan"' } diff --git a/web/src/components/Sidebar.vue b/web/src/components/Sidebar.vue index a19f01c3..03d09d5d 100644 --- a/web/src/components/Sidebar.vue +++ b/web/src/components/Sidebar.vue @@ -36,12 +36,12 @@ {{$t('comment.Tell_Comment')}}
Need help? Join our - Discord + Discord or send an Email to us.
需要帮助吗?加入我们的 - Discord + Discord 或发送 电子邮件 给我们。
@@ -56,11 +56,11 @@ 目前使用量:{{free_usage | byteStorage}}GB(Onchain Storage免费储存空间配额:{{free_quota_per_month | byteStorage}}GB) -->
@@ -120,6 +120,11 @@ export default { share_github: require('@/assets/images/landing/github-fill.png'), share_telegram: require('@/assets/images/landing/telegram.png'), share_discord: require('@/assets/images/landing/discord.png'), + medium_link: process.env.MEDIUM_LINK, + discord_link: process.env.DISCORD_LINK, + twitter_link: process.env.TWITTER_LINK, + github_link: process.env.GITHUB_LINK, + telegram_link: process.env.TELEGRAM_LINK, rateValue: null, colors: { 5: '#e92721' }, iconClasses: ['icon-rate-face'] diff --git a/web/src/components/footHome.vue b/web/src/components/footHome.vue index bff20512..f8554cd5 100644 --- a/web/src/components/footHome.vue +++ b/web/src/components/footHome.vue @@ -9,11 +9,11 @@
  • {{$t('footer.Get_Help')}}
  • © {{fullYear}}{{$t('footer.copy')}}

    @@ -33,6 +33,11 @@ export default { share_github: require('@/assets/images/landing/github-fill.png'), share_telegram: require('@/assets/images/landing/telegram.png'), share_discord: require('@/assets/images/landing/discord.png'), + medium_link: process.env.MEDIUM_LINK, + discord_link: process.env.DISCORD_LINK, + twitter_link: process.env.TWITTER_LINK, + github_link: process.env.GITHUB_LINK, + telegram_link: process.env.TELEGRAM_LINK, ComingSoon: false, typeName: 'comingSoon', fullYear: new Date().getFullYear() diff --git a/web/src/components/pricing.vue b/web/src/components/pricing.vue index 521cb6fe..86e86d98 100644 --- a/web/src/components/pricing.vue +++ b/web/src/components/pricing.vue @@ -3,7 +3,7 @@

    {{$t('pricing.title_1')}}

    {{$t('pricing.title_2')}}

    {{$t('pricing.title_3')}}

    - {{$t('pricing.btn')}}. + {{$t('pricing.btn')}}.
    @@ -35,7 +35,7 @@ $96USD/annually
    - + {{$t('pricing.btn')}}
    @@ -76,7 +76,7 @@

    {{$t('pricing.volume_title')}}

    {{$t('pricing.volume_p')}}

    - + {{$t('pricing.btn')}}

    {{$t('pricing.volume_title_1')}}

    @@ -111,7 +111,7 @@ {{$t('pricing.collapse_4_title')}}
    No worries! Our team always open to communicate and customize a special plan for your needs. - Create a ticket in our Discord community and we will get back to you shortly after.
    + Create a ticket in our Discord community and we will get back to you shortly after.
    @@ -184,7 +184,8 @@ export default { desc: this.$t('pricing.collapse_2_desc') } ], - activeNames: ['1'] + activeNames: ['1'], + discord_link: process.env.DISCORD_LINK } }, components: {}, diff --git a/web/src/main.js b/web/src/main.js index 4477d6d0..944caf23 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -49,7 +49,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-4-11', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-16', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { From 37a1e62c5b00bf66c2d347ffab45c4cc3195a3ed Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Fri, 26 May 2023 17:01:06 +0800 Subject: [PATCH 14/16] Optimize buckets --- commit_timestamp.txt | 2 +- web/config/calibration.env.js | 2 +- web/config/dev.env.js | 2 +- web/config/prod.env.js | 2 +- web/config/semi_prod.env.js | 2 +- web/config/test.env.js | 2 +- web/config/test_prod.env.js | 2 +- web/index.html | 49 ++++++++++++++++++---------------- web/src/components/popups.vue | 29 ++++++++++++++++++-- web/src/main.js | 4 +-- web/src/views/space/detail.vue | 32 +++++++++++++++------- web/src/views/space/index.vue | 20 +++++++------- 12 files changed, 95 insertions(+), 53 deletions(-) diff --git a/commit_timestamp.txt b/commit_timestamp.txt index 6e7908b9..dc885c90 100644 --- a/commit_timestamp.txt +++ b/commit_timestamp.txt @@ -1 +1 @@ -Commit timestamp: 2023-05-15 14:54:03 +Commit timestamp: 2023-05-26 17:01:06 diff --git a/web/config/calibration.env.js b/web/config/calibration.env.js index 71a65461..1c21544f 100644 --- a/web/config/calibration.env.js +++ b/web/config/calibration.env.js @@ -2,7 +2,7 @@ module.exports = { NODE_ENV: '"production"', BASE_API: '"https://calibration-api.filswan.com/"', - BASE_URL: '"https://calibration-mcs.filswan.com/"', + BASE_URL: '"https://calibration-mcs.filswan.com"', BASE_PAYMENT_GATEWAY_API: '"https://calibration-mcs-api.filswan.com/"', BASE_PAYMENT_GATEWAY_BSC_API: '"https://calibration-mcs-bsc.filswan.com/"', BASE_PAYMENT_GATEWAY_POLYGON_API: '"https://api.multichain.storage/"', diff --git a/web/config/dev.env.js b/web/config/dev.env.js index 1dcbce1f..9b23dc04 100644 --- a/web/config/dev.env.js +++ b/web/config/dev.env.js @@ -1,6 +1,6 @@ 'use strict' const merge = require('webpack-merge') -const prodEnv = require('./prod.env') +const prodEnv = require('./calibration.env') module.exports = merge(prodEnv, { NODE_ENV: '"development"' diff --git a/web/config/prod.env.js b/web/config/prod.env.js index dedf45dc..510606e7 100644 --- a/web/config/prod.env.js +++ b/web/config/prod.env.js @@ -2,7 +2,7 @@ module.exports = { NODE_ENV: '"production"', BASE_API: '"https://api.filswan.com/"', - BASE_URL: '"https://www.multichain.storage/"', + BASE_URL: '"https://www.multichain.storage"', BASE_PAYMENT_GATEWAY_API: '"https://api.multichain.storage/"', BASE_PAYMENT_GATEWAY_BSC_API: '"https://calibration-mcs-bsc.filswan.com/"', BASE_PAYMENT_GATEWAY_POLYGON_API: '"https://api.multichain.storage/"', diff --git a/web/config/semi_prod.env.js b/web/config/semi_prod.env.js index 37e15162..e1fdd263 100644 --- a/web/config/semi_prod.env.js +++ b/web/config/semi_prod.env.js @@ -2,7 +2,7 @@ module.exports = { NODE_ENV: '"production"', BASE_API: '"https://api.filswan.com/"', - BASE_URL: '"https://www.multichain.storage/"', + BASE_URL: '"https://www.multichain.storage"', BASE_PAYMENT_GATEWAY_API: '"https://mcs-api.filswan.com/"', BASE_PAYMENT_GATEWAY_BSC_API: '"https://calibration-mcs-bsc.filswan.com/"', BASE_PAYMENT_GATEWAY_POLYGON_API: '"https://api.multichain.storage/"', diff --git a/web/config/test.env.js b/web/config/test.env.js index dd535a45..03d1268b 100644 --- a/web/config/test.env.js +++ b/web/config/test.env.js @@ -2,7 +2,7 @@ module.exports = { NODE_ENV: '"test"', BASE_API: '"http://192.168.88.216:5002/"', - BASE_URL: '"http://192.168.88.216:8080/mcs/"', + BASE_URL: '"http://192.168.88.216:8080/mcs"', BASE_PAYMENT_GATEWAY_API: '"http://192.168.88.41:8889/"', BASE_PAYMENT_GATEWAY_BSC_API: '"http://192.168.88.41:8892/"', BASE_PAYMENT_GATEWAY_POLYGON_API: '"https://api.multichain.storage/"', diff --git a/web/config/test_prod.env.js b/web/config/test_prod.env.js index 39d9ad5d..150f0f8e 100644 --- a/web/config/test_prod.env.js +++ b/web/config/test_prod.env.js @@ -2,7 +2,7 @@ module.exports = { NODE_ENV: '"test"', BASE_API: '"http://192.168.88.216:5002/"', - BASE_URL: '"http://192.168.88.216:8080/mcs/"', + BASE_URL: '"http://192.168.88.216:8080/mcs"', BASE_PAYMENT_GATEWAY_API: '"http://192.168.88.41:8889/"', BASE_PAYMENT_GATEWAY_BSC_API: '"http://192.168.88.41:8892/"', BASE_PAYMENT_GATEWAY_POLYGON_API: '"https://api.multichain.storage/"', diff --git a/web/index.html b/web/index.html index ca46818d..f0596bf3 100644 --- a/web/index.html +++ b/web/index.html @@ -1,14 +1,15 @@ - - - Multi-Chain storage - - - - - - + + + + Multi-Chain storage + + + + + + <%if (process.env.NODE_ENV === 'production'){ %> - - - - - - - - - + + + + + + + + + <%} else {%> @@ -63,9 +64,11 @@ - - -
    - - + + + +
    + + + diff --git a/web/src/components/popups.vue b/web/src/components/popups.vue index c62ffb32..08f3f8af 100644 --- a/web/src/components/popups.vue +++ b/web/src/components/popups.vue @@ -95,7 +95,7 @@ {{areaBody.size | formatbytes}} - + {{$t('metaSpace.Close')}} @@ -154,6 +154,31 @@ {{areaBody.payload_cid}} + + +
    + {{$t('metaSpace.detail_StorageProvider')}}({{areaBody.miner_count}}) + + + + + +
    +
    + +
    + {{areaBody.piece_cid}} + +
    +
    + + {{areaBody.remaining_service_days}} + {{$t('metaSpace.Close')}} diff --git a/web/src/main.js b/web/src/main.js index 91bcf6e8..5eaf5fbb 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-16', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-26', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { @@ -82,7 +82,7 @@ new Vue({ router, store, i18n, - metaInfo() { + metaInfo () { return { title: this.$store.getters.metaInfo.title, meta: [{ diff --git a/web/src/views/space/detail.vue b/web/src/views/space/detail.vue index 03032de2..776633cc 100644 --- a/web/src/views/space/detail.vue +++ b/web/src/views/space/detail.vue @@ -193,17 +193,31 @@ export default { that.dialogFun(type, row) let bucketDetail = row if (type === 'detail_file') { - let params = { - file_id: row.id + // let params = { + // file_id: row.id + // } + // const infoRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_file_info?${Qs.stringify(params)}`, 'get') + // if (!infoRes || infoRes.status !== 'success') that.$message.error(infoRes ? infoRes.message : 'Fail') + // else { + // bucketDetail.name = infoRes.data.name + // bucketDetail.created_at = infoRes.data.created_at + // bucketDetail.size = infoRes.data.size + bucketDetail.ipfs_url = `https://${that.$route.query.domain}/ipfs/${row.payload_cid}${row.type === 2 ? '?filename=' + row.name : ''}` + // bucketDetail.payload_cid = infoRes.data.payload_cid + // } + + const backupParams = { + bucket_uid: row.bucket_uid, + object_name: row.object_name } - const infoRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_file_info?${Qs.stringify(params)}`, 'get') - if (!infoRes || infoRes.status !== 'success') that.$message.error(infoRes ? infoRes.message : 'Fail') + const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_file_by_object_name?${Qs.stringify(backupParams)}`, 'get') + if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') else { - bucketDetail.name = infoRes.data.name - bucketDetail.created_at = infoRes.data.created_at - bucketDetail.size = infoRes.data.size - bucketDetail.ipfs_url = `https://${that.$route.query.domain}/ipfs/${infoRes.data.payload_cid}${row.type === 2 ? '?filename=' + infoRes.data.name : ''}` - bucketDetail.payload_cid = infoRes.data.payload_cid + // bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' + // bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' + // bucketDetail.miner_count = backupRes.data.miner_count || 0 + // bucketDetail.piece_cid = backupRes.data.piece_cid || '' + // bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 } } else { const domainRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/gateway/get_gateway`, 'get') diff --git a/web/src/views/space/index.vue b/web/src/views/space/index.vue index 964b79ad..54a00630 100644 --- a/web/src/views/space/index.vue +++ b/web/src/views/space/index.vue @@ -136,16 +136,16 @@ export default { that.backupLoad = true that.dialogFun('detail', row) let bucketDetail = row - // const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') - // if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') - // else { - // bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' - // bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' - // bucketDetail.miner_count = backupRes.data.miner_count || 0 - // bucketDetail.piece_cid = backupRes.data.piece_cid || '' - // bucketDetail.payload_cid = backupRes.data.payload_cid || '' - // bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 - // } + const backupRes = await that.$commonFun.sendRequest(`${process.env.BASE_PAYMENT_GATEWAY_API}api/v2/oss_file/get_backup_info?payload_cid=${row.bucket_uid}`, 'get') + if (!backupRes || backupRes.status !== 'success') that.$message.error(backupRes ? backupRes.message : 'Fail') + else { + bucketDetail.miner_list = backupRes.data.miner_list.split(',') || '' + bucketDetail.miner_url_prefix = backupRes.data.miner_url_prefix || '' + bucketDetail.miner_count = backupRes.data.miner_count || 0 + bucketDetail.piece_cid = backupRes.data.piece_cid || '' + bucketDetail.payload_cid = backupRes.data.payload_cid || '' + bucketDetail.remaining_service_days = backupRes.data.remaining_service_days || 0 + } that.dialogFun('detail', bucketDetail) that.backupLoad = false }, From 69500cefc9cc00c66a6535daed7905798f8ca66b Mon Sep 17 00:00:00 2001 From: "yxie@nbai.io" Date: Tue, 30 May 2023 16:42:33 +0800 Subject: [PATCH 15/16] Add backup API --- commit_timestamp.txt | 2 +- web/src/components/Sidebar.vue | 14 ++++----- web/src/components/popups.vue | 55 ++++++++++++++++++++++++---------- web/src/lang/cn.js | 1 + web/src/lang/en.js | 1 + web/src/main.js | 2 +- web/src/views/space/detail.vue | 34 ++++++++------------- web/src/views/space/index.vue | 10 ------- 8 files changed, 64 insertions(+), 55 deletions(-) diff --git a/commit_timestamp.txt b/commit_timestamp.txt index dc885c90..19d2cb22 100644 --- a/commit_timestamp.txt +++ b/commit_timestamp.txt @@ -1 +1 @@ -Commit timestamp: 2023-05-26 17:01:06 +Commit timestamp: 2023-05-30 16:42:33 diff --git a/web/src/components/Sidebar.vue b/web/src/components/Sidebar.vue index 4781eb0f..ba9edfa2 100644 --- a/web/src/components/Sidebar.vue +++ b/web/src/components/Sidebar.vue @@ -86,13 +86,6 @@ export default { lanShow: false, bodyWidth: document.body.clientWidth < 999, items: [ - { - icon: 'el-icon-s-deal', - index: '1', - title: this.$t('route.Deal'), - name: 'my_files', - type: '' - }, { icon: 'el-icon-s-metaSpace', index: '20', @@ -100,6 +93,13 @@ export default { name: 'Space', type: '' }, + { + icon: 'el-icon-s-deal', + index: '1', + title: this.$t('route.Deal'), + name: 'my_files', + type: '' + }, { icon: 'el-icon-s-billing', index: '5', diff --git a/web/src/components/popups.vue b/web/src/components/popups.vue index 08f3f8af..51731d67 100644 --- a/web/src/components/popups.vue +++ b/web/src/components/popups.vue @@ -95,7 +95,7 @@ {{areaBody.size | formatbytes}} - + {{$t('metaSpace.Close')}} @@ -156,29 +156,38 @@ -
    - {{$t('metaSpace.detail_StorageProvider')}}({{areaBody.miner_count}}) - - -
    - - {{minerFid}} - - +
    + +
    + {{minerFid.storage_provider_id}} +
    - +
      +
    • + Storage Status: {{minerFid.storage_status}}
    • +
    • + Deal ID: {{minerFid.deal_id}}
    • +
    • + Deal CID: {{minerFid.deal_cid}}
    • +
    • + Start Time: {{momentFun(minerFid.start_time)}}
    • +
    • + End Time: {{momentFun(minerFid.end_time)}}
    • +
    +
    -
    -
    +
    {{areaBody.piece_cid}}
    +
    -
    - + {{$t('metaSpace.Close')}} @@ -3578,3 +3587,19 @@ export default { } } + + diff --git a/web/src/lang/cn.js b/web/src/lang/cn.js index 1a03eaa3..26b8a2eb 100644 --- a/web/src/lang/cn.js +++ b/web/src/lang/cn.js @@ -726,6 +726,7 @@ export default { table_cid: 'CID', table_cid_tip: '文件或存储桶的内容ID', table_status: '状态', + table_backup_status: '备份状态', table_LastModified: '上次修改时间', table_action: '操作', delete_title: '删除Bucket', diff --git a/web/src/lang/en.js b/web/src/lang/en.js index 641ef374..b020f826 100644 --- a/web/src/lang/en.js +++ b/web/src/lang/en.js @@ -720,6 +720,7 @@ export default { table_cid: 'CID', table_cid_tip: 'The content ID for the file or bucket', table_status: 'Status', + table_backup_status: 'Backup Status', table_LastModified: 'Last Modified', table_action: 'Actions', delete_title: 'Delete Bucket', diff --git a/web/src/main.js b/web/src/main.js index 5eaf5fbb..8b2f16b1 100644 --- a/web/src/main.js +++ b/web/src/main.js @@ -50,7 +50,7 @@ Vue.prototype.baseAPIURL = netData === 80001 ? process.env.BASE_PAYMENT_GATEWAY_ Vue.prototype.baseAddressURL = netData === 80001 ? process.env.BASE_MUMBAI_ADDRESS : process.env.BASE_POLYGON_ADDRESS Vue.prototype.Web3 = Web3 Vue.prototype.baseNetwork = process.env.BASE_ENV === true -console.log('update time: 2023-5-26', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) +console.log('update time: 2023-5-30', 'env:', process.env.BASE_ENV === true ? 'Main' : 'Cali', process.env.BASE_ENV) router.beforeEach((to, from, next) => { if (to.matched.some(record => record.meta.requiresAuth)) { if (!sessionStorage.getItem('metaAddress')) { diff --git a/web/src/views/space/detail.vue b/web/src/views/space/detail.vue index 776633cc..c0c085e4 100644 --- a/web/src/views/space/detail.vue +++ b/web/src/views/space/detail.vue @@ -108,6 +108,13 @@
    + + +