Erweiterungen

This commit is contained in:
2025-08-25 14:21:12 +02:00
parent 2d2702d9e4
commit 3689459b8d
5 changed files with 29 additions and 16 deletions
Binary file not shown.
@@ -13,17 +13,17 @@ import de.assecutor.emulatorstation.pojo.UserInfo;
@Theme("default")
public class Application implements AppShellConfigurator {
public static final Map<String, UserInfo> users = Map.ofEntries(
Map.entry("admin", new UserInfo("ZY6X9X93Co8m", null)),
Map.entry("GFL", new UserInfo("GFL123", "172.18.0.100")),
Map.entry("Berlin", new UserInfo("Berlin123", "172.18.0.101")),
Map.entry("Bremen", new UserInfo("Bremen123", "172.18.0.102")),
Map.entry("Hamburg", new UserInfo("Hamburg123", "172.18.0.103")),
Map.entry("Essen", new UserInfo("Essen123", "172.18.0.104")),
Map.entry("Leipzig", new UserInfo("Leipzig123", "172.18.0.105")),
Map.entry("Dresden", new UserInfo("Dresden123", "172.18.0.106")),
Map.entry("Hannover", new UserInfo("Hannover123", "172.18.0.107")),
Map.entry("Stuttgart", new UserInfo("Stuttgart123", "172.18.0.108")),
Map.entry("FrankfurtAmMain", new UserInfo("FrankfurtAmMain123", "172.18.0.109"))
Map. entry("admin", new UserInfo("ZY6X9X93Co8m", null, null, null)),
Map.entry("GFL", new UserInfo("GFL123", "172.18.0.112", "6092", "/gfl")),
Map.entry("Berlin", new UserInfo("Berlin123", "172.18.0.103", "6083", "/berlin")),
Map.entry("Bremen", new UserInfo("Bremen123", "172.18.0.101", "6081", "/bremen")),
Map.entry("Hamburg", new UserInfo("Hamburg123", "172.18.0.102", "6082", "/hamburg")),
Map.entry("Essen", new UserInfo("Essen123", "172.18.0.107", "6087", "/essen")),
Map.entry("Leipzig", new UserInfo("Leipzig123", "172.18.0.108", "6088", "/leipzig")),
Map.entry("Dresden", new UserInfo("Dresden123", "172.18.0.106", "6086", "/dresden")),
Map.entry("Hannover", new UserInfo("Hannover123", "172.18.0.104", "6084", "")),
Map.entry("Stuttgart", new UserInfo("Stuttgart123", "172.18.0.111", "6091", "/stuttgart")),
Map.entry("FrankfurtAmMain", new UserInfo("FrankfurtAmMain123", "172.18.0.105", "6085", "/frankfurt"))
);
public static void main(String[] args) {
@@ -144,7 +144,12 @@ public final class MainView extends Main implements BeforeEnterObserver
}
private void refreshWebView() {
webView.setSrc("http://" + Application.users.get(username).ip() + ":6080/?autoconnect=true");
var url = "https://sb-app.emu.assecutor.org" + Application.users.get(username).urlExtension() + "?autoconnect=true";
System.out.println("URL: " + url);
webView.setSrc(url);
webView.reload();
}
@@ -313,7 +318,14 @@ public final class MainView extends Main implements BeforeEnterObserver
"PathInContainer": "/dev/kvm",
"CgroupPermissions": "rwm"
}
]
],
"PortBindings": {
"6080/tcp": [
{
"HostPort": "%s"
}
]
}
},
"ExposedPorts": {
"6080/tcp": {}
@@ -328,9 +340,10 @@ public final class MainView extends Main implements BeforeEnterObserver
}
}
}
""".formatted(Application.users.get(username).ip());
""".formatted(Application.users.get(username).port(), Application.users.get(username).ip());
System.out.println(jsonPayload);
// HTTP-Request erstellen
HttpRequest request = HttpRequest.newBuilder()
.uri(URI.create("http://" + server + ":2375/containers/create?name=android-container-" + username))
@@ -1,6 +1,6 @@
package de.assecutor.emulatorstation.pojo;
public record UserInfo(String password, String ip) {
public record UserInfo(String password, String ip, String port, String urlExtension) {
}