-
-
Notifications
You must be signed in to change notification settings - Fork 107
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #218 from ActivityWatch/dev/settings-split
refactor: Split Settings into multiple views
- Loading branch information
Showing
6 changed files
with
119 additions
and
68 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
<template lang="pug"> | ||
div.row | ||
div.col-sm-9 | ||
h5.mb-0 Start of day | ||
small | ||
| The time at which days "start", since humans don't always go to bed before midnight. Set to 04:00 by default. | ||
div.col-sm-3 | ||
input.form-control(type="time" :value="startOfDay" @change="setStartOfDay($event.target.value)") | ||
</template> | ||
<script> | ||
export default { | ||
name: 'DaystartSettings', | ||
data: () => { | ||
return { | ||
startOfDay: '', | ||
}; | ||
}, | ||
mounted() { | ||
this.startOfDay = localStorage.startOfDay; | ||
}, | ||
methods: { | ||
setStartOfDay: function(time_minutes) { | ||
localStorage.startOfDay = time_minutes; | ||
console.log('Set start of day to ' + time_minutes); | ||
}, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
<template lang="pug"> | ||
div | ||
h3 Settings | ||
|
||
b-alert(variant="warning", show) #[b Note:] These settings are only saved in your browser and will not remain if you switch browser. We are working on getting this fixed. | ||
|
||
hr | ||
|
||
DaystartSettings | ||
|
||
hr | ||
|
||
TimelineDurationSettings | ||
|
||
hr | ||
|
||
CategorizationSettings | ||
|
||
</template> | ||
|
||
<script> | ||
import DaystartSettings from '~/views/settings/DaystartSettings.vue'; | ||
import TimelineDurationSettings from '~/views/settings/TimelineDurationSettings.vue'; | ||
import CategorizationSettings from '~/views/settings/CategorizationSettings.vue'; | ||
export default { | ||
name: 'Settings', | ||
components: { | ||
DaystartSettings, | ||
TimelineDurationSettings, | ||
CategorizationSettings, | ||
}, | ||
}; | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<template lang="pug"> | ||
div.row | ||
div.col-sm-9 | ||
h5.mb-0 Duration default value | ||
small | ||
| The default duration used for 'show last' in the timeline view | ||
div.col-sm-3 | ||
select(id="durationDefaultValue" :value="durationDefaultValue", @change="setDurationDefault($event.target.value)") | ||
option(:value="15*60") 15min | ||
option(:value="30*60") 30min | ||
option(:value="60*60") 1h | ||
option(:value="2*60*60") 2h | ||
option(:value="4*60*60") 4h | ||
option(:value="6*60*60") 6h | ||
option(:value="12*60*60") 12h | ||
option(:value="24*60*60") 24h | ||
</template> | ||
<script> | ||
export default { | ||
name: 'TimelineDurationSettings', | ||
data: () => { | ||
return { | ||
durationDefaultValue: localStorage.durationDefault || 60 * 60, | ||
}; | ||
}, | ||
mounted() { | ||
this.startOfDay = localStorage.startOfDay; | ||
}, | ||
methods: { | ||
setDurationDefault: function(duration) { | ||
localStorage.durationDefault = duration; | ||
console.log('Set default timeline duration to ' + duration); | ||
}, | ||
}, | ||
}; | ||
</script> |