Skip to content

Commit a95e24b

Browse files
committed
Improve log design, fix kriskbx#15, decrease window-size
1 parent 99dfbf3 commit a95e24b

File tree

11 files changed

+190
-132
lines changed

11 files changed

+190
-132
lines changed

package-lock.json

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,8 @@
3434
},
3535
"make_targets": {
3636
"win32": [
37-
"squirrel"
37+
"squirrel",
38+
"appx"
3839
],
3940
"darwin": [
4041
"zip"
@@ -93,7 +94,11 @@
9394
},
9495
"windowsStoreConfig": {
9596
"packageName": "gtt-taskbar",
96-
"name": "gitlab time tracker taskbar"
97+
"packageDisplayName": "gitlab time tracker taskbar",
98+
"packageVersion": "<%= version %>.0",
99+
"publisher": "CN=F0C20719-E0F4-4F1A-99EB-2C25503A0622",
100+
"devCert": "",
101+
"deploy": false
97102
}
98103
}
99104
},
@@ -104,7 +109,7 @@
104109
"electron-compile": "^6.4.2",
105110
"electron-log": "^2.2.14",
106111
"electron-squirrel-startup": "^1.0.0",
107-
"gitlab-time-tracker": "^1.7.20",
112+
"gitlab-time-tracker": "^1.7.21",
108113
"moment": "^2.20.1",
109114
"raven": "^2.6.2",
110115
"write-yaml": "^1.0.0"

resources/assets/js/app.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -68,6 +68,7 @@ const app = new Vue({
6868
this.platform = ipc.sync('gtt-platform', 'get');
6969

7070
// set ipc listeners
71+
ipc.on('gtt-last-sync', (event, lastSync) => this.lastSync = lastSync);
7172
ipc.on('gtt-config', (event, config) => this.setConfig(config));
7273
ipc.on('gtt-log', (event, data) => {
7374
this.loadingLog = false;
@@ -123,6 +124,10 @@ const app = new Vue({
123124
},
124125

125126
methods: {
127+
synced(modified) {
128+
if(!this.lastSync) return;
129+
return moment(modified).diff(this.lastSync) < 0;
130+
},
126131
human(input) {
127132
if (!this.config) return;
128133
return this.config.toHumanReadable(input);
@@ -171,6 +176,7 @@ const app = new Vue({
171176
loadLog() {
172177
this.loadingLog = true;
173178
ipc.send('gtt-log');
179+
ipc.send('gtt-sync');
174180
},
175181
loadResource() {
176182
if (this.resourceType) {

resources/assets/js/components/track.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010

1111
<v-select class="project"
1212
v-model="selectedProject"
13+
max-height="220px"
1314
placeholder="Select Project"
1415
:options="projectOptions"></v-select>
1516
</div>
@@ -31,6 +32,7 @@
3132

3233
<v-select class="resource"
3334
v-model="selectedResource"
35+
max-height="220px"
3436
:placeholder="resourceType ? 'Select Issue' : 'Select MR'"
3537
:options="resourceOptions"></v-select>
3638
</div>
@@ -261,4 +263,4 @@
261263
}
262264
}
263265
}
264-
</script>
266+
</script>

resources/assets/stylus/app.styl

Lines changed: 58 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $color-light-gray = #e6e6e6
66
$color-middle-gray = #cbcbcb
77
$color-mac-gray = #E7E7E7
88
$color-bluish = #bfcbd9
9+
$color-blue = #1c79c3
910
$color-black = #000
1011
$border-radius = .7rem
1112

@@ -20,29 +21,37 @@ html
2021
padding: 0
2122

2223
body
23-
height: 25.4rem
24-
padding: 0 10px
2524
overflow: visible
25+
padding: 0 10px
2626
border-bottom-left-radius: $border-radius
2727
border-bottom-right-radius: $border-radius
2828
background: transparent
2929

30-
body, html
30+
body, html
3131
border: 0
3232
margin: 0
3333

34-
#app
34+
#app
35+
height: 25.4rem
36+
overflow: visible
3537
position: relative
36-
height: 100%
38+
3739
div.triangle
3840
display: none
3941
&.bottom
4042
transform: rotate(180deg)
41-
filter: drop-shadow(0 -3px 2px rgba(0,0,0,0.5))
43+
filter: drop-shadow(0 -3px 2px rgba(0, 0, 0, 0.5))
4244
&.mac, &.linux
4345
& > .triangle.top
4446
display: block
4547
&.win
48+
position: absolute
49+
bottom: 0
50+
left: 10px
51+
right: 10px
52+
.v-select .dropdown-menu
53+
top: auto
54+
bottom: 100%
4655
& > .triangle.bottom
4756
display: block
4857

@@ -52,15 +61,16 @@ body, html
5261
height: calc(100% - 3rem)
5362
overflow-y: visible
5463
overflow-x: hidden
55-
box-shadow: 0 0 .2rem rgba(0,0,0,0.5)
64+
box-shadow: 0 0 .2rem rgba(0, 0, 0, 0.5)
65+
border-radius: $border-radius
5666

5767
.settings
5868
line-height: 1.2
5969

6070
.triangle
6171
text-align: center
6272
height: 1.5rem
63-
filter: drop-shadow(0 0 2px rgba(0,0,0,0.5))
73+
filter: drop-shadow(0 0 2px rgba(0, 0, 0, 0.5))
6474
&.bottom
6575
transform: rotate(180deg)
6676
display: none
@@ -271,32 +281,45 @@ body, html
271281
cursor: pointer
272282

273283
.log
274-
.day
275-
font-weight: bold
276284

277-
table
278-
margin: 0
279-
tr
280-
height: 4.7rem
281-
overflow: hidden
282-
&:last-child
283-
td
284-
border: 0 !important
285-
td
286-
white-space: nowrap
287-
height: 4.7rem
288-
padding-left: 1.5rem
289-
padding-right: 1.5rem
290-
overflow: hidden
291-
text-overflow: ellipsis
292-
293-
th
294-
color: $color-gray
295-
296-
td
297-
vertical-align: top
298-
&:not(:first-child)
299-
padding: 0
300-
285+
.timeframe
286+
color: $color-blue
287+
288+
.sync
289+
font-size: 1.6rem
290+
.red
291+
color: $color-red
292+
.green
293+
color: green
294+
295+
& > .day
296+
overflow: hidden
297+
box-shadow: 0 .05rem .3rem rgba(0, 0, 0, 0.4)
298+
border-radius: .6rem
299+
margin-bottom: 2rem
300+
& > .headline
301+
background: $color-light-gray
302+
color: $color-gray
303+
font-weight: bold
304+
padding: 1rem
305+
& > small
306+
font-weight: normal
307+
display: inline-block
308+
float: right
309+
margin-top: .3rem
310+
& > .list
311+
& > .entry
312+
display: flex
313+
flex-direction: row
314+
width: 100%
315+
border-bottom: 1px solid $color-light-gray
316+
padding: .6rem 1rem
317+
& > .cell
318+
flex: 1
319+
&:hover
320+
background: lighten($color-light-gray, 40%)
321+
&:last-child
322+
border-bottom: 0
323+
301324
button.clear
302-
display: none
325+
display: none

src/build/app.css

Lines changed: 58 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -570,9 +570,8 @@ html {
570570
padding: 0;
571571
}
572572
body {
573-
height: 25.4rem;
574-
padding: 0 10px;
575573
overflow: visible;
574+
padding: 0 10px;
576575
border-bottom-left-radius: 0.7rem;
577576
border-bottom-right-radius: 0.7rem;
578577
background: transparent;
@@ -583,8 +582,9 @@ html {
583582
margin: 0;
584583
}
585584
#app {
585+
height: 25.4rem;
586+
overflow: visible;
586587
position: relative;
587-
height: 100%;
588588
}
589589
#app div.triangle {
590590
display: none;
@@ -599,6 +599,16 @@ html {
599599
#app.linux > .triangle.top {
600600
display: block;
601601
}
602+
#app.win {
603+
position: absolute;
604+
bottom: 0;
605+
left: 10px;
606+
right: 10px;
607+
}
608+
#app.win .v-select .dropdown-menu {
609+
top: auto;
610+
bottom: 100%;
611+
}
602612
#app.win > .triangle.bottom {
603613
display: block;
604614
}
@@ -615,6 +625,7 @@ html {
615625
overflow-x: hidden;
616626
-webkit-box-shadow: 0 0 0.2rem rgba(0,0,0,0.5);
617627
box-shadow: 0 0 0.2rem rgba(0,0,0,0.5);
628+
border-radius: 0.7rem;
618629
}
619630
.settings {
620631
line-height: 1.2;
@@ -894,35 +905,59 @@ html {
894905
color: #909090 !important;
895906
cursor: pointer;
896907
}
897-
.log .day {
898-
font-weight: bold;
908+
.log .timeframe {
909+
color: #1c79c3;
899910
}
900-
.log table {
901-
margin: 0;
911+
.log .sync {
912+
font-size: 1.6rem;
902913
}
903-
.log table tr {
904-
height: 4.7rem;
905-
overflow: hidden;
914+
.log .sync .red {
915+
color: #f8561e;
906916
}
907-
.log table tr:last-child td {
908-
border: 0 !important;
917+
.log .sync .green {
918+
color: #008000;
909919
}
910-
.log table td {
911-
white-space: nowrap;
912-
height: 4.7rem;
913-
padding-left: 1.5rem;
914-
padding-right: 1.5rem;
920+
.log > .day {
915921
overflow: hidden;
916-
text-overflow: ellipsis;
922+
-webkit-box-shadow: 0 0.05rem 0.3rem rgba(0,0,0,0.4);
923+
box-shadow: 0 0.05rem 0.3rem rgba(0,0,0,0.4);
924+
border-radius: 0.6rem;
925+
margin-bottom: 2rem;
917926
}
918-
.log th {
927+
.log > .day > .headline {
928+
background: #e6e6e6;
919929
color: #909090;
930+
font-weight: bold;
931+
padding: 1rem;
920932
}
921-
.log td {
922-
vertical-align: top;
933+
.log > .day > .headline > small {
934+
font-weight: normal;
935+
display: inline-block;
936+
float: right;
937+
margin-top: 0.3rem;
923938
}
924-
.log td:not(:first-child) {
925-
padding: 0;
939+
.log > .day > .list > .entry {
940+
display: -webkit-box;
941+
display: -ms-flexbox;
942+
display: flex;
943+
-webkit-box-orient: horizontal;
944+
-webkit-box-direction: normal;
945+
-ms-flex-direction: row;
946+
flex-direction: row;
947+
width: 100%;
948+
border-bottom: 1px solid #e6e6e6;
949+
padding: 0.6rem 1rem;
950+
}
951+
.log > .day > .list > .entry > .cell {
952+
-webkit-box-flex: 1;
953+
-ms-flex: 1;
954+
flex: 1;
955+
}
956+
.log > .day > .list > .entry:hover {
957+
background: #f0f0f0;
958+
}
959+
.log > .day > .list > .entry:last-child {
960+
border-bottom: 0;
926961
}
927962
button.clear {
928963
display: none;

0 commit comments

Comments
 (0)