mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-19 00:41:41 +00:00
Force reload after restart and switch URL after IP change (#2278)
## Description Forces a reload after restarting PhotonVision, restarting the coprocessor, performing an offline update, or nuking the install. We wait until we are reconnected to the coprocessor to reload, this is accomplished by the addition of a status API endpoint. This is being implemented due to issues experienced when the webpage is not updated (particularly during offline updates). --- Using the same statusCheck, we also wait until a new IP is available, then change to it, after changing our static IP. --- closes #2169 closes #903 ## Meta Merge checklist: - [x] Pull Request title is [short, imperative summary](https://cbea.ms/git-commit/) of proposed changes - [x] The description documents the _what_ and _why_ - [ ] If this PR changes behavior or adds a feature, user documentation is updated - [ ] If this PR touches photon-serde, all messages have been regenerated and hashes have not changed unexpectedly - [ ] If this PR touches configuration, this is backwards compatible with settings back to v2025.3.2 - [ ] If this PR touches pipeline settings or anything related to data exchange, the frontend typing is updated - [ ] If this PR addresses a bug, a regression test for it is added
This commit is contained in:
@@ -75,6 +75,11 @@ public class RequestHandler {
|
||||
|
||||
private static boolean testMode = false;
|
||||
|
||||
public static void onStatusRequest(Context ctx) {
|
||||
ctx.status(200);
|
||||
ctx.result("not dead yet");
|
||||
}
|
||||
|
||||
public static void setTestMode(boolean isTestMode) {
|
||||
testMode = isTestMode;
|
||||
}
|
||||
|
||||
@@ -117,6 +117,8 @@ public class Server {
|
||||
});
|
||||
|
||||
/* API Events */
|
||||
app.get("/api/status", RequestHandler::onStatusRequest);
|
||||
|
||||
// Settings
|
||||
app.post("/api/settings", RequestHandler::onSettingsImportRequest);
|
||||
app.get("/api/settings/photonvision_config.zip", RequestHandler::onSettingsExportRequest);
|
||||
|
||||
Reference in New Issue
Block a user