优化日志异常展示

This commit is contained in:
marvzhang
2020-04-19 11:07:51 +08:00
parent 9e7a00e481
commit 3cafb47378
4 changed files with 20 additions and 2 deletions

View File

@@ -12,8 +12,8 @@
<el-form-item :label="$t('Status')">
<status-tag :status="taskForm.status"/>
<el-badge
v-if="errorLogData.length > 0"
:value="errorLogData.length"
v-if="taskForm.error_log_count > 0"
:value="taskForm.error_log_count"
style="margin-left:10px; cursor:pointer;"
>
<el-tag type="danger" @click="onClickLogWithErrors">

View File

@@ -488,6 +488,7 @@ export default {
'Enable Tutorial': '启用教程',
'Error Regex Pattern': '异常正则表达式',
'By default: ': '默认: ',
'Max Error Logs Display': '最大异常日志展示',
// 挑战
'Challenge': '挑战',
@@ -627,6 +628,7 @@ docker run -d --restart always --name crawlab_worker \\
'Please enter your Wechat account': '请输入您的微信账号',
'Please enter your feedback content': '请输入您的反馈内容',
'No response from the server. Please make sure your server is running correctly. You can also refer to the documentation to solve this issue.': '服务器无响应请保证您的服务器正常运行您也可以参考文档来解决这个问题文档链接在下方',
'Are you sure to restart this task?': '确认重新运行该任务?',
// 其他
'Star crawlab-team/crawlab on GitHub': ' GitHub 上为 Crawlab 加星吧'

View File

@@ -87,6 +87,10 @@ const user = {
getInfo ({ commit, state }) {
return request.get('/me')
.then(response => {
// ensure compatibility
if (!response.data.data.setting.max_error_log) {
response.data.data.setting.max_error_log = 1000
}
commit('SET_USER_INFO', response.data.data)
window.localStorage.setItem('user_info', JSON.stringify(response.data.data))
})

View File

@@ -129,6 +129,18 @@
clearable
/>
</el-form-item>
<el-form-item :label="$t('Max Error Logs Display')" prop="setting.max_error_log">
<el-select
v-model="userInfo.setting.max_error_log"
clearable
>
<el-option :value="100" label="100"/>
<el-option :value="500" label="500"/>
<el-option :value="1000" label="1000"/>
<el-option :value="5000" label="5000"/>
<el-option :value="10000" label="10000"/>
</el-select>
</el-form-item>
<el-form-item>
<div style="text-align: right">
<el-button type="success" size="small" @click="saveUserInfo">