优化分页条数修改/在弹窗下不运行某些任务

This commit is contained in:
GoEdgeLab
2021-10-16 12:45:56 +08:00
parent 17ba8a1836
commit 0d3ae67c7f

View File

@@ -11,6 +11,7 @@ Tea.context(function () {
this.$refs.focus.focus() this.$refs.focus.focus()
} }
if (!window.IS_POPUP) {
// 检查消息 // 检查消息
this.checkMessages() this.checkMessages()
@@ -19,6 +20,7 @@ Tea.context(function () {
// 检查DNS同步 // 检查DNS同步
this.loadDNSTasks() this.loadDNSTasks()
}
}) })
/** /**
@@ -204,11 +206,17 @@ window.NotifyPopup = function (resp) {
window.ChangePageSize = function (size) { window.ChangePageSize = function (size) {
let url = window.location.toString(); let url = window.location.toString();
url = url.replace(/page=\d+/g, "page=1")
if (url.indexOf("pageSize") > 0) { if (url.indexOf("pageSize") > 0) {
url = url.replace(/pageSize=\d+/g, "pageSize=" + size); url = url.replace(/pageSize=\d+/g, "pageSize=" + size)
} else { } else {
if (url.indexOf("?") > 0) { if (url.indexOf("?") > 0) {
let anchorIndex = url.indexOf("#")
if (anchorIndex < 0) {
url += "&pageSize=" + size; url += "&pageSize=" + size;
} else {
url = url.substring(0, anchorIndex) + "&pageSize=" + size + url.substr(anchorIndex);
}
} else { } else {
url += "?pageSize=" + size; url += "?pageSize=" + size;
} }