use of com.vaadin.flow.server.WebBrowser in project flow by vaadin.
the class InfoView method update.
private void update(UI ui) {
VaadinSession session = ui.getSession();
WebBrowser webBrowser = session.getBrowser();
DeploymentConfiguration deploymentConfiguration = session.getConfiguration();
List<String> device = new ArrayList<>();
List<String> os = new ArrayList<>();
List<String> browser = new ArrayList<>();
removeAll();
add(new NativeButton("Refresh", e -> {
update(ui);
}));
header("Browser");
info("Address", webBrowser.getAddress());
add(device, "Android", webBrowser.isAndroid());
add(device, "iOS", webBrowser.isIOS());
add(device, "iPad", webBrowser.isIPad());
add(device, "iPhone", webBrowser.isIPhone());
add(device, "Windows Phone", webBrowser.isWindowsPhone());
info("Device", device.stream().collect(Collectors.joining(", ")));
add(os, "Linux", webBrowser.isLinux());
add(os, "Mac", webBrowser.isMacOSX());
add(os, "Windows", webBrowser.isWindows());
info("Os", os.stream().collect(Collectors.joining(", ")));
add(browser, "Touch device", webBrowser.isTouchDevice());
add(browser, "Chrome", webBrowser.isChrome());
add(browser, "Edge", webBrowser.isEdge());
add(browser, "Firefox", webBrowser.isFirefox());
add(browser, "IE", webBrowser.isIE());
add(browser, "Safari", webBrowser.isSafari());
info("Browser", browser.stream().collect(Collectors.joining(", ")));
if (webBrowser.isTooOldToFunctionProperly()) {
header("Browser is too old to function properly");
}
info("User-agent", webBrowser.getBrowserApplication());
info("Browser major", webBrowser.getBrowserMajorVersion());
info("Browser minor", webBrowser.getBrowserMinorVersion());
info("Screen height", webBrowser.getScreenHeight());
info("Screen width", webBrowser.getScreenWidth());
info("Locale", webBrowser.getLocale());
info("Secure connection (https)", webBrowser.isSecureConnection());
separator();
header("Push configuration");
info("Push mode", ui.getPushConfiguration().getPushMode());
info("Push transport", ui.getPushConfiguration().getTransport());
separator();
header("Deployment configuration");
info("Heartbeat interval", deploymentConfiguration.getHeartbeatInterval());
info("Router configurator class", deploymentConfiguration.getRouterConfiguratorClassName());
info("UI class", deploymentConfiguration.getUIClassName());
info("Close idle sessions", deploymentConfiguration.isCloseIdleSessions());
info("Send URLs as parameters", deploymentConfiguration.isSendUrlsAsParameters());
info("Sync id enabled", deploymentConfiguration.isSyncIdCheckEnabled());
info("XSRF protection enabled", deploymentConfiguration.isXsrfProtectionEnabled());
info("Production mode", deploymentConfiguration.isProductionMode());
}
Aggregations