server
server copied to clipboard
Dashboard endpoint to list widgets
There is currently no way for clients to get information on the widgets right now.
- [x] add separate endpoint for the list of widgets
- [x] switch icon from using classes to images or icon content (not sure how it's done for other cases?)
- [ ] sort by "mobile usable" widgets, @jancborchardt
API draft (from client perspective): /list
- returns: list of widgets with
- id
- icon (as url)
- title
- button: name, url
/items
- params: widget id, since (optional), limit: int
- returns:
- icon with status badge (e.g. in zammad notificatons)
- first line
- subline
- link (absolute link to web is enough)
For second iteration
- app id
- object id (this is needed to e.g. open a deck card directly if deck app is installed)
From https://github.com/nextcloud/files-clients/issues/17#issuecomment-1036076355
- switch icon from using classes to images or icon content (not sure how it's done for other cases?)
I'd prefer real icons (svg, png) as this is also what is used in e.g. activities and client can cache this easily.
@PVince81 will get in touch with you about the server-side supporting dev @tobiasKaminsky
Existing OCS API is: https://github.com/nextcloud/server/blob/e15270cbb9a6aa483f8d85642c267cfd3dc6d25e/apps/dashboard/lib/Controller/DashboardApiController.php#L69
@icewind1991 I added a first draft version of API in first comment.
@PVince81 Robin pointed out in our call that the existing api (see above) is not yet used by any widget. While this is not a problem for non-bundled apps, it is for those that we ship with NC25.
does it mean we need to port the existing widgets to use that API ? @juliushaertl @eneiluj
Iirc @eneiluj worked on the API, so maybe he knows if it is already implemented by some apps. The backend API was supposed to be additionally available as the web frontend may still provide custom rendering.
Initial work is at https://github.com/nextcloud/server/pull/33658
Vincent, can you make sure that at least the apps that are shipped with NC25 are compatible with new API? I expect that this is an easy job, as it only needs to output the same data on a different api :crossed_fingers:
is there a list of those apps somewhere ? maybe need to grep for a string in the release tarball ?
Maybe https://github.com/nextcloud/server/blob/master/lib/public/Dashboard/IDashboardWidget.php and then we check which of those apps are bundled? @eneiluj do you have a better idea?
Else we can check widgets in "customize" at https://cloud.nextcloud.com/apps/dashboard
- [ ] make widgets compatible with the new API
- [ ] user status: apps/user_status/lib/Dashboard/UserStatusWidget.php
- [ ] recommandations: apps/recommendations/lib/Dashboard/RecommendationWidget.php
- [ ] activity: apps/activity/lib/Dashboard/ActivityWidget.php
- [ ] weather_status
- [ ] recent statuses
Please, whenever there is a (draft) PR ping me, so I can directly test/use it on Android side, to see if every content is valid :)
does it mean we need to port the existing widgets to use that API ? @juliushaertl @eneiluj
@PVince81 Yes. It is rather an extension than a port. It does not require to change anything to what exists. Widgets need to implement the new interfaces from #33658
@PVince81 Robin pointed out in our call that the existing api (see above) is not yet used by any widget. While this is not a problem for non-bundled apps, it is for those that we ship with NC25.
Yeah no app implements the IAPIWidget interface yet except integration_github (but not yet in the latest release). See https://github.com/nextcloud/integration_github/blob/master/lib/Dashboard/GithubWidget.php
Maybe https://github.com/nextcloud/server/blob/master/lib/public/Dashboard/IDashboardWidget.php and then we check which of those apps are bundled? @eneiluj do you have a better idea?
@tobiasKaminsky For the apps that implement a widget for the new dashboard, we can search for "implements IWidget" to get the list of apps.
Please, whenever there is a (draft) PR ping me, so I can directly test/use it on Android side, to see if every content is valid :)
I can implement the new interfaces from @icewind1991 in integration_github and deck this week if needed for tests.
I can implement the new interfaces from @icewind1991 in integration_github and deck this week if needed for tests.
@eneiluj That be nice, especially deck since it is a nc app coming as a recommended app within Nc Hub - integration_* is less important but of course any widget that is available for the client thatnk to the immplemented interface would be great for the launch and announcement of it :)
@tobiasKaminsky @PVince81 I'll try to implement the new dashboard APIs in some core apps this week (starting with user_status and recommandations, if someone wants to deal with the others let's coordinate here).
@icewind1991 Is it fine if I create PRs on top of your branch?
Please see https://github.com/nextcloud/server/issues/221#issue-1147130186 for overview. If you do any other app, please also add it there in "other apps", so that I am aware of it, can put it on my testing server, so that Android and iOS can test with same data set.
We could close this as https://github.com/nextcloud/server/pull/33658 is now merged.
sort by "mobile usable" widgets, @jancborchardt
Is that mandatory?