-
Notifications
You must be signed in to change notification settings - Fork 184
/
Ignition.js
70 lines (58 loc) · 2.24 KB
/
Ignition.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
import Vue from 'vue';
import App from './components/App';
export default class Ignition {
constructor(data) {
this.data = data;
this.tabCallbacks = [];
}
registerIcons() {
Vue.component('Icon', require('./components/Icons/Icon').default);
}
registerBuiltinTabs() {
Vue.component('AppTab', require('./components/Tabs/AppTab').default);
Vue.component('ContextTab', require('./components/Tabs/ContextTab').default);
Vue.component('DebugTab', require('./components/Tabs/DebugTab').default);
Vue.component('RequestTab', require('./components/Tabs/RequestTab').default);
Vue.component('StackTab', require('./components/Tabs/StackTab').default);
Vue.component('UserTab', require('./components/Tabs/UserTab').default);
}
registerCustomTabs() {
this.tabCallbacks.forEach(callback => callback(Vue, this.data));
this.tabCallbacks = [];
}
registerTab(callback) {
this.tabCallbacks.push(callback);
}
start() {
this.registerIcons();
this.registerBuiltinTabs();
this.registerCustomTabs();
window.app = new Vue({
data: () => this.data,
render(h) {
return h(App, {
props: {
report: {
...this.report,
stacktrace: this.report.stacktrace.map(frame => ({
...frame,
relative_file: frame.file.replace(
`${this.report.application_path}/`,
'',
),
})),
},
config: this.config,
solutions: this.solutions,
telescopeUrl: this.telescopeUrl,
shareEndpoint: this.shareEndpoint,
defaultTab: this.defaultTab,
defaultTabProps: this.defaultTabProps,
appEnv: this.appEnv,
appDebug: this.appDebug,
},
});
},
}).$mount('#app');
}
}