-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
57 lines (51 loc) · 1.73 KB
/
index.html
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
<!DOCTYPE html>
<html>
<head>
<title>Commit Log Analyzer</title>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link href="https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css" rel="stylesheet" integrity="sha384-EVSTQN3/azprG1Anm3QDgpJLIm9Nao0Yz1ztcQTwFspd3yD65VohhpuuCOmLASjC" crossorigin="anonymous">
<link href="./app.css" rel="stylesheet">
</head>
<body>
<div class="container">
<div id="app"></div>
</div>
<script type="module">
import { createApp, defineAsyncComponent } from 'https://unpkg.com/vue@3/dist/vue.esm-browser.prod.js';
import { getData, loadFile } from './app.js';
const template = `<div>
<Upload :empty="data.files.length === 0" :load="loadData" />
<Gitstats :weeks="data.weeks" :authors="data.authors" :commits="data.commits" />
<BusFactor :files="data.files" :authors="data.authors" />
</div>`;
const app = createApp({
data() {
return {
data: {
files: [],
authors: [],
weeks: [],
commits: {}
}
}
},
components: {
'BusFactor': defineAsyncComponent(() => import('./bus-factor.js')),
'Gitstats': defineAsyncComponent(() => import('./gitstats.js')),
'Upload': defineAsyncComponent(() => import('./upload.js'))
},
template,
methods: {
loadData(evt) {
loadFile(evt.target.files[0], (text) => {
this.data = getData(text);
evt.target.blur();
})
}
}
})
app.mount('#app');
</script>
</body>
</html>