mirror of
https://github.com/galaxyproject/galaxy.git
synced 2026-09-24 16:30:27 +08:00
Add error stack vue component and client side routes
This commit is contained in:
@@ -14,6 +14,7 @@ import DataTables from "components/admin/DataTables.vue";
|
||||
import DataTypes from "components/admin/DataTypes.vue";
|
||||
import DataManagerView from "components/admin/DataManager/DataManagerView.vue";
|
||||
import DataManagerRouter from "components/admin/DataManager/DataManagerRouter.vue";
|
||||
import ErrorStack from "components/admin/ErrorStack.vue";
|
||||
import Vue from "vue";
|
||||
import { serverPath } from "utils/serverPath";
|
||||
|
||||
@@ -33,6 +34,7 @@ window.app = function app(options, bootstrapped) {
|
||||
"(/)admin(/)users": "show_users",
|
||||
"(/)admin(/)roles": "show_roles",
|
||||
"(/)admin(/)groups": "show_groups",
|
||||
"(/)admin(/)error_stack": "show_error_stack",
|
||||
"(/)admin(/)tool_versions": "show_tool_versions",
|
||||
"(/)admin(/)quotas": "show_quotas",
|
||||
"(/)admin(/)repositories": "show_repositories",
|
||||
@@ -120,10 +122,15 @@ window.app = function app(options, bootstrapped) {
|
||||
show_data_tables: function() {
|
||||
this._display_vue_helper(DataTables);
|
||||
},
|
||||
|
||||
show_data_types: function() {
|
||||
this._display_vue_helper(DataTypes);
|
||||
},
|
||||
|
||||
show_error_stack: function() {
|
||||
this._display_vue_helper(ErrorStack);
|
||||
},
|
||||
|
||||
show_data_manager: function(path) {
|
||||
let vueMount = document.createElement("div");
|
||||
this.page.display(vueMount);
|
||||
|
||||
@@ -132,7 +132,8 @@ var AdminPanel = Backbone.View.extend({
|
||||
},
|
||||
{
|
||||
title: _l("View error logs"),
|
||||
url: "admin/tool_errors"
|
||||
url: "admin/error_stack",
|
||||
target: "__use_router__"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
import { getAppRoot } from "onload/loadConfig";
|
||||
import axios from "axios";
|
||||
|
||||
export function getErrorStack() {
|
||||
let url = `${getAppRoot()}api/tools/error_stack`;
|
||||
return axios.get(url);
|
||||
}
|
||||
@@ -0,0 +1,54 @@
|
||||
<template>
|
||||
<div>
|
||||
<div v-if="messageVisible" class="alert alert-danger">
|
||||
{{ messageText }}
|
||||
</div>
|
||||
<div v-if="!errorsVisible && errorsLoaded" class="alert alert-info">
|
||||
No errors available.
|
||||
</div>
|
||||
<b-table v-if="errorsVisible" striped :fields="errorsAttributes" :items="errors">
|
||||
</b-table>
|
||||
</div>
|
||||
</template>
|
||||
<script>
|
||||
import { getErrorStack } from "./AdminServices.js"
|
||||
|
||||
export default {
|
||||
data() {
|
||||
return {
|
||||
errors: [],
|
||||
errorsLoaded: false,
|
||||
errorsAttributes: [
|
||||
{ key: 'time', sortable: true },
|
||||
{ key: 'phase', sortable: true },
|
||||
{ key: 'file' },
|
||||
{ key: 'error' }
|
||||
],
|
||||
messageText: null,
|
||||
messageClass: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
errorsVisible: function() {
|
||||
return this.errors.length > 0;
|
||||
},
|
||||
errorsLength: function() {
|
||||
return this.errors.length;
|
||||
},
|
||||
messageVisible: function() {
|
||||
return this.messageText != null;
|
||||
}
|
||||
},
|
||||
created() {
|
||||
getErrorStack()
|
||||
.then(response => {
|
||||
this.errors = response.data;
|
||||
this.errorsLoaded = true;
|
||||
})
|
||||
.catch(e => {
|
||||
let message = e && e.response && e.response.data && e.response.data.err_msg;
|
||||
this.messageText = message || "Request failed for an unknown reason.";
|
||||
});
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -102,6 +102,7 @@ def app_factory(global_conf, load_app_kwds={}, **kwargs):
|
||||
webapp.add_client_route('/admin/data_tables', 'admin')
|
||||
webapp.add_client_route('/admin/data_types', 'admin')
|
||||
webapp.add_client_route('/admin/data_manager{path_info:.*}', 'admin')
|
||||
webapp.add_client_route('/admin/error_stack', 'admin')
|
||||
webapp.add_client_route('/admin/users', 'admin')
|
||||
webapp.add_client_route('/admin/roles', 'admin')
|
||||
webapp.add_client_route('/admin/forms', 'admin')
|
||||
|
||||
Reference in New Issue
Block a user