From b916848baf46a28bc8a3279a262c0702675a1386 Mon Sep 17 00:00:00 2001 From: Anyon Date: Mon, 23 Mar 2020 13:33:04 +0800 Subject: [PATCH] Update admin.js --- public/static/admin.js | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/public/static/admin.js b/public/static/admin.js index 03292f49c..ab08fefcf 100644 --- a/public/static/admin.js +++ b/public/static/admin.js @@ -759,8 +759,13 @@ $(function () { (function loadprocess(code, that) { that = this, this.$box = $('[data-queue-load=' + code + ']'); if (that.$box.length < 1) return false; + this.$area = that.$box.find('textarea'); + this.$title = that.$box.find('[data-message-title]'); + this.$percent = that.$box.find('.layui-progress div'); this.setState = function (status, message) { - if (status === 1) { + if (message.indexOf('javascript:') === 0) { + window.location.href = message; + } else if (status === 1) { that.$title.html('' + message + ''); that.$percent.addClass('layui-bg-blue').removeClass('layui-bg-green layui-bg-red'); } else if (status === 2) { @@ -774,7 +779,6 @@ $(function () { that.$percent.addClass('layui-bg-red').removeClass('layui-bg-blue layui-bg-green'); } }; - this.$area = that.$box.find('textarea'), this.$title = that.$box.find('[data-message-title]'), this.$percent = that.$box.find('.layui-progress div'); $.form.load(window.ROOT_URL + '?s=admin/api.queue/progress', {code: code}, 'post', function (ret) { if (ret.code) { (function (lines) {