pull/121/head
midoks 3 years ago
parent f3c651ff6b
commit 616dd3d03f
  1. 3
      plugins/php-apt/index.py
  2. 24
      plugins/php-yum/index.py
  3. 68
      route/static/app/public.js
  4. 15
      route/static/app/soft.js

@ -624,6 +624,9 @@ def installPreInspection(version):
sys = mw.execShell( sys = mw.execShell(
"cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'") "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( sys_id = mw.execShell(
"cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'")

@ -619,18 +619,24 @@ def uninstallLib(version):
def installPreInspection(version): def installPreInspection(version):
sys = mw.execShell( try:
"cat /etc/*-release | grep PRETTY_NAME |awk -F = '{print $2}' | awk -F '\"' '{print $2}'| awk '{print $1}'") 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( sys_id = mw.execShell(
"cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'") "cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F '\"' '{print $2}'")
sysName = sys[0].strip().lower() sysName = sys[0].strip().lower()
sysId = sys_id[0].strip() 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__": if __name__ == "__main__":

@ -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 = $('<span class="yuandian"></span>');
// 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(); var b = $("#task").offset();
$("." + a).click(function(d) { var e = $("." + a);
var e = $(this); var d = e;
var c = $('<span class="yuandian"></span>'); var c = $('<span class="yuandian"></span>');
c.fly({ c.fly({
start: { start: {
left: d.pageX, left: d.pageX,
top: d.pageY top: d.pageY
}, },
end: { end: {
left: b.left + 10, left: b.left + 10,
top: b.top + 10, top: b.top + 10,
width: 0, width: 0,
height: 0 height: 0
}, },
onEnd: function() { onEnd: function() {
layer.closeAll(); layer.closeAll();
layer.msg(lan.bt.task_add, {icon: 1}); layer.msg(lan.bt.task_add, {icon: 1});
getTaskCount(); getTaskCount();
} }
});
}); });
}; };
function readerTableChecked(){ function readerTableChecked(){

@ -170,7 +170,7 @@ function installPreInspection(name, ver, callback){
layer.msg(rdata.data, { icon: 2 }); layer.msg(rdata.data, { icon: 2 });
} }
} else { } else {
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); layer.msg(rdata.data, { icon: rdata.status ? 1 : 2 });
} }
},'json'); },'json');
@ -210,11 +210,13 @@ function addVersion(name, ver, type, obj, title, install_pre_inspection) {
<div class='version line'>安装版本" + option + "</div>\ <div class='version line'>安装版本" + option + "</div>\
</div>", </div>",
success:function(){ success:function(){
$('.fangshi input').click(function() { $('.fangshi input').click(function() {
$(this).attr('checked', 'checked').parent().siblings().find("input").removeAttr('checked'); $(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(); var info = $("#selectVersion").val().toLowerCase();
if (info == ''){ if (info == ''){
info = $("#selectVersion").text().toLowerCase(); info = $("#selectVersion").text().toLowerCase();
@ -228,17 +230,14 @@ function addVersion(name, ver, type, obj, title, install_pre_inspection) {
//安装检查 //安装检查
installPreInspection(name, version, function(){ installPreInspection(name, version, function(){
runInstall(data); runInstall(data);
fly("layui-layer-btn0"); fly("layui-layer-btn0",e);
}); });
return; return;
} }
runInstall(data); runInstall(data);
fly("layui-layer-btn0"); fly("layui-layer-btn0",e);
} }
}); });
installTips();
fly("layui-layer-btn0");
} }
//卸载软件 //卸载软件

Loading…
Cancel
Save