Fix consistency of parameter naming to in error stack component

This commit is contained in:
guerler
2018-12-21 15:16:53 -05:00
parent d53e33cf9f
commit d385be993a
@@ -6,7 +6,9 @@
<b-alert :show="infoVisible" variant="info">
No errors available.
</b-alert>
<b-table :show="errorsVisible" striped :fields="errorsAttributes" :items="errors"/>
<b-table striped v-if="errorStackVisible"
:fields="errorStackAttributes"
:items="errorStack"/>
</div>
</template>
<script>
@@ -15,9 +17,9 @@ import { getErrorStack } from "./AdminServices.js"
export default {
data() {
return {
errors: [],
errorsLoaded: false,
errorsAttributes: [
errorStack: [],
errorStackLoaded: false,
errorStackAttributes: [
{ key: 'time', sortable: true },
{ key: 'phase', sortable: true },
{ key: 'file', sortable: true },
@@ -27,24 +29,21 @@ export default {
};
},
computed: {
errorsVisible: function() {
return this.errors.length > 0;
},
errorsLength: function() {
return this.errors.length;
errorStackVisible: function() {
return this.errorStack.length > 0;
},
messageVisible: function() {
return this.messageText != null;
},
infoVisible: function() {
return !this.errorsVisible && this.errorsLoaded;
return !this.errorStackVisible && this.errorStackLoaded;
}
},
created() {
getErrorStack()
.then(response => {
this.errors = response.data;
this.errorsLoaded = true;
this.errorStack = response.data;
this.errorStackLoaded = true;
})
.catch(e => {
let message = e && e.response && e.response.data && e.response.data.err_msg;