File tree 5 files changed +234
-0
lines changed
5 files changed +234
-0
lines changed Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <v-list-tile avatar >
4
+ <!-- <div> -->
5
+ <v-layout justify-space-between >
6
+ <div >
7
+ <v-list-tile-title v-html =" author" ></v-list-tile-title >
8
+ </div >
9
+ <div class =" mx-5" >
10
+ <div class =" badge-simple" :style =" {backgroundColor: getColor()}" ></div >
11
+ </div >
12
+ </v-layout >
13
+ <!-- </div> -->
14
+ <!-- <div>
15
+ <v-list-tile-title>{ Total commits: {{total}}, Last commit: {{getLastWeek()}} week(s) ago }</v-list-tile-title>
16
+ </div>-->
17
+ </v-list-tile >
18
+ </div >
19
+ </template >
20
+
21
+ <script >
22
+ export default {
23
+ name: ' ContributorItem' ,
24
+ props: {
25
+ author: {
26
+ type: String
27
+ },
28
+ weeks: {
29
+ type: Array
30
+ },
31
+ total: {
32
+ type: Number
33
+ }
34
+ },
35
+ data () {
36
+ return {
37
+ reversedWeeks: this .weeks .reverse ()
38
+ };
39
+ },
40
+ methods: {
41
+ getLastWeek () {
42
+ return this .reversedWeeks .findIndex (week => week .c != 0 );
43
+ },
44
+ getColor () {
45
+ let value = this .getLastWeek ();
46
+
47
+ if (value == 1 ) return ' #1B5E20' ;
48
+ else if (value == 2 ) return ' #2E7D32' ;
49
+ else if (value == 3 ) return ' #66BB6A' ;
50
+ else if (3 < value && value <= 5 ) return ' #A5D6A7' ;
51
+ else if (5 < value && value <= 8 ) return ' #FFF9C4' ;
52
+ else if (8 < value && value <= 16 ) return ' #FFF176' ;
53
+ else if (16 < value && value <= 32 ) return ' #F9A825' ;
54
+ else if (32 < value && value <= 56 ) return ' #FF6F00' ;
55
+ else if (56 < value && value <= 84 ) return ' #E65100' ;
56
+ else if (84 < value && value <= 112 ) return ' #FF3D00' ;
57
+ else if (112 < value) return ' #78909C' ;
58
+ }
59
+ }
60
+ };
61
+ </script >
62
+
63
+ <style lang="scss" scoped>
64
+ .badge-simple {
65
+ width : 20px ;
66
+ height : 20px ;
67
+ border-radius : 4px ;
68
+ }
69
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <v-card flat ripple >
4
+ <v-layout justify-center row >
5
+ <v-avatar size =" 80" >
6
+ <img :src =" dp" >
7
+ </v-avatar >
8
+ <div class =" name ml-3" >{{name}}</div >
9
+ </v-layout >
10
+ </v-card >
11
+ </div >
12
+ </template >
13
+
14
+ <script >
15
+ export default {
16
+ name: ' UserDetails' ,
17
+ props: {
18
+ dp: {
19
+ type: String
20
+ },
21
+ name: {
22
+ type: String
23
+ }
24
+ }
25
+ };
26
+ </script >
27
+
28
+ <style lang="scss" scoped>
29
+ .name {
30
+ font-size : 20px ;
31
+ }
32
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <div class =" my-3" >
4
+ <div class =" mt-5 count" >Total repo count: {{repos.length}}</div >
5
+ <div class =" my-5" v-for =" repo in repos" :key =" repo.name" >
6
+ <div class =" repo-name" >{{repo.name}}</div >
7
+ <RepoContributors :orgName =" orgName" :repoName =" repo.name" />
8
+ </div >
9
+ </div >
10
+ </div >
11
+ </template >
12
+
13
+ <script >
14
+ import RepoContributors from ' ./RepoContributors.vue' ;
15
+
16
+ export default {
17
+ name: ' OrgRepos' ,
18
+ props: {
19
+ repos: {
20
+ type: Array
21
+ },
22
+ orgName: {
23
+ type: String
24
+ }
25
+ },
26
+ components: {
27
+ RepoContributors
28
+ }
29
+ };
30
+ </script >
31
+
32
+ <style lang="scss" scoped>
33
+ .repo-name {
34
+ font-size : 18px ;
35
+ font-weight : 600 ;
36
+ }
37
+ .count {
38
+ font-size : 20px ;
39
+ }
40
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <div v-for =" contributor in contributors" :key =" contributor.author.id" >
4
+ <ContributorItem
5
+ :author =" contributor.author.login"
6
+ :weeks =" contributor.weeks"
7
+ :total =" contributor.total"
8
+ />
9
+ </div >
10
+ </div >
11
+ </template >
12
+
13
+ <script >
14
+ import axios from ' axios' ;
15
+ import ContributorItem from ' ./ContributorItem' ;
16
+ import AxiosHelper from ' ../../config/AxiosHelper' ;
17
+ import AuthService from ' ../../services/authService' ;
18
+
19
+ const authService = new AuthService ();
20
+
21
+ export default {
22
+ name: ' RepoContributors' ,
23
+ data () {
24
+ return {
25
+ contributors: []
26
+ };
27
+ },
28
+ props: {
29
+ orgName: {
30
+ type: String
31
+ },
32
+ repoName: {
33
+ type: String
34
+ }
35
+ },
36
+ components: {
37
+ ContributorItem
38
+ },
39
+ methods: {
40
+ loadContributors () {
41
+ axios
42
+ .get (
43
+ ` ${ AxiosHelper .baseUrl } /repos/${ this .orgName } /${
44
+ this .repoName
45
+ } /stats/contributors` ,
46
+ {
47
+ headers: {
48
+ Authorization: ` token ${ authService .getToken ()} `
49
+ }
50
+ }
51
+ )
52
+ .then (res => (this .contributors = res .data ))
53
+ .catch (err => console .log (err));
54
+ }
55
+ },
56
+ created () {
57
+ this .loadContributors ();
58
+ }
59
+ };
60
+ </script >
61
+
62
+ <style lang="scss" scoped>
63
+ .badge {
64
+ width : 20px ;
65
+ height : 20px ;
66
+ }
67
+ table ,
68
+ th ,
69
+ td {
70
+ border : 1px solid black ;
71
+ }
72
+ </style >
Original file line number Diff line number Diff line change
1
+ <template >
2
+ <div >
3
+ <v-layout class =" ma-5" justify-center >
4
+ <Org />
5
+ </v-layout >
6
+ </div >
7
+ </template >
8
+
9
+ <script >
10
+ import Org from ' ../components/org/Org' ;
11
+
12
+ export default {
13
+ name: ' OrgView' ,
14
+ components: {
15
+ Org
16
+ }
17
+ };
18
+ </script >
19
+
20
+ <style lang="scss" scoped>
21
+ </style >
You can’t perform that action at this time.
0 commit comments