Commit 91b071c0 authored by jose's avatar jose

Add some features

parent 96f49529
......@@ -944,16 +944,20 @@ html {
top: 14px
}
.sidebar-auto .menu {
.sidebar-scroll .mypcip:hover .btedit {
display: block
}
.sidebar-scroll .sidebar-auto .menu {
background-color: #353d44
}
.menu li {
.sidebar-scroll .menu li {
margin-bottom: 1px;
position: relative
}
.menu li a {
.sidebar-scroll .menu li a {
font-size: 15px;
color: #d6d7d9;
display: block;
......@@ -965,8 +969,8 @@ html {
border-left: #404040 2px solid
}
.menu li.current a,
.menu li a:hover {
.sidebar-scroll .menu li.current a,
.sidebar-scroll .menu li a:hover {
background-color: #2c3138;
color: #fff;
border-left: #20a53a 2px solid
......@@ -2044,7 +2048,7 @@ html .menu .menu_exit:hover {
}
.rec-install .rec-box {
width: 300px;
width: 305px;
float: left
}
......@@ -2083,7 +2087,7 @@ html .menu .menu_exit:hover {
.fangshi label {
font-weight: normal;
margin-right: 40px;
margin-right: 44px;
float: right
}
......@@ -2359,6 +2363,7 @@ html .menu .menu_exit:hover {
}
.setting-con div.mtb15 .modify {
margin-left: -40px;
vertical-align: 0;
position: absolute;
right: 4px;
......@@ -3259,8 +3264,8 @@ html .menu .menu_exit:hover {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAYFJREFUeNpi/P//P8NAAhZkzrVr1zyB1FwglqSiHSZAfBZZQEtLC7sDQJZLSUlJcnNzU8Xm27dvg6jVQByqqqp6FpsaJjS+JCcnJ8O/f/+ogkFATk5uJ8gRQMcYE+MAqgN2dvYMeXn5g0DmGmyOYKJHQmNjY0tQUFA4gc0RLLS0mI+PD5YOQCACSp8BYka6OEBUVJRBXFwcW8IkPgQ+r2lk+PPsJnl5XEqdgTeknvhyABsAWS6Ytwyr3PtJUTjlYPKEAEWJEGQ5MZbQzAGEQoDmDhgNAWITGk0dQCkYcAewUJoIh38IgIpTchMai6Qa5Q4gVJYP+SgYcAcwIjfLHxZo0qWNLj/hOp4GCQs7bo0121D4D1u8wGIwGlkcd/3+k/xyANlgdMcgy8McRbM0QIoFVC8J8VkOCxVSHMdCTZ+TEyooDvjPKfCP8ddXJgZGJqISIskW/v8HtIP/H85seGdWYT3L/eN1jN8/0qR8+M8l8PePgkWzSlp/I1YHDAQACDAAtKS/DHmsv9AAAAAASUVORK5CYII=")
}
.list-list .ico-gz {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAHtSURBVFiF7Ze/T8JAFMe/1QYCRKIDIe1AYcAfLJLowL/grCbGydEJTXBw0qiLA4NxNGFlkX/A0UlJJGEBQzoAC3EzxhgTgz0HPXI9jrahxTr4TZrm3r3r+/Tdu2tPIoTAT8lso9lsrgEoAVA8jLEKoMYaMpmMGABASVVVJRKJeBJZ13UAuAawmU6nayKfKa6thEIhGIbhyQUAiUTiBsC1rusrTgA8VzAY3NU07RZARQQxcQAACAQCO8lk8l4EwdeAp4pGo7QOAGDr5/4AQPoVgFgshng8brIxQM4AXisn6PdaYwHI6gJmNo6tfewe0u+1MJcvC/ueL7dH9tF+O7kqwrl82VGQiQHYZWDiAP8ZoBC+AriV7wCudkK38w/8lQxI0ve3odFoDDuoC2MXmqzMC+003gDASnZ7uVv5PgW+A5imIHK1jicA2sUjuvtLEwk49LvLngs6e4uEVaewTHjxtk5h2XTZ+u4tmg4iQ0XYPchCK9bRPcgO2lRasW7y48WOo758m5ejjWjUYKdiwXjZFiEdPOoBboJbArBvrRXrlllg0y3ytRovEUIGO1P7MPcpfbxNQRpvdfI1MPTmxAAJhI3UeXWamkw10E/lTuX23ZH0/iImkIOWADQDAITLmIRnP/vJ3BlQZYw+H8+/AFShLMorUUd8AAAAAElFTkSuQmCC")
.list-list .ico-gz, .list-list .ico-bz2 {
background-image: url("data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAABx0RVh0U29mdHdhcmUAQWRvYmUgRmlyZXdvcmtzIENTNui8sowAAAHtSURBVFiF7Ze/T8JAFMe/1QYCRKIDIe1AYcAfLJLowL/grCbGydEJTXBw0qiLA4NxNGFlkX/A0UlJJGEBQzoAC3EzxhgTgz0HPXI9jrahxTr4TZrm3r3r+/Tdu2tPIoTAT8lso9lsrgEoAVA8jLEKoMYaMpmMGABASVVVJRKJeBJZ13UAuAawmU6nayKfKa6thEIhGIbhyQUAiUTiBsC1rusrTgA8VzAY3NU07RZARQQxcQAACAQCO8lk8l4EwdeAp4pGo7QOAGDr5/4AQPoVgFgshng8brIxQM4AXisn6PdaYwHI6gJmNo6tfewe0u+1MJcvC/ueL7dH9tF+O7kqwrl82VGQiQHYZWDiAP8ZoBC+AriV7wCudkK38w/8lQxI0ve3odFoDDuoC2MXmqzMC+003gDASnZ7uVv5PgW+A5imIHK1jicA2sUjuvtLEwk49LvLngs6e4uEVaewTHjxtk5h2XTZ+u4tmg4iQ0XYPchCK9bRPcgO2lRasW7y48WOo758m5ejjWjUYKdiwXjZFiEdPOoBboJbArBvrRXrlllg0y3ytRovEUIGO1P7MPcpfbxNQRpvdfI1MPTmxAAJhI3UeXWamkw10E/lTuX23ZH0/iImkIOWADQDAITLmIRnP/vJ3BlQZYw+H8+/AFShLMorUUd8AAAAAElFTkSuQmCC")
}
.list-list .ico-bt {
......@@ -5049,9 +5054,9 @@ select[disabled]{
text-overflow:ellipsis;
white-space: nowrap;
}
.codebg{
background-color: #333;
max-height:200px;
.codebg {
background-color: #333;
max-height: 98%;
}
.codebg code {
background: none;
......@@ -5138,20 +5143,25 @@ select[disabled]{
background: -webkit-linear-gradient(top,rgba(220, 220, 220, .8),rgba(255, 255, 255, 0));
}
#force{
vertical-align: top;
.disable {
background-color: #ededed;
}
#force+label{
word-wrap: break-word;
width: 350px;
.onekeyCode .table > tbody > tr > td {
line-height: 1.7;
}
#webedit-con .tname{
width: 140px;
.oneKeysearchBar {
position: absolute;
top: 10px;
right: 15px;
z-index: 20;
}
.ssl_tabs{
.success-msg .suc-con {
float: right;
width: 280px;
}
.bt-progress {
background-color: #e2e2e2;
......
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -27,6 +27,8 @@ var soft = {
if (type == 10) {
$("#updata_pro_info").html('<div class="alert alert-info" style="margin-bottom:15px"><strong>' + lan.soft.bt_developer + '</strong><a class="btn btn-success btn-xs va0" href="https://www.bt.cn/developer/" title="' + lan.soft.free_to_enter + '" style="margin-left: 8px" target="_blank">' + lan.soft.free_to_enter + '</a><a class="btn btn-success btn-xs va0" href="https://www.bt.cn/bbs/forum-40-1.html" title="' + lan.soft.get_third_party_apps + '" style="margin-left: 8px" target="_blank">' + lan.soft.get_third_party_apps + '</a><input type="file" style="display:none;" accept=".zip,.tar.gz" id="update_zip" multiple="multiple"><button class="btn btn-success btn-xs" onclick="soft.update_zip_open()" style="margin-left:8px">' + lan.soft.import_plug + '</button></div>')
} else if (type == 11) {
$("#updata_pro_info").html('<div class="alert alert-info" style="margin-bottom:15px"><strong>'+lan.soft.comingsoon+'</strong></div>')
}
var tBody = '';
rdata.type.unshift({ icon: 'icon', id: 0, ps: lan.soft.all, sort: 1, title: lan.soft.all })
......@@ -42,7 +44,7 @@ var soft = {
}
if (page) bt.set_cookie('p' + type, page);
$(".softtype").html(tBody);
$(".menu-sub span").click(function() {
$(".menu-sub span").click(function () {
var _type = $(this).attr('typeid');
bt.set_cookie('softType', _type);
$(this).addClass("on").siblings().removeClass("on");
......@@ -83,12 +85,6 @@ var soft = {
return '<span ' + click_opt + ' ' + sStyle + ' ><img src="/static/img/soft_ico/ico-' + fName + '.png">' + item.title + ' ' + version + '</span>';
}
},
// {
// field: 'price', title: lan.soft.developers, width: 92, templet: function (item) {
// if(!item.author) return lan.soft.the_official;
// return item.author;
// }
// },
{
field: 'price', title: 'Developer', width: 92, templet: function (item) {
if(!item.author) return 'official'
......@@ -165,15 +161,13 @@ var soft = {
}
},
{
field: 'status',
width: 40,
title: lan.soft.status1,
templet: function(item) {
field: 'status', width: 40, title: lan.soft.status1, templet: function (item) {
var status = '';
if (item.setup) {
if (item.status) {
status = '<span style="color:#20a53a" class="glyphicon glyphicon-play"></span>';
} else {
}
else {
status = '<span style="color:red" class="glyphicon glyphicon-pause"></span>';
}
}
......@@ -181,10 +175,7 @@ var soft = {
}
},
{
field: 'index',
width: 100,
title: lan.soft.display_at_homepage,
templet: function(item) {
field: 'index', width: 100, title: lan.soft.display_at_homepage, templet: function (item) {
var to_index = '';
if (item.setup) {
var checked = '';
......@@ -196,11 +187,7 @@ var soft = {
}
},
{
field: 'opt',
width: 180,
title: lan.soft.operate,
align: 'right',
templet: function(item) {
field: 'opt', width: 180, title: lan.soft.operate, align: 'right', templet: function (item) {
var option = '';
var pay_opt = '';
......@@ -219,7 +206,7 @@ var soft = {
if (item.type != 10) {
pay_opt = '<a class="btlink" onclick="bt.soft.re_plugin_pay(\'' + item.title + '\',\'' + item.pid + '\',' + re_status + ')">' + re_msg + '</a>';
} else {
pay_opt = '<a class="btlink" onclick="bt.soft.re_plugin_pay_other(\'' + item.title + '\',\'' + item.pid + '\',' + re_status + ',' + item.price + ')">' + re_msg + '</a>';
pay_opt = '<a class="btlink" onclick="bt.soft.re_plugin_pay_other(\'' + item.title + '\',\'' + item.pid + '\',' + re_status + ','+item.price+')">' + re_msg + '</a>';
}
}
......@@ -227,16 +214,20 @@ var soft = {
if (rdata.apache22 && is_php && $.inArray(item.name, phps) == -1) {
if (item.setup) {
option = '<a class="btlink" onclick="bt.soft.un_install(\'' + item.name + '\')" >' + lan.soft.uninstall + '</a>';
} else {
option = '<span title="' + lan.soft.ap2_2_not_support + '">' + lan.not_comp + '</span>';
}
} else if (rdata.apache24 && item.name == 'php-5.2') {
else {
option = '<span title="\' + lan.soft.ap2_2_not_support + \'">\' + lan.not_comp + \'</span>';
}
}
else if (rdata.apache24 && item.name == 'php-5.2') {
if (item.setup) {
option = '<a class="btlink" onclick="bt.soft.un_install(\'' + item.name + '\')" >' + lan.soft.uninstall + '</a>';
} else {
option = '<span title="' + lan.soft.ap2_2_not_support + '">' + lan.not_comp + '</span>';
}
} else {
else {
option = '<span title="\' + lan.soft.ap2_2_not_support + \'">\' + lan.not_comp + \'</span>';
}
}
else {
if (item.setup) {
if (pay_opt == '') {
if (item.versions.length > 1) {
......@@ -248,28 +239,34 @@ var soft = {
break;
}
}
} else {
}
else {
var min_version = item.versions[0];
var cloud_version = min_version.m_version + '.' + min_version.version;
if (item.version != cloud_version) option += '<a class="btlink" onclick="bt.soft.update_soft(\'' + item.name + '\',\'' + item.title + '\',\'' + min_version.m_version + '\',\'' + min_version.version + '\')" >' + lan.soft.update + '</a> | ';
}
if (item.admin) {
option += '<a class="btlink" onclick="bt.soft.set_lib_config(\'' + item.name + '\',\'' + item.title + '\')">' + lan.soft.setup + '</a> | ';
} else {
}
else {
option += '<a class="btlink" onclick="soft.set_soft_config(\'' + item.name + '\')">' + lan.soft.setup + '</a> | ';
}
} else {
option = pay_opt + ' | ' + option;
}
option += '<a class="btlink" onclick="bt.soft.un_install(\'' + item.name + '\')" >' + lan.soft.uninstall + '</a>';
} else if (item.task == '-1') {
}
else if (item.task == '-1') {
option = '<a class="btlink" onclick="messagebox()" >' + lan.soft.installing + '</a>';
} else if (item.task == '0') {
}
else if (item.task == '0') {
option = '<a class="btlink" onclick="messagebox()" >' + lan.soft.wait_install + '</a>';
} else {
}
else {
if (pay_opt) {
option = pay_opt;
} else {
}
else {
option = '<a class="btlink" onclick="bt.soft.install(\'' + item.name + '\')" >' + lan.soft.install + '</a>';
}
}
......@@ -362,14 +359,20 @@ var soft = {
<th style="text-align: right;" width="80">Operate</th>\
</tr>\
</thead>';
var icon_other ='data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACAAAAAgCAYAAABzenr0AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAYFJREFUeNpi/P//P8NAAhZkzrVr1zyB1FwglqSiHSZAfBZZQEtLC7sDQJZLSUlJcnNzU8Xm27dvg6jVQByqqqp6FpsaJjS+JCcnJ8O/f/+ogkFATk5uJ8gRQMcYE+MAqgN2dvYMeXn5g0DmGmyOYKJHQmNjY0tQUFA4gc0RLLS0mI+PD5YOQCACSp8BYka6OEBUVJRBXFwcW8IkPgQ+r2lk+PPsJnl5XEqdgTeknvhyABsAWS6Ytwyr3PtJUTjlYPKEAEWJEGQ5MZbQzAGEQoDmDhgNAWITGk0dQCkYcAewUJoIh38IgIpTchMai6Qa5Q4gVJYP+SgYcAcwIjfLHxZo0qWNLj/hOp4GCQs7bo0121D4D1u8wGIwGlkcd/3+k/xyANlgdMcgy8McRbM0QIoFVC8J8VkOCxVSHMdCTZ+TEyooDvjPKfCP8ddXJgZGJqISIskW/v8HtIP/H85seGdWYT3L/eN1jN8/0qR8+M8l8PePgkWzSlp/I1YHDAQACDAAtKS/DHmsv9AAAAAASUVORK5CYII='
for (var i = 0; i < rdata.list.length; i++) {
var remove_opt = '';
if (rdata.list[i].id === 0) {
remove_opt = ' | <a class="btlink" onclick="soft.update_package(\'' + rdata.list[i].name + '\')">'+lan.public.update+'</a> | <a class="btlink" onclick="soft.remove_other_dep(\'' + rdata.list[i].name + '\')">'+lan.public.del+'</a>';
rdata.list[i].min_image = icon_other
}
zbody += '<tr>'
+ '<td><img src="'+rdata.list[i].min_image+'">' + rdata.list[i].title + '</td>'
+ '<td><img src="' + rdata.list[i].min_image +'">' + rdata.list[i].title + '</td>'
+ '<td>' + rdata.list[i].version + '</td>'
+ '<td>' + rdata.list[i].ps + '</td>'
+ '<td>' + rdata.list[i].php + '</td>'
+ '<td><a class="btlink" target="_blank" href="' + rdata.list[i].official + '">' + (rdata.list[i].author == 'aaPanel' ? rdata.list[i].title : rdata.list[i].author) + '</a></td>'
+ '<td class="text-right"><a href="javascript:onekeyCodeSite(\'' + rdata.list[i].name + '\',\'' + rdata.list[i].php + '\',\'' + rdata.list[i].title + '\',\'' + rdata.list[i].enable_functions + '\');" class="btlink">One-Click</a></td>'
+ '<td class="text-right"><a href="javascript:onekeyCodeSite(\'' + rdata.list[i].name + '\',\'' + rdata.list[i].php + '\',\'' + rdata.list[i].title + '\',\'' + rdata.list[i].enable_functions + '\');" class="btlink">One-Click</a>' + remove_opt+'</td>'
+ '</tr>'
}
$("#softList").html(zbody);
......@@ -377,6 +380,16 @@ var soft = {
});
},
remove_other_dep: function (name) {
bt.show_confirm(lan.soft.del_custom_item, lan.soft.confirm_del.replace('{1}',name), function () {
var loadT = layer.msg(lan.soft.deleting, { icon: 16, time: 0, shade: 0.3 });
$.post('/deployment?action=DelPackage', { dname: name }, function (rdata) {
layer.close(loadT);
if (rdata.status) soft.get_dep_list();
setTimeout(function () { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }); }, 1000);
});
});
},
input_package: function () {
var con = '<form class="bt-form pd20 pb70" id="input_package">\
<div class="line"><span class="tname">Index name</span>\
......@@ -409,8 +422,8 @@ var soft = {
<span class="c9">Please upload the project package in zip format, which must contain the auto_insatll.json configuration file.</span>\
</div>\
<div class="bt-form-submit-btn">\
<button type="button" class="btn btn-danger btn-sm onekeycodeclose" onclick="layer.closeAll()">Cancel</button>\
<button type="button" class="btn btn-success btn-sm" onclick="soft.input_package_to()">Submit</button>\
<button type="button" class="btn btn-danger btn-sm onekeycodeclose" onclick="layer.closeAll()">'+lan.public.cancel+'</button>\
<button type="button" class="btn btn-success btn-sm" onclick="soft.input_package_to()">'+lan.public.submit+'</button>\
</div>\
</from>';
layer.open({
......@@ -422,6 +435,51 @@ var soft = {
content: con
});
},
update_package: function (p_name) {
$.post('/deployment?action=GetPackageOther', { p_name: p_name }, function (rdata) {
var con = '<form class="bt-form pd20 pb70" id="input_package">\
<div class="line"><span class="tname">Index name</span>\
<input class="bt-input-text" type="text" value="'+rdata.name+'" name="name" placeholder="Project index name" style="width:190px" />\
<span class="c9" style="margin-left: 5px;">Format: [0-9A-Za-z_-]+, Do not have spaces and special characters</span>\
</div>\
<div class="line"><span class="tname">Name</span>\
<input class="bt-input-text" name="title" value="'+ rdata.title +'" placeholder="Project name" style="width:190px" type="text">\
<span class="c9" style="margin-left: 5px;">The name used to display to the list</span>\
</div>\
<div class="line"><span class="tname">PHP Version</span>\
<input class="bt-input-text mr5 " name="php" placeholder="e.g.:53,54,55,56,70,71,72" style="width:190px" value="'+ rdata.php +'" type="text" />\
<span class="c9">Please use multiple "," (comma) to separate, do not use PHP5.2</span>\
</div>\
<div class="line"><span class="tname">Unblocked function</span>\
<input class="bt-input-text mr5" name="enable_functions" value="'+ rdata.enable_functions +'" style="width:190px" placeholder="e.g.:system,exec" type="text" />\
<span class="c9">Multiples should be separated by "," (comma), only the necessary functions are unblocked.</span>\
</div>\
<div class="line"><span class="tname">Project version</span>\
<input class="bt-input-text mr5" name="version" value="'+ rdata.version +'" style="width:190px" placeholder="e.g.:5.2.1" type="text" />\
<span class="c9">Currently imported project version</span>\
</div>\
<div class="line"><span class="tname">Introduction</span>\
<div class="info-r c15"><input class="bt-input-text mr5" name="ps" value="'+ rdata.ps +'" type="text" style="width:290px" /></div>\
</div>\
<div class="line"><span class="tname">Upload project package</span>\
<input class="bt-input-text mr5" name="dep_zip" type="file" style="width:290px" placeholder="e.g.:system,exec" >\
<span class="c9">Please upload the project package in zip format, which must contain the auto_insatll.json configuration file.</span>\
</div>\
<div class="bt-form-submit-btn">\
<button type="button" class="btn btn-danger btn-sm onekeycodeclose" onclick="layer.closeAll()">'+lan.public.cancel+'</button>\
<button type="button" class="btn btn-success btn-sm" onclick="soft.input_package_to()">'+lan.public.update+'</button>\
</div>\
</from>';
layer.open({
type: 1,
title: "Update one-click deployment project package",
area: '600px',
closeBtn: 2,
shadeClose: false,
content: con
});
});
},
input_package_to: function () {
var pdata = new FormData($("#input_package")[0]);
if (!pdata.get('name') || !pdata.get('title') || !pdata.get('version') || !pdata.get('php') || !pdata.get('ps')) {
......@@ -581,9 +639,16 @@ var soft = {
bt.soft.get_soft_find('apache', function (rdata) {
if (rdata.setup) {
if (rdata.version.indexOf('2.2') >= 0) {
$(".apache24").hide();
$(".bt_server").remove();
$(".bt-w-menu p:eq(0)").trigger("click");
if (name.indexOf('php-') != -1) {
$(".apache24").hide();
$(".bt_server").remove();
$(".bt-w-menu p:eq(0)").trigger("click");
}
if (name.indexOf('apache') != -1) {
$(".bt-soft-menu p:eq(3)").remove()
$(".bt-soft-menu p:eq(3)").remove()
}
}
}
})
......@@ -654,16 +719,13 @@ var soft = {
title: lan.soft.select_version, items: [
{ name: 'phpVersion', width: '160px', type: 'select', value: opt_version, items: _list },
{
name: 'btn_change_version',
type: 'button',
text: lan.soft.version_to,
callback: function(ldata) {
name: 'btn_change_version', type: 'button', text: lan.soft.version_to, callback: function (ldata) {
if (ldata.phpVersion == opt_version) {
bt.msg({ msg: '当前已经是[' + opt_version + ']', icon: 2 })
return;
}
if (data.name == 'mysql') {
bt.database.get_list(1, '', function(ddata) {
bt.database.get_list(1, '', function (ddata) {
if (ddata.data.length > 0) {
bt.msg({ msg: lan.soft.mysql_d, icon: 5, time: 5000 })
return;
......@@ -944,20 +1006,20 @@ var soft = {
break;
case 'mysql_log':
var loadT = bt.load();
bt.send('BinLog', 'database/BinLog', { status: 1 }, function(rdata) {
bt.send('BinLog', 'database/BinLog', { status: 1 }, function (rdata) {
loadT.close();
var limitCon = '<p class="conf_p">\
<span class="f14 c6 mr20">' + lan.soft.mysql_log_bin + ' </span><span class="f14 c6 mr20">' + ToSize(rdata.msg) + '</span>\
<button class="btn btn-success btn-xs btn-bin va0">' + (rdata.status ? lan.soft.off : lan.soft.on) + '</button>\
<p class="f14 c6 mtb10" style="border-top:#ddd 1px solid; padding:10px 0">' + lan.soft.mysql_log_err + '<button class="btn btn-default btn-clear btn-xs" style="float:right;" >' + lan.soft.mysql_log_close + '</button></p>\
<textarea readonly style="margin: 0px;width: 600px;height: 440px;background-color: #333;color:#fff; padding:0 5px" id="error_log"></textarea>\
</p>'
<span class="f14 c6 mr20">'+ lan.soft.mysql_log_bin + ' </span><span class="f14 c6 mr20">' + ToSize(rdata.msg) + '</span>\
<button class="btn btn-success btn-xs btn-bin va0">'+ (rdata.status ? lan.soft.off : lan.soft.on) + '</button>\
<p class="f14 c6 mtb10" style="border-top:#ddd 1px solid; padding:10px 0">'+ lan.soft.mysql_log_err + '<button class="btn btn-default btn-clear btn-xs" style="float:right;" >' + lan.soft.mysql_log_close + '</button></p>\
<textarea readonly style="margin: 0px;width: 600px;height: 440px;background-color: #333;color:#fff; padding:0 5px" id="error_log"></textarea>\
</p>'
$(".soft-man-con").html(limitCon);
//设置二进制日志
$(".btn-bin").click(function() {
$(".btn-bin").click(function () {
var loadT = layer.msg(lan.public.the, { icon: 16, time: 0, shade: 0.3 });
$.post('/database?action=BinLog', "", function(rdata) {
$.post('/database?action=BinLog', "", function (rdata) {
layer.close(loadT);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 });
soft.get_tab_contents('mysql_log')
......@@ -965,15 +1027,15 @@ var soft = {
})
//清空日志
$(".btn-clear").click(function() {
$(".btn-clear").click(function () {
var loadT = layer.msg(lan.public.the, { icon: 16, time: 0, shade: 0.3 });
$.post('/database?action=GetErrorLog', "close=1", function(rdata) {
$.post('/database?action=GetErrorLog', "close=1", function (rdata) {
layer.close(loadT);
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 5 });
soft.get_tab_contents('mysql_log')
});
})
bt.send('GetErrorLog', 'database/GetErrorLog', {}, function(error_body) {
bt.send('GetErrorLog', 'database/GetErrorLog', {}, function (error_body) {
if (error_body.status === false) {
layer.msg(error_body.msg, { icon: 5 });
error_body = lan.soft.mysql_log_ps1;
......@@ -987,7 +1049,7 @@ var soft = {
break;
case 'mysql_slow_log':
var loadT = bt.load();
bt.send('GetSlowLogs', 'database/GetSlowLogs', {}, function(logs) {
bt.send('GetSlowLogs', 'database/GetSlowLogs', {}, function (logs) {
loadT.close();
if (!logs.status) {
logs.msg = '';
......@@ -1001,7 +1063,7 @@ var soft = {
break;
case 'log':
var loadT = bt.load(lan.public.the_get);
bt.send('GetOpeLogs', 'ajax/GetOpeLogs', { path: '/www/wwwlogs/nginx_error.log' }, function(rdata) {
bt.send('GetOpeLogs', 'ajax/GetOpeLogs', { path: '/www/wwwlogs/nginx_error.log' }, function (rdata) {
loadT.close();
if (rdata.msg == '') rdata.msg = lan.soft.no_log;
var ebody = '<div class="soft-man-con"><textarea readonly="" style="margin: 0px;width: 600px;height: 520px;background-color: #333;color:#fff; padding:0 5px" id="error_log">' + rdata.msg + '</textarea></div>';
......@@ -1012,7 +1074,7 @@ var soft = {
break;
case 'nginx_status':
var loadT = bt.load();
bt.send('GetNginxStatus', 'ajax/GetNginxStatus', {}, function(rdata) {
bt.send('GetNginxStatus', 'ajax/GetNginxStatus', {}, function (rdata) {
loadT.close();
$(".soft-man-con").html("<div><table id='tab-nginx-status' class='table table-hover table-bordered'> </table></div>");
var arrs = []
......@@ -1028,10 +1090,10 @@ var soft = {
arrs[lan.bt.nginx_workermen] = rdata.workermen;
bt.render_table("tab-nginx-status", arrs);
})
break;
break;
case 'apache_status':
var loadT = bt.load();
bt.send('GetApacheStatus', 'ajax/GetApacheStatus', {}, function(rdata) {
bt.send('GetApacheStatus', 'ajax/GetApacheStatus', {}, function (rdata) {
loadT.close();
$(".soft-man-con").html("<div><table id='tab-Apache-status' class='table table-hover table-bordered'> </table></div>");
var arrs = []
......@@ -1046,10 +1108,10 @@ var soft = {
arrs[lan.bt.apache_busyworkers] = rdata.BusyWorkers;
bt.render_table("tab-Apache-status", arrs);
})
break;
break;
case 'nginx_set':
var loadT = bt.load();
bt.send('GetNginxValue', 'config/GetNginxValue', {}, function(rdata) {
bt.send('GetNginxValue', 'config/GetNginxValue', {}, function (rdata) {
loadT.close();
var form_datas = []
for (var i = 0; i < rdata.length; i++) {
......@@ -1064,26 +1126,24 @@ var soft = {
}
form_datas.push({
items: [{
text: lan.public.save,
type: 'button',
name: 'bt_nginx_save',
callback: function(item) {
delete item['bt_nginx_save']
bt.send('SetNginxValue', 'config/SetNginxValue', item, function(rdata) {
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
});
text: lan.public.save, type: 'button', name: 'bt_nginx_save', callback: function (item) {
delete item['bt_nginx_save']
bt.send('SetNginxValue','config/SetNginxValue',item, function (rdata) {
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
});
}
}
}]
]
})
$(".soft-man-con").empty().append('<div class="set_nginx_config"></div>');
for (var i = 0; i < form_datas.length; i++) {
bt.render_form_line(form_datas[i], '', $(".soft-man-con .set_nginx_config"));
}
});
break;
break;
case 'apache_set':
var loadT = bt.load();
bt.send('GetNginxValue', 'config/GetApacheValue', {}, function(rdata) {
bt.send('GetNginxValue', 'config/GetApacheValue', {}, function (rdata) {
loadT.close();
var form_datas = []
for (var i = 0; i < rdata.length; i++) {
......@@ -1096,28 +1156,26 @@ var soft = {
}
form_datas.push({
items: [{
text: lan.public.save,
type: 'button',
name: 'bt_apache_save',
callback: function(item) {
delete item['bt_apache_save'];
// console.log(item)
bt.send('SetApacheValue', 'config/SetApacheValue', item, function(rdata) {
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
});
text: lan.public.save, type: 'button', name: 'bt_apache_save', callback: function (item) {
delete item['bt_apache_save'];
console.log(item)
bt.send('SetApacheValue','config/SetApacheValue',item, function (rdata) {
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
});
}
}
}]
]
})
$(".soft-man-con").empty().append('<div class="set_Apache_config"></div>');
for (var i = 0; i < form_datas.length; i++) {
bt.render_form_line(form_datas[i], '', $(".soft-man-con .set_Apache_config"));
}
});
break;
break;
case 'memcached_status':
case 'memcached_set':
var loadT = bt.load(lan.public.get_the);
bt.send('GetMemcachedStatus', 'ajax/GetMemcachedStatus', {}, function(rdata) {
bt.send('GetMemcachedStatus', 'ajax/GetMemcachedStatus', {}, function (rdata) {
loadT.close();
if (key == 'memcached_set') {
var form_data = [
......@@ -1126,12 +1184,8 @@ var soft = {
{ title: 'CACHESIZE', name: 'cachesize', type: 'number', width: '120px', value: rdata.cachesize, ps: lan.soft.cache_size },
{ title: 'MAXCONN', name: 'maxconn', type: 'number', width: '120px', value: rdata.maxconn, ps: lan.soft.mac_connect },
{
title: ' ',
items: [{
text: lan.public.save,
name: 'btn_set_memcached',
type: 'button',
callback: function(ldata) {
title: ' ', items: [{
text: lan.public.save, name: 'btn_set_memcached', type: 'button', callback: function (ldata) {
if (ldata.ip.split('.').length < 4) {
layer.msg(lan.soft.ip_format_err, { icon: 2 });
return;
......@@ -1162,7 +1216,8 @@ var soft = {
bt.render_form_line(form_data[i], '', tabCon);
}
return;
} else {
}
else {
var arr = {};
arr['BindIP'] = [rdata.bind, lan.soft.listen_ip];
arr['PORT'] = [rdata.port, lan.soft.listen_port];
......@@ -1186,7 +1241,7 @@ var soft = {
})
break;
case 'phpmyadmin_php':
bt.send('GetPHPVersion', 'site/GetPHPVersion', {}, function(rdata) {
bt.send('GetPHPVersion', 'site/GetPHPVersion', {}, function (rdata) {
var sdata = $('.bt-soft-menu').data('data');
var body = "<div class='ver line'><span class='tname'>" + lan.soft.php_version + "</span><select id='get_phpVersion' class='bt-input-text mr20' name='phpVersion' style='width:110px'>";
......@@ -1196,13 +1251,13 @@ var soft = {
}
body += '</select><button class="btn btn-success btn-sm" >' + lan.public.save + '</button></div>';
$(".soft-man-con").html(body);
$('.btn-success').click(function() {
$('.btn-success').click(function () {
var loadT = bt.load(lan.public.the);
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { phpversion: $("#get_phpVersion").val() }, function(rdata) {
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { phpversion: $("#get_phpVersion").val() }, function (rdata) {
loadT.close();
bt.msg(rdata);
if (rdata.status) {
setTimeout(function() {
setTimeout(function () {
window.location.reload();
}, 3000);
}
......@@ -1213,40 +1268,40 @@ var soft = {
case 'phpmyadmin_safe':
var sdata = $('.bt-soft-menu').data('data');
var con = '<div class="ver line">\
<span style="margin-right:10px">' + lan.soft.pma_port + '</span>\
<input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="' + sdata.ext.port + '" placeholder="' + lan.soft.pma_port_title + '" maxlength="5" type="number">\
<button class="btn btn-success btn-sm phpmyadmin_port" >' + lan.public.save + '</button>\
</div>\
<div class="user_pw_tit">\
<span class="tit">' + lan.soft.pma_pass + '</span>\
<span class="btswitch-p"><input class="btswitch btswitch-ios" id="phpmyadminsafe" type="checkbox" ' + (sdata.ext.auth ? 'checked' : '') + '>\
<label class="btswitch-btn phpmyadmin-btn phpmyadmin_safe" for="phpmyadminsafe" ></label>\
</span>\
</div>\
<div class="user_pw">\
<p><span>' + lan.soft.pma_user + '</span><input id="username_get" class="bt-input-text" name="username_get" value="" type="text" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><span>' + lan.soft.pma_pass1 + '</span><input id="password_get_1" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><span>' + lan.soft.pma_pass2 + '</span><input id="password_get_2" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><button class="btn btn-success btn-sm phpmyadmin_safe_save" >' + lan.public.save + '</button></p>\
</div>\
<ul class="help-info-text c7"><li>' + lan.soft.pma_ps + '</li></ul>';
<span style="margin-right:10px">'+ lan.soft.pma_port + '</span>\
<input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="'+ sdata.ext.port + '" placeholder="' + lan.soft.pma_port_title + '" maxlength="5" type="number">\
<button class="btn btn-success btn-sm phpmyadmin_port" >'+ lan.public.save + '</button>\
</div>\
<div class="user_pw_tit">\
<span class="tit">'+ lan.soft.pma_pass + '</span>\
<span class="btswitch-p"><input class="btswitch btswitch-ios" id="phpmyadminsafe" type="checkbox" '+ (sdata.ext.auth ? 'checked' : '') + '>\
<label class="btswitch-btn phpmyadmin-btn phpmyadmin_safe" for="phpmyadminsafe" ></label>\
</span>\
</div>\
<div class="user_pw">\
<p><span>'+ lan.soft.pma_user + '</span><input id="username_get" class="bt-input-text" name="username_get" value="" type="text" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><span>'+ lan.soft.pma_pass1 + '</span><input id="password_get_1" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><span>'+ lan.soft.pma_pass2 + '</span><input id="password_get_2" class="bt-input-text" name="password_get_1" value="" type="password" placeholder="' + lan.soft.edit_empty + '"></p>\
<p><button class="btn btn-success btn-sm phpmyadmin_safe_save" >'+ lan.public.save + '</button></p>\
</div>\
<ul class="help-info-text c7"><li>'+ lan.soft.pma_ps + '</li></ul>';
$(".soft-man-con").html(con);
if (sdata.ext.port) {
$(".user_pw").show();
}
$('.phpmyadmin_port').click(function() {
$('.phpmyadmin_port').click(function () {
var pmport = $("#pmport").val();
if (!bt.check_port(pmport)) {
layer.msg(lan.firewall.port_err, { icon: 2 });
return;
}
var loadT = bt.load(lan.public.the);
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { port: pmport }, function(rdata) {
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { port: pmport }, function (rdata) {
loadT.close();
bt.msg(rdata);
})
})
$('.phpmyadmin_safe').click(function() {
$('.phpmyadmin_safe').click(function () {
var stat = $("#phpmyadminsafe").prop("checked");
if (stat) {
$(".user_pw").hide();
......@@ -1255,16 +1310,16 @@ var soft = {
$(".user_pw").show();
}
})
$('.phpmyadmin_safe_save').click(function() {
$('.phpmyadmin_safe_save').click(function () {
set_phpmyadmin('get');
})
function set_phpmyadmin(msg) {
var type = 'password';
if (msg == 'close') {
bt.confirm({ msg: lan.soft.pma_pass_close }, function() {
bt.confirm({ msg: lan.soft.pma_pass_close }, function () {
var loading = bt.load(lan.public.the);
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { password: msg, siteName: 'phpmyadmin' }, function(rdata) {
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { password: msg, siteName: 'phpmyadmin' }, function (rdata) {
loading.close();
bt.msg(rdata);
})
......@@ -1284,7 +1339,7 @@ var soft = {
}
}
var loading = bt.load(lan.public.the);
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { password: password_1, username: username, siteName: 'phpmyadmin' }, function(rdata) {
bt.send('setPHPMyAdmin', 'ajax/setPHPMyAdmin', { password: password_1, username: username, siteName: 'phpmyadmin' }, function (rdata) {
loading.close();
bt.msg(rdata);
})
......@@ -1292,7 +1347,7 @@ var soft = {
break;
case 'set_php_config':
bt.soft.php.get_config(version, function(rdata) {
bt.soft.php.get_config(version, function (rdata) {
$(".soft-man-con").empty().append('<div class="divtable" id="phpextdiv" style="margin-right:10px;height: 420px; overflow: auto; margin-right: 0px;"><table id="tab_phpext" class="table table-hover" width="100%" cellspacing="0" cellpadding="0" border="0"></div></div>');
var list = [];
......@@ -1308,18 +1363,12 @@ var soft = {
{ field: 'type', title: lan.soft.php_ext_type, width: 64 },
{ field: 'msg', title: lan.soft.php_ext_ps },
{
field: 'status',
title: lan.soft.php_ext_status,
width: 40,
templet: function(item) {
field: 'status', title: lan.soft.php_ext_status, width: 40, templet: function (item) {
return '<span class="ico-' + (item.status ? 'start' : 'stop') + ' glyphicon glyphicon-' + (item.status ? 'ok' : 'remove') + '"></span>'
}
},
{
field: 'opt',
title: lan.public.action,
width: 50,
templet: function(item) {
field: 'opt', title: lan.public.action, width: 50, templet: function (item) {
var opt = '<a class="btlink lib-install" data-name="' + item.name + '" data-title="' + item.title + '" href="javascript:;">' + lan.soft.install + '</a>'
if (item['task'] == '-1' && item.phpversions.indexOf(version) != -1) {
opt = '<a style="color:green;" href="javascript:messagebox();">' + lan.soft.the_install + '</a>'
......@@ -1340,17 +1389,18 @@ var soft = {
var scrollTopNum = 0;
if (divObj) scrollTopNum = divObj.scrollTop;
document.getElementById('phpextdiv').scrollTop = scrollTopNum;
$('a').click(function() {
$('a').click(function () {
var _obj = $(this);
if (_obj.hasClass('lib-uninstall')) {
bt.soft.php.un_install_php_lib(version, _obj.attr('data-name'), _obj.attr('data-title'), function(rdata) {
setTimeout(function() {
bt.soft.php.un_install_php_lib(version, _obj.attr('data-name'), _obj.attr('data-title'), function (rdata) {
setTimeout(function () {
soft.get_tab_contents('set_php_config', obj);
}, 1000)
});
} else if (_obj.hasClass('lib-install')) {
bt.soft.php.install_php_lib(version, _obj.attr('data-name'), _obj.attr('data-title'), function(rdata) {
setTimeout(function() {
}
else if (_obj.hasClass('lib-install')) {
bt.soft.php.install_php_lib(version, _obj.attr('data-name'), _obj.attr('data-title'), function (rdata) {
setTimeout(function () {
soft.get_tab_contents('set_php_config', obj);
}, 1000)
});
......@@ -1362,9 +1412,9 @@ var soft = {
var con = '<button id="btn_phpinfo" class="btn btn-default btn-sm" >' + lan.soft.phpinfo + '</button>';
$(".soft-man-con").html(con);
$('#btn_phpinfo').click(function() {
$('#btn_phpinfo').click(function () {
var loadT = bt.load(lan.soft.get);
bt.send('GetPHPInfo', 'ajax/GetPHPInfo', { version: version }, function(rdata) {
bt.send('GetPHPInfo', 'ajax/GetPHPInfo', { version: version }, function (rdata) {
loadT.close();
bt.open({
type: 1,
......@@ -1378,7 +1428,7 @@ var soft = {
})
break;
case 'config_edit':
bt.soft.php.get_php_config(version, function(rdata) {
bt.soft.php.get_php_config(version, function (rdata) {
var mlist = '';
for (var i = 0; i < rdata.length; i++) {
var w = '70'
......@@ -1403,28 +1453,21 @@ var soft = {
var datas = {
title: ' ',
items: [{
name: 'btn_fresh',
text: lan.public.fresh,
type: 'button',
callback: function(ldata) {
name: 'btn_fresh', text: lan.public.fresh, type: 'button', callback: function (ldata) {
soft.get_tab_contents(key, obj);
}
},
{
name: 'btn_save', text: lan.public.save, type: 'button', callback: function (ldata) {
var loadT = bt.load();
ldata['version'] = version;
bt.send('SetPHPConf', 'config/SetPHPConf', ldata, function (rdata) {
loadT.close();
soft.get_tab_contents(key, obj);
}
},
{
name: 'btn_save',
text: lan.public.save,
type: 'button',
callback: function(ldata) {
var loadT = bt.load();
ldata['version'] = version;
bt.send('SetPHPConf', 'config/SetPHPConf', ldata, function(rdata) {
loadT.close();
soft.get_tab_contents(key, obj);
bt.msg(rdata)
});
}
bt.msg(rdata)
});
}
]
}]
}
var _form_data = bt.render_form_line(datas);
$('.conf_p').append(_form_data.html)
......@@ -1432,30 +1475,29 @@ var soft = {
});
break;
case 'set_upload_limit':
bt.soft.php.get_limit_config(version, function(ret) {
var datas = [{
items: [
{ title: '', type: 'number', width: '100px', value: ret.max, unit: 'MB', name: 'phpUploadLimit' },
{
name: 'btn_limit_get',
text: lan.public.save,
type: 'button',
callback: function(ldata) {
var max = ldata.phpUploadLimit;
if (max < 2) {
layer.msg(lan.soft.php_upload_size, { icon: 2 });
return;
}
bt.soft.php.set_upload_max(version, max, function(rdata) {
if (rdata.status) {
soft.get_tab_contents(key, obj);
bt.soft.php.get_limit_config(version, function (ret) {
var datas = [
{
items: [
{ title: '', type: 'number', width: '100px', value: ret.max, unit: 'MB', name: 'phpUploadLimit' },
{
name: 'btn_limit_get', text: lan.public.save, type: 'button', callback: function (ldata) {
var max = ldata.phpUploadLimit;
if (max < 2) {
layer.msg(lan.soft.php_upload_size, { icon: 2 });
return;
}
bt.msg(rdata);
})
bt.soft.php.set_upload_max(version, max, function (rdata) {
if (rdata.status) {
soft.get_tab_contents(key, obj);
}
bt.msg(rdata);
})
}
}
}
]
}]
]
}
]
var clicks = [];
var tabCon = $(".soft-man-con").empty().append("<div class='set_upload_limit'></div>")
for (var i = 0; i < datas.length; i++) {
......@@ -1467,26 +1509,24 @@ var soft = {
})
break;
case 'set_timeout_limit':
bt.soft.php.get_limit_config(version, function(ret) {
var datas = [{
items: [
{ title: '', type: 'number', width: '100px', value: ret.maxTime, name: 'phpTimeLimit', unit: 'sec' },
{
name: 'btn_limit_get',
text: lan.public.save,
type: 'button',
callback: function(ldata) {
var max = ldata.phpTimeLimit;
bt.soft.php.set_php_timeout(version, max, function(rdata) {
if (rdata.status) {
soft.get_tab_contents(key, obj);
}
bt.msg(rdata);
})
}
}
]
}]
bt.soft.php.get_limit_config(version, function (ret) {
var datas = [
{
items: [
{ title: '', type: 'number', width: '100px', value: ret.maxTime, name: 'phpTimeLimit', unit: 'Sec' },
{
name: 'btn_limit_get', text: lan.public.save, type: 'button', callback: function (ldata) {
var max = ldata.phpTimeLimit;
bt.soft.php.set_php_timeout(version, max, function (rdata) {
if (rdata.status) {
soft.get_tab_contents(key, obj);
}
bt.msg(rdata);
})
}
}]
}
]
var clicks = [];
var tabCon = $(".soft-man-con").empty().append("<div class='set_timeout_limit bt-form'></div>")
for (var i = 0; i < datas.length; i++) {
......@@ -1498,7 +1538,7 @@ var soft = {
})
break;
case 'set_dis_fun':
bt.soft.php.get_config(version, function(rdata) {
bt.soft.php.get_config(version, function (rdata) {
var list = [];
var disable_functions = rdata.disable_functions.split(',');
for (var i = 0; i < disable_functions.length; i++) {
......@@ -1508,14 +1548,10 @@ var soft = {
var _bt_form = $("<div class='bt-form' style='height:400px;'></div>")
var tabCon = $(".soft-man-con").empty().append(_bt_form);
var _line = bt.render_form_line({
title: '',
items: [
title: '', items: [
{ name: 'disable_function_val', placeholder: lan.soft.fun_ps1, width: '410px' },
{
name: 'btn_disable_function_val',
text: lan.public.save,
type: 'button',
callback: function(ldata) {
name: 'btn_disable_function_val', text: lan.public.save, type: 'button', callback: function (ldata) {
var disable_functions = rdata.disable_functions.split(',')
if ($.inArray(ldata.disable_function_val, disable_functions) >= 0) {
bt.msg({ msg: lan.soft.fun_msg, icon: 5 });
......@@ -1536,14 +1572,11 @@ var soft = {
columns: [
{ field: 'name', title: lan.soft.php_ext_name },
{
field: 'opt',
title: lan.public.action,
width: 50,
templet: function(item) {
field: 'opt', title: lan.public.action, width: 50, templet: function (item) {
var new_disable_functions = disable_functions.slice()
new_disable_functions.splice($.inArray(item.name, new_disable_functions), 1)
// console.log(new_disable_functions)
return '<a class="del_functions btlink" style="float:right;" data-val="shell_exec" onclick="set_disable_functions(\'' + version + '\',\'' + new_disable_functions.join(',') + '\')" href="javascript:;">' + lan.soft.del + '</a>';
return '<a class="del_functions" style="float:right;" data-val="shell_exec" onclick="set_disable_functions(\'' + version + '\',\'' + new_disable_functions.join(',') + '\')" href="javascript:;">' + lan.soft.del + '</a>';
}
}
]
......@@ -1554,7 +1587,7 @@ var soft = {
})
break;
case 'set_fpm_config':
bt.soft.php.get_fpm_config(version, function(rdata) {
bt.soft.php.get_fpm_config(version, function (rdata) {
var datas = {
'30': {
max_children: 30,
......@@ -1593,44 +1626,29 @@ var soft = {
max_spare_servers: 250
}
}
var limits = [],
pmList = [];
var limits = [], pmList = [];
for (var k in datas) limits.push({ title: k + lan.soft.concurrency, value: k });
var _form_datas = [{
title: lan.soft.concurrency_type,
name: 'limit',
value: rdata.max_children,
type: 'select',
items: limits,
callback: function(iKey) {
var _form_datas = [
{
title: lan.soft.concurrency_type, name: 'limit', value: rdata.max_children, type: 'select', items: limits, callback: function (iKey) {
var item = datas[iKey.val()]
for (var sk in item) $('.' + sk).val(item[sk]);
}
},
{
title: lan.soft.php_fpm_model,
name: 'pm',
value: rdata.pm,
type: 'select',
items: [
title: lan.soft.php_fpm_model, name: 'pm', value: rdata.pm, type: 'select', items: [
{ title: lan.bt.static, value: 'static' },
{ title: lan.bt.dynamic, value: 'dynamic' }
],
ps: '*' + lan.soft.php_fpm_ps1
], ps: '*' + lan.soft.php_fpm_ps1
},
{ title: 'max_children', name: 'max_children', value: rdata.max_children, type: 'number', width: '100px', ps: '*' + lan.soft.php_fpm_ps2 },
{ title: 'start_servers', name: 'start_servers', value: rdata.start_servers, type: 'number', width: '100px', ps: '*' + lan.soft.php_fpm_ps3 },
{ title: 'min_spare_servers', name: 'min_spare_servers', value: rdata.min_spare_servers, type: 'number', width: '100px', ps: '*' + lan.soft.php_fpm_ps4 },
{ title: 'max_spare_servers', name: 'max_spare_servers', value: rdata.max_spare_servers, type: 'number', width: '100px', ps: '*' + lan.soft.php_fpm_ps5 },
{
title: ' ',
text: lan.public.save,
name: 'btn_children_submit',
css: 'btn-success',
type: 'button',
callback: function(ldata) {
title: ' ', text: lan.public.save, name: 'btn_children_submit', css: 'btn-success', type: 'button', callback: function (ldata) {
// console.log(ldata)
bt.pub.get_menm(function(memInfo) {
bt.pub.get_menm(function (memInfo) {
var limit_children = parseInt(memInfo['memTotal'] / 8);
if (limit_children < parseInt(ldata.max_children)) {
layer.msg(lan.soft.php_child_process.replace('{1}', limit_children), { icon: 2 });
......@@ -1658,7 +1676,7 @@ var soft = {
return;
}
ldata['version'] = version;
bt.soft.php.set_fpm_config(version, ldata, function(rdata) {
bt.soft.php.set_fpm_config(version, ldata, function (rdata) {
soft.get_tab_contents(key, obj);
bt.msg(rdata);
})
......@@ -1679,7 +1697,7 @@ var soft = {
});
break;
case 'get_php_status':
bt.soft.php.get_php_status(version, function(rdata) {
bt.soft.php.get_php_status(version, function (rdata) {
var arr = {};
arr[lan.bt.php_pool] = rdata.pool;
arr[lan.bt.php_manager] = ((rdata['process manager'] == 'dynamic') ? lan.bt.dynamic : lan.bt.static);
......@@ -1700,119 +1718,118 @@ var soft = {
bt.render_table('tab_php_status', arr);
})
break;
case 'get_php_session':
bt.soft.php.get_php_session(version, function(res) {
$(".soft-man-con").html('<div class="conf_p">' +
'<div class="line ">' +
'<span class="tname">' + lan.soft.storage_mode + '</span>' +
'<div class="info-r ">' +
'<select class="bt-input-text mr5 change_select_session" name="save_handler" style="width:160px">' +
'<option value="files" ' + (res.save_handler == 'files' ? 'selected' : '') + '>files</option>' +
(version != '52' ? '<option value="redis" ' + (res.save_handler == 'redis' ? 'selected' : '') + '>redis</option>' : '') +
(version != '73' ? '<option value="memcache" ' + (res.save_handler == 'memcache' ? 'selected' : '') + '>memcache</option>' : '') +
'</select>' +
'</div>' +
'</div>' +
'<div class="line">' +
'<span class="tname">' + lan.soft.ip_addr + '</span>' +
'<div class="info-r ">' +
'<input name="ip" class="bt-input-text mr5" type="text" style="width:180px" value="' + res.save_path + '">' +
'</div>' +
'</div>' +
case 'get_php_session':
bt.soft.php.get_php_session(version,function(res){
$(".soft-man-con").html('<div class="conf_p">'+
'<div class="line ">'+
'<span class="tname">' + lan.soft.storage_mode + '</span>'+
'<div class="info-r ">'+
'<select class="bt-input-text mr5 change_select_session" name="save_handler" style="width:160px">'+
'<option value="files" '+ (res.save_handler == 'files'?'selected':'') +'>files</option>'+
(version != '52'?'<option value="redis" '+ (res.save_handler == 'redis'?'selected':'') +'>redis</option>':'') +
(version != '73'?'<option value="memcache" '+ (res.save_handler == 'memcache'?'selected':'') +'>memcache</option>':'')+
'</select>'+
'</div>'+
'</div>'+
'<div class="line">'+
'<span class="tname">' + lan.soft.ip_addr + '</span>'+
'<div class="info-r ">'+
'<input name="ip" class="bt-input-text mr5" type="text" style="width:180px" value="'+ res.save_path +'">'+
'</div>'+
'</div>'+
'<div class="line">' +
'<span class="tname">' + lan.soft.port + '</span>' +
'<div class="info-r ">' +
'<input name="port" class="bt-input-text mr5" type="text" style="width:180px" value="' + res.port + '">' +
'</div>' +
'</div>' +
'<span class="tname">' + lan.soft.port + '</span>'+
'<div class="info-r ">'+
'<input name="port" class="bt-input-text mr5" type="text" style="width:180px" value="'+ res.port +'">'+
'</div>'+
'</div>'+
'<div class="line">'+
'<span class="tname">' + lan.soft.passwd + '</span>'+
'<div class="info-r ">'+
'<input name="passwd" class="bt-input-text mr5" placeholder="' + lan.soft.no_passwd_set_empty + '" type="text" style="width:180px" value="'+ res.passwd +'">'+
'</div>'+
'</div>'+
'<div class="line">' +
'<span class="tname">' + lan.soft.passwd + '</span>' +
'<div class="info-r ">' +
'<input name="passwd" class="bt-input-text mr5" placeholder="' + lan.soft.no_passwd_set_empty + '" type="text" style="width:180px" value="' + res.passwd + '">' +
'</div>' +
'</div>' +
'<div class="line">' +
'<button name="btn_save" class="btn btn-success btn-sm mr5 ml5 btn_conf_save" style="margin-left: 135px;">' + lan.soft.save + '</button>' +
'</div>' +
'<ul class="help-info-text c7">' +
'<li>' + lan.soft.php_seesion_tips1 + '</li>' +
'<li>' + lan.soft.php_seesion_tips2 + '</li>' +
'<li>' + lan.soft.php_seesion_tips3 + '</li>' +
'</ul>' +
'<div class="session_clear" style="border-top: #ccc 1px dashed;padding-top: 15px;margin-top: 15px;">' +
'<div class="clear_title" style="padding-bottom:15px;">' + lan.soft.clear_seesion_files + '</div><div class="clear_conter"></div></div>' +
'</div>');
if (res.save_handler == 'files') {
bt.soft.php.get_session_count(function(res) {
'<button name="btn_save" class="btn btn-success btn-sm mr5 ml5 btn_conf_save" style="margin-left: 135px;">' + lan.soft.save + '</button>'+
'</div>'+
'<ul class="help-info-text c7">'+
'<li>' + lan.soft.php_seesion_tips1 + '</li>'+
'<li>' + lan.soft.php_seesion_tips2 + '</li>'+
'<li>' + lan.soft.php_seesion_tips3 + '</li>'+
'</ul>'+
'<div class="session_clear" style="border-top: #ccc 1px dashed;padding-top: 15px;margin-top: 15px;">'+
'<div class="clear_title" style="padding-bottom:15px;">' + lan.soft.clear_seesion_files + '</div><div class="clear_conter"></div></div>'+
'</div>');
if(res.save_handler == 'files'){
bt.soft.php.get_session_count(function(res){
// console.log(res);
$('.clear_conter').html('<div class="session_clear_list"><div class="line"><span>' + lan.soft.total_seesion_files + '</span><span>' + res.total + '</span></div><div class="line"><span>' + lan.soft.can_clear_seesion + '</span><span>' + res.oldfile + '</span></div></div><button class="btn btn-success btn-sm clear_session_file">' + lan.soft.clear_seesion_files + '</button>')
$('.clear_session_file').click(function() {
$('.clear_session_file').click(function(){
bt.soft.php.clear_session_count({
title: lan.soft.clear_php_seesion_files,
msg: lan.soft.sure_clear_php_seesion_files
}, function(res) {
layer.msg(res.msg, { icon: res.status ? 1 : 2 });
setTimeout(function() {
},function(res) {
layer.msg(res.msg,{icon:res.status?1:2});
setTimeout(function(){
$('.bt-soft-menu p:eq(9)').click();
}, 2000);
},2000);
});
})
});
} else {
}else{
$('.clear_conter').html(lan.soft.only_files_storage_mode_can_clear).attr('style', 'color:#666')
}
switch_type(res.save_handler);
$('.change_select_session').change(function() {
$('.change_select_session').change(function(){
switch_type($(this).val());
switch ($(this).val()) {
switch($(this).val()){
case 'redis':
$('[name="ip"]').val('127.0.0.1');
$('[name="port"]').val('6379');
break;
break;
case 'memcache':
$('[name="ip"]').val('127.0.0.1');
$('[name="port"]').val('11211');
break;
break;
}
});
$('.btn_conf_save').click(function() {
$('.btn_conf_save').click(function(){
bt.soft.php.set_php_session({
version: version,
save_handler: $('[name="save_handler"]').val(),
ip: $('[name="ip"]').val(),
port: $('[name="port"]').val(),
passwd: $('[name="passwd"]').val()
}, function(res) {
layer.msg(res.msg, { icon: res.status ? 1 : 2 });
setTimeout(function() {
$('.bt-soft-menu p:eq(9)').click();
}, 2000);
version:version,
save_handler:$('[name="save_handler"]').val(),
ip:$('[name="ip"]').val(),
port:$('[name="port"]').val(),
passwd:$('[name="passwd"]').val()
},function(res){
layer.msg(res.msg,{icon:res.status?1:2});
setTimeout(function(){
$('.bt-soft-menu p:eq(9)').click();
},2000);
})
});
function switch_type(type) {
switch (type) {
function switch_type(type){
switch(type){
case 'files':
$('[name="ip"]').attr('disabled', 'disabled').val('');
$('[name="port"]').attr('disabled', 'disabled').val('');
$('[name="passwd"]').attr('disabled', 'disabled').val('');
break;
$('[name="ip"]').attr('disabled','disabled').val('');
$('[name="port"]').attr('disabled','disabled').val('');
$('[name="passwd"]').attr('disabled','disabled').val('');
break;
case 'redis':
$('[name="ip"]').attr('disabled', false);
$('[name="port"]').attr('disabled', false);
$('[name="passwd"]').attr('disabled', false);
break;
$('[name="ip"]').attr('disabled',false);
$('[name="port"]').attr('disabled',false);
$('[name="passwd"]').attr('disabled',false);
break;
case 'memcache':
$('[name="ip"]').attr('disabled', false);
$('[name="port"]').attr('disabled', false);
$('[name="passwd"]').attr('disabled', 'disabled').val('');
break;
$('[name="ip"]').attr('disabled',false);
$('[name="port"]').attr('disabled',false);
$('[name="passwd"]').attr('disabled','disabled').val('');
break;
}
}
});
break
break
case 'get_fpm_logs':
bt.soft.php.get_fpm_logs(version, function(logs) {
bt.soft.php.get_fpm_logs(version, function (logs) {
var phpCon = '<textarea readonly="" style="margin: 0px;width: 500px;height: 520px;background-color: #333;color:#fff; padding:0 5px" id="error_log">' + logs.msg + '</textarea>';
$(".soft-man-con").html(phpCon);
var ob = document.getElementById('error_log');
......@@ -1820,7 +1837,7 @@ var soft = {
})
break;
case 'get_slow_logs':
bt.soft.php.get_slow_logs(version, function(logs) {
bt.soft.php.get_slow_logs(version, function (logs) {
var phpCon = '<textarea readonly="" style="margin: 0px;width: 500px;height: 520px;background-color: #333;color:#fff; padding:0 5px" id="error_log">' + logs.msg + '</textarea>';
$(".soft-man-con").html(phpCon);
var ob = document.getElementById('error_log');
......@@ -1828,7 +1845,7 @@ var soft = {
})
break;
case 'get_redis_status':
bt.soft.redis.get_redis_status(function(rdata) {
bt.soft.redis.get_redis_status(function (rdata) {
var hit = (parseInt(rdata.keyspace_hits) / (parseInt(rdata.keyspace_hits) + parseInt(rdata.keyspace_misses)) * 100).toFixed(2);
var arrs = [];
arrs['uptime_in_days'] = [rdata.uptime_in_days, lan.soft.run_days];
......@@ -1852,8 +1869,8 @@ var soft = {
break;
}
},
update_zip_open: function() {
$("#update_zip").on("change", function() {
update_zip_open: function (){
$("#update_zip").on("change", function () {
var files = $("#update_zip")[0].files;
if (files.length == 0) {
return;
......@@ -1864,7 +1881,7 @@ var soft = {
$("#update_zip").click();
},
update_zip: function(file) {
update_zip: function (file) {
var formData = new FormData();
formData.append("plugin_zip", file);
$.ajax({
......@@ -1873,7 +1890,7 @@ var soft = {
data: formData,
processData: false,
contentType: false,
success: function(data) {
success: function (data) {
if (data.status === false) {
layer.msg(data.msg, { icon: 2 });
return;
......@@ -1922,7 +1939,7 @@ var soft = {
if (rdata.status) {
soft.get_list();
}
setTimeout(function() { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }) }, 1000);
setTimeout(function () { layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 }) }, 1000);
});
}
......@@ -1930,8 +1947,7 @@ var soft = {
};
function soft_td_width_auto() {
var thead_width = '',
winWidth = $(window).width();
var thead_width = '', winWidth = $(window).width();
if (winWidth <= 1370 && winWidth > 1280) {
thead_width = winWidth / 4;
} else if (winWidth <= 1280 && winWidth > 1210) {
......@@ -1941,12 +1957,12 @@ function soft_td_width_auto() {
} else {
thead_width = winWidth / 3.5;
}
$('#softList thead th:eq(1)').width(thead_width);
$('#softList thead th:eq(2)').width(thead_width);
$('#softList tbody tr td:nth-child(8n+2)>span').width(thead_width + 75);
}
function set_disable_functions(version, data) {
bt.soft.php.disable_functions(version, data, function(rdata) {
bt.soft.php.disable_functions(version, data, function (rdata) {
if (rdata.status) {
soft.get_tab_contents('set_dis_fun', $(".bgw"));
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment