From 087a9ece2c2b8fd290d592bee87b8b4c849da576 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Gina=20H=C3=A4u=C3=9Fge?=
Date: Fri, 19 Oct 2018 17:00:42 +0200
Subject: [PATCH] Make sure to show only one external address warning
notification at once
---
src/octoprint/static/js/app/viewmodels/loginstate.js | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/src/octoprint/static/js/app/viewmodels/loginstate.js b/src/octoprint/static/js/app/viewmodels/loginstate.js
index c67273c2a..d00e7f804 100644
--- a/src/octoprint/static/js/app/viewmodels/loginstate.js
+++ b/src/octoprint/static/js/app/viewmodels/loginstate.js
@@ -20,6 +20,8 @@ $(function() {
self.elementPasswordInput = undefined;
self.elementLoginButton = undefined;
+ self.externalAddressNotification = undefined;
+
self.userMenuText = ko.pureComputed(function() {
if (self.loggedIn()) {
return self.username();
@@ -80,10 +82,15 @@ $(function() {
"everyone with an internet connection.
Please see " +
"this blog post for " +
"ways to safely access your OctoPrint instance from remote.
" +
- "If you know what you are doing or you are sure this message is" +
+ "
If you know what you are doing or you are sure this message is " +
"mistaken since you are in an isolated LAN, feel free to ignore it.
");
text = _.sprintf(text, {url: "https://octoprint.org/blog/2018/09/03/safe-remote-access/"});
- new PNotify({
+
+ if (self.externalAddressNotification !== undefined) {
+ self.externalAddressNotification.remove();
+ }
+
+ self.externalAddressNotification = new PNotify({
title: gettext("Possible external access detected"),
text: text,
hide: false,