forked from timoschwarzer/gitlab-monitor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main.js
39 lines (35 loc) · 790 Bytes
/
main.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
import 'babel-polyfill'
import Vue from 'vue'
import VueTimeago from 'vue-timeago'
import App from './components/app.vue'
import Config from './Config'
import { configureApi } from './GitLabApi'
import axios from 'axios'
const finish = () => {
if (Config.isConfigured) {
configureApi()
}
Vue.use(VueTimeago, {
name: 'timeago', // component name, `timeago` by default
locale: 'en',
locales: {
'en': require('date-fns/locale/en')
}
})
new Vue({
el: '#app',
render: h => h(App)
})
}
// Load bundled config, if present.
;(async () => {
try {
const { data } = await axios.get('/config.json')
Config.load(data)
} catch (e) {
Config.load()
finish()
} finally {
finish()
}
})()