You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* require fewer clicks for time interval changes. apply bootstrap styles.
* notify user, that timeline was not updated / re-rendered on purpose (because there are no matching events to render). addresses issues reported in #395
* update lastUpdate timer display every 500ms
* use for loop to render duration buttons. replace sr-only by d-none.
* extra margin for small screens.
* re-add sync button next to last update label. always show it, and label it "reload" instead of former "update".
* Apply suggestions from code review
* tests: fixed e2e test for new timeline inputs
* fix: minor style improvements to new timeline
---------
Co-authored-by: Erik Bjäreholt <[email protected]>
Co-authored-by: Erik Bjäreholt <[email protected]>
| Last update: #[time(:datetime="lastUpdate.format()") {{lastUpdate | friendlytime}}]
50
47
</template>
51
48
52
-
<style scoped lang="scss"></style>
49
+
<style scoped lang="scss">
50
+
.btn-group {
51
+
input[type='radio']:checked + label {
52
+
background-color: #aaa;
53
+
}
54
+
}
55
+
</style>
53
56
54
57
<script lang="ts">
55
58
importmomentfrom'moment';
@@ -77,6 +80,18 @@ export default {
77
80
start: null,
78
81
end: null,
79
82
lastUpdate: null,
83
+
durations: [
84
+
{ seconds: 0.25*60*60, label: '¼h' },
85
+
{ seconds: 0.5*60*60, label: '½h' },
86
+
{ seconds: 60*60, label: '1h' },
87
+
{ seconds: 2*60*60, label: '2h' },
88
+
{ seconds: 3*60*60, label: '3h' },
89
+
{ seconds: 4*60*60, label: '4h' },
90
+
{ seconds: 6*60*60, label: '6h' },
91
+
{ seconds: 12*60*60, label: '12h' },
92
+
{ seconds: 24*60*60, label: '24h' },
93
+
{ seconds: 48*60*60, label: '48h' },
94
+
],
80
95
};
81
96
},
82
97
computed: {
@@ -103,13 +118,13 @@ export default {
103
118
this.duration=this.defaultDuration;
104
119
this.valueChanged();
105
120
106
-
// We want our lastUpdated text to update every ~3s
121
+
// We want our lastUpdated text to update every ~500ms
107
122
// We can do this by setting it to null and then the previous value.
108
123
this.lastUpdateTimer=setInterval(() => {
109
124
const _lastUpdate =this.lastUpdate;
110
125
this.lastUpdate=null;
111
126
this.lastUpdate=_lastUpdate;
112
-
}, 1000);
127
+
}, 500);
113
128
},
114
129
beforeDestroy() {
115
130
clearInterval(this.lastUpdateTimer);
@@ -124,12 +139,20 @@ export default {
124
139
this.$emit('input', this.value);
125
140
}
126
141
},
127
-
update() {
128
-
if (this.mode=='last_duration') {
129
-
this.mode=''; // remove cache on v-model, see explanation: https://github.com/ActivityWatch/aw-webui/pull/344/files#r892982094
0 commit comments