Skip to content
Merged

pull #13

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
12 changes: 11 additions & 1 deletion src/components/ErrorLog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@
</el-button>
</el-badge>

<el-dialog :visible.sync="dialogTableVisible" title="Error Log" width="80%" append-to-body>
<el-dialog :visible.sync="dialogTableVisible" width="80%" append-to-body>
<div slot="title">
<span style="padding-right: 10px;">Error Log</span>
<el-button size="mini" type="primary" icon="el-icon-delete" @click="clearAll">Clear All</el-button>
</div>
<el-table :data="errorLogs" border>
<el-table-column label="Message">
<template slot-scope="{row}">
Expand Down Expand Up @@ -54,6 +58,12 @@ export default {
errorLogs() {
return this.$store.getters.errorLogs
}
},
methods: {
clearAll() {
this.dialogTableVisible = false
this.$store.dispatch('errorLog/clearErrorLog')
}
}
}
</script>
Expand Down
6 changes: 6 additions & 0 deletions src/store/modules/errorLog.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,18 @@ const state = {
const mutations = {
ADD_ERROR_LOG: (state, log) => {
state.logs.push(log)
},
CLEAR_ERROR_LOG: (state) => {
state.logs.splice(0)
}
}

const actions = {
addErrorLog({ commit }, log) {
commit('ADD_ERROR_LOG', log)
},
clearErrorLog({ commit }) {
commit('CLEAR_ERROR_LOG')
}
}

Expand Down
1 change: 1 addition & 0 deletions src/views/redirect/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ export default {
const { params, query } = this.$route
const { path } = params
this.$router.replace({ path: '/' + path, query })
return
},
render: function(h) {
return h() // avoid warning message
Expand Down