diff options
author | Stas Vilchik <vilchiks@gmail.com> | 2016-08-22 15:15:28 +0200 |
---|---|---|
committer | Stas Vilchik <vilchiks@gmail.com> | 2016-08-23 12:08:51 +0200 |
commit | 4c2d7de3467a39db6a11452e7436929b67e2c875 (patch) | |
tree | 29f9baf8c64bb9fdf348019cd706e4e77a32021b /server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js | |
parent | 87c95bc05d147ae016dd9ad5ea48961dec01de68 (diff) | |
download | sonarqube-4c2d7de3467a39db6a11452e7436929b67e2c875.tar.gz sonarqube-4c2d7de3467a39db6a11452e7436929b67e2c875.zip |
SONAR-7846 Display error of a failing CE task in the background page
Diffstat (limited to 'server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js')
-rw-r--r-- | server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js | 50 |
1 files changed, 50 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js b/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js new file mode 100644 index 00000000000..809467dff01 --- /dev/null +++ b/server/sonar-web/src/main/js/apps/background-tasks/views/StacktraceView.js @@ -0,0 +1,50 @@ +/* + * SonarQube + * Copyright (C) 2009-2016 SonarSource SA + * mailto:contact AT sonarsource DOT com + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU Lesser General Public + * License as published by the Free Software Foundation; either + * version 3 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * Lesser General Public License for more details. + * + * You should have received a copy of the GNU Lesser General Public License + * along with this program; if not, write to the Free Software Foundation, + * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ +import Modal from '../../../components/common/modals'; +import Template from './StacktraceView.hbs'; +import { getTask } from '../../../api/ce'; + +export default Modal.extend({ + template: Template, + className: 'modal modal-large', + + initialize () { + this.loaded = false; + this.stacktrace = null; + this.loadStacktrace(); + }, + + loadStacktrace() { + getTask(this.options.task.id, ['stacktrace']).then(task => { + this.loaded = true; + this.stacktrace = task.errorStacktrace; + this.render(); + }); + }, + + serializeData() { + return { + task: this.options.task, + stacktrace: this.stacktrace, + loaded: this.loaded + }; + } +}); + |