diff --git a/route/static/app/soft.js b/route/static/app/soft.js index 252038b0c..df7165a95 100755 --- a/route/static/app/soft.js +++ b/route/static/app/soft.js @@ -342,7 +342,7 @@ function indexSoft() { var data = $("#indexsoft > div").map(function() { return $(this).attr("data-id"); }).get(); tmp = []; for(i in data){ - console.log(data[i]); + // console.log(data[i]); if (data[i] != ''){ tmp.push($.trim(data[i])); } @@ -359,8 +359,86 @@ function indexSoft() { }; } -// $(function() { -// if (window.document.location.pathname == '/soft/') { -// setInterval(function() { getSList(); }, 10000); -// } -// }); \ No newline at end of file + +function importPluginOpen(){ + $("#update_zip").on("change", function () { + var files = $("#update_zip")[0].files; + if (files.length == 0) { + return; + } + importPlugin(files[0]); + $("#update_zip").val('') + }); + + $("#update_zip").click(); +} + + +function importPlugin(file){ + var formData = new FormData(); + formData.append("plugin_zip", file); + $.ajax({ + url: "/plugin?action=update_zip", + type: "POST", + data: formData, + processData: false, + contentType: false, + success: function (data) { + if (data.status === false) { + layer.msg(data.msg, { icon: 2 }); + return; + } + var loadT = layer.open({ + type: 1, + area: "500px", + title: "安装第三方插件包", + closeBtn: 2, + shift: 5, + shadeClose: false, + content: '\ +
名称:'+ data.title + '
\ +版本:' + data.versions +'
\ +描述:' + data.ps + '
\ +大小:' + bt.format_size(data.size, true) + '
\ +作者:' + data.author + '
\ + \ +