给 Node 页面添加了 本节点打包的区块列表模板。

给 各页面都读入了页头的数据,如IP地址,邻居数量。
This commit is contained in:
luk.lu
2018-11-28 16:38:52 +08:00
parent aca23682ca
commit f70e5bd73d
11 changed files with 241 additions and 55 deletions

View File

@@ -57,13 +57,13 @@ const necessaryPath = (path) => {
}
ssh.connect(connection).then(async () => {
console.log(`[ mv ${dist} ${dist}-backup-${new Date().toISOString()} ... ]`)
console.log(`[ ${root} > mv ${dist} ${dist}-backup-${new Date().toISOString()} ... ]`)
await ssh.execCommand(`mv ${dist} ${dist}-backup-${new Date().toISOString()}`, { cwd:root })
console.log(`[ mkdir ${dist} ... ]`)
console.log(`[ ${root} > mkdir ${dist} ... ]`)
await ssh.execCommand(`mkdir ${dist}`, { cwd:root })
const toCreate = necessaryPath('./dist')
for (const name of toCreate) {
console.log(`[ mkdir ${dist}/${name.join('/')} ... ]`)
console.log(`[ ${root} > mkdir ${dist}/${name.join('/')} ... ]`)
await ssh.execCommand(`mkdir ${dist}/${name.join('/')}`, { cwd:root })
}
@@ -77,13 +77,13 @@ ssh.connect(connection).then(async () => {
return !baseName.endsWith('.map');
},
tick: (localPath, remotePath, error) => {
console.log(`Uploading "${localPath}" ===> "${remotePath}" ${error || 'succeeded!'}`)
console.log(`"${localPath}" ===> "${remotePath}" ... ${error || 'succeeded!'}`)
err = error
},
})
ssh.dispose()
if (err) {
console.log('[ Uploaded with error! ]')
console.log('[ Upload failed! ]')
process.exit(1)
} else {
console.log('[ Uploaded successfully! ]')