Skip to content

Commit

Permalink
Feature/beacons frontend (#733)
Browse files Browse the repository at this point in the history
* Beacons API

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Subscription for beacon states

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Adding beacon datagrid table to react-components

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Beacons microapp

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Start by getting all beacons

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Added more entries to storybook

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

* Using more explicit import instead of glob

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>

---------

Signed-off-by: Aaron Chong <aaronchongth@gmail.com>
  • Loading branch information
aaronchongth authored Aug 10, 2023
1 parent 0aa093d commit 5fcccd3
Show file tree
Hide file tree
Showing 15 changed files with 832 additions and 8 deletions.
5 changes: 5 additions & 0 deletions packages/api-client/lib/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import Debug from 'debug';
import { io, Socket } from 'socket.io-client';
import {
ApiServerModelsTortoiseModelsAlertsAlertLeaf,
ApiServerModelsTortoiseModelsBeaconsBeaconStateLeaf as BeaconState,
BuildingMap,
DispenserHealth,
DispenserState,
Expand Down Expand Up @@ -68,6 +69,10 @@ export class SioClient {
this.sio.off(sub.room, sub.listener);
}

subscribeBeaconState(listener: Listener<BeaconState>): Subscription {
return this.subscribe<BeaconState>('/beacons', listener);
}

subscribeBuildingMap(listener: Listener<BuildingMap>): Subscription {
return this.subscribe<BuildingMap>(`/building_map`, listener);
}
Expand Down
Loading

0 comments on commit 5fcccd3

Please sign in to comment.