Use Eve dashboard broker

This commit is contained in:
Meta Vens 2026-05-31 01:23:15 +01:00
commit ffb53fe456
3 changed files with 28 additions and 10 deletions

View file

@ -81,9 +81,11 @@ Start the dashboard authority on Starfire:
dotnet run --project E:\Projects\Mimir\src\Mimir.EveDashboard\Mimir.EveDashboard.csproj -- --port 8795
```
EveCanvas connects to `ws://192.168.1.66:8795/eve/dashboard`. Mimir sends
`dashboard-state` snapshots containing scene nodes, selection, visibility,
transform, size, and health. EveCanvas sends compact commands back:
EveCanvas connects first to `ws://192.168.1.66:8795/eve/deck`, with
`/eve/dashboard` kept as a compatibility fallback. The Starfire broker sends
native retained `dashboard-state` snapshots containing provider id, title,
scene nodes, selection, visibility, transform, size, and health. EveCanvas sends
compact commands back:
- `select`
- `move`
@ -91,9 +93,11 @@ transform, size, and health. EveCanvas sends compact commands back:
- `rotate`
- `toggle-visibility`
- `reset-transform`
- `open-provider`
Eve renders and edits the dashboard; Mimir owns the accepted state. Eve is the
operator's hand on the scene graph, not a second compositor.
Eve renders and edits dashboard trees natively; each provider owns accepted
state and command handling. Eve is the operator's hand on the scene graph, not a
second compositor and not a remote WebKit runtime.
## Build Shape

View file

@ -87,7 +87,6 @@
if ([state isKindOfClass:NSDictionary.class]) {
dispatch_async(dispatch_get_main_queue(), ^{
[self.delegate dashboardClient:self didReceiveState:state];
[self.delegate dashboardClient:self didChangeStatus:@"dashboard live"];
});
}
}

View file

@ -129,6 +129,8 @@ static int64_t EVEHostTimeNowNs(void) {
[self.streamClient connect];
NSArray<NSURL *> *dashboardURLs = @[
[NSURL URLWithString:@"ws://127.0.0.1:8795/eve/deck"],
[NSURL URLWithString:@"ws://192.168.1.66:8795/eve/deck"],
[NSURL URLWithString:@"ws://127.0.0.1:8795/eve/dashboard"],
[NSURL URLWithString:@"ws://192.168.1.66:8795/eve/dashboard"],
];
@ -515,7 +517,9 @@ static int64_t EVEHostTimeNowNs(void) {
- (void)dashboardClient:(EVEDashboardClient *)client didReceiveState:(NSDictionary *)state {
(void)client;
self.dashboardStatus = [NSString stringWithFormat:@"v%@", state[@"version"] ?: @"?"];
NSString *title = [state[@"title"] isKindOfClass:NSString.class] ? state[@"title"] : @"dashboard";
self.dashboardStatus = [NSString stringWithFormat:@"%@ v%@", title, state[@"version"] ?: @"?"];
self.dashboardStatusLabel.text = self.dashboardStatus;
NSString *selected = state[@"selectedNodeId"];
if ([selected isKindOfClass:NSString.class]) {
self.selectedNodeId = selected;
@ -630,7 +634,7 @@ static int64_t EVEHostTimeNowNs(void) {
}
UILabel *title = [[UILabel alloc] initWithFrame:CGRectZero];
title.text = @"Scene Graph";
title.text = @"Dashboards";
title.textColor = UIColor.whiteColor;
title.font = [UIFont systemFontOfSize:16.0 weight:UIFontWeightBold];
[self.hierarchyStackView addArrangedSubview:title];
@ -659,8 +663,7 @@ static int64_t EVEHostTimeNowNs(void) {
return;
}
self.selectedNodeId = nodeId;
[self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}];
[self selectOrOpenDashboardNode:nodeId];
}
- (void)nodePanned:(UIPanGestureRecognizer *)recognizer {
@ -722,7 +725,19 @@ static int64_t EVEHostTimeNowNs(void) {
return;
}
[self selectOrOpenDashboardNode:nodeId];
}
- (void)selectOrOpenDashboardNode:(NSString *)nodeId {
self.selectedNodeId = nodeId;
NSDictionary *node = self.dashboardNodes[nodeId];
NSString *command = [node[@"command"] isKindOfClass:NSString.class] ? node[@"command"] : nil;
NSString *providerId = [node[@"providerId"] isKindOfClass:NSString.class] ? node[@"providerId"] : nil;
if ([command isEqualToString:@"open-provider"] && providerId) {
[self.dashboardClient sendCommand:@{@"type": @"open-provider", @"nodeId": nodeId, @"providerId": providerId}];
return;
}
[self.dashboardClient sendCommand:@{@"type": @"select", @"nodeId": nodeId}];
}