Skip to content

Commit

Permalink
updated graph display
Browse files Browse the repository at this point in the history
  • Loading branch information
borud committed Apr 4, 2023
1 parent 5e355c6 commit 82d4099
Show file tree
Hide file tree
Showing 9 changed files with 30 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"files.watcherExclude": {
"**/.git/objects/**": true,
"**/.git/subtree-cache/**": true,
"**/node_modules/*/**": true,
"**/.hg/store/**": true
}
}
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
VERSION=0.1.6
VERSION=0.1.7
all: gen test lint vet build

build: pax
Expand Down
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# PAX - People Counter Dashboard Service

stand by
This server provides a simple backend and dashboard for the Pax Counters. The Pax Counter is a device that counts the number of unique WiFi and Bluetooth devices it sees within a 5 minute time window. It then reports this count every 2 minutes via the [Span](https://span.lab5e.com/) service.

The Pax Counter counts the number of unique MAC addresses (WiFi and BT) it sees within a 5 minute time window. It never reports the actual MAC addresses, only the unique count within that time window. Most personal devices tend to have some form of MAC address randomization that will change the MAC address every 10-15 minutes. We make no effort to try to identify devices beyond just counting the number of unique MAC addresses seen within a 5 minute window.
10 changes: 10 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: '3.9'
services:
pax:
image: ghcr.io/lab5e/pax:latest
restart: on-error
ports:
- "4500:4500/tcp"
env_file:
- apitoken.env

2 changes: 1 addition & 1 deletion frontend/dist/frontend/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@

<body>
<app-root></app-root>
<script src="runtime.aaedba49815d2ab0.js" type="module"></script><script src="polyfills.1a4a779d95e3f377.js" type="module"></script><script src="main.a7a0dba0f880d2dd.js" type="module"></script>
<script src="runtime.aaedba49815d2ab0.js" type="module"></script><script src="polyfills.1a4a779d95e3f377.js" type="module"></script><script src="main.37fe84e139ef58a4.js" type="module"></script>

</body></html>

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion frontend/src/app/api/pax/model/protobufAny.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@


/**
* `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use \'type.googleapis.com/full.type.name\' as the type URL and the unpack methods only use the fully qualified type name after the last \'/\' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": <string>, \"lastName\": <string> } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" }
* `Any` contains an arbitrary serialized protocol buffer message along with a URL that describes the type of the serialized message. Protobuf library provides support to pack/unpack Any values in the form of utility functions or additional generated methods of the Any type. Example 1: Pack and unpack a message in C++. Foo foo = ...; Any any; any.PackFrom(foo); ... if (any.UnpackTo(&foo)) { ... } Example 2: Pack and unpack a message in Java. Foo foo = ...; Any any = Any.pack(foo); ... if (any.is(Foo.class)) { foo = any.unpack(Foo.class); } Example 3: Pack and unpack a message in Python. foo = Foo(...) any = Any() any.Pack(foo) ... if any.Is(Foo.DESCRIPTOR): any.Unpack(foo) ... Example 4: Pack and unpack a message in Go foo := &pb.Foo{...} any, err := anypb.New(foo) if err != nil { ... } ... foo := &pb.Foo{} if err := any.UnmarshalTo(foo); err != nil { ... } The pack methods provided by protobuf library will by default use \'type.googleapis.com/full.type.name\' as the type URL and the unpack methods only use the fully qualified type name after the last \'/\' in the type URL, for example \"foo.bar.com/x/y.z\" will yield type name \"y.z\". JSON ==== The JSON representation of an `Any` value uses the regular representation of the deserialized, embedded message, with an additional field `@type` which contains the type URL. Example: package google.profile; message Person { string first_name = 1; string last_name = 2; } { \"@type\": \"type.googleapis.com/google.profile.Person\", \"firstName\": <string>, \"lastName\": <string> } If the embedded message type is well-known and has a custom JSON representation, that representation will be embedded adding a field `value` which holds the custom JSON in addition to the `@type` field. Example (for message [google.protobuf.Duration][]): { \"@type\": \"type.googleapis.com/google.protobuf.Duration\", \"value\": \"1.212s\" }
*/
export interface ProtobufAny {
[key: string]: object | any;
Expand Down
3 changes: 3 additions & 0 deletions frontend/src/app/api/pax/model/v1Data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@ import { V1Sample } from './v1Sample';

export interface V1Data {
deviceId?: string;
deviceName?: string;
lat?: number;
lon?: number;
samples?: Array<V1Sample>;
}

4 changes: 2 additions & 2 deletions frontend/src/app/src/app/main-chart/main-chart.component.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export class MainChartComponent implements OnInit, AfterViewInit {
createChart(): void {
let bleSamples = this.dataPoints.map(v => {
return {
label: (v.deviceId || "") + " (BLE)",
label: (v.deviceName || "") + " (BLE)",
data: v.samples?.map(sample => {
return {
x: new Date(parseInt(sample.timestamp!)),
Expand All @@ -83,7 +83,7 @@ export class MainChartComponent implements OnInit, AfterViewInit {

let wifiSamples = this.dataPoints.map(v => {
return {
label: (v.deviceId || "") + " (WiFi)",
label: (v.deviceName || "") + " (WiFi)",
data: v.samples?.map(sample => {
return {
x: new Date(parseInt(sample.timestamp!)),
Expand Down

0 comments on commit 82d4099

Please sign in to comment.