2026-02-11 23:22:20 +01:00
|
|
|
package ins.frontend;
|
|
|
|
|
|
|
|
|
|
import ins.frontend.utils.WebApp;
|
2026-02-22 17:21:23 +01:00
|
|
|
import org.openautonomousconnection.protocol.packets.v1_0_1.beta.web.impl.resource.WebResourceResponsePacket;
|
|
|
|
|
import org.openautonomousconnection.protocol.versions.v1_0_1.beta.WebPacketFlags;
|
|
|
|
|
import org.openautonomousconnection.protocol.versions.v1_0_1.beta.WebPacketHeader;
|
2026-02-11 23:22:20 +01:00
|
|
|
import org.openautonomousconnection.webserver.api.Route;
|
|
|
|
|
import org.openautonomousconnection.webserver.api.WebPage;
|
|
|
|
|
import org.openautonomousconnection.webserver.api.WebPageContext;
|
2026-02-22 17:21:23 +01:00
|
|
|
import org.openautonomousconnection.webserver.utils.HeaderMaps;
|
2026-02-11 23:22:20 +01:00
|
|
|
import org.openautonomousconnection.webserver.utils.Html;
|
|
|
|
|
|
2026-02-22 17:21:23 +01:00
|
|
|
import java.util.Map;
|
2026-02-11 23:22:20 +01:00
|
|
|
|
|
|
|
|
/**
|
2026-02-22 17:21:23 +01:00
|
|
|
* Info page for INS registrar frontend (v1.0.1).
|
2026-02-11 23:22:20 +01:00
|
|
|
*/
|
2026-02-22 17:21:23 +01:00
|
|
|
@Route(path = "/info.html")
|
2026-03-02 18:41:19 +01:00
|
|
|
public final class info extends WebPage {
|
2026-02-11 23:22:20 +01:00
|
|
|
|
|
|
|
|
@Override
|
2026-02-22 17:21:23 +01:00
|
|
|
public WebResourceResponsePacket handle(WebPageContext ctx) {
|
2026-02-11 23:22:20 +01:00
|
|
|
WebApp.init();
|
2026-02-22 17:21:23 +01:00
|
|
|
|
2026-02-11 23:22:20 +01:00
|
|
|
String html = Html.page("INS Info", """
|
2026-02-22 17:21:23 +01:00
|
|
|
<section class="card">
|
2026-02-11 23:22:20 +01:00
|
|
|
<h2>OAC Default INS Server</h2>
|
2026-02-22 17:21:23 +01:00
|
|
|
|
2026-02-11 23:22:20 +01:00
|
|
|
<p>
|
|
|
|
|
The <strong>Default INS Server</strong> is the official, project-operated
|
|
|
|
|
name service of the Open Autonomous Connection (OAC) network.
|
|
|
|
|
</p>
|
2026-02-22 17:21:23 +01:00
|
|
|
|
2026-02-11 23:22:20 +01:00
|
|
|
<p>
|
|
|
|
|
It provides a trusted reference point for resolving InfoNames
|
|
|
|
|
and enables initial client connections
|
2026-03-02 18:41:19 +01:00
|
|
|
to the OAC.
|
2026-02-11 23:22:20 +01:00
|
|
|
</p>
|
2026-02-22 17:21:23 +01:00
|
|
|
|
2026-02-11 23:22:20 +01:00
|
|
|
<p>
|
|
|
|
|
This server is maintained by the OAC project and is intended
|
|
|
|
|
as the recommended entry point for public services and new clients.
|
|
|
|
|
</p>
|
2026-02-22 17:21:23 +01:00
|
|
|
|
2026-02-11 23:22:20 +01:00
|
|
|
<p class="muted">
|
|
|
|
|
Note: Alternative or private INS servers may exist, but the default INS
|
|
|
|
|
server represents the official and stable reference instance.
|
|
|
|
|
</p>
|
2026-03-02 18:41:19 +01:00
|
|
|
|
|
|
|
|
<p>Checkout the Source here: https://repo.open-autonomous-connection.org/open-autonomous-connection/INSServer/</p>
|
2026-02-22 17:21:23 +01:00
|
|
|
</section>
|
|
|
|
|
""");
|
|
|
|
|
|
|
|
|
|
byte[] body = Html.utf8(html);
|
|
|
|
|
Map<String, String> headers = HeaderMaps.mutable();
|
|
|
|
|
headers.put("content-length", String.valueOf(body.length));
|
|
|
|
|
|
|
|
|
|
return new WebResourceResponsePacket(outHeader(ctx), 200, "text/html; charset=utf-8", headers, body, null);
|
|
|
|
|
}
|
2026-02-11 23:22:20 +01:00
|
|
|
|
2026-02-22 17:21:23 +01:00
|
|
|
private WebPacketHeader outHeader(WebPageContext ctx) {
|
|
|
|
|
WebPacketHeader in = (ctx != null && ctx.request != null) ? ctx.request.getHeader() : null;
|
|
|
|
|
if (in == null) {
|
|
|
|
|
return new WebPacketHeader(0, 0, 0, 0, WebPacketFlags.RESOURCE, System.currentTimeMillis());
|
|
|
|
|
}
|
|
|
|
|
return new WebPacketHeader(
|
|
|
|
|
in.getRequestId(),
|
|
|
|
|
in.getTabId(),
|
|
|
|
|
in.getPageId(),
|
|
|
|
|
in.getFrameId(),
|
|
|
|
|
in.getFlags() | WebPacketFlags.RESOURCE,
|
|
|
|
|
System.currentTimeMillis()
|
|
|
|
|
);
|
2026-02-11 23:22:20 +01:00
|
|
|
}
|
2026-02-22 17:21:23 +01:00
|
|
|
}
|