Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .github/workflows/eslint-check.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
name: Eslint Check
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false

- name: Install dependencies
run: yarn install
working-directory: front-end

- name: Run eslint
run: npx eslint . --ext .js,.jsx,.ts,.vue,.tsx
working-directory: front-end
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -104,4 +104,6 @@ dist
.tern-port

# vscode-root file
**/.vscode-root
**/.vscode-root

.DS_Store
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions andv-front-end/.env.development
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
NODE_ENV=development
VUE_APP_PREVIEW=true
VUE_APP_API_BASE_URL=/api
File renamed without changes.
75 changes: 75 additions & 0 deletions andv-front-end/.eslintrc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/strongly-recommended',
'@vue/standard'
],
rules: {
'no-console': 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'generator-star-spacing': 'off',
'no-mixed-operators': 0,
'vue/max-attributes-per-line': [
2,
{
'singleline': 5,
'multiline': {
'max': 5,
'allowFirstLine': true
}
}
],
'vue/attribute-hyphenation': 0,
'vue/html-self-closing': 0,
'vue/component-name-in-template-casing': 0,
'vue/html-closing-bracket-spacing': 0,
'vue/singleline-html-element-content-newline': 0,
'vue/no-unused-components': 0,
'vue/multiline-html-element-content-newline': 0,
'vue/no-use-v-if-with-v-for': 0,
'vue/html-closing-bracket-newline': 0,
'vue/no-parsing-error': 0,
'no-tabs': 0,
'quotes': [
2,
'single',
{
'avoidEscape': true,
'allowTemplateLiterals': true
}
],
'semi': [
2,
'never',
{
'beforeStatementContinuationChars': 'never'
}
],
'no-delete-var': 2,
'prefer-const': [
2,
{
'ignoreReadBeforeAssign': false
}
],
'template-curly-spacing': 'off',
'indent': 'off'
},
parserOptions: {
parser: 'babel-eslint'
},
overrides: [
{
files: [
'**/__tests__/*.{j,t}s?(x)',
'**/tests/unit/**/*.spec.{j,t}s?(x)'
],
env: {
jest: true
}
}
]
}
File renamed without changes.
22 changes: 22 additions & 0 deletions andv-front-end/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
.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*
package-lock.json
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
67 changes: 67 additions & 0 deletions andv-front-end/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
{
"name": "vue-antd-pro",
"version": "0.2.0",
"private": true,
"scripts": {
"api": "vue-cli-service serve --mode api",
"start": "vue-cli-service serve",
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"test:unit": "vue-cli-service test:unit",
"lint": "vue-cli-service lint",
"build:prod": "vue-cli-service build --mode api",
"lint:nofix": "vue-cli-service lint --no-fix"
},
"dependencies": {
"@ant-design-vue/pro-layout": "^1.0.7",
"@antv/data-set": "^0.10.2",
"ant-design-vue": "^1.7.2",
"axios": "^0.19.0",
"core-js": "^3.1.2",
"enquire.js": "^2.1.6",
"lodash.clonedeep": "^4.5.0",
"lodash.get": "^4.4.2",
"lodash.pick": "^4.4.0",
"md5": "^2.2.1",
"mockjs2": "1.0.8",
"moment": "^2.24.0",
"nprogress": "^0.2.0",
"store": "^2.0.12",
"uid": "^2.0.0",
"viser-vue": "^2.4.6",
"vue": "^2.6.10",
"vue-clipboard2": "^0.2.1",
"vue-cropper": "0.4.9",
"vue-i18n": "^8.17.4",
"vue-quill-editor": "^3.0.6",
"vue-router": "^3.1.2",
"vue-svg-component-runtime": "^1.0.1",
"vuex": "^3.1.1",
"wangeditor": "^3.1.1"
},
"devDependencies": {
"@ant-design/colors": "^3.2.1",
"@vue/cli-plugin-babel": "^4.0.4",
"@vue/cli-plugin-eslint": "^4.0.4",
"@vue/cli-plugin-router": "^4.0.4",
"@vue/cli-plugin-unit-jest": "^4.0.4",
"@vue/cli-plugin-vuex": "^4.0.4",
"@vue/cli-service": "^4.0.4",
"@vue/eslint-config-standard": "^4.0.0",
"@vue/test-utils": "^1.0.0-beta.29",
"babel-eslint": "^10.0.1",
"babel-plugin-import": "^1.12.2",
"babel-plugin-transform-remove-console": "^6.9.4",
"eslint": "^5.16.0",
"eslint-plugin-html": "^5.0.0",
"eslint-plugin-vue": "^5.2.3",
"git-revision-webpack-plugin": "^3.0.6",
"less": "^3.0.4",
"less-loader": "^5.0.0",
"opencollective": "^1.0.3",
"opencollective-postinstall": "^2.0.2",
"vue-svg-icon-loader": "^2.1.1",
"vue-template-compiler": "^2.6.10",
"webpack-theme-color-replacer": "^1.3.12"
}
}
5 changes: 5 additions & 0 deletions andv-front-end/postcss.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
module.exports = {
plugins: {
autoprefixer: {}
}
}
File renamed without changes
File renamed without changes.
File renamed without changes
28 changes: 28 additions & 0 deletions andv-front-end/src/App.vue
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<template>
<a-config-provider :locale="locale">
<div id="app">
<router-view/>
</div>
</a-config-provider>
</template>

<script>
import { domTitle, setDocumentTitle } from '@/utils/domUtil'
import { i18nRender } from '@/locales'

export default {
data () {
return {
}
},
computed: {
locale () {
// 只是为了切换语言时,更新标题
const { title } = this.$route.meta
title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))

return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
}
}
}
</script>
59 changes: 59 additions & 0 deletions andv-front-end/src/api/func.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
import request from '@/utils/request'

const { post, get, put } = request

export const funcApi = {
list: '/admin/v3/functions/public/default',
create: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}`,
update: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}`,
info: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}`,
stats: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}/stats`,
status: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}/status`,
trigger: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}/trigger`,
delete: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}`,
stop: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}/stop`,
start: ({ funcName }) => `/admin/v3/functions/public/default/${funcName}/start`
}

export function getList () {
return get(funcApi.list)
}

export function create (funcName, data) {
return post(funcApi.create({ funcName }), data, { headers: { 'Content-Type': 'multipart/form-data' } })
}

export function update (funcName, data) {
return put(funcApi.update({ funcName }), data, { headers: { 'Content-Type': 'multipart/form-data' } })
}

export function getInfo (funcName) {
return get(funcApi.info({ funcName }))
}

export function getStats (funcName) {
return get(funcApi.stats({ funcName }))
}

export function getStatus (funcName) {
return get(funcApi.status({ funcName }))
}

export function triggerFunc (funcName, data) {
return post(funcApi.trigger({ funcName }), { data })
}

export function deleteFunc (funcName) {
return request({
url: funcApi.delete({ funcName }),
method: 'delete'
})
}

export function startFunc (funcName) {
return post(funcApi.start({ funcName }))
}

export function stopFunc (funcName) {
return post(funcApi.stop({ funcName }))
}
File renamed without changes.
File renamed without changes.
Binary file added andv-front-end/src/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
<template>
<global-footer class="footer custom-render">
<template v-slot:links>
Powered by <a href="https://github.com/vueComponent"
target="_blank">vueComponent</a>
Powered by
<a href="https://github.com/vueComponent"
target="_blank">vueComponent
</a>
</template>
<template v-slot:copyright>
<a href="https://github.com/FunctionStream/function-stream"
target="_blank">
<a-icon type="github" /> Function Stream
<a-icon type="github" />
Function Stream
</a>
</template>
</global-footer>
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -37,5 +37,5 @@ export default {
'menu.account.trigger': 'Trigger Error',
'menu.account.logout': 'Logout',

'menu.function': 'Function',
'menu.function': 'Function'
}
File renamed without changes.
24 changes: 24 additions & 0 deletions andv-front-end/src/mock/index.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
import { isIE } from '@/utils/util'

// 判断环境不是 prod 或者 preview 是 true 时,加载 mock 服务
if (process.env.NODE_ENV !== 'production' || process.env.VUE_APP_PREVIEW === 'true') {
if (isIE()) {
console.error('[antd-pro] ERROR: `mockjs` NOT SUPPORT `IE` PLEASE DO NOT USE IN `production` ENV.')
}
// 使用同步加载依赖
// 防止 vuex 中的 GetInfo 早于 mock 运行,导致无法 mock 请求返回结果
console.log('[antd-pro] mock mounting')
const Mock = require('mockjs2')
require('./services/auth')
require('./services/user')
require('./services/manage')
require('./services/other')
require('./services/tagCloud')
require('./services/article')
require('./services/func')

Mock.setup({
timeout: 800 // setter delay time
})
console.log('[antd-pro] mock mounted')
}
Loading