-
-
Notifications
You must be signed in to change notification settings - Fork 54
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: custom visualization support #83
Conversation
This pull request fixes 1 alert when merging be8b628 into e429c54 - view on LGTM.com fixed alerts:
|
This pull request introduces 1 alert and fixes 1 when merging 79d0f9a into e429c54 - view on LGTM.com new alerts:
fixed alerts:
|
This pull request fixes 1 alert when merging 54b551e into e429c54 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging 35bca88 into def3e54 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some comments
Codecov Report
@@ Coverage Diff @@
## master #83 +/- ##
==========================================
- Coverage 58.48% 57.90% -0.58%
==========================================
Files 10 11 +1
Lines 554 582 +28
==========================================
+ Hits 324 337 +13
- Misses 230 245 +15
Continue to review full report at Codecov.
|
This pull request fixes 1 alert when merging 2846e7f into def3e54 - view on LGTM.com fixed alerts:
|
This pull request fixes 1 alert when merging cc961c1 into def3e54 - view on LGTM.com fixed alerts:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would like to merge this. I really like the idea of experimenting with new visualizations through this method.
Looks really good. The only thing is that I don't see the need for the get_data
endpoint, as it's a bit redundant, so probably just drop that and we'll merge it? :)
This pull request fixes 1 alert when merging a4d962e into 7399920 - view on LGTM.com fixed alerts:
|
This pull request introduces 1 alert and fixes 1 when merging bd8b6b6 into 7399920 - view on LGTM.com new alerts:
fixed alerts:
|
@ErikBjare I am glad that you want to merge the visualization. I implemented the changes according to your feedback in the aw-server. Since the get_data endpoint is gone, I also had to remove it from the aw-webui. There is only one missing: since the data does not get passed to the custom visualization now, the start/end date (that you can pick in the activity watch GUI) needs to be passed to the visualization. I am not sure where to get it from, so I think it would be better if you could implement this tiny last bit. Just replace my null values here. Thanks for merging! |
@ErikBjare Yay! Thanks for merging! |
@Alwinator Thanks for contributing! (and sorry for the delay) I'm working on an example for the aw-watcher-input watcher to demonstrate how to use the feature, so hopefully that'll be ready sometime next week :) |
@ErikBjare No problem! Sounds great! |
Here's my super-basic initial example: ActivityWatch/aw-watcher-input#12 |
Finished custom visualization feature Fix linting Fix cannot parse JSON because of request failed bug Do not call watcher view with undefined data Remove the data endpoint according ActivityWatch/aw-server#83 (review) style: formatted with prettier
Finished custom visualization feature Fix linting Fix cannot parse JSON because of request failed bug Do not call watcher view with undefined data Remove the data endpoint according ActivityWatch/aw-server#83 (review) style: formatted with prettier
Finished custom visualization feature Fix linting Fix cannot parse JSON because of request failed bug Do not call watcher view with undefined data Remove the data endpoint according ActivityWatch/aw-server#83 (review) style: formatted with prettier
Finished custom visualization feature Fix linting Fix cannot parse JSON because of request failed bug Do not call watcher view with undefined data Remove the data endpoint according ActivityWatch/aw-server#83 (review) style: formatted with prettier
I struggled a bit with this since it is my first time with Rust but here it is. I used the FileServer from Rocket because that is the easiest way I found to get custom HTML per watcher. How to use: Create a `visualizations` folder in your [data](https://docs.activitywatch.net/en/latest/directories.html#data) folder. Then create a folder for your custom watcher and put your index.html here. Example: `/home/USER/.local/share/activitywatch/aw-server-rust/visualizations/aw-watcher-test/index.html` You can also load JavaScript from other files, just put them in the same directory. I tested it with my custom watcher and it works with [custom visualization support](ActivityWatch/aw-server#83) of aw-server.
See ActivityWatch/activitywatch#453