mirror of
https://github.com/crawlab-team/crawlab.git
synced 2026-01-21 17:21:09 +01:00
加入反馈
This commit is contained in:
@@ -312,6 +312,12 @@ export default {
|
||||
'Home Page Response Time (sec)': '首页响应时间(秒)',
|
||||
'Home Page Response Status Code': '首页响应状态码',
|
||||
|
||||
// 反馈
|
||||
'Feedback': '反馈',
|
||||
'Feedbacks': '反馈',
|
||||
'Wechat': '微信',
|
||||
'Content': '内容',
|
||||
|
||||
// 用户
|
||||
'Super Admin': '超级管理员',
|
||||
|
||||
@@ -425,6 +431,7 @@ export default {
|
||||
'How to Upgrade': '升级方式',
|
||||
'Release': '发布',
|
||||
'Add Wechat to join discussion group': '添加微信 tikazyq1 加入交流群',
|
||||
'Submitted successfully': '提交成功',
|
||||
|
||||
// 登录
|
||||
'Sign in': '登录',
|
||||
@@ -599,6 +606,9 @@ docker run -d --restart always --name crawlab_worker \\
|
||||
'Sent signals to cancel selected tasks': '已经向所选任务发送取消任务信号',
|
||||
'Copied successfully': '已成功复制',
|
||||
'You have started the challenge.': '您已开始挑战',
|
||||
'Please enter your email': '请输入您的邮箱',
|
||||
'Please enter your Wechat account': '请输入您的微信账号',
|
||||
'Please enter your feedback content': '请输入您的反馈内容',
|
||||
|
||||
// 其他
|
||||
'Star crawlab-team/crawlab on GitHub': '在 GitHub 上为 Crawlab 加星吧'
|
||||
|
||||
@@ -192,30 +192,11 @@ export const constantRouterMap = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/users',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: 'User',
|
||||
icon: 'fa fa-users'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'UserList',
|
||||
component: () => import('../views/user/UserList'),
|
||||
meta: {
|
||||
title: 'Users',
|
||||
icon: 'fa fa-users'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/challenges',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: 'User',
|
||||
title: 'ChallengeList',
|
||||
icon: 'fa fa-flash'
|
||||
},
|
||||
children: [
|
||||
@@ -230,6 +211,45 @@ export const constantRouterMap = [
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/feedback',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: 'Feedback',
|
||||
icon: 'fa fa-commenting-o'
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'Feedback',
|
||||
component: () => import('../views/feedback/Feedback'),
|
||||
meta: {
|
||||
title: 'Feedback',
|
||||
icon: 'fa fa-commenting'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/users',
|
||||
component: Layout,
|
||||
meta: {
|
||||
title: 'User',
|
||||
icon: 'fa fa-users',
|
||||
isNew: true
|
||||
},
|
||||
children: [
|
||||
{
|
||||
path: '',
|
||||
name: 'UserList',
|
||||
component: () => import('../views/user/UserList'),
|
||||
meta: {
|
||||
title: 'Users',
|
||||
icon: 'fa fa-users'
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/setting',
|
||||
component: Layout,
|
||||
|
||||
121
frontend/src/views/feedback/Feedback.vue
Normal file
121
frontend/src/views/feedback/Feedback.vue
Normal file
@@ -0,0 +1,121 @@
|
||||
<template>
|
||||
<div class="feedback app-container">
|
||||
<div class="content">
|
||||
<el-card
|
||||
class="form"
|
||||
>
|
||||
<el-form
|
||||
ref="form"
|
||||
v-model="form"
|
||||
:model="form"
|
||||
label-width="80px"
|
||||
>
|
||||
<el-form-item
|
||||
:label="$t('Email')"
|
||||
prop="email"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.email"
|
||||
:placeholder="$t('Please enter your email')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('Wechat')"
|
||||
prop="wechat"
|
||||
>
|
||||
<el-input
|
||||
v-model="form.wechat"
|
||||
:placeholder="$t('Please enter your Wechat account')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item
|
||||
:label="$t('Content')"
|
||||
prop="content"
|
||||
required
|
||||
>
|
||||
<el-input
|
||||
type="textarea"
|
||||
rows="5"
|
||||
v-model="form.content"
|
||||
:placeholder="$t('Please enter your feedback content')"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<div class="actions">
|
||||
<el-button
|
||||
type="primary"
|
||||
size="small"
|
||||
:icon="isLoading ? 'el-icon-loading' : ''"
|
||||
:disabled="isLoading"
|
||||
@click="submit"
|
||||
>
|
||||
{{$t('Submit')}}
|
||||
</el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import axios from 'axios'
|
||||
|
||||
export default {
|
||||
name: 'Feedback',
|
||||
data () {
|
||||
return {
|
||||
form: {
|
||||
email: '',
|
||||
wechat: '',
|
||||
content: ''
|
||||
},
|
||||
isLoading: false
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
submit () {
|
||||
this.$refs['form'].validate(async valid => {
|
||||
if (!valid) return
|
||||
this.isLoading = true
|
||||
try {
|
||||
const res = await axios.put(process.env.VUE_APP_CRAWLAB_BASE_URL + '/feedback', {
|
||||
uid: localStorage.getItem('uid'),
|
||||
sid: sessionStorage.getItem('sid'),
|
||||
email: this.form.email,
|
||||
wechat: this.form.wechat,
|
||||
content: this.form.content,
|
||||
v: sessionStorage.getItem('v')
|
||||
})
|
||||
if (res && res.data.error) {
|
||||
this.$message.error(res.data.error)
|
||||
return
|
||||
}
|
||||
this.form = {
|
||||
email: '',
|
||||
wechat: '',
|
||||
content: ''
|
||||
}
|
||||
this.$message.success(this.$t('Submitted successfully'))
|
||||
} catch (e) {
|
||||
this.$message.error(e.toString())
|
||||
} finally {
|
||||
this.isLoading = false
|
||||
}
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.content {
|
||||
width: 900px;
|
||||
margin-left: calc(50% - 450px);
|
||||
}
|
||||
|
||||
.actions {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
Reference in New Issue
Block a user