添加 favicon;尝试从后台读出 blockList 到 Chain.vue

This commit is contained in:
lulu
2018-10-23 11:48:40 +08:00
parent 8bae1ead24
commit 6a2eaaa175
8 changed files with 33 additions and 17 deletions

2
.npmrc
View File

@@ -1 +1 @@
registry=http://101.132.121.111:6842 #registry=http://101.132.121.111:6842

View File

@@ -8,13 +8,15 @@ commander
.version('1.0', '-v, --version') // 默认是 -V。如果要 -v就要加 '-v --version' .version('1.0', '-v, --version') // 默认是 -V。如果要 -v就要加 '-v --version'
.option('-H, --host <host>', 'domain name or ip address of the target server') .option('-H, --host <host>', 'domain name or ip address of the target server')
.option('-P, --port <port>', 'ssh port number of the target server') .option('-P, --port <port>', 'ssh port number of the target server')
.option('-r, --root <root>', 'root directory to deploy on the target server') .option('-r, --root <root>', 'root path to deploy on the target server')
.option('-d, --dist <dist>', 'dist folder to deploy on the target server')
.option('-u, --user <user>', 'user id to login the target server') .option('-u, --user <user>', 'user id to login the target server')
.option('-k, --key <key>', 'user key file to login the target server') .option('-k, --key <key>', 'user key file to login the target server')
.option('-p, --password <password>', 'user password to login the target server. You may have to enclose the password in ""') .option('-p, --password <password>', 'user password to login the target server. You may have to enclose the password in ""')
.parse(process.argv) .parse(process.argv)
const root=commander.root||'/home/tic/tic.node/console' // 本地的项目目录。似乎该目录必须已经存在于服务器上 const root=commander.root||'/home/tic/tic.node/console' // 本地的项目目录。似乎该目录必须已经存在于服务器上
const dist=commander.dist||'dist' // 新系统将发布在这个目录里。建议和npm run build产生的目录一致这样既可以远程自动部署也可以直接登录服务器手动部署。
const privateKeyFile=commander.key||`${process.env.HOME}/.ssh/id_rsa` const privateKeyFile=commander.key||`${process.env.HOME}/.ssh/id_rsa`
const connection = { const connection = {
@@ -47,16 +49,15 @@ const necessaryPath = (path) => {
}; };
ssh.connect(connection).then(async () => { ssh.connect(connection).then(async () => {
const proj = 'dist' // 新系统将发布在这个目录里。建议和npm run build产生的目录一致这样既可以远程自动部署也可以直接登录服务器手动部署。 await ssh.execCommand(`mv ${dist} ${dist}-backup-${new Date().toISOString()}`, { root }); // 把服务器上老系统改名成另一个目录
await ssh.execCommand(`mv ${proj} ${proj}-backup-${new Date().toISOString()}`, { root }); // 把服务器上老系统改名成另一个目录 await ssh.execCommand(`mkdir ${dist}`, { root }); // 新建发布目录
await ssh.execCommand(`mkdir ${proj}`, { root }); // 新建发布目录
const toCreate = necessaryPath('./dist'); // 读取本地项目的发布目录下的子目录,去服务器上建立。 const toCreate = necessaryPath('./dist'); // 读取本地项目的发布目录下的子目录,去服务器上建立。
for (const name of toCreate) { for (const name of toCreate) {
await ssh.execCommand(`mkdir ${proj}/${name.join('/')}`, { root }); await ssh.execCommand(`mkdir ${dist}/${name.join('/')}`, { root });
} }
let err; let err;
await ssh.putDirectory('./dist', `${root}/${proj}`, { await ssh.putDirectory('./dist', `${root}/${dist}`, {
concurrency: 10, concurrency: 10,
recursive: true, recursive: true,
validate: itemPath => { validate: itemPath => {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 4.2 KiB

View File

@@ -5,7 +5,7 @@
<meta http-equiv="X-UA-Compatible" content="IE=edge"> <meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width,initial-scale=1.0"> <meta name="viewport" content="width=device-width,initial-scale=1.0">
<link rel="icon" href="<%= BASE_URL %>favicon.ico"> <link rel="icon" href="<%= BASE_URL %>favicon.ico">
<title>console</title> <title>TIC Console</title>
</head> </head>
<body> <body>
<noscript> <noscript>

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.7 KiB

View File

@@ -6,11 +6,11 @@ export default {
errorMnemonic: '输入的密语无效', errorMnemonic: '输入的密语无效',
}, },
home: { home: {
titleOwner: '个人中心', titleOwner: '个人',
titleChain: '链内数据', titleChain: '区块',
titleNode: '当前节点', titleNode: '节点',
titleNetwork: '对等网络', titleNetwork: '网络',
titleMarket: '应用商城', titleMarket: '应用',
}, },
owner: { owner: {
tableHeader: '我的交易', tableHeader: '我的交易',

View File

@@ -26,10 +26,6 @@ const router = new Router({
path: 'owner', path: 'owner',
component: Owner, component: Owner,
}, },
{
path: 'chain',
component: Chain,
},
{ {
path: 'node', path: 'node',
component: Node, component: Node,
@@ -38,6 +34,10 @@ const router = new Router({
path: 'network', path: 'network',
component: Network, component: Network,
}, },
{
path: 'chain',
component: Chain,
},
{ {
path: 'market', path: 'market',
component: Market, component: Market,

View File

@@ -90,6 +90,12 @@ const { mapState, mapGetters, mapActions, mapMutations } = createNamespacedHelpe
export default { export default {
name: 'Chain', name: 'Chain',
data(){
return {
blockList:[],
}
},
computed: { computed: {
...mapState([ ...mapState([
'headers', 'headers',
@@ -102,6 +108,15 @@ export default {
...mapGetters([]), ...mapGetters([]),
}, },
created: async function(){
let result=await axios({
method:'post',
url:location.protocol+'//'+location.hostname+':6842/api/Block/getBlockList',
data: {config:{order:'height DESC'}}
})
this.blockList=result.data||[]
},
methods: { methods: {
...mapActions([ ...mapActions([
]), ]),