pull/109/head
Mr Chen 7 years ago
parent 8d5f097071
commit 593826ae4b
  1. BIN
      plugins/readme/ico.png
  2. 36
      plugins/readme/index.html
  3. 11
      plugins/readme/index.py
  4. 14
      plugins/readme/info.json
  5. 27
      plugins/readme/install.sh
  6. 301
      plugins/readme/js/score.js
  7. 7
      route/plugins.py
  8. 102
      static/js/public.js
  9. 20
      static/js/soft.js

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

@ -0,0 +1,36 @@
<div class="testServer">
<div class="ts-head">
<div class="ts-h-score">
<div class="ts-h-s-img ts-h-s-imging"></div>
<div class="ts-h-s-num"><span>正在跑分中<img src="/static/img/ings.gif"></span></div>
<div class="ts-stamper"></div>
</div>
<div class="ts-btn ts-btn-start" onclick="startTest();">开始跑分</div>
</div>
<div class="ts-info">公式:1万次整数+2万次浮点+1亿位圆周率+1万次排序 +((磁盘读+磁盘写)*IO速度)+内存容量</div>
<div class="ts-content">
<div class="ts-c-box ts-cpu">
<div class="ts-c-b-score"></div>
<div class="ts-c-b-img"></div>
<div class="ts-c-b-name">CPU</div>
<div class="ts-c-b-info">cpu运算能力</div>
</div>
<div class="ts-c-box ts-disk">
<div class="ts-c-b-score"></div>
<div class="ts-c-b-img"></div>
<div class="ts-c-b-name">磁盘</div>
<div class="ts-c-b-info">磁盘读写能力</div>
</div>
<div class="ts-c-box ts-mem">
<div class="ts-c-b-score"></div>
<div class="ts-c-b-img"></div>
<div class="ts-c-b-name">内存</div>
<div class="ts-c-b-info">内存容量</div>
</div>
</div>
</div>
<script type="text/javascript">
resetPluginWinWidth(700);
$.getScript("/plugins/file?name=readme&f=js/score.js");
</script>

@ -0,0 +1,11 @@
# coding: utf-8
import time
import psutil
import random
import os
import urllib
import binascii
import json
import public
import re

@ -0,0 +1,14 @@
{
"title":"插件开发说明",
"tip":"soft",
"name":"readme",
"type":"扩展",
"ps":"(mdserver-web)插件产开发说明,每个版本可能有所变化!",
"versions": "0.1",
"shell":"install.sh",
"checks":"mdserver-web/plugins/readme/r",
"author":"mdserver-web",
"home":"github.com/midoks/mdserver-web",
"date":"2018-11-30",
"pid":"5"
}

@ -0,0 +1,27 @@
#!/bin/bash
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
export PATH
curPath=`pwd`
rootPath=$(dirname "$curPath")
rootPath=$(dirname "$rootPath")
serverPath=$(dirname "$rootPath")
install_tmp=${rootPath}/tmp/bt_install.pl
Install_readme()
{
echo '安装完成' > $install_tmp
}
Uninstall_readme()
{
echo '卸载完成' > $install_tmp
}
action=$1
if [ "${1}" == 'install' ];then
Install_readme
else
Uninstall_readme
fi

File diff suppressed because one or more lines are too long

@ -51,6 +51,13 @@ def indexList():
return public.getJson(data)
@plugins.route('/index_sort', methods=['POST'])
def indexSort():
sort = request.form.get('ssrot', '')
# data = plugin_api.plugin_api().setIndexSort()
return public.returnJson(False, '已将安装任务添加到队列!')
@plugins.route('/install', methods=['POST'])
def install():

@ -341,6 +341,25 @@ function showHidePwd() {
})
}
function showMsg(msg, callback ,icon, time){
if (typeof time == 'undefined'){
time = 2000;
}
if (typeof icon == 'undefined'){
icon = {};
}
var loadT = layer.msg(msg, icon);
setTimeout(function() {
layer.close(loadT);
if (typeof callback == 'function'){
callback();
}
}, time);
}
function openPath(a) {
setCookie("Path", a);
window.location.href = "/files"
@ -489,89 +508,6 @@ function OnlineEditFile(k, f) {
});
}
function ServiceAdmin(a, b) {
if(!isNaN(a)) {
a = "php-fpm-" + a
}
a = a.replace('_soft','');
var c = "name=" + a + "&type=" + b;
var d = "";
switch(b) {
case "stop":
d = lan.bt.stop;
break;
case "start":
d = lan.bt.start;
break;
case "restart":
d = lan.bt.restart;
break;
case "reload":
d = lan.bt.reload;
break
}
layer.confirm( lan.get('service_confirm',[d,a]), {icon:3,
closeBtn: 2
}, function() {
var e = layer.msg(lan.get('service_the',[d,a]), {
icon: 16,
time: 0
});
$.post("/system?action=ServiceAdmin", c, function(g) {
layer.close(e);
var f = g.status ? lan.get('service_ok',[a,d]):lan.get('service_err',[a,d]);
layer.msg(f, {
icon: g.status ? 1 : 2
});
if(b != "reload" && g.status == true) {
setTimeout(function() {
window.location.reload()
}, 1000)
}
if(!g.status) {
layer.msg(g.msg, {
icon: 2,
time: 0,
shade: 0.3,
shadeClose: true
})
}
}).error(function() {
layer.close(e);
layer.msg(lan.public.success, {
icon: 1
})
})
})
}
function GetConfigFile(a) {
var b = "";
switch(a) {
case "mysql":
b = "/etc/my.cnf";
break;
case "nginx":
b = "/www/server/nginx/conf/nginx.conf";
break;
case "pure-ftpd":
b = "/www/server/pure-ftpd/etc/pure-ftpd.conf";
break;
case "apache":
b = "/www/server/apache/conf/httpd.conf";
break;
case "tomcat":
b = "/www/server/tomcat/conf/server.xml";
break;
default:
b = "/www/server/php/" + a + "/etc/php.ini";
break
}
OnlineEditFile(0, b)
}
function GetPHPStatus(a) {
if(a == "52") {
layer.msg(lan.bt.php_status_err, {

@ -298,7 +298,6 @@ function toIndexDisplay(name, version, coexist) {
var verinfo = version.replace(/\./, "");
status = $("#index_" + name + verinfo).prop("checked") ? "0" : "1";
}
console.log(name,status,version);
var data = "name=" + name + "&status=" + status + "&version=" + version;
$.post("/plugins/set_index", data, function(rdata) {
@ -323,6 +322,7 @@ function indexSoft() {
var loadT = layer.msg('正在获取列表...', { icon: 16, time: 0, shade: [0.3, '#000'] });
$.get('/plugins/index_list', function(rdata) {
layer.close(loadT);
$("#indexsoft").html('');
var con = '';
for (var i = 0; i < rdata.length; i++) {
var plugin = rdata[i];
@ -340,8 +340,6 @@ function indexSoft() {
version_info = version_info.substring(0, version_info.length - 1);
}
console.log(version_info, plugin);
if (plugin.status == true) {
state = '<span style="color:#20a53a" class="glyphicon glyphicon-play"></span>'
@ -353,18 +351,18 @@ function indexSoft() {
if (plugin.coexist){
name = plugin.title + ' ';
}
//(\'' + plugin.name + '\',\'' + version_info + '\')"
if (plugin.display == true) {
con += '<div class="col-sm-3 col-md-3 col-lg-3" data-id="' + plugin.pid + '">\
<span class="spanmove"></span>\
<div onclick="softMain(\'' + plugin.name + '\',\'' + version_info + '\')">\
<div class="image"><img src="/static/img/soft_ico/ico-' + plugin.name + '.png"></div>\
<div class="image"><img src="plugins/file?name=' + plugin.name + '&f=ico.png"></div>\
<div class="sname">' + name + state + '</div>\
</div>\
</div>'
}
}
$("#indexsoft").html(con);
//软件位置移动
var softboxlen = $("#indexsoft > div").length;
@ -378,13 +376,19 @@ function indexSoft() {
}
$("#indexsoft").append(softboxcon);
}
$("#indexsoft").dragsort({ dragSelector: ".spanmove", dragBetween: true, dragEnd: saveOrder, placeHolderTemplate: "<div class='col-sm-3 col-md-3 col-lg-3 dashed-border'></div>" });
$("#indexsoft").dragsort({ dragSelector: ".spanmove", dragBetween: true, dragEnd: saveOrder, placeHolderTemplate: "<div class='col-sm-3 col-md-3 col-lg-3 dashed-border'></div>" });
function saveOrder() {
var data = $("#indexsoft > div").map(function() { return $(this).attr("data-id"); }).get();
var ssort = data.join("|");
$("input[name=list1SortOrder]").val(ssort);
$.post("/plugin?action=savePluginSort", 'ssort=' + ssort, function(rdata) {});
$.post("/plugins/index_sort", 'ssort=' + ssort, function(rdata) {
if (!rdata.status){
showMsg('设置失败:'+ rdata.msg, function(){
indexSoft();
}, { icon: 16, time: 0, shade: [0.3, '#000'] });
}
},'json');
};
},'json');
}

Loading…
Cancel
Save