marvzhang
2019-12-27 16:06:19 +08:00
parent 78156266fc
commit 787bc89949
3 changed files with 17 additions and 8 deletions

View File

@@ -6,25 +6,25 @@ services:
environment:
CRAWLAB_API_ADDRESS: "http://localhost:8000" # backend API address 后端 API 地址,设置为 http://<宿主机IP>:<端口>,端口为映射出来的端口
CRAWLAB_SERVER_MASTER: "Y" # whether to be master node 是否为主节点,主节点为 Y工作节点为 N
CRAWLAB_MONGO_HOST: "mongo1" # MongoDB host address MongoDB 的地址,在 docker compose 网络中,直接引用服务名称
CRAWLAB_MONGO_HOST: "mongo" # MongoDB host address MongoDB 的地址,在 docker compose 网络中,直接引用服务名称
CRAWLAB_REDIS_ADDRESS: "redis" # Redis host address Redis 的地址,在 docker compose 网络中,直接引用服务名称
ports:
- "8080:8080" # frontend port mapping 前端端口映射
- "8000:8000" # backend port mapping 后端端口映射
depends_on:
- mongo1
- mongo
- redis
worker:
image: tikazyq/crawlab:latest
container_name: worker
environment:
CRAWLAB_SERVER_MASTER: "N"
CRAWLAB_MONGO_HOST: "mongo1"
CRAWLAB_MONGO_HOST: "mongo"
CRAWLAB_REDIS_ADDRESS: "redis"
depends_on:
- mongo1
- mongo
- redis
mongo1:
mongo:
image: mongo:latest
restart: always
# volumes:

View File

@@ -267,6 +267,8 @@ export default {
'Notification': '提示',
'Are you sure to delete this node?': '你确定要删除该节点?',
'Are you sure to run this spider?': '你确定要运行该爬虫?',
'Added spider successfully': '成功添加爬虫',
'Uploaded spider files successfully': '成功上传爬虫文件',
'Node info has been saved successfully': '节点信息已成功保存',
'A task has been scheduled successfully': '已经成功派发一个任务',
'Are you sure to delete this spider?': '你确定要删除该爬虫?',

View File

@@ -62,14 +62,15 @@
</el-form-item>
</el-form>
<el-alert
type="error"
type="warning"
:closable="false"
style="margin-bottom: 10px"
>
<p>{{$t('You can click "Add" to create an empty spider and upload files later.')}}</p>
<p>{{$t('OR, you can also click "Upload" and upload a zip file containing your spider project.')}}</p>
<p style="font-weight: bolder">
<i class="fa fa-exclamation-triangle"></i> {{$t('NOTE: When uploading a zip file, please zip your spider files from the ROOT DIRECTORY.')}}
<i class="fa fa-exclamation-triangle"></i> {{$t('NOTE: When uploading a zip file, please zip your' +
' spider files from the ROOT DIRECTORY.')}}
</p>
</el-alert>
<div class="actions">
@@ -511,7 +512,7 @@ export default {
}
})
},
onUploadSuccess () {
onUploadSuccess (res) {
// clear fileList
this.fileList = []
@@ -519,6 +520,12 @@ export default {
setTimeout(() => {
this.getList()
}, 500)
// message
this.$message.success(this.$t('Uploaded spider files successfully'))
// navigate to spider detail
this.$router.push(`/spiders/${res.data._id}`)
},
getTime (str) {
if (!str || str.match('^0001')) return 'NA'