diff --git a/README-zh.md b/README-zh.md
index 102eeceb..36e9d82d 100644
--- a/README-zh.md
+++ b/README-zh.md
@@ -5,14 +5,15 @@
+中文 | [English](https://github.com/tikazyq/crawlab/blob/master/README.md)
+
基于Celery的爬虫分布式爬虫管理平台,支持多种编程语言以及多种爬虫框架.
-[查看演示 Demo](http://114.67.75.98:8080)
-
-[English Documentation](https://github.com/tikazyq/crawlab/blob/master/README.md)
+[查看演示 Demo](http://114.67.75.98:8080) | [文档](https://tikazyq.github.io/crawlab)
## 要求
-- Python3
+- Python 3.6+
+- Node.js 8.12+
- MongoDB
- Redis
@@ -177,6 +178,8 @@ Crawlab使用起来很方便,也很通用,可以适用于几乎任何主流
- [ ] 登录和用户管理
- [ ] 全局搜索
+## 社区 & 赞助
+
如果您觉得Crawlab对您的日常开发或公司有帮助,请加作者微信 tikazyq1 并注明"Crawlab",作者会将你拉入群。或者,您可以扫下方支付宝二维码给作者打赏去升级团队协作软件或买一杯咖啡。
diff --git a/README.md b/README.md
index 4c6729c1..2914ffa2 100644
--- a/README.md
+++ b/README.md
@@ -5,14 +5,16 @@
+[中文](https://github.com/tikazyq/crawlab/blob/master/README-zh.md) | English
+
Celery-based web crawler admin platform for managing distributed web spiders regardless of languages and frameworks.
-[Demo](http://114.67.75.98:8080)
+[Demo](http://114.67.75.98:8080) | [Documentation](https://tikazyq.github.io/crawlab)
-[中文文档](https://github.com/tikazyq/crawlab/blob/master/README-zh.md)
## Pre-requisite
-- Python3
+- Python 3.6+
+- Node.js 8.12+
- MongoDB
- Redis
@@ -166,12 +168,14 @@ Crawlab is easy to use, general enough to adapt spiders in any language and any
- [ ] More spider examples
##### Frontend
-- [ ] Task Stats/Analytics
-- [ ] Table Filters
+- [x] Task Stats/Analytics
+- [x] Table Filters
- [x] Multi-Language Support (中文)
- [ ] Login & User Management
- [ ] General Search
+## Community & Sponsorship
+
If you feel Crawlab could benefit your daily work or your company, please add the author's Wechat account noting "Crawlab" to enter the discussion group. Or you scan the Alipay QR code below to give us a reward to upgrade our teamwork software or buy a coffee.
diff --git a/frontend/src/main.js b/frontend/src/main.js index 721f0f63..a3008fae 100644 --- a/frontend/src/main.js +++ b/frontend/src/main.js @@ -12,8 +12,6 @@ import 'font-awesome/scss/font-awesome.scss'// FontAwesome import 'codemirror/lib/codemirror.css' -// import ba from 'vue-ba' - import App from './App' import store from './store' import router from './router' @@ -23,6 +21,7 @@ import '@/permission' // permission control import request from './api/request' import i18n from './i18n' +import utils from './utils' Vue.use(ElementUI, { locale }) @@ -45,6 +44,12 @@ window._hmt = window._hmt || []; // inject request api Vue.prototype.$request = request +// inject utils +Vue.prototype.$utils = utils + +// inject stats +Vue.prototype.$st = utils.stats + const app = new Vue({ el: '#app', i18n, diff --git a/frontend/src/router/index.js b/frontend/src/router/index.js index 4eddc102..acd85b4a 100644 --- a/frontend/src/router/index.js +++ b/frontend/src/router/index.js @@ -1,6 +1,8 @@ import Vue from 'vue' import Router from 'vue-router' +import stats from '../utils/stats' + /* Layout */ import Layout from '../views/layout/Layout' @@ -225,7 +227,7 @@ router.beforeEach((to, from, next) => { router.afterEach((to, from, next) => { if (to.path) { if (localStorage.getItem('useStats') !== '0') { - window._hmt.push(['_trackPageview', to.path]) + stats.sendPv(to.path) } } }) diff --git a/frontend/src/utils/index.js b/frontend/src/utils/index.js index e69de29b..d5a118af 100644 --- a/frontend/src/utils/index.js +++ b/frontend/src/utils/index.js @@ -0,0 +1,5 @@ +import stats from './stats' + +export default { + stats +} diff --git a/frontend/src/utils/stats.js b/frontend/src/utils/stats.js index e69de29b..0029bff0 100644 --- a/frontend/src/utils/stats.js +++ b/frontend/src/utils/stats.js @@ -0,0 +1,8 @@ +export default { + sendPv (page) { + window._hmt.push(['_trackPageview', page]) + }, + sendEv (ev) { + window._hmt.push(['_trackCustomEvent', ev]) + } +}