闲置通知未显示-Vaadin 14
我正在尝试使用add-on https://vaadin.com/directory/directory/component/空闲通知用于会话管理。我想在给定时间中使用用户在应用程序中不活动时显示通知。
我有主要布局:
@PWA(name = "App", shortName = "App", enableInstallPrompt = false)
@Theme(themeFolder = "app")
@CssImport(value = "./styles/example.css", themeFor = "vaadin-grid")
@PreserveOnRefresh
@Push
public class MainView extends AppLayout implements AfterNavigationObserver {
public MainView() {
...
IdleNotification idleNotification = new IdleNotification();
idleNotification.setSecondsBeforeNotification(90);
idleNotification.setMessage("Your session will expire in " +
IdleNotification.MessageFormatting.SECS_TO_TIMEOUT
+ " seconds.");
idleNotification.addExtendSessionButton("Extend session");
idleNotification.addRedirectButton("Logout now", "logout");
idleNotification.addCloseButton();
idleNotification.setExtendSessionOnOutsideClick(false);
UI.getCurrent().add(idleNotification);
}
}
不幸的通知未显示。 中的设置参数。
vaadin.closeIdleSessions=false
vaadin.heartbeatInterval=true
vaadin.pushMode=true
我还尝试了应用程序
I'm trying to use an add-on https://vaadin.com/directory/component/idle-notification for Session Management. I would like to show notification when user is inactive in the application for a given time.
I have Main Layout:
@PWA(name = "App", shortName = "App", enableInstallPrompt = false)
@Theme(themeFolder = "app")
@CssImport(value = "./styles/example.css", themeFor = "vaadin-grid")
@PreserveOnRefresh
@Push
public class MainView extends AppLayout implements AfterNavigationObserver {
public MainView() {
...
IdleNotification idleNotification = new IdleNotification();
idleNotification.setSecondsBeforeNotification(90);
idleNotification.setMessage("Your session will expire in " +
IdleNotification.MessageFormatting.SECS_TO_TIMEOUT
+ " seconds.");
idleNotification.addExtendSessionButton("Extend session");
idleNotification.addRedirectButton("Logout now", "logout");
idleNotification.addCloseButton();
idleNotification.setExtendSessionOnOutsideClick(false);
UI.getCurrent().add(idleNotification);
}
}
Unfortunatelly notification not showing.
I also tried set parameters in application.properties as:
vaadin.closeIdleSessions=false
vaadin.heartbeatInterval=true
vaadin.pushMode=true
but that does not solve the problem
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
问题是设置vaadin.whitelisted packages = com.my.app,我将com.vaadin.com pontontfactory添加到vaadin.whitelisted-capkages and Works。
The problem was setting vaadin.whitelisted-packages = com.my.app, I added com.vaadin.componentfactory to vaadin.whitelisted-packages and work.