Skip to content

Commit 2ff9f39

Browse files
committed
update README
Signed-off-by: Teo Koon Peng <[email protected]>
1 parent 4c0de1c commit 2ff9f39

File tree

1 file changed

+34
-68
lines changed

1 file changed

+34
-68
lines changed
+34-68
Original file line numberDiff line numberDiff line change
@@ -1,48 +1,16 @@
1-
# rmf-dashboard
1+
# rmf-dashboard-framework
22

3-
`rmf-dashboard` is a web application that provides overall visualization and control over the RMF system.
3+
`rmf-dashboard-framework` is a library that makes it easy to build a web application that provides visualization and control over the RMF system.
44

5-
# Setup
5+
## Getting Started
66

7-
Follow the build instructions [here](../../README.md/#launching).
7+
See the [Getting Started](./docs/getting-started.md) docs.
88

9-
## Configuration
9+
## MicroApps
1010

11-
Before building the dashboard, you must configure it according to the deployment. All the configurations is on `app-config.json`, the default configuration is for running the api-server and dashboard locally. You may check [src/app-config.ts](src/app-config.ts) for more details on the config file schema.
11+
MicroApps are react components that can be used to build a page. The dashboard comes with many different micro-apps, each serving a different purpose when interacting with an Open-RMF deployment. The dashboard uses events to pipe information between micro-apps, for example clicking onto a task row in the Task app, will center the map onto the robot that the task was assigned to.
1212

13-
### (Optional) Add external resources.
14-
15-
The `resources` option in the app config allows configuring various assets used by the dashboard. At the moment, it mainly allows configuring the header logo and robot icons, they should point to either the full url or absolute url, for example
16-
17-
```json
18-
"resources": {
19-
"default": {
20-
"fleets": {
21-
"tinyRobot": {
22-
"default": {
23-
"icon": "https://raw.githubusercontent.com/open-rmf/rmf_demos/rmf-web-dashboard-resources/rmf_demos_dashboard_resources/office/icons/tinyRobot.png",
24-
"scale": 0.00123
25-
}
26-
}
27-
},
28-
"logos": {
29-
"header": "/resources/defaultLogo.png"
30-
}
31-
}
32-
},
33-
```
34-
35-
In the above config, the header logo will be on absolute url `/resources/defaultLogo.png`, if the resources are hosted on a different domain (e.g. you are using a cdn), then it should include the full url, e.g. `https://storage.googleapis.com/[BUCKET_NAME]/[OBJECT_NAME]`.
36-
37-
For testing, it is convenient to put the resources in the `public` folder and they will be served by the vite dev server.
38-
39-
For dashboard resources for `rmf_demos` simulation worlds, check out the [rmf-web-dashboard-resources](https://github.com/open-rmf/rmf_demos/tree/rmf-web-dashboard-resources) branch of `rmf_demos`.
40-
41-
### Micro-apps
42-
43-
The dashboard comes with many different micro-apps, each serving a different purpose when interacting with an Open-RMF deployment. The dashboard uses events to pipe information between micro-apps, for example clicking onto a task row in the Task app, will center the map onto the robot that the task was assigned to.
44-
45-
Here are the available apps,
13+
Some of the built in MicroApps are:
4614
* Robots
4715
* Map
4816
* Doors
@@ -54,39 +22,37 @@ Here are the available apps,
5422
* Task Details
5523
* Task Logs
5624

57-
### Workspace (tab) layouts
25+
It is also possible to create new MicroApps, see [Creating a MicroApp](./docs/micro-apps.md#creating-a-microapp) for some examples.
5826

59-
Each workspace (tab) allows users to define how the layout of micro-apps should be. By modifying the `WorkspaceState` of the workspace, micro-apps can be resized, moved, added or removed.
27+
## Workspaces
6028

61-
Here is an example workspace state,
29+
A `Workspace` is a react component that render MicroApps based on a given layout, it makes it very easy to build a page in `rmf-dashboard-framework` by combining multiple MicroApps. Here is an example of a workspace
6230

63-
```typescript
64-
export const robotsWorkspace: WorkspaceState = {
65-
layout: [
66-
{ i: 'robots', x: 0, y: 0, w: 7, h: 3 },
67-
{ i: 'map', x: 8, y: 0, w: 5, h: 9 },
68-
{ i: 'doors', x: 0, y: 0, w: 7, h: 3 },
69-
{ i: 'lifts', x: 0, y: 0, w: 7, h: 3 },
70-
{ i: 'beacons', x: 0, y: 0, w: 7, h: 3 },
71-
{ i: 'mutexGroups', x: 8, y: 0, w: 5, h: 3 },
72-
],
73-
windows: [
74-
{ key: 'robots', appName: 'Robots' },
75-
{ key: 'map', appName: 'Map' },
76-
{ key: 'doors', appName: 'Doors' },
77-
{ key: 'lifts', appName: 'Lifts' },
78-
{ key: 'beacons', appName: 'Beacons' },
79-
{ key: 'mutexGroups', appName: 'Mutex Groups' },
80-
],
81-
};
31+
```tsx
32+
<Workspace initialWindows={[
33+
{ layout: { x: 0, y: 0, w: 7, h: 8 }, microApp: tasksApp },
34+
{ layout: { x: 8, y: 0, w: 5, h: 8 }, microApp: mapApp },
35+
]} />
8236
```
8337

84-
### Custom tab(s)
85-
86-
With the dashboard configuration parameter `customTabs: true`, 2 custom tabs would be available on the App bar. These custom tabs allow users to create a custom layout of desired micro-apps, if a custom workflow is desired.
87-
88-
These custom layouts will be cached locally on the browser's machine, where it can be brought up again.
38+
The above workspace renders a "Tasks" and "Map" MicroApp with a fixed layout, but it supports a `designMode` that allows free customizable of the layout by the user at runtime
39+
40+
```tsx
41+
<LocallyPersistentWorkspace
42+
defaultWindows={[]}
43+
allowDesignMode
44+
appRegistry={[
45+
mapApp,
46+
doorsApp,
47+
liftsApp,
48+
robotsApp,
49+
robotMutexGroupsApp,
50+
tasksApp,
51+
]}
52+
storageKey="custom-workspace"
53+
/>
54+
```
8955

90-
To edit a custom tab, click onto the wand icon on the right end of the App bar, and proceed to add, resize, move or remove micro-apps from the layout.
56+
## Examples
9157

92-
![](https://github.com/open-rmf/rmf-web/blob/media/custom-tabs.gif)
58+
See [examples](./examples/)

0 commit comments

Comments
 (0)