|
|
@@ -1,49 +1,165 @@
|
|
1
|
1
|
from flask import Flask, render_template
|
|
2
|
2
|
app = Flask (__name__)
|
|
3
|
3
|
|
|
4
|
|
-@app.route("/dashboard")
|
|
5
|
|
-def dashboard():
|
|
6
|
4
|
|
|
7
|
|
- data= {
|
|
8
|
|
- "main_repo_name" : "Main Project Name",
|
|
9
|
|
- "main_repo_summary" : "Summary: This project is about making Zebra really fast and efficient",
|
|
10
|
|
- "main_repo_description" : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
11
|
|
- "heatmap" : {
|
|
12
|
|
- "divID" : "heatmap",
|
|
13
|
|
- "title" : "Commits by Hour of Week - dummy data",
|
|
14
|
|
- # NOTE these paths are relative to where the script.js file is
|
|
15
|
|
- "data_path1" : "../static/data/data_dummy.tsv",
|
|
16
|
|
- "data_path2" : "../static/data/data2_dummy.tsv",
|
|
17
|
|
- "summary" : "This data shows cool stuff",
|
|
18
|
|
- "description" : "As you van see, this data focuses on business hours",
|
|
19
|
|
- "timestamp" : "System last updated at 11:34am"
|
|
20
|
|
- },
|
|
21
|
|
- "barchart" : {
|
|
22
|
|
- "divID" : "day_of_week",
|
|
23
|
|
- "title" : "# Commits by day - real data",
|
|
24
|
|
- "data_path" : "../static/data/day_of_week_copy.tsv",
|
|
25
|
|
- "summary" : "Bar Chart",
|
|
26
|
|
- "description" : "What week is this from? Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
27
|
|
- "timestamp" : "System last updated at 11:34am"
|
|
28
|
|
- },
|
|
29
|
|
- "linegraph1" : {
|
|
30
|
|
- "divID" : "lineChart1",
|
|
31
|
|
- "title" : "Commits per Author - real data",
|
|
32
|
|
- "data_path" : "../static/data/commits_by_author_copy.tsv",
|
|
33
|
|
- "summary" : "Multi Series Line Chart",
|
|
34
|
|
- "description" : "Theres a few authors on this project but 1 stands out",
|
|
35
|
|
- "timestamp" : "System last updated at 11:34am"
|
|
|
5
|
+data= {
|
|
|
6
|
+ "main_repo" :
|
|
|
7
|
+ [{
|
|
|
8
|
+ "name" : "Simul-scan",
|
|
|
9
|
+ "summary" : "Summary: This project is about making Zebra really fast and efficient",
|
|
|
10
|
+ "description" : "Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
|
11
|
+ "visualizations" :
|
|
|
12
|
+ [
|
|
|
13
|
+ {
|
|
|
14
|
+ "heatmap" : {
|
|
|
15
|
+ "divID" : "heatmap",
|
|
|
16
|
+ "title" : "Commits by Hour of Week - dummy data",
|
|
|
17
|
+ # NOTE these paths are relative to where the script.js file is
|
|
|
18
|
+ "data_path1" : "../static/data/data_dummy.tsv",
|
|
|
19
|
+ "data_path2" : "../static/data/data2_dummy.tsv",
|
|
|
20
|
+ "summary" : "This data shows cool stuff",
|
|
|
21
|
+ "description" : "As you van see, this data focuses on business hours",
|
|
|
22
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
23
|
+ },
|
|
|
24
|
+ "barchart" : {
|
|
|
25
|
+ "divID" : "day_of_week",
|
|
|
26
|
+ "title" : "# Commits by day - real data",
|
|
|
27
|
+ "data_path" : "../static/data/day_of_week_copy.tsv",
|
|
|
28
|
+ "summary" : "Bar Chart",
|
|
|
29
|
+ "description" : "What week is this from? Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
|
30
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
31
|
+ },
|
|
|
32
|
+ "linegraph1" : {
|
|
|
33
|
+ "divID" : "lineChart1",
|
|
|
34
|
+ "title" : "Commits per Author - real data",
|
|
|
35
|
+ "data_path" : "../static/data/commits_by_author_copy.tsv",
|
|
|
36
|
+ "summary" : "Multi Series Line Chart",
|
|
|
37
|
+ "description" : "Theres a few authors on this project but 1 stands out",
|
|
|
38
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
39
|
+ },
|
|
|
40
|
+ "linegraph2" : {
|
|
|
41
|
+ "divID" : "lineChart2",
|
|
|
42
|
+ "title" : "Commits per Author - real data",
|
|
|
43
|
+ "data_path" : "../static/data/lines_of_code_by_author_copy.tsv",
|
|
|
44
|
+ "summary" : "Multi Series Line Chart",
|
|
|
45
|
+ "description" : "Theres a few authors on this project but 1 stands out",
|
|
|
46
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
47
|
+ }
|
|
|
48
|
+ }
|
|
|
49
|
+ ]
|
|
|
50
|
+ }],
|
|
|
51
|
+
|
|
|
52
|
+ "sub_repos" :
|
|
|
53
|
+ [
|
|
|
54
|
+ # each of these is going to be a sub-repo
|
|
|
55
|
+ {
|
|
|
56
|
+ "name" : "sub-1",
|
|
|
57
|
+ "summary" : "Test Summary1",
|
|
|
58
|
+ "description" : "Test Description 1",
|
|
|
59
|
+ "visualizations" :
|
|
|
60
|
+ [
|
|
|
61
|
+ {
|
|
|
62
|
+ "heatmap" : {
|
|
|
63
|
+ "divID" : "heatmap",
|
|
|
64
|
+ "title" : "Commits by Hour of Week - dummy data",
|
|
|
65
|
+ # NOTE these paths are relative to where the script.js file is
|
|
|
66
|
+ "data_path1" : "../static/data/data_dummy.tsv",
|
|
|
67
|
+ "data_path2" : "../static/data/data2_dummy.tsv",
|
|
|
68
|
+ "summary" : "This data shows cool stuff",
|
|
|
69
|
+ "description" : "As you van see, this data focuses on business hours",
|
|
|
70
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
71
|
+ },
|
|
|
72
|
+ "barchart" : {
|
|
|
73
|
+ "divID" : "day_of_week",
|
|
|
74
|
+ "title" : "# Commits by day - real data",
|
|
|
75
|
+ "data_path" : "../static/data/day_of_week_copy.tsv",
|
|
|
76
|
+ "summary" : "Bar Chart",
|
|
|
77
|
+ "description" : "What week is this from? Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
|
78
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
79
|
+ },
|
|
|
80
|
+ "linegraph1" : {
|
|
|
81
|
+ "divID" : "lineChart1",
|
|
|
82
|
+ "title" : "Commits per Author - real data",
|
|
|
83
|
+ "data_path" : "../static/data/commits_by_author_copy.tsv",
|
|
|
84
|
+ "summary" : "Multi Series Line Chart",
|
|
|
85
|
+ "description" : "Theres a few authors on this project but 1 stands out",
|
|
|
86
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
87
|
+ },
|
|
|
88
|
+ "linegraph2" : {
|
|
|
89
|
+ "divID" : "lineChart2",
|
|
|
90
|
+ "title" : "Commits per Author - real data",
|
|
|
91
|
+ "data_path" : "../static/data/lines_of_code_by_author_copy.tsv",
|
|
|
92
|
+ "summary" : "Multi Series Line Chart",
|
|
|
93
|
+ "description" : "Theres a few authors on this project but 1 stands out",
|
|
|
94
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
95
|
+ }
|
|
|
96
|
+ }
|
|
|
97
|
+ ]
|
|
36
|
98
|
},
|
|
37
|
|
- "linegraph2" : {
|
|
38
|
|
- "divID" : "lineChart2",
|
|
39
|
|
- "title" : "Commits per Author - real data",
|
|
40
|
|
- "data_path" : "../static/data/lines_of_code_by_author_copy.tsv",
|
|
41
|
|
- "summary" : "Multi Series Line Chart",
|
|
42
|
|
- "description" : "Theres a few authors on this project but 1 stands out",
|
|
43
|
|
- "timestamp" : "System last updated at 11:34am"
|
|
|
99
|
+ {
|
|
|
100
|
+ "name" : "sub-2",
|
|
|
101
|
+ "summary" : "Test Summary 2",
|
|
|
102
|
+ "description" : "Test Description 2",
|
|
|
103
|
+ "visualizations" :
|
|
|
104
|
+ [
|
|
|
105
|
+ {
|
|
|
106
|
+ "heatmap" : {
|
|
|
107
|
+ "divID" : "heatmap",
|
|
|
108
|
+ "title" : "Commits by Hour of Week - dummy data",
|
|
|
109
|
+ # NOTE these paths are relative to where the script.js file is
|
|
|
110
|
+ "data_path1" : "../static/data/data_dummy.tsv",
|
|
|
111
|
+ "data_path2" : "../static/data/data2_dummy.tsv",
|
|
|
112
|
+ "summary" : "This data shows cool stuff",
|
|
|
113
|
+ "description" : "As you van see, this data focuses on business hours",
|
|
|
114
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
115
|
+ },
|
|
|
116
|
+ "barchart" : {
|
|
|
117
|
+ "divID" : "day_of_week",
|
|
|
118
|
+ "title" : "# Commits by day - real data",
|
|
|
119
|
+ "data_path" : "../static/data/day_of_week_copy.tsv",
|
|
|
120
|
+ "summary" : "Bar Chart",
|
|
|
121
|
+ "description" : "What week is this from? Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.",
|
|
|
122
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
123
|
+ },
|
|
|
124
|
+ "linegraph1" : {
|
|
|
125
|
+ "divID" : "lineChart1",
|
|
|
126
|
+ "title" : "Commits per Author - real data",
|
|
|
127
|
+ "data_path" : "../static/data/commits_by_author_copy.tsv",
|
|
|
128
|
+ "summary" : "Multi Series Line Chart",
|
|
|
129
|
+ "description" : "Theres a few authors on this project but 1 stands out",
|
|
|
130
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
131
|
+ },
|
|
|
132
|
+ "linegraph2" : {
|
|
|
133
|
+ "divID" : "lineChart2",
|
|
|
134
|
+ "title" : "Commits per Author - real data",
|
|
|
135
|
+ "data_path" : "../static/data/lines_of_code_by_author_copy.tsv",
|
|
|
136
|
+ "summary" : "Multi Series Line Chart",
|
|
|
137
|
+ "description" : "Theres a few authors on this project but 1 stands out",
|
|
|
138
|
+ "timestamp" : "System last updated at 11:34am"
|
|
|
139
|
+ }
|
|
|
140
|
+ }
|
|
|
141
|
+ ]
|
|
44
|
142
|
}
|
|
45
|
|
- }
|
|
46
|
|
- return render_template("dashboard.html", data=data )
|
|
|
143
|
+ ]
|
|
|
144
|
+}
|
|
|
145
|
+
|
|
|
146
|
+@app.route('/dashboard/<repo>')
|
|
|
147
|
+def sub_repo(repo):
|
|
|
148
|
+ global data
|
|
|
149
|
+ sub_repo_data= None
|
|
|
150
|
+ for sub_repo in data['sub_repos']:
|
|
|
151
|
+ print (sub_repo['name'], repo)
|
|
|
152
|
+ if sub_repo['name'] == repo:
|
|
|
153
|
+ #this should happen in one case, else this isnt a valid sub repo...
|
|
|
154
|
+ sub_repo_data=sub_repo
|
|
|
155
|
+ return render_template("dashboard.html", sub=sub_repo_data, nav=data)
|
|
|
156
|
+
|
|
|
157
|
+@app.route("/dashboard")
|
|
|
158
|
+def dashboard():
|
|
|
159
|
+ global data
|
|
|
160
|
+ main_repo=data['main_repo'][0]
|
|
|
161
|
+ return render_template("dashboard.html", sub=main_repo, nav=data )
|
|
|
162
|
+
|
|
47
|
163
|
|
|
48
|
164
|
|
|
49
|
165
|
|