diff --git a/.gitignore b/.gitignore index 04e1286c..c7a90ab9 100644 --- a/.gitignore +++ b/.gitignore @@ -104,3 +104,6 @@ venv.bak/ # mypy .mypy_cache/ + +# node_modules +node_modules/ diff --git a/app.py b/app.py index 91ba55f6..a9d9c5bf 100644 --- a/app.py +++ b/app.py @@ -49,7 +49,7 @@ api.add_resource(StatsApi, '/api/stats/') # create folder if it does not exist -if os.path.exists(PROJECT_LOGS_FOLDER): +if not os.path.exists(PROJECT_LOGS_FOLDER): os.makedirs(PROJECT_LOGS_FOLDER) if __name__ == '__main__': diff --git a/frontend/.editorconfig b/frontend/.editorconfig new file mode 100644 index 00000000..7053c49a --- /dev/null +++ b/frontend/.editorconfig @@ -0,0 +1,5 @@ +[*.{js,jsx,ts,tsx,vue}] +indent_style = space +indent_size = 2 +trim_trailing_whitespace = true +insert_final_newline = true diff --git a/frontend/.eslintrc.js b/frontend/.eslintrc.js new file mode 100644 index 00000000..98d04316 --- /dev/null +++ b/frontend/.eslintrc.js @@ -0,0 +1,17 @@ +module.exports = { + root: true, + env: { + node: true + }, + 'extends': [ + 'plugin:vue/essential', + '@vue/standard' + ], + rules: { + 'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off', + 'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off' + }, + parserOptions: { + parser: 'babel-eslint' + } +} diff --git a/frontend/.gitignore b/frontend/.gitignore new file mode 100644 index 00000000..185e6631 --- /dev/null +++ b/frontend/.gitignore @@ -0,0 +1,21 @@ +.DS_Store +node_modules +/dist + +# local env files +.env.local +.env.*.local + +# Log files +npm-debug.log* +yarn-debug.log* +yarn-error.log* + +# Editor directories and files +.idea +.vscode +*.suo +*.ntvs* +*.njsproj +*.sln +*.sw* diff --git a/frontend/LICENSE b/frontend/LICENSE new file mode 100644 index 00000000..61515750 --- /dev/null +++ b/frontend/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2017-present PanJiaChen + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/frontend/README.md b/frontend/README.md new file mode 100644 index 00000000..006332d0 --- /dev/null +++ b/frontend/README.md @@ -0,0 +1,34 @@ +# tmp + +## Project setup +``` +yarn install +``` + +### Compiles and hot-reloads for development +``` +yarn run serve +``` + +### Compiles and minifies for production +``` +yarn run build +``` + +### Run your tests +``` +yarn run test +``` + +### Lints and fixes files +``` +yarn run lint +``` + +### Run your unit tests +``` +yarn run test:unit +``` + +### Customize configuration +See [Configuration Reference](https://cli.vuejs.org/config/). diff --git a/frontend/README.zh-CN.md b/frontend/README.zh-CN.md new file mode 100644 index 00000000..5dc9f1d7 --- /dev/null +++ b/frontend/README.zh-CN.md @@ -0,0 +1,233 @@ +

+ +

+ +

+ + vue + + + element-ui + + + Build Status + + + license + + + GitHub release + + + gitter + + + donate + +

+ +简体中文 | [English](./README.md) + +## 简介 + +[vue-element-admin](http://panjiachen.github.io/vue-element-admin) 是一个后台集成解决方案,它基于 [vue](https://github.com/vuejs/vue) 和 [element](https://github.com/ElemeFE/element)。它使用了最新的前端技术栈,内置了 i18 国际化解决方案,动态路由,权限验证,提炼了典型的业务模型,提供了丰富的功能组件,它可以帮助你快速搭建企业级中后台产品原型。相信不管你的需求是什么,本项目都能帮助到你。 + +- [在线访问](http://panjiachen.github.io/vue-element-admin) + +- [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) + +- [Gitter 讨论组](https://gitter.im/vue-element-admin/discuss) + +- [Wiki](https://github.com/PanJiaChen/vue-element-admin/wiki) + +- [Donate](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate) + +- [Gitee](https://panjiachen.gitee.io/vue-element-admin/) 国内用户可访问该地址在线预览 + +- [国内访问文档](https://panjiachen.gitee.io/vue-element-admin-site/zh/) 方便没翻墙的用户查看文档 + +**本项目的定位是后台集成方案,不适合当基础模板来开发。** + +- 模板建议使用: [vue-admin-template](https://github.com/PanJiaChen/vue-admin-template) +- 桌面端: [electron-vue-admin](https://github.com/PanJiaChen/electron-vue-admin) +- Typescript版: [vue-typescript-admin-template](https://github.com/Armour/vue-typescript-admin-template) (鸣谢: [@Armour](https://github.com/Armour)) + +群主 **[圈子](https://jianshiapp.com/circles/1209)** 楼主会经常分享一些技术相关的东西,或者加入[qq 群](https://github.com/PanJiaChen/vue-element-admin/issues/602) + +**注意:该项目使用 element-ui@2.3.0+ 版本,所以最低兼容 vue@2.5.0+** + +**从`v3.8.0`开始使用`webpack4`。所以若还想使用`webpack3`开发,请使用该分支[webpack3](https://github.com/PanJiaChen/vue-element-admin/tree/webpack3)** + +**该项目不支持低版本浏览器(如 ie),有需求请自行添加 polyfill [详情](https://github.com/PanJiaChen/vue-element-admin/wiki#babel-polyfill)** + +## 前序准备 + +你需要在本地安装 [node](http://nodejs.org/) 和 [git](https://git-scm.com/)。本项目技术栈基于 [ES2015+](http://es6.ruanyifeng.com/)、[vue](https://cn.vuejs.org/index.html)、[vuex](https://vuex.vuejs.org/zh-cn/)、[vue-router](https://router.vuejs.org/zh-cn/) 、[axios](https://github.com/axios/axios) 和 [element-ui](https://github.com/ElemeFE/element),所有的请求数据都使用[Mock.js](https://github.com/nuysoft/Mock)模拟,提前了解和学习这些知识会对使用本项目有很大的帮助。 + +同时配套一个系列的教程文章,如何从零构建后一个完整的后台项目,建议大家先看完这些文章再来实践本项目 + +- [手摸手,带你用 vue 撸后台 系列一(基础篇)](https://juejin.im/post/59097cd7a22b9d0065fb61d2) +- [手摸手,带你用 vue 撸后台 系列二(登录权限篇)](https://juejin.im/post/591aa14f570c35006961acac) +- [手摸手,带你用 vue 撸后台 系列三 (实战篇)](https://juejin.im/post/593121aa0ce4630057f70d35) +- [手摸手,带你用 vue 撸后台 系列四(vueAdmin 一个极简的后台基础模板)](https://juejin.im/post/595b4d776fb9a06bbe7dba56) +- [手摸手,带你封装一个 vue component](https://segmentfault.com/a/1190000009090836) +- [手摸手,带你优雅的使用 icon](https://juejin.im/post/59bb864b5188257e7a427c09) +- [手摸手,带你用合理的姿势使用 webpack4(上)](https://juejin.im/post/5b56909a518825195f499806) +- [手摸手,带你用合理的姿势使用 webpack4(下)](https://juejin.im/post/5b5d6d6f6fb9a04fea58aabc) + +**如有问题请先看上述使用文档和文章,若不能满足,欢迎 issue 和 pr** + +

+ +

+ +## Sponsors +Become a sponsor and get your logo on our README on GitHub with a link to your site. [[Become a sponsor]](https://www.patreon.com/panjiachen) + +

Admin Dashboard Templates made with Vue, React and Angular.

+ +## 功能 + +``` +- 登录 / 注销 + +- 权限验证 + - 页面权限 + - 指令权限 + - 二步登录 + +- 多环境发布 + - dev sit stage prod + +- 全局功能 + - 国际化多语言 + - 多种动态换肤 + - 动态侧边栏(支持多级路由嵌套) + - 动态面包屑 + - 快捷导航(标签页) + - Svg Sprite 图标 + - 本地mock数据 + - Screenfull全屏 + - 自适应收缩侧边栏 + +- 编辑器 + - 富文本 + - Markdown + - JSON 等多格式 + +- Excel + - 导出excel + - 导出zip + - 导入excel + - 前端可视化excel + +- 表格 + - 动态表格 + - 拖拽表格 + - 树形表格 + - 内联编辑 + +- 错误页面 + - 401 + - 404 + +- 組件 + - 头像上传 + - 返回顶部 + - 拖拽Dialog + - 拖拽Select + - 拖拽看板 + - 列表拖拽 + - SplitPane + - Dropzone + - Sticky + - CountTo + +- 综合实例 +- 错误日志 +- Dashboard +- 引导页 +- ECharts 图表 +- Clipboard(剪贴复制) +- Markdown2html +``` + +## 开发 + +```bash +# 克隆项目 +git clone https://github.com/PanJiaChen/vue-element-admin.git + +# 安装依赖 +npm install + +# 建议不要用 cnpm 安装 会有各种诡异的bug 可以通过如下操作解决 npm 下载速度慢的问题 +npm install --registry=https://registry.npm.taobao.org + +# 启动服务 +npm run dev +``` + +浏览器访问 http://localhost:9527 + +## 发布 + +```bash +# 构建测试环境 +npm run build:sit + +# 构建生产环境 +npm run build:prod +``` + +## 其它 + +```bash +# --report to build with bundle size analytics +npm run build:prod + +# --generate a bundle size analytics. default: bundle-report.html +npm run build:prod --generate_report + +# --preview to start a server in local to preview +npm run build:prod --preview + +# lint code +npm run lint + +# auto fix +npm run lint -- --fix +``` + +更多信息请参考 [使用文档](https://panjiachen.github.io/vue-element-admin-site/zh/) + +## Changelog + +Detailed changes for each release are documented in the [release notes](https://github.com/PanJiaChen/vue-element-admin/releases). + +## Online Demo + +[在线 Demo](http://panjiachen.github.io/vue-element-admin) + +## Donate + +如果你觉得这个项目帮助到了你,你可以帮作者买一杯果汁表示鼓励 :tropical_drink: +![donate](https://panjiachen.github.io/donate/donation.png) + +[更多捐赠方式](https://panjiachen.gitee.io/vue-element-admin-site/zh/donate) + +[Paypal Me](https://www.paypal.me/panfree23) + +## Browsers support + +Modern browsers and Internet Explorer 10+. + +| [IE / Edge](http://godban.github.io/browsers-support-badges/)
IE / Edge | [Firefox](http://godban.github.io/browsers-support-badges/)
Firefox | [Chrome](http://godban.github.io/browsers-support-badges/)
Chrome | [Safari](http://godban.github.io/browsers-support-badges/)
Safari | +| --------- | --------- | --------- | --------- | +| IE10, IE11, Edge| last 2 versions| last 2 versions| last 2 versions + +## License + +[MIT](https://github.com/PanJiaChen/vue-element-admin/blob/master/LICENSE) + +Copyright (c) 2017-present PanJiaChen diff --git a/frontend/babel.config.js b/frontend/babel.config.js new file mode 100644 index 00000000..ba179669 --- /dev/null +++ b/frontend/babel.config.js @@ -0,0 +1,5 @@ +module.exports = { + presets: [ + '@vue/app' + ] +} diff --git a/frontend/conf/mime.types b/frontend/conf/mime.types new file mode 100644 index 00000000..cd3d700e --- /dev/null +++ b/frontend/conf/mime.types @@ -0,0 +1,88 @@ +types { + text/html html htm shtml; + text/css css; + text/xml xml; + image/gif gif; + image/jpeg jpeg jpg; + application/javascript js; + application/atom+xml atom; + application/rss+xml rss; + + text/mathml mml; + text/plain txt; + text/vnd.sun.j2me.app-descriptor jad; + text/vnd.wap.wml wml; + text/x-component htc; + + image/png png; + image/tiff tif tiff; + image/vnd.wap.wbmp wbmp; + image/x-icon ico; + image/x-jng jng; + image/x-ms-bmp bmp; + image/svg+xml svg svgz; + image/webp webp; + + application/font-woff woff; + application/java-archive jar war ear; + application/json json; + application/mac-binhex40 hqx; + application/msword doc; + application/pdf pdf; + application/postscript ps eps ai; + application/rtf rtf; + application/vnd.apple.mpegurl m3u8; + application/vnd.ms-excel xls; + application/vnd.ms-fontobject eot; + application/vnd.ms-powerpoint ppt; + application/vnd.wap.wmlc wmlc; + application/vnd.google-earth.kml+xml kml; + application/vnd.google-earth.kmz kmz; + application/x-7z-compressed 7z; + application/x-cocoa cco; + application/x-java-archive-diff jardiff; + application/x-java-jnlp-file jnlp; + application/x-makeself run; + application/x-perl pl pm; + application/x-pilot prc pdb; + application/x-rar-compressed rar; + application/x-redhat-package-manager rpm; + application/x-sea sea; + application/x-shockwave-flash swf; + application/x-stuffit sit; + application/x-tcl tcl tk; + application/x-x509-ca-cert der pem crt; + application/x-xpinstall xpi; + application/xhtml+xml xhtml; + application/xspf+xml xspf; + application/zip zip; + + application/octet-stream bin exe dll; + application/octet-stream deb; + application/octet-stream dmg; + application/octet-stream iso img; + application/octet-stream msi msp msm; + + application/vnd.openxmlformats-officedocument.wordprocessingml.document docx; + application/vnd.openxmlformats-officedocument.spreadsheetml.sheet xlsx; + application/vnd.openxmlformats-officedocument.presentationml.presentation pptx; + + audio/midi mid midi kar; + audio/mpeg mp3; + audio/ogg ogg; + audio/x-m4a m4a; + audio/x-realaudio ra; + + video/3gpp 3gpp 3gp; + video/mp2t ts; + video/mp4 mp4; + video/mpeg mpeg mpg; + video/quicktime mov; + video/webm webm; + video/x-flv flv; + video/x-m4v m4v; + video/x-mng mng; + video/x-ms-asf asx asf; + video/x-ms-wmv wmv; + video/x-msvideo avi; +} diff --git a/frontend/conf/nginx.conf b/frontend/conf/nginx.conf new file mode 100644 index 00000000..72c248d2 --- /dev/null +++ b/frontend/conf/nginx.conf @@ -0,0 +1,19 @@ +events { + worker_connections 1024; + multi_accept on; +} + +http { + include mime.types; + default_type application/octet-stream; + + server { + listen 8888; + root /Users/yeqing/projects/crawlab-frontend/dist; + index index.html; + + location ~ .*\.(js|css)?$ { + expires 1d; + } + } +} diff --git a/frontend/docs/file-manager-prototype.png b/frontend/docs/file-manager-prototype.png new file mode 100644 index 00000000..270435b7 Binary files /dev/null and b/frontend/docs/file-manager-prototype.png differ diff --git a/frontend/favicon.ico b/frontend/favicon.ico new file mode 100644 index 00000000..34b63ac6 Binary files /dev/null and b/frontend/favicon.ico differ diff --git a/frontend/index.html b/frontend/index.html new file mode 100644 index 00000000..98cf9b85 --- /dev/null +++ b/frontend/index.html @@ -0,0 +1,15 @@ + + + + + + + + Crawlab + + + +
+ + + diff --git a/frontend/jest.config.js b/frontend/jest.config.js new file mode 100644 index 00000000..29fee32b --- /dev/null +++ b/frontend/jest.config.js @@ -0,0 +1,23 @@ +module.exports = { + moduleFileExtensions: [ + 'js', + 'jsx', + 'json', + 'vue' + ], + transform: { + '^.+\\.vue$': 'vue-jest', + '.+\\.(css|styl|less|sass|scss|svg|png|jpg|ttf|woff|woff2)$': 'jest-transform-stub', + '^.+\\.jsx?$': 'babel-jest' + }, + moduleNameMapper: { + '^@/(.*)$': '/src/$1' + }, + snapshotSerializers: [ + 'jest-serializer-vue' + ], + testMatch: [ + '**/tests/unit/**/*.spec.(js|jsx|ts|tsx)|**/__tests__/*.(js|jsx|ts|tsx)' + ], + testURL: 'http://localhost/' +} diff --git a/frontend/package.json b/frontend/package.json new file mode 100644 index 00000000..ad1b8ceb --- /dev/null +++ b/frontend/package.json @@ -0,0 +1,44 @@ +{ + "name": "crawlab", + "version": "0.0.1", + "private": true, + "scripts": { + "serve": "vue-cli-service serve --ip=0.0.0.0", + "config": "vue ui", + "build": "vue-cli-service build", + "lint": "vue-cli-service lint", + "test:unit": "vue-cli-service test:unit" + }, + "dependencies": { + "@tinymce/tinymce-vue": "^2.0.0", + "axios": "0.18.0", + "dayjs": "^1.8.6", + "echarts": "^4.1.0", + "element-ui": "2.4.6", + "font-awesome": "^4.7.0", + "js-cookie": "2.2.0", + "normalize.css": "7.0.0", + "nprogress": "0.2.0", + "path": "^0.12.7", + "vue": "^2.5.22", + "vue-codemirror-lite": "^1.0.4", + "vue-router": "^3.0.1", + "vuex": "^3.0.1" + }, + "devDependencies": { + "@vue/cli-plugin-babel": "^3.4.0", + "@vue/cli-plugin-eslint": "^3.4.0", + "@vue/cli-plugin-unit-jest": "^3.4.0", + "@vue/cli-service": "^3.4.0", + "@vue/eslint-config-standard": "^4.0.0", + "@vue/test-utils": "^1.0.0-beta.20", + "babel-core": "7.0.0-bridge.0", + "babel-eslint": "^10.0.1", + "babel-jest": "^23.6.0", + "eslint": "^5.8.0", + "eslint-plugin-vue": "^5.0.0", + "node-sass": "^4.9.0", + "sass-loader": "^7.1.0", + "vue-template-compiler": "^2.5.21" + } +} diff --git a/frontend/postcss.config.js b/frontend/postcss.config.js new file mode 100644 index 00000000..961986e2 --- /dev/null +++ b/frontend/postcss.config.js @@ -0,0 +1,5 @@ +module.exports = { + plugins: { + autoprefixer: {} + } +} diff --git a/frontend/src/App.vue b/frontend/src/App.vue new file mode 100644 index 00000000..7b5c9085 --- /dev/null +++ b/frontend/src/App.vue @@ -0,0 +1,51 @@ + + + + + diff --git a/frontend/src/api/login.js b/frontend/src/api/login.js new file mode 100644 index 00000000..4699f07e --- /dev/null +++ b/frontend/src/api/login.js @@ -0,0 +1,27 @@ +import request from '@/utils/request' + +export function login (username, password) { + return request({ + url: '/user/login', + method: 'post', + data: { + username, + password + } + }) +} + +export function getInfo (token) { + return request({ + url: '/user/info', + method: 'get', + params: { token } + }) +} + +export function logout () { + return request({ + url: '/user/logout', + method: 'post' + }) +} diff --git a/frontend/src/api/request.js b/frontend/src/api/request.js new file mode 100644 index 00000000..a7570fea --- /dev/null +++ b/frontend/src/api/request.js @@ -0,0 +1,42 @@ +import axios from 'axios' + +const baseUrl = 'http://localhost:5000/api' + +const request = (method, path, params, data) => { + return new Promise((resolve, reject) => { + const url = `${baseUrl}${path}` + axios({ + method, + url, + params, + data + }) + .then(resolve) + .catch(reject) + }) +} + +const get = (path, params) => { + return request('GET', path, params) +} + +const post = (path, data) => { + return request('POST', path, {}, data) +} + +const put = (path, data) => { + return request('PUT', path, {}, data) +} + +const del = (path, data) => { + return request('DELETE', path) +} + +export default { + baseUrl, + request, + get, + post, + put, + delete: del +} diff --git a/frontend/src/api/table.js b/frontend/src/api/table.js new file mode 100644 index 00000000..95d1df60 --- /dev/null +++ b/frontend/src/api/table.js @@ -0,0 +1,9 @@ +import request from '@/utils/request' + +export function getList (params) { + return request({ + url: '/table/list', + method: 'get', + params + }) +} diff --git a/frontend/src/assets/404_images/404.png b/frontend/src/assets/404_images/404.png new file mode 100644 index 00000000..3d8e2305 Binary files /dev/null and b/frontend/src/assets/404_images/404.png differ diff --git a/frontend/src/assets/404_images/404_cloud.png b/frontend/src/assets/404_images/404_cloud.png new file mode 100644 index 00000000..c6281d09 Binary files /dev/null and b/frontend/src/assets/404_images/404_cloud.png differ diff --git a/frontend/src/components/BackToTop/index.vue b/frontend/src/components/BackToTop/index.vue new file mode 100644 index 00000000..39977178 --- /dev/null +++ b/frontend/src/components/BackToTop/index.vue @@ -0,0 +1,116 @@ + + + + + diff --git a/frontend/src/components/Breadcrumb/index.vue b/frontend/src/components/Breadcrumb/index.vue new file mode 100644 index 00000000..5b12d2d3 --- /dev/null +++ b/frontend/src/components/Breadcrumb/index.vue @@ -0,0 +1,86 @@ + + + + + diff --git a/frontend/src/components/Charts/keyboard.vue b/frontend/src/components/Charts/keyboard.vue new file mode 100644 index 00000000..857b26ae --- /dev/null +++ b/frontend/src/components/Charts/keyboard.vue @@ -0,0 +1,156 @@ + + + diff --git a/frontend/src/components/Charts/lineMarker.vue b/frontend/src/components/Charts/lineMarker.vue new file mode 100644 index 00000000..5d41b022 --- /dev/null +++ b/frontend/src/components/Charts/lineMarker.vue @@ -0,0 +1,227 @@ + + + diff --git a/frontend/src/components/Charts/mixChart.vue b/frontend/src/components/Charts/mixChart.vue new file mode 100644 index 00000000..a8e271ca --- /dev/null +++ b/frontend/src/components/Charts/mixChart.vue @@ -0,0 +1,271 @@ + + + diff --git a/frontend/src/components/Charts/mixins/resize.js b/frontend/src/components/Charts/mixins/resize.js new file mode 100644 index 00000000..c4c432f4 --- /dev/null +++ b/frontend/src/components/Charts/mixins/resize.js @@ -0,0 +1,32 @@ +import { debounce } from '@/utils' + +export default { + data() { + return { + sidebarElm: null + } + }, + mounted() { + this.__resizeHandler = debounce(() => { + if (this.chart) { + this.chart.resize() + } + }, 100) + window.addEventListener('resize', this.__resizeHandler) + + this.sidebarElm = document.getElementsByClassName('sidebar-container')[0] + this.sidebarElm && this.sidebarElm.addEventListener('transitionend', this.sidebarResizeHandler) + }, + beforeDestroy() { + window.removeEventListener('resize', this.__resizeHandler) + + this.sidebarElm && this.sidebarElm.removeEventListener('transitionend', this.sidebarResizeHandler) + }, + methods: { + sidebarResizeHandler(e) { + if (e.propertyName === 'width') { + this.__resizeHandler() + } + } + } +} diff --git a/frontend/src/components/Common/DialogView.vue b/frontend/src/components/Common/DialogView.vue new file mode 100644 index 00000000..41917279 --- /dev/null +++ b/frontend/src/components/Common/DialogView.vue @@ -0,0 +1,165 @@ + + + + + diff --git a/frontend/src/components/DndList/index.vue b/frontend/src/components/DndList/index.vue new file mode 100644 index 00000000..7587daa7 --- /dev/null +++ b/frontend/src/components/DndList/index.vue @@ -0,0 +1,157 @@ + + + + + diff --git a/frontend/src/components/DragSelect/index.vue b/frontend/src/components/DragSelect/index.vue new file mode 100644 index 00000000..513be006 --- /dev/null +++ b/frontend/src/components/DragSelect/index.vue @@ -0,0 +1,61 @@ + + + + + diff --git a/frontend/src/components/Dropzone/index.vue b/frontend/src/components/Dropzone/index.vue new file mode 100644 index 00000000..15d811d9 --- /dev/null +++ b/frontend/src/components/Dropzone/index.vue @@ -0,0 +1,297 @@ + + + + + diff --git a/frontend/src/components/ErrorLog/index.vue b/frontend/src/components/ErrorLog/index.vue new file mode 100644 index 00000000..c46cf110 --- /dev/null +++ b/frontend/src/components/ErrorLog/index.vue @@ -0,0 +1,63 @@ + + + + + diff --git a/frontend/src/components/FileList/FileList.vue b/frontend/src/components/FileList/FileList.vue new file mode 100644 index 00000000..f1850b21 --- /dev/null +++ b/frontend/src/components/FileList/FileList.vue @@ -0,0 +1,200 @@ + + + + + + + diff --git a/frontend/src/components/GithubCorner/index.vue b/frontend/src/components/GithubCorner/index.vue new file mode 100644 index 00000000..b5da8874 --- /dev/null +++ b/frontend/src/components/GithubCorner/index.vue @@ -0,0 +1,51 @@ + + + diff --git a/frontend/src/components/Hamburger/index.vue b/frontend/src/components/Hamburger/index.vue new file mode 100644 index 00000000..220d67ec --- /dev/null +++ b/frontend/src/components/Hamburger/index.vue @@ -0,0 +1,42 @@ + + + + + diff --git a/frontend/src/components/HeaderSearch/index.vue b/frontend/src/components/HeaderSearch/index.vue new file mode 100644 index 00000000..ab0d556a --- /dev/null +++ b/frontend/src/components/HeaderSearch/index.vue @@ -0,0 +1,187 @@ + + + + + diff --git a/frontend/src/components/ImageCropper/index.vue b/frontend/src/components/ImageCropper/index.vue new file mode 100644 index 00000000..04b1ede9 --- /dev/null +++ b/frontend/src/components/ImageCropper/index.vue @@ -0,0 +1,1420 @@ + + + + + + + diff --git a/frontend/src/components/ImageCropper/utils/data2blob.js b/frontend/src/components/ImageCropper/utils/data2blob.js new file mode 100755 index 00000000..9c47f8af --- /dev/null +++ b/frontend/src/components/ImageCropper/utils/data2blob.js @@ -0,0 +1,19 @@ +/** + * database64文件格式转换为2进制 + * + * @param {[String]} data dataURL 的格式为 “data:image/png;base64,****”,逗号之前都是一些说明性的文字,我们只需要逗号之后的就行了 + * @param {[String]} mime [description] + * @return {[blob]} [description] + */ +export default function(data, mime) { + data = data.split(',')[1] + data = window.atob(data) + var ia = new Uint8Array(data.length) + for (var i = 0; i < data.length; i++) { + ia[i] = data.charCodeAt(i) + } + // canvas.toDataURL 返回的默认格式就是 image/png + return new Blob([ia], { + type: mime + }) +} diff --git a/frontend/src/components/ImageCropper/utils/effectRipple.js b/frontend/src/components/ImageCropper/utils/effectRipple.js new file mode 100755 index 00000000..46a01640 --- /dev/null +++ b/frontend/src/components/ImageCropper/utils/effectRipple.js @@ -0,0 +1,39 @@ +/** + * 点击波纹效果 + * + * @param {[event]} e [description] + * @param {[Object]} arg_opts [description] + * @return {[bollean]} [description] + */ +export default function(e, arg_opts) { + var opts = Object.assign({ + ele: e.target, // 波纹作用元素 + type: 'hit', // hit点击位置扩散center中心点扩展 + bgc: 'rgba(0, 0, 0, 0.15)' // 波纹颜色 + }, arg_opts) + var target = opts.ele + if (target) { + var rect = target.getBoundingClientRect() + var ripple = target.querySelector('.e-ripple') + if (!ripple) { + ripple = document.createElement('span') + ripple.className = 'e-ripple' + ripple.style.height = ripple.style.width = Math.max(rect.width, rect.height) + 'px' + target.appendChild(ripple) + } else { + ripple.className = 'e-ripple' + } + switch (opts.type) { + case 'center': + ripple.style.top = (rect.height / 2 - ripple.offsetHeight / 2) + 'px' + ripple.style.left = (rect.width / 2 - ripple.offsetWidth / 2) + 'px' + break + default: + ripple.style.top = (e.pageY - rect.top - ripple.offsetHeight / 2 - document.body.scrollTop) + 'px' + ripple.style.left = (e.pageX - rect.left - ripple.offsetWidth / 2 - document.body.scrollLeft) + 'px' + } + ripple.style.backgroundColor = opts.bgc + ripple.className = 'e-ripple z-active' + return false + } +} diff --git a/frontend/src/components/ImageCropper/utils/language.js b/frontend/src/components/ImageCropper/utils/language.js new file mode 100755 index 00000000..727872d9 --- /dev/null +++ b/frontend/src/components/ImageCropper/utils/language.js @@ -0,0 +1,232 @@ +export default { + zh: { + hint: '点击,或拖动图片至此处', + loading: '正在上传……', + noSupported: '浏览器不支持该功能,请使用IE10以上或其他现在浏览器!', + success: '上传成功', + fail: '图片上传失败', + preview: '头像预览', + btn: { + off: '取消', + close: '关闭', + back: '上一步', + save: '保存' + }, + error: { + onlyImg: '仅限图片格式', + outOfSize: '单文件大小不能超过 ', + lowestPx: '图片最低像素为(宽*高):' + } + }, + 'zh-tw': { + hint: '點擊,或拖動圖片至此處', + loading: '正在上傳……', + noSupported: '瀏覽器不支持該功能,請使用IE10以上或其他現代瀏覽器!', + success: '上傳成功', + fail: '圖片上傳失敗', + preview: '頭像預覽', + btn: { + off: '取消', + close: '關閉', + back: '上一步', + save: '保存' + }, + error: { + onlyImg: '僅限圖片格式', + outOfSize: '單文件大小不能超過 ', + lowestPx: '圖片最低像素為(寬*高):' + } + }, + en: { + hint: 'Click or drag the file here to upload', + loading: 'Uploading…', + noSupported: 'Browser is not supported, please use IE10+ or other browsers', + success: 'Upload success', + fail: 'Upload failed', + preview: 'Preview', + btn: { + off: 'Cancel', + close: 'Close', + back: 'Back', + save: 'Save' + }, + error: { + onlyImg: 'Image only', + outOfSize: 'Image exceeds size limit: ', + lowestPx: 'Image\'s size is too low. Expected at least: ' + } + }, + ro: { + hint: 'Atinge sau trage fișierul aici', + loading: 'Se încarcă', + noSupported: 'Browser-ul tău nu suportă acest feature. Te rugăm încearcă cu alt browser.', + success: 'S-a încărcat cu succes', + fail: 'A apărut o problemă la încărcare', + preview: 'Previzualizează', + + btn: { + off: 'Anulează', + close: 'Închide', + back: 'Înapoi', + save: 'Salvează' + }, + + error: { + onlyImg: 'Doar imagini', + outOfSize: 'Imaginea depășește limita de: ', + loewstPx: 'Imaginea este prea mică; Minim: ' + } + }, + ru: { + hint: 'Нажмите, или перетащите файл в это окно', + loading: 'Загружаю……', + noSupported: 'Ваш браузер не поддерживается, пожалуйста, используйте IE10 + или другие браузеры', + success: 'Загрузка выполнена успешно', + fail: 'Ошибка загрузки', + preview: 'Предпросмотр', + btn: { + off: 'Отменить', + close: 'Закрыть', + back: 'Назад', + save: 'Сохранить' + }, + error: { + onlyImg: 'Только изображения', + outOfSize: 'Изображение превышает предельный размер: ', + lowestPx: 'Минимальный размер изображения: ' + } + }, + 'pt-br': { + hint: 'Clique ou arraste o arquivo aqui para carregar', + loading: 'Carregando…', + noSupported: 'Browser não suportado, use o IE10+ ou outro browser', + success: 'Sucesso ao carregar imagem', + fail: 'Falha ao carregar imagem', + preview: 'Pré-visualizar', + btn: { + off: 'Cancelar', + close: 'Fechar', + back: 'Voltar', + save: 'Salvar' + }, + error: { + onlyImg: 'Apenas imagens', + outOfSize: 'A imagem excede o limite de tamanho: ', + lowestPx: 'O tamanho da imagem é muito pequeno. Tamanho mínimo: ' + } + }, + fr: { + hint: 'Cliquez ou glissez le fichier ici.', + loading: 'Téléchargement…', + noSupported: 'Votre navigateur n\'est pas supporté. Utilisez IE10 + ou un autre navigateur s\'il vous plaît.', + success: 'Téléchargement réussit', + fail: 'Téléchargement echoué', + preview: 'Aperçu', + btn: { + off: 'Annuler', + close: 'Fermer', + back: 'Retour', + save: 'Enregistrer' + }, + error: { + onlyImg: 'Image uniquement', + outOfSize: 'L\'image sélectionnée dépasse la taille maximum: ', + lowestPx: 'L\'image sélectionnée est trop petite. Dimensions attendues: ' + } + }, + nl: { + hint: 'Klik hier of sleep een afbeelding in dit vlak', + loading: 'Uploaden…', + noSupported: 'Je browser wordt helaas niet ondersteund. Gebruik IE10+ of een andere browser.', + success: 'Upload succesvol', + fail: 'Upload mislukt', + preview: 'Voorbeeld', + btn: { + off: 'Annuleren', + close: 'Sluiten', + back: 'Terug', + save: 'Opslaan' + }, + error: { + onlyImg: 'Alleen afbeeldingen', + outOfSize: 'De afbeelding is groter dan: ', + lowestPx: 'De afbeelding is te klein! Minimale afmetingen: ' + } + }, + tr: { + hint: 'Tıkla veya yüklemek istediğini buraya sürükle', + loading: 'Yükleniyor…', + noSupported: 'Tarayıcı desteklenmiyor, lütfen IE10+ veya farklı tarayıcı kullanın', + success: 'Yükleme başarılı', + fail: 'Yüklemede hata oluştu', + preview: 'Önizle', + btn: { + off: 'İptal', + close: 'Kapat', + back: 'Geri', + save: 'Kaydet' + }, + error: { + onlyImg: 'Sadece resim', + outOfSize: 'Resim yükleme limitini aşıyor: ', + lowestPx: 'Resmin boyutu çok küçük. En az olması gereken: ' + } + }, + 'es-MX': { + hint: 'Selecciona o arrastra una imagen', + loading: 'Subiendo...', + noSupported: 'Tu navegador no es soportado, porfavor usa IE10+ u otros navegadores mas recientes', + success: 'Subido exitosamente', + fail: 'Sucedió un error', + preview: 'Vista previa', + btn: { + off: 'Cancelar', + close: 'Cerrar', + back: 'Atras', + save: 'Guardar' + }, + error: { + onlyImg: 'Unicamente imagenes', + outOfSize: 'La imagen excede el tamaño maximo:', + lowestPx: 'La imagen es demasiado pequeño. Se espera por lo menos:' + } + }, + de: { + hint: 'Klick hier oder zieh eine Datei hier rein zum Hochladen', + loading: 'Hochladen…', + noSupported: 'Browser wird nicht unterstützt, bitte verwende IE10+ oder andere Browser', + success: 'Upload erfolgreich', + fail: 'Upload fehlgeschlagen', + preview: 'Vorschau', + btn: { + off: 'Abbrechen', + close: 'Schließen', + back: 'Zurück', + save: 'Speichern' + }, + error: { + onlyImg: 'Nur Bilder', + outOfSize: 'Das Bild ist zu groß: ', + lowestPx: 'Das Bild ist zu klein. Mindestens: ' + } + }, + ja: { + hint: 'クリック・ドラッグしてファイルをアップロード', + loading: 'アップロード中...', + noSupported: 'このブラウザは対応されていません。IE10+かその他の主要ブラウザをお使いください。', + success: 'アップロード成功', + fail: 'アップロード失敗', + preview: 'プレビュー', + btn: { + off: 'キャンセル', + close: '閉じる', + back: '戻る', + save: '保存' + }, + error: { + onlyImg: '画像のみ', + outOfSize: '画像サイズが上限を超えています。上限: ', + lowestPx: '画像が小さすぎます。最小サイズ: ' + } + } +} diff --git a/frontend/src/components/ImageCropper/utils/mimes.js b/frontend/src/components/ImageCropper/utils/mimes.js new file mode 100755 index 00000000..e20c085c --- /dev/null +++ b/frontend/src/components/ImageCropper/utils/mimes.js @@ -0,0 +1,7 @@ +export default { + 'jpg': 'image/jpeg', + 'png': 'image/png', + 'gif': 'image/gif', + 'svg': 'image/svg+xml', + 'psd': 'image/photoshop' +} diff --git a/frontend/src/components/InfoView/NodeInfoView.vue b/frontend/src/components/InfoView/NodeInfoView.vue new file mode 100644 index 00000000..109bb288 --- /dev/null +++ b/frontend/src/components/InfoView/NodeInfoView.vue @@ -0,0 +1,73 @@ + + + + + diff --git a/frontend/src/components/InfoView/SpiderInfoView.vue b/frontend/src/components/InfoView/SpiderInfoView.vue new file mode 100644 index 00000000..94cec531 --- /dev/null +++ b/frontend/src/components/InfoView/SpiderInfoView.vue @@ -0,0 +1,112 @@ + + + + + diff --git a/frontend/src/components/InfoView/TaskInfoView.vue b/frontend/src/components/InfoView/TaskInfoView.vue new file mode 100644 index 00000000..a81174d2 --- /dev/null +++ b/frontend/src/components/InfoView/TaskInfoView.vue @@ -0,0 +1,89 @@ + + + + + diff --git a/frontend/src/components/JsonEditor/index.vue b/frontend/src/components/JsonEditor/index.vue new file mode 100644 index 00000000..d68b8c05 --- /dev/null +++ b/frontend/src/components/JsonEditor/index.vue @@ -0,0 +1,72 @@ +