From 616dd3d03f35129b9fddede1d09d1979cfdb823e Mon Sep 17 00:00:00 2001 From: midoks Date: Sat, 9 Jul 2022 14:30:33 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plugins/php-apt/index.py | 3 ++ plugins/php-yum/index.py | 24 +++++++++----- route/static/app/public.js | 68 ++++++++++++++++++++++++++------------ route/static/app/soft.js | 15 ++++----- 4 files changed, 72 insertions(+), 38 deletions(-) diff --git a/plugins/php-apt/index.py b/plugins/php-apt/index.py index c80259663..9b9487c14 100755 --- a/plugins/php-apt/index.py +++ b/plugins/php-apt/index.py @@ -624,6 +624,9 @@ def installPreInspection(version): sys = mw.execShell( "cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'") + if sys[1] != '': + return '不支持改系统' + sys_id = mw.execShell( "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") diff --git a/plugins/php-yum/index.py b/plugins/php-yum/index.py index 4d6d43421..103f0ca53 100755 --- a/plugins/php-yum/index.py +++ b/plugins/php-yum/index.py @@ -619,18 +619,24 @@ def uninstallLib(version): def installPreInspection(version): - sys = mw.execShell( - "cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'") + try: + sys = mw.execShell( + "cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'") + if sys[1] != '': + return '不支持该系统' - sys_id = mw.execShell( - "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") + sys_id = mw.execShell( + "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") - sysName = sys[0].strip().lower() - sysId = sys_id[0].strip() + sysName = sys[0].strip().lower() + sysId = sys_id[0].strip() + + if not sysName in ('centos'): + return '暂时仅支持centos' + return 'ok' + except Exception as e: + return (str(e)) - if not sysName in ('centos'): - return '暂时仅支持centos' - return 'ok' if __name__ == "__main__": diff --git a/route/static/app/public.js b/route/static/app/public.js index d938542c9..9f6da1f9c 100755 --- a/route/static/app/public.js +++ b/route/static/app/public.js @@ -800,29 +800,55 @@ function installTips() { }) } -function fly(a) { + +// function fly(a) { +// var b = $("#task").offset(); +// $("." + a).click(function(d) { +// var e = $(this); +// var c = $(''); +// c.fly({ +// start: { +// left: d.pageX, +// top: d.pageY +// }, +// end: { +// left: b.left + 10, +// top: b.top + 10, +// width: 0, +// height: 0 +// }, +// onEnd: function() { +// layer.closeAll(); +// layer.msg(lan.bt.task_add, {icon: 1}); +// getTaskCount(); +// } +// }); +// }); +// }; + +function fly(a,e) { var b = $("#task").offset(); - $("." + a).click(function(d) { - var e = $(this); - var c = $(''); - c.fly({ - start: { - left: d.pageX, - top: d.pageY - }, - end: { - left: b.left + 10, - top: b.top + 10, - width: 0, - height: 0 - }, - onEnd: function() { - layer.closeAll(); - layer.msg(lan.bt.task_add, {icon: 1}); - getTaskCount(); - } - }); + var e = $("." + a); + var d = e; + var c = $(''); + c.fly({ + start: { + left: d.pageX, + top: d.pageY + }, + end: { + left: b.left + 10, + top: b.top + 10, + width: 0, + height: 0 + }, + onEnd: function() { + layer.closeAll(); + layer.msg(lan.bt.task_add, {icon: 1}); + getTaskCount(); + } }); + }; function readerTableChecked(){ diff --git a/route/static/app/soft.js b/route/static/app/soft.js index 1b3594520..aeec49547 100755 --- a/route/static/app/soft.js +++ b/route/static/app/soft.js @@ -170,7 +170,7 @@ function installPreInspection(name, ver, callback){ layer.msg(rdata.data, { icon: 2 }); } } else { - layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); + layer.msg(rdata.data, { icon: rdata.status ? 1 : 2 }); } },'json'); @@ -210,11 +210,13 @@ function addVersion(name, ver, type, obj, title, install_pre_inspection) {
安装版本:" + option + "
\ ", success:function(){ - $('.fangshi input').click(function() { + $('.fangshi input').click(function() { $(this).attr('checked', 'checked').parent().siblings().find("input").removeAttr('checked'); }); + installTips(); + // fly("layui-layer-btn0"); }, - yes:function(){ + yes:function(e){ var info = $("#selectVersion").val().toLowerCase(); if (info == ''){ info = $("#selectVersion").text().toLowerCase(); @@ -228,17 +230,14 @@ function addVersion(name, ver, type, obj, title, install_pre_inspection) { //安装检查 installPreInspection(name, version, function(){ runInstall(data); - fly("layui-layer-btn0"); + fly("layui-layer-btn0",e); }); return; } runInstall(data); - fly("layui-layer-btn0"); + fly("layui-layer-btn0",e); } }); - - installTips(); - fly("layui-layer-btn0"); } //卸载软件