Skip to content

Commit 761d563

Browse files
committed
Add remote Build reads and image integration
1 parent e1451f2 commit 761d563

24 files changed

Lines changed: 964 additions & 65 deletions

CMakeLists.txt

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,13 @@ target_link_libraries(BrickSuite PRIVATE
454454
include(CTest)
455455

456456
if(BUILD_TESTING)
457+
qt_add_executable(SingleInstanceWindowRegistryTest EXCLUDE_FROM_ALL
458+
tests/SingleInstanceWindowRegistryTest.cpp
459+
src/ui/common/SingleInstanceWindowRegistry.h
460+
)
461+
target_link_libraries(SingleInstanceWindowRegistryTest PRIVATE Qt6::Core)
462+
add_test(NAME SingleInstanceWindowRegistry COMMAND SingleInstanceWindowRegistryTest)
463+
457464
qt_add_executable(InventoryRemoveHardeningTest EXCLUDE_FROM_ALL
458465
tests/InventoryRemoveHardeningTest.cpp
459466
src/database/DatabaseManager.h src/database/DatabaseManager.cpp

resources/help/bricksuite_server.html

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
<!doctype html><html><head><meta charset="utf-8"><title>BrickSuite Server</title>
22
<style>body{font-family:sans-serif;line-height:1.5;margin:22px}h2{margin-top:1.5em}.note{border-left:4px solid #888;padding-left:10px;margin:14px 0}</style></head><body>
33
<h1>BrickSuite Server</h1>
4-
<p>BrickSuite Server lets another BrickSuite installation establish a secure connection to the computer that owns the authoritative workshop database. A connected Client can browse Host Workspaces, Storage used by Inventory, My Inventory, and Inventory History. Remote Inventory is read-only at this stage; adding, editing, moving, correcting, losing, or removing Inventory still requires using the Host computer.</p>
4+
<p>BrickSuite Server lets another BrickSuite installation establish a secure connection to the computer that owns the authoritative workshop database. A connected Client can browse Host Workspaces, Storage used by Inventory, My Inventory, Inventory History, and Builds. Remote shared data is read-only at this stage; changes still require using the Host computer.</p>
55
<p>The Client chooses its Host Workspace independently. This does not change the Workspace selected in the Host computer's UI. The selection is remembered on the Client for that Host identity and validated again after reconnecting.</p>
6-
<div class="note"><b>Hybrid data:</b> operational Workspace, Storage, Inventory, and History data comes from the Host. Part and Color names and images continue to use the Client device's local Rebrickable catalog and image cache. Unknown local catalog items remain visible using Host fallback text.</div>
7-
<p>Remote Builds and Collection workflows are not yet enabled in the application UI.</p>
6+
<div class="note"><b>Hybrid data:</b> operational Workspace, Storage, Inventory, History, Build requirements, allocations, Missing Parts, and Pulling state come from the Host. Part and Color names and images continue to use the Client device's local Rebrickable catalog and image cache. Unknown local catalog items remain visible using Host fallback text.</div>
7+
<p>In <b>Builds</b>, a Client can view the Host Build list, immutable requirement snapshots, Host-calculated Missing Parts, and the current Pulling projection. Pulling is read-only: creating or editing Builds, allocating Inventory, recording pulls, reconciling pull lists, completing, cancelling, archiving, or disassembling a Build is not available remotely yet.</p>
8+
<p>Remote Collection workflows are not yet enabled in the application UI.</p>
89
<h2>Security model</h2>
910
<p>Connections use <b>WSS/TLS</b>. Each Host generates its own persistent certificate and private key. The Client verifies its SHA-256 fingerprint. A separate access token authorizes the Client through a nonce-based HMAC-SHA-256 challenge response and is stored through the operating-system credential service.</p>
1011
<div class="note"><b>Verify before trusting.</b> Compare the Client fingerprint with the fingerprint shown directly in Server Settings on the Host computer. First-use acceptance without that comparison can trust the wrong computer.</div>

src/network/BrickSuiteOperationDispatcher.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ BrickSuiteOperationDispatcher::BrickSuiteOperationDispatcher()
2222
addCapability(QStringLiteral("inventory.get"), QStringLiteral("inventory.detail.read"));
2323
addCapability(QStringLiteral("inventory.history"), QStringLiteral("inventory.history.read"));
2424
addCapability(QStringLiteral("builds.list"), QStringLiteral("builds.read"));
25+
addCapability(QStringLiteral("builds.get"), QStringLiteral("builds.detail.read"));
2526
addCapability(QStringLiteral("builds.requirements"), QStringLiteral("builds.requirements.read"));
2627
addCapability(QStringLiteral("builds.missingParts"), QStringLiteral("builds.missingParts.read"));
2728
addCapability(QStringLiteral("builds.pulling"), QStringLiteral("builds.pulling.read"));

src/services/application/HostReadExecutor.cpp

Lines changed: 76 additions & 7 deletions
Large diffs are not rendered by default.

src/services/application/HostReadExecutor.h

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ class HostReadExecutor : public QObject
5050
void listBuilds(int workspaceId, bool includeArchived, QObject* context,
5151
std::function<void(const QList<Build>&)> completion,
5252
ErrorCallback failure = {});
53-
void getBuild(int buildId, QObject* context,
53+
void getBuild(int workspaceId, int buildId, QObject* context,
5454
std::function<void(const std::optional<Build>&)> completion,
5555
ErrorCallback failure = {});
5656
void buildRequirements(int buildId, QObject* context,
@@ -59,6 +59,12 @@ class HostReadExecutor : public QObject
5959
void missingParts(int workspaceId, int buildId, QObject* context,
6060
std::function<void(const QList<MissingPartsService::MissingPart>&)> completion,
6161
ErrorCallback failure = {});
62+
void listBuildsPortable(int workspaceId, bool includeArchived, QObject* context,
63+
std::function<void(const QList<RemoteReadDto::BuildSummary>&)> completion,
64+
ErrorCallback failure = {});
65+
void getBuildPortable(int workspaceId, int buildId, QObject* context,
66+
std::function<void(const std::optional<RemoteReadDto::BuildDetail>&)> completion,
67+
ErrorCallback failure = {});
6268
void pullingView(int buildId, QObject* context,
6369
std::function<void(const BuildPullingService::PullingView&)> completion,
6470
ErrorCallback failure = {});
@@ -83,15 +89,15 @@ class HostReadExecutor : public QObject
8389
int rebrickableColorId, QObject* context,
8490
std::function<void(const QList<RemoteReadDto::InventoryHistoryRow>&)> completion,
8591
ErrorCallback failure = {});
86-
void buildRequirementsPortable(int buildId, const RemoteReadDto::PageRequest& page,
92+
void buildRequirementsPortable(int workspaceId, int buildId, const RemoteReadDto::PageRequest& page,
8793
QObject* context,
8894
std::function<void(const RemoteReadDto::Page<RemoteReadDto::BuildRequirement>&)> completion,
8995
ErrorCallback failure = {});
9096
void missingPartsPortable(int workspaceId, int buildId,
9197
const RemoteReadDto::PageRequest& page, QObject* context,
9298
std::function<void(const RemoteReadDto::Page<RemoteReadDto::MissingPart>&)> completion,
9399
ErrorCallback failure = {});
94-
void pullingPortable(int buildId, const RemoteReadDto::PageRequest& page,
100+
void pullingPortable(int workspaceId, int buildId, const RemoteReadDto::PageRequest& page,
95101
QObject* context,
96102
std::function<void(const RemoteReadDto::Page<RemoteReadDto::PullingRow>&)> completion,
97103
ErrorCallback failure = {});

0 commit comments

Comments
 (0)