From b31a50509428f86d9c6d7ebdbe6b8768acf92a23 Mon Sep 17 00:00:00 2001 From: marvzhang Date: Tue, 28 Jan 2020 11:03:21 +0800 Subject: [PATCH] added adding node instruction --- frontend/package.json | 1 + frontend/src/i18n/en.js | 25 +++++++++++- frontend/src/i18n/zh.js | 24 +++++++++++ frontend/src/views/node/NodeList.vue | 61 ++++++++++++++++------------ frontend/yarn.lock | 5 +++ 5 files changed, 90 insertions(+), 26 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index 64d80294..b08c2689 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -26,6 +26,7 @@ "echarts": "^4.1.0", "element-ui": "2.13.0", "font-awesome": "^4.7.0", + "github-markdown-css": "^3.0.1", "js-cookie": "2.2.0", "normalize.css": "7.0.0", "nprogress": "0.2.0", diff --git a/frontend/src/i18n/en.js b/frontend/src/i18n/en.js index b1c6ea43..0ac1c460 100644 --- a/frontend/src/i18n/en.js +++ b/frontend/src/i18n/en.js @@ -1 +1,24 @@ -export default {} +export default { + // 内容 + addNodeInstruction: ` +You cannot add nodes directly on the web interface in Crawlab. + +Adding a node is quite simple. The only thing you have to do is to run a Crawlab service on your target machine. + +#### Docker Deployment +If you are running Crawlab using Docker, you can start a new \`worker\` container on the target machine, or add a \`worker\` service in the \`docker-compose.yml\`. + +\`\`\`bash +docker run -d --restart always --name crawlab_worker \\ + -e CRAWLAB_SERVER_MASTER=N \\ + -e CRAWLAB_MONGO_HOST=xxx.xxx.xxx.xxx \\ # make sure you are connecting to the same MongoDB + -e CRAWLAB_REDIS_ADDRESS=xxx.xxx.xxx.xxx \\ # make sure you are connecting to the same Redis + tikazyq/crawlab:latest +\`\`\` + +#### Direct Deploy +If you are deploying directly, the only thing you have to do is to run a backend service on the target machine, you can refer to [Direct Deploy](https://docs.crawlab.cn/Installation/Direct.html). + +For more information, please refer to the [Official Documentation](https://docs.crawlab.cn). +` +} diff --git a/frontend/src/i18n/zh.js b/frontend/src/i18n/zh.js index 2255473c..c9c1d47a 100644 --- a/frontend/src/i18n/zh.js +++ b/frontend/src/i18n/zh.js @@ -70,6 +70,7 @@ export default { 'Uninstall': '卸载', 'Create Directory': '新建目录', 'Create File': '新建文件', + 'Add Node': '添加节点', // 主页 'Total Tasks': '总任务数', @@ -382,6 +383,29 @@ export default { cron_format: 'Cron 格式: [秒] [分] [小时] [日] [月] [周]' }, + // 内容 + addNodeInstruction: ` +您不能在 Crawlab 的 Web 界面直接添加节点。 + +添加节点的方式非常简单,您只需要在目标机器上运行一个 Crawlab 服务就可以了。 + +#### Docker 部署 +如果您是用 Docker 启动 Crawlab,可以在目标机器上运行一个新的 \`worker\` 容器,或者在 \`docker-compose.yml\` 中添加 \`worker\` 服务。 + +\`\`\`bash +docker run -d --restart always --name crawlab_worker \\ + -e CRAWLAB_SERVER_MASTER=N \\ + -e CRAWLAB_MONGO_HOST=xxx.xxx.xxx.xxx \\ # 保证连接的是同一个 MongoDB + -e CRAWLAB_REDIS_ADDRESS=xxx.xxx.xxx.xxx \\ # 保证连接的是同一个 Redis + tikazyq/crawlab:latest +\`\`\` + +#### 直接部署 +如果您是用直接部署,只需要在目标机器上启动一个后端服务,请参考 [直接部署文档](https://docs.crawlab.cn/Installation/Direct.html)。 + +更多信息,请参考 [官方文档](https://docs.crawlab.cn)。 +`, + // 其他 'Star crawlab-team/crawlab on GitHub': '在 GitHub 上为 Crawlab 加星吧' } diff --git a/frontend/src/views/node/NodeList.vue b/frontend/src/views/node/NodeList.vue index 3842c6ef..bd091bf3 100644 --- a/frontend/src/views/node/NodeList.vue +++ b/frontend/src/views/node/NodeList.vue @@ -1,33 +1,31 @@