From 5ebe3bb8e07db5f6dcd51f0cfded9efb47810123 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=88=98=E7=A5=A5=E8=B6=85?= Date: Sat, 10 Dec 2022 19:01:57 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=9E=E6=97=B6=E8=AE=BF=E9=97=AE=E6=97=A5?= =?UTF-8?q?=E5=BF=97=E6=9C=89=E5=BC=B9=E7=AA=97=E6=89=93=E5=BC=80=E6=97=B6?= =?UTF-8?q?=EF=BC=8C=E6=9A=82=E6=97=B6=E4=B8=8D=E6=9B=B4=E6=96=B0=E6=95=B0?= =?UTF-8?q?=E6=8D=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- web/public/js/utils.js | 3 +++ web/views/@default/servers/server/log/index.js | 8 ++++++++ 2 files changed, 11 insertions(+) diff --git a/web/public/js/utils.js b/web/public/js/utils.js index c9b8dc79..efbef7db 100644 --- a/web/public/js/utils.js +++ b/web/public/js/utils.js @@ -353,6 +353,9 @@ window.teaweb = { Swal: function () { return this.isPopup() ? window.parent.Swal : window.Swal; }, + hasPopup: function () { + return document.getElementsByClassName("swal2-container").length > 0 + }, success: function (message, callback) { var width = "20em"; if (message.length > 30) { diff --git a/web/views/@default/servers/server/log/index.js b/web/views/@default/servers/server/log/index.js index 3d234214..336511e5 100644 --- a/web/views/@default/servers/server/log/index.js +++ b/web/views/@default/servers/server/log/index.js @@ -8,6 +8,14 @@ Tea.context(function () { this.isLoaded = false this.load = function () { + // 如果有弹窗时,暂时不更新 + if (teaweb.hasPopup()) { + this.$delay(function () { + this.load() + }, 5000) + return + } + this.$post("$") .params({ serverId: this.serverId,