This repository has been archived by the owner on Aug 8, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
gitlab-stats.js
272 lines (223 loc) · 17.8 KB
/
gitlab-stats.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: red; icon-glyph: code;
/*
GitLab Configuration
Configure your gitlab credentials
If you don't know how to obtain a personal access token see:
https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#creating-a-personal-access-token
*/
const GITLAB_URL = '';
const USERNAME = '';
const ACCESS_TOKEN = '';
/*
Color Configuration
Choose the colors of the text, background and icons
Different settings for dark and light mode are possible
*/
function colorConfig() {
// general
const tintLogo = false; // set to true to color the gitlab logo
const tintColor = new Color('#FC6D26');
// dark mode
const darkBackgroud = new Color('#1A1B1E');
const darkText = new Color('#E3E3E3');
// light mode
const lightBackgroud = new Color('#FFFFFF');
const lightText = new Color('#000000');
return {
bgColor: Color.dynamic(lightBackgroud, darkBackgroud),
textColor: Color.dynamic(lightText, darkText),
tintColor: tintColor,
tintLogo: tintLogo,
};
}
if (config.runsInWidget) {
const size = config.widgetFamily;
const widget = await createWidget(size);
Script.setWidget(widget);
Script.complete();
} else {
// choose any size for debugging
const size = 'small';
//const size = 'medium'
//const size = 'large'
const widget = await createWidget(size);
if (size == 'small') {
widget.presentSmall();
} else if (size == 'medium') {
widget.presentMedium();
} else {
widget.presentLarge();
}
Script.complete();
}
async function createWidget(size) {
const colors = colorConfig();
const widget = new ListWidget();
const data = await fetchData();
// images
const issueIconPath = await getImage('issues');
const mrIconPath = await getImage('merge');
const todoIconPath = await getImage('todo');
const gitLabLogo = await getImage('gitlab-logo');
const contrSymbol = await getImage('contrib');
widget.backgroundColor = colors.bgColor;
// small size
if (size == 'small') {
widget.setPadding(5, 0, 15, 0);
const logo = widget.addImage(gitLabLogo);
logo.imageSize = new Size(80, 30);
logo.leftAlignImage();
if (colors.tintLogo) {
logo.tintColor = colors.tintColor;
}
widget.addSpacer();
const contentStack = widget.addStack();
contentStack.layoutHorizontally();
contentStack.addSpacer();
let leftColumn = contentStack.addStack();
leftColumn.layoutVertically();
contentStack.addSpacer();
let rightColumn = contentStack.addStack();
rightColumn.layoutVertically();
contentStack.addSpacer();
// left column
addItem(issueIconPath, '', `${data.issues}`, '', leftColumn, size);
leftColumn.addSpacer();
addItem(todoIconPath, '', `${data.todos}`, '', leftColumn, size);
// right column
addItem(mrIconPath, '', `${data.mrs}`, '', rightColumn, size);
rightColumn.addSpacer();
addItem(contrSymbol.image, '', `${data.contributions}`, '', rightColumn, size);
}
// medium size
else if (size == 'medium') {
widget.setPadding(5, 0, 15, 0);
const logo = widget.addImage(gitLabLogo);
logo.imageSize = new Size(100, 40);
logo.leftAlignImage();
if (colors.tintLogo) {
logo.tintColor = colors.tintColor;
}
widget.addSpacer();
let contentStack = widget.addStack();
contentStack.layoutHorizontally();
contentStack.addSpacer();
addItem(
issueIconPath,
'ISSUEs',
`${data.issues}`,
`${GITLAB_URL}/dashboard/issues?assignee_username=${USERNAME}`,
contentStack,
size
);
contentStack.addSpacer(30);
addItem(todoIconPath, 'TODOs', `${data.todos}`, `${GITLAB_URL}/dashboard/todos`, contentStack, size);
contentStack.addSpacer(30);
addItem(
mrIconPath,
'MRs',
`${data.mrs}`,
`${GITLAB_URL}/dashboard/merge_requests?assignee_username=${USERNAME}`,
contentStack,
size
);
contentStack.addSpacer(30);
addItem(contrSymbol.image, 'CONs', `${data.contributions}`, `${GITLAB_URL}/${USERNAME}`, contentStack, size);
contentStack.addSpacer();
widget.addSpacer();
} else {
const title = widget.addText(`size not supported`);
title.font = Font.boldRoundedSystemFont(20);
title.textColor = colors.textColor;
title.centerAlignText();
}
return widget;
}
function addItem(img, description, count, link, stack, size) {
const colors = colorConfig();
// small size
if (size == 'small') {
const line = stack.addStack();
line.layoutVertically();
line.url = link;
const wimg = line.addImage(img);
wimg.imageSize = new Size(20, 20);
wimg.tintColor = colors.tintColor;
line.addSpacer(3);
const wname = line.addText(count);
wname.font = Font.boldSystemFont(20);
wname.textColor = colors.textColor;
}
// medium size
else if (size == 'medium') {
const item = stack.addStack();
item.layoutVertically();
item.url = link;
const wimg = item.addImage(img);
wimg.imageSize = new Size(30, 30);
wimg.tintColor = colors.tintColor;
const wname2 = item.addText(description);
wname2.font = Font.thinRoundedSystemFont(13);
wname2.textColor = colors.textColor;
item.addSpacer(3);
const wname = item.addText(count);
wname.font = Font.boldSystemFont(25);
wname.textColor = colors.textColor;
}
}
async function fetchData() {
let req = new Request(`${GITLAB_URL}/api/v4/issues?state=opened&scope=assigned_to_me&per_page=100`);
req.headers = { Authorization: `Bearer ${ACCESS_TOKEN}` };
let resp = await req.loadJSON();
const assignedIssueCount = resp.length;
req = new Request(`${GITLAB_URL}/api/v4/todos`);
req.headers = { Authorization: `Bearer ${ACCESS_TOKEN}` };
resp = await req.loadJSON();
const todoCount = resp.length;
req = new Request(`${GITLAB_URL}/api/v4/merge_requests?scope=assigned_to_me&state=opened`);
req.headers = { Authorization: `Bearer ${ACCESS_TOKEN}` };
resp = await req.loadJSON();
const assingedMrCount = resp.length;
const formatter = new DateFormatter();
formatter.dateFormat = 'yyyy-MM-dd';
const yesterday = formatter.string(new Date(Date.now() - 864e5));
req = new Request(`${GITLAB_URL}/api/v4/users/${USERNAME}/events?after=${yesterday}`);
req.headers = { Authorization: `Bearer ${ACCESS_TOKEN}` };
resp = await req.loadJSON();
const contribCount = resp.length;
return {
issues: assignedIssueCount,
todos: todoCount,
mrs: assingedMrCount,
contributions: contribCount,
};
}
async function getImage(name) {
let data = '';
switch (name) {
case 'issues':
data =
'iVBORw0KGgoAAAANSUhEUgAAADQAAAA0CAYAAADFeBvrAAAAAXNSR0IArs4c6QAAAERlWElmTU0AKgAAAAgAAYdpAAQAAAABAAAAGgAAAAAAA6ABAAMAAAABAAEAAKACAAQAAAABAAAANKADAAQAAAABAAAANAAAAABdv+0DAAAAHGlET1QAAAACAAAAAAAAABoAAAAoAAAAGgAAABoAAAIsDSC4nAAAAfhJREFUaAXUl79Lw0AUx6uDqAjq4A/Q2UFwqqCbi4ObDrq4ujpKJwX/DQddxL9B0FUHwcViJ4VY0jRplYhFwZ+N31f6atuQy7VpzV3hcUn67t33c+/dXZJICH6e5/UahjGSzWZHw4z8ZM113WHE7hEM3bm/SJRlWfv5fP4W9g3zumRfiHtt2/ZOsVgc6hxBXSSALGOQpy4BiCbGwJjzdVKiX2KmlhD0MwYYBi05jjMXnQQRTNMcAJAVIwxDpWndRoZCqW0rAMNQa5GBAHOmENAptAxGgkKAB4WAKFMmbLNtKHR+FgCtYH2NyRgW9biMocS3BONx6VF7CWt990OnQCAIXGh7pgI6YnLWJYEIqgz/I5xVkwHh/I8VB+KMlZDZVCaT6fMTND3RBIjB7gG22oTQeBsD0AbGZIHttucoxdlGkuqdpkA0Ee90hvqgNAaqZNcHpRhQuroLGtAlW44fuVxuppapGIACt23A3JAwfMb0Q9cu7FUS7CBOoMBNgYFYHF6cpwB0DCu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bnrmHsJoUkmPQStYvmLHAyYGdXgjYqfolMPBR18jt1vo9NFSbJcHIoYbgGLuKDN+ad6/Mn5IdkGM/cdnsPHqp8AeDpxfScrTTFgGna/YcbKSfd0li/Sr//45j3wwUbNbhXp06/1iuvIL/mhzPylh2F/mFE6o7PTZz03amZcerRsBRZ58NY9dckpirEPGCqzV2u5IL9/ZdF8z88cpeprxut5H92bovm13K56puWApKBKYTAlZX/XwY/gA28aPmiswfrU4cbAimqZt18pZspKsxFy7eiE/uCw7BptNYZV8lAlUh4DyqzAJJnkLolq4YQwMLAjspQeBe7TV/DveL/s03qSyuSrkUkgjMBATofgL7inutZrJt7Haype8rwT57JfYpSbLDSSnKTBijHINEYNIIjHeTueP3k8eOfy/wpNlW/5DTc1lt/4Ns0iOWCiQCFSLgtF523ugqMrdCMVldIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCQCEgGJgERAIiARkAhIBCpD4L8TyFTSqInLTgAAAABJRU5ErkJggg==';
break;
case 'contrib':
return SFSymbol.named('square.grid.4x3.fill');
default:
data = '';
break;
}
return Image.fromData(Data.fromBase64String(data));
}