mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-10 03:59:25 +08:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
a1d8523dd9 | ||
|
|
295e456a20 | ||
|
|
453cb4cf14 | ||
|
|
56a1ffed2a | ||
|
|
b94f302fbe | ||
|
|
3a278f4cc6 | ||
|
|
67b7f9cf43 | ||
|
|
b3dc24428c | ||
|
|
233e6dfc0f | ||
|
|
07e74a8947 | ||
|
|
4eed1e8a93 | ||
|
|
1b91af6f22 | ||
|
|
9bc824906b | ||
|
|
394f345764 | ||
|
|
a10a11817b | ||
|
|
6b82dd5eca | ||
|
|
a5d976ad36 | ||
|
|
4bb4746a1b | ||
|
|
9fad06585f | ||
|
|
50ed66d26a | ||
|
|
ed17622a0b | ||
|
|
b8e993cd04 | ||
|
|
7fe6744c09 | ||
|
|
beb085e95c | ||
|
|
657f408a8b | ||
|
|
3994f1505e | ||
|
|
0ecc9307f1 | ||
|
|
93de3dd3ab | ||
|
|
f99225f172 | ||
|
|
cd9b043525 | ||
|
|
0e5c59dae2 | ||
|
|
1a5c7b9a3f | ||
|
|
2282776020 | ||
|
|
cd2b07f5d2 | ||
|
|
a5d4d53883 | ||
|
|
9e463cec7a | ||
|
|
e489bd43b8 | ||
|
|
983eb38165 | ||
|
|
677894ca35 | ||
|
|
a302ded8b2 | ||
|
|
3eeee10de6 | ||
|
|
160998ba6e | ||
|
|
8ece38c082 | ||
|
|
52d4215a80 | ||
|
|
029b548af0 | ||
|
|
4db10d22a7 | ||
|
|
1d3ca158cb | ||
|
|
74e19287e4 | ||
|
|
ece8dd8b19 | ||
|
|
d082297b25 | ||
|
|
1a1e211107 | ||
|
|
2d32578b5f | ||
|
|
e07f0fca9c | ||
|
|
80344149da | ||
|
|
046abc4cba | ||
|
|
588ec43543 | ||
|
|
ea8a4baba6 | ||
|
|
bcf3516f22 | ||
|
|
16acda5d60 | ||
|
|
68b9b95d5c | ||
|
|
e32c4926ca | ||
|
|
f4bb052776 | ||
|
|
3cc92a1eab | ||
|
|
24b8b1ee7c | ||
|
|
1996442b56 | ||
|
|
529ba08aee | ||
|
|
701b19e0b6 | ||
|
|
06f1b34f52 | ||
|
|
72c5efcc2f | ||
|
|
ac29bb098b | ||
|
|
887589dbf9 | ||
|
|
bc640ad888 | ||
|
|
8b00a7436a | ||
|
|
e8483b78a0 | ||
|
|
ab6ffa4cf5 | ||
|
|
14682df7cb | ||
|
|
2c9b05be6d | ||
|
|
5626110bd9 | ||
|
|
e3e704984e | ||
|
|
1ac89246a4 | ||
|
|
6c8790b915 | ||
|
|
2dad3bc59d | ||
|
|
60c0c0a34b | ||
|
|
2323de4fc6 | ||
|
|
f15134aa9e | ||
|
|
a71936cabc | ||
|
|
58af7bb152 | ||
|
|
f8b04deb03 | ||
|
|
4b798b14b0 | ||
|
|
9cc667ac4a | ||
|
|
6775934a0d | ||
|
|
cec9c3a23d | ||
|
|
e904ad4406 | ||
|
|
a68c8605b7 | ||
|
|
a65a484bf1 | ||
|
|
24ca8cfde3 | ||
|
|
57b83e654b | ||
|
|
aa13a9163a | ||
|
|
f83e00d565 | ||
|
|
63cd240b5c | ||
|
|
7ef311d972 | ||
|
|
1a8e643c10 | ||
|
|
da4c8750fc | ||
|
|
1e366c6263 | ||
|
|
364a8ba5db | ||
|
|
5867c5d2cc | ||
|
|
52d5fe4470 | ||
|
|
c2f1dba9dc | ||
|
|
1bf2dc2738 | ||
|
|
0d09cf6ad4 | ||
|
|
b6543b54e6 | ||
|
|
bb8f970604 | ||
|
|
c7b2fd182c | ||
|
|
afd255c767 | ||
|
|
8daa136bc8 | ||
|
|
5c3840ee63 | ||
|
|
3e0ab6176c | ||
|
|
9a4336935b | ||
|
|
7ca8d687d7 | ||
|
|
b2a2ce52a7 |
@@ -130,6 +130,7 @@ pyvenv.cfg
|
||||
include
|
||||
pip-selfcheck.json
|
||||
|
||||
scripts/mdserver-web
|
||||
data/api_login.txt
|
||||
data/sessions
|
||||
data/ssl.pl
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
### mdserver-web 0.9.0
|
||||
### mdserver-web 0.9.5
|
||||
|
||||
简单的Linux面板,感谢BT.CN写出如此好的web管理软件。我一看到,就知道这是我一直想要的页面化管理方式。
|
||||
复制了后台管理界面,按照自己想要的方式写了一版。
|
||||
@@ -22,6 +22,7 @@
|
||||
|
||||
- 吹水组 - https://t.me/mdserver_web
|
||||
- [兼容性测试报告](/compatibility.md)
|
||||
- [常用命令说明](/cmd.md)
|
||||
|
||||
### 主要插件介绍
|
||||
|
||||
@@ -70,20 +71,13 @@ docker run -itd --name mw-server --privileged=true -p 7200:7200 -p 80:80 -p 443:
|
||||
```
|
||||
|
||||
|
||||
### 版本更新 0.9.0
|
||||
* 主流系统支持。
|
||||
* 插件支持更多参数。
|
||||
* MySQL主从支持GTID和经典模式。
|
||||
* MariaDB主从支持GTID和经典模式。
|
||||
* Rsyncd更新。
|
||||
* 添加网站统计的插件。
|
||||
* 添加varnish插件。
|
||||
* 添加PHP的APT安装方式[辅助插件]。
|
||||
* 添加PHP的YUM安装方式[辅助插件]。
|
||||
* 添加MYSQL的YUM安装方式[辅助插件]。
|
||||
* 各种bug修复。
|
||||
|
||||
### 版本更新 0.9.5
|
||||
|
||||
* 页面更新优化[2].
|
||||
* 修复maridb的用户管理[2].
|
||||
* Gogs初始化提示更人性.
|
||||
* MySQL&&MariaDB修改密码修复.
|
||||
* MySQL&&MariaDB导入修复.
|
||||
|
||||
|
||||
### JSDelivr安装地址
|
||||
|
||||
@@ -15,8 +15,7 @@ from flask import request
|
||||
|
||||
class config_api:
|
||||
|
||||
# mariadb 优化
|
||||
__version = '0.9.0'
|
||||
__version = '0.9.5'
|
||||
|
||||
def __init__(self):
|
||||
pass
|
||||
|
||||
@@ -878,6 +878,9 @@ class site_api:
|
||||
domain = request.form.get('domain', '')
|
||||
webname = request.form.get('webname', '')
|
||||
pid = request.form.get('id', '')
|
||||
return self.addDomain(domain, webname, pid)
|
||||
|
||||
def addDomain(self, domain, webname, pid):
|
||||
if len(domain) < 3:
|
||||
return mw.returnJson(False, '域名不能为空!')
|
||||
domains = domain.split(',')
|
||||
@@ -1137,10 +1140,10 @@ class site_api:
|
||||
if conf.find(rep) == -1:
|
||||
rep = '#error_page 404/404.html;'
|
||||
data = '''
|
||||
# AUTH_START
|
||||
#AUTH_START
|
||||
auth_basic "Authorization";
|
||||
auth_basic_user_file %s;
|
||||
# AUTH_END''' % (filename,)
|
||||
#AUTH_END''' % (filename,)
|
||||
conf = conf.replace(rep, rep + data)
|
||||
mw.writeFile(configFile, conf)
|
||||
# 写密码配置
|
||||
@@ -2023,7 +2026,7 @@ location ^~ {from} {
|
||||
return 404;
|
||||
}
|
||||
}
|
||||
# SECURITY-END
|
||||
#SECURITY-END
|
||||
include %s/enable-php-''' % (fix.strip().replace(',', '|'), domains.strip().replace(',', ' '), pre_path)
|
||||
conf = re.sub(re_path, rconf, conf)
|
||||
mw.writeLog('网站管理', '站点[' + name + ']已开启防盗链!')
|
||||
@@ -2184,7 +2187,7 @@ location ^~ {from} {
|
||||
sdomain = domain
|
||||
swebname = self.siteName
|
||||
spid = str(pid)
|
||||
# self.addDomain(domain, webname, pid)
|
||||
self.addDomain(domain, webname, pid)
|
||||
|
||||
mw.M('domain').add('pid,name,port,addtime',
|
||||
(pid, self.siteName, self.sitePort, mw.getDate()))
|
||||
|
||||
+41
-29
@@ -625,13 +625,13 @@ class system_api:
|
||||
def getServerInfo(self):
|
||||
import urllib.request
|
||||
import ssl
|
||||
upAddr = 'https://cdn.jsdelivr.net/gh/midoks/mdserver-web@latest/version/info.json'
|
||||
upAddr = 'https://api.github.com/repos/midoks/mdserver-web/releases/latest'
|
||||
try:
|
||||
context = ssl._create_unverified_context()
|
||||
req = urllib.request.urlopen(upAddr, context=context, timeout=3)
|
||||
result = req.read().decode('utf-8')
|
||||
version = json.loads(result)
|
||||
return version[0]
|
||||
return version
|
||||
except Exception as e:
|
||||
print('getServerInfo', e)
|
||||
return {}
|
||||
@@ -642,58 +642,70 @@ class system_api:
|
||||
if not mw.isRestart():
|
||||
return mw.returnJson(False, '请等待所有安装任务完成再执行!')
|
||||
|
||||
version_new_info = self.getServerInfo()
|
||||
version_now = config_api.config_api().getVersion()
|
||||
|
||||
new_ver = version_new_info['name']
|
||||
|
||||
if stype == 'check':
|
||||
version_now = config_api.config_api().getVersion()
|
||||
version_new_info = self.getServerInfo()
|
||||
if not 'version' in version_new_info:
|
||||
if not 'name' in version_new_info:
|
||||
return mw.returnJson(False, '服务器数据或网络有问题!')
|
||||
|
||||
diff = self.versionDiff(
|
||||
version_now, version_new_info['version'])
|
||||
diff = self.versionDiff(version_now, new_ver)
|
||||
if diff == 'new':
|
||||
return mw.returnJson(True, '有新版本!', version_new_info['version'])
|
||||
return mw.returnJson(True, '有新版本!', new_ver)
|
||||
elif diff == 'test':
|
||||
return mw.returnJson(True, '有测试版本!', version_new_info['version'])
|
||||
return mw.returnJson(True, '有测试版本!', new_ver)
|
||||
else:
|
||||
return mw.returnJson(False, '已经是最新,无需更新!')
|
||||
|
||||
if stype == 'info':
|
||||
version_new_info = self.getServerInfo()
|
||||
version_now = config_api.config_api().getVersion()
|
||||
|
||||
if not 'version' in version_new_info:
|
||||
if not 'name' in version_new_info:
|
||||
return mw.returnJson(False, '服务器数据有问题!')
|
||||
diff = self.versionDiff(
|
||||
version_now, version_new_info['version'])
|
||||
return mw.returnJson(True, '更新信息!', version_new_info)
|
||||
diff = self.versionDiff(version_now, new_ver)
|
||||
data = {}
|
||||
data['version'] = new_ver
|
||||
data['content'] = version_new_info[
|
||||
'body'].replace("\n", "<br/>")
|
||||
return mw.returnJson(True, '更新信息!', data)
|
||||
|
||||
if stype == 'update':
|
||||
if version == '':
|
||||
return mw.returnJson(False, '缺少版本信息!')
|
||||
|
||||
v_new_info = self.getServerInfo()
|
||||
if v_new_info['version'] != version:
|
||||
if new_ver != version:
|
||||
return mw.returnJson(False, '更新失败,请重试!')
|
||||
|
||||
if not 'path' in v_new_info or v_new_info['path'] == '':
|
||||
return mw.returnJson(False, '下载地址不存在!')
|
||||
|
||||
newUrl = v_new_info['path']
|
||||
toPath = mw.getRootDir() + '/temp'
|
||||
if not os.path.exists(toPath):
|
||||
mw.execShell('mkdir -p ' + toPath)
|
||||
|
||||
mw.execShell('wget -O ' + toPath + '/mw.zip ' + newUrl)
|
||||
newUrl = "https://github.com/midoks/mdserver-web/archive/refs/tags/" + version + ".zip"
|
||||
|
||||
mw.execShell('unzip -o ' + toPath + '/mw.zip' + ' -d ./')
|
||||
mw.execShell('unzip -o mw.zip -d ./')
|
||||
mw.execShell('rm -f mw.zip')
|
||||
return mw.returnJson(True, '安装更新成功,需自己重启!')
|
||||
dist_mw = toPath + '/mw.zip'
|
||||
if not os.path.exists(dist_mw):
|
||||
mw.execShell(
|
||||
'wget --no-check-certificate -O ' + dist_mw + ' ' + newUrl)
|
||||
|
||||
dist_to = toPath + "/mdserver-web-" + version
|
||||
if not os.path.exists(dist_to):
|
||||
os.system('unzip -o ' + toPath +
|
||||
'/mw.zip' + ' -d ' + toPath)
|
||||
|
||||
cmd_cp = 'cp -rf ' + toPath + '/mdserver-web-' + \
|
||||
version + '/* ' + mw.getServerDir() + '/mdserver-web'
|
||||
mw.execShell(cmd_cp)
|
||||
|
||||
mw.execShell('rm -rf ' + toPath + '/mdserver-web-' + version)
|
||||
mw.execShell('rm -rf ' + toPath + '/mw.zip')
|
||||
|
||||
self.restartMw()
|
||||
return mw.returnJson(True, '安装更新成功!')
|
||||
|
||||
return mw.returnJson(False, '已经是最新,无需更新!')
|
||||
except Exception as ex:
|
||||
print('updateServer', ex)
|
||||
return mw.returnJson(False, "连接服务器失败!")
|
||||
# print('updateServer', ex)
|
||||
return mw.returnJson(False, "连接服务器失败!" + str(ex))
|
||||
|
||||
# 修复面板
|
||||
def repPanel(self, get):
|
||||
|
||||
+23
-20
@@ -53,8 +53,8 @@ class task_api:
|
||||
return v
|
||||
|
||||
def getTaskSpeedApi(self):
|
||||
tempFile = os.getcwd() + '/tmp/panelExec.log'
|
||||
freshFile = os.getcwd() + '/tmp/panelFresh'
|
||||
tempFile = mw.getRunDir() + '/tmp/panelExec.log'
|
||||
freshFile = mw.getRunDir() + '/tmp/panelFresh'
|
||||
|
||||
find = mw.M('tasks').where('status=? OR status=?',
|
||||
('-1', '0')).field('id,type,name,execstr').find()
|
||||
@@ -63,25 +63,28 @@ class task_api:
|
||||
|
||||
mw.triggerTask()
|
||||
|
||||
echoMsg = {}
|
||||
echoMsg['name'] = find['name']
|
||||
echoMsg['execstr'] = find['execstr']
|
||||
data = {}
|
||||
data['name'] = find['name']
|
||||
data['execstr'] = find['execstr']
|
||||
if find['type'] == 'download':
|
||||
import json
|
||||
try:
|
||||
tmp = mw.readFile(tempFile)
|
||||
if len(tmp) < 10:
|
||||
return mw.returnJson(False, '当前没有任务队列在执行-3!')
|
||||
echoMsg['msg'] = json.loads(tmp)
|
||||
echoMsg['isDownload'] = True
|
||||
except:
|
||||
mw.M('tasks').where(
|
||||
"id=?", (find['id'],)).save('status', ('0',))
|
||||
return mw.returnJson(False, '当前没有任务队列在执行-4!')
|
||||
readLine = ""
|
||||
for i in range(3):
|
||||
try:
|
||||
readLine = mw.readFile(tempFile)
|
||||
if len(readLine) > 10:
|
||||
data['msg'] = json.loads(readLine)
|
||||
data['isDownload'] = True
|
||||
break
|
||||
except Exception as e:
|
||||
if i == 2:
|
||||
mw.M('tasks').where("id=?", (find['id'],)).save(
|
||||
'status', ('0',))
|
||||
return mw.returnJson(False, '当前没有任务队列在执行-4:' + str(e))
|
||||
time.sleep(0.5)
|
||||
else:
|
||||
echoMsg['msg'] = mw.getLastLine(tempFile, 10)
|
||||
echoMsg['isDownload'] = False
|
||||
data['msg'] = mw.getLastLine(tempFile, 10)
|
||||
data['isDownload'] = False
|
||||
|
||||
echoMsg['task'] = mw.M('tasks').where("status!=?", ('1',)).field(
|
||||
data['task'] = mw.M('tasks').where("status!=?", ('1',)).field(
|
||||
'id,status,name,type').order("id asc").select()
|
||||
return mw.getJson(echoMsg)
|
||||
return mw.getJson(data)
|
||||
|
||||
@@ -11,6 +11,7 @@ class ORM:
|
||||
__DB_PASS = None
|
||||
__DB_USER = 'root'
|
||||
__DB_PORT = 3306
|
||||
__DB_NAME = ''
|
||||
__DB_HOST = 'localhost'
|
||||
__DB_CONN = None
|
||||
__DB_CUR = None
|
||||
@@ -27,21 +28,25 @@ class ORM:
|
||||
if os.path.exists(self.__DB_SOCKET):
|
||||
try:
|
||||
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
|
||||
database=self.__DB_NAME,
|
||||
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
|
||||
unix_socket=self.__DB_SOCKET, cursorclass=pymysql.cursors.DictCursor)
|
||||
except Exception as e:
|
||||
self.__DB_HOST = '127.0.0.1'
|
||||
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
|
||||
database=self.__DB_NAME,
|
||||
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
|
||||
unix_socket=self.__DB_SOCKET, cursorclass=pymysql.cursors.DictCursor)
|
||||
else:
|
||||
try:
|
||||
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
|
||||
database=self.__DB_NAME,
|
||||
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
except Exception as e:
|
||||
self.__DB_HOST = '127.0.0.1'
|
||||
self.__DB_CONN = pymysql.connect(host=self.__DB_HOST, user=self.__DB_USER, passwd=self.__DB_PASS,
|
||||
database=self.__DB_NAME,
|
||||
port=int(self.__DB_PORT), charset=self.__DB_CHARSET, connect_timeout=1,
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
|
||||
@@ -69,6 +74,9 @@ class ORM:
|
||||
def getPwd(self):
|
||||
return self.__DB_PASS
|
||||
|
||||
def setDbName(self, name):
|
||||
self.__DB_NAME = name
|
||||
|
||||
def execute(self, sql):
|
||||
# 执行SQL语句返回受影响行
|
||||
if not self.__Conn():
|
||||
|
||||
@@ -0,0 +1,68 @@
|
||||
### 常用命令说明
|
||||
|
||||
|
||||
- 面板相关命令
|
||||
|
||||
```
|
||||
/etc/init.d/mw default
|
||||
|
||||
service mw [start|stop|reload|restart|status]
|
||||
```
|
||||
|
||||
- OpenResty
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] openresty
|
||||
|
||||
```
|
||||
|
||||
- MySQL
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] mysql
|
||||
|
||||
```
|
||||
|
||||
- MariaDB
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] mariadb
|
||||
|
||||
```
|
||||
|
||||
- PHP
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] php[54-81]
|
||||
|
||||
sytemctl start php71
|
||||
```
|
||||
|
||||
- Redis
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] redis
|
||||
|
||||
```
|
||||
|
||||
- Memcached
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] memcached
|
||||
|
||||
```
|
||||
|
||||
|
||||
- sphinx
|
||||
|
||||
```
|
||||
|
||||
sytemctl [start|stop|reload|restart|status] sphinx
|
||||
|
||||
```
|
||||
@@ -48,6 +48,11 @@ def mw_reset_pwd():
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
if os.geteuid() != 0:
|
||||
print("请使用root账户执行该命令.")
|
||||
sys.exit(1)
|
||||
|
||||
os.chdir("/www/server/mdserver-web")
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
|
||||
|
||||
@@ -388,7 +388,7 @@ def postReceiveLog():
|
||||
def getGogsConf():
|
||||
conf = getConf()
|
||||
if not os.path.exists(conf):
|
||||
return mw.returnJson(False, "请先安装初始化!")
|
||||
return mw.returnJson(False, "请先安装初始化!<br/>默认地址:http://" + mw.getLocalIp() + ":3000")
|
||||
|
||||
gets = [
|
||||
{'name': 'DOMAIN', 'type': -1, 'ps': '服务器域名'},
|
||||
@@ -455,7 +455,7 @@ def userList():
|
||||
|
||||
conf = getConf()
|
||||
if not os.path.exists(conf):
|
||||
return mw.returnJson(False, "请先安装初始化!")
|
||||
return mw.returnJson(False, "请先安装初始化!<br/>默认地址:http://" + mw.getLocalIp() + ":3000")
|
||||
|
||||
import math
|
||||
args = getArgs()
|
||||
|
||||
@@ -45,11 +45,11 @@ skip-name-resolve = on
|
||||
|
||||
log-bin=mysql-bin
|
||||
binlog_format=mixed
|
||||
expire_logs_days = 10
|
||||
slow_query_log=1
|
||||
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
|
||||
long_query_time=3
|
||||
#log_queries_not_using_indexes=on
|
||||
binlog-expire-logs-seconds = 2592000
|
||||
|
||||
relay-log=mdserver
|
||||
relay-log-index=mdserver
|
||||
|
||||
+42
-26
@@ -150,7 +150,7 @@ def pSqliteDb(dbname='databases'):
|
||||
return conn
|
||||
|
||||
|
||||
def pMysqlDb():
|
||||
def pMysqlDb(name=''):
|
||||
# pymysql
|
||||
db = mw.getMyORM()
|
||||
# MySQLdb |
|
||||
@@ -159,6 +159,7 @@ def pMysqlDb():
|
||||
db.setDbConf(getConf())
|
||||
db.setPort(getDbPort())
|
||||
db.setSocket(getSocketFile())
|
||||
db.setDbName(name)
|
||||
|
||||
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
|
||||
db.setPwd(pwd)
|
||||
@@ -631,7 +632,7 @@ def isSqlError(mysqlMsg):
|
||||
|
||||
|
||||
def __createUser(dbname, username, password, address):
|
||||
pdb = pMysqlDb()
|
||||
pdb = pMysqlDb('mysql')
|
||||
|
||||
if username == 'root':
|
||||
dbname = '*'
|
||||
@@ -691,8 +692,8 @@ def importDbBackup():
|
||||
mw.execShell(cmd)
|
||||
|
||||
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
|
||||
|
||||
mysql_cmd = mw.getRootDir() + '/server/mysql/bin/mysql -uroot -p' + pwd + \
|
||||
sock = getSocketFile()
|
||||
mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \
|
||||
' ' + name + ' < ' + file_path_sql
|
||||
|
||||
# print(mysql_cmd)
|
||||
@@ -797,7 +798,7 @@ def syncGetDatabases():
|
||||
if isError != None:
|
||||
return isError
|
||||
users = pdb.query(
|
||||
"select User,Host from mysql.user where User!='root' AND Host!='localhost' AND Host!=''")
|
||||
"select User,Host from user where User!='root' AND Host!='localhost' AND Host!=''")
|
||||
nameArr = ['information_schema', 'performance_schema', 'mysql', 'sys']
|
||||
n = 0
|
||||
|
||||
@@ -893,16 +894,19 @@ def setRootPwd(version=''):
|
||||
|
||||
password = args['password']
|
||||
try:
|
||||
pdb = pMysqlDb()
|
||||
pdb = pMysqlDb('mysql')
|
||||
result = pdb.query("show databases")
|
||||
isError = isSqlError(result)
|
||||
if isError != None:
|
||||
return isError
|
||||
|
||||
result = pdb.execute(
|
||||
"update mysql.user set Password=password('" + password + "') where User='root'")
|
||||
pdb.execute("flush privileges")
|
||||
cmd = "ALTER USER 'root'@'localhost' IDENTIFIED BY '" + password + "';"
|
||||
r = pdb.execute(cmd)
|
||||
# print(r)
|
||||
|
||||
pSqliteDb('config').where('id=?', (1,)).save('mysql_root', (password,))
|
||||
orm = pMysqlDb()
|
||||
orm.execute("flush privileges")
|
||||
return mw.returnJson(True, '数据库root密码修改成功!')
|
||||
except Exception as ex:
|
||||
return mw.returnJson(False, '修改错误:' + str(ex))
|
||||
@@ -910,7 +914,7 @@ def setRootPwd(version=''):
|
||||
|
||||
def setUserPwd(version=''):
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['password', 'name'])
|
||||
data = checkArgs(args, ['password', 'name', 'id'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
@@ -920,16 +924,28 @@ def setUserPwd(version=''):
|
||||
try:
|
||||
pdb = pMysqlDb()
|
||||
psdb = pSqliteDb('databases')
|
||||
name = psdb.where('id=?', (uid,)).getField('name')
|
||||
data = psdb.field('id,name,accept').where('id=?', (uid,)).find()
|
||||
|
||||
result = pdb.execute("update mysql.user set Password=password('" +
|
||||
newpassword + "') where User='" + username + "'")
|
||||
cmd = "SET PASSWORD FOR '" + username + \
|
||||
"'@'localhost' = PASSWORD('" + newpassword + "')"
|
||||
r = pdb.execute(cmd)
|
||||
# print(cmd, r)
|
||||
|
||||
accept = data['accept']
|
||||
alist = accept.split(',')
|
||||
for x in alist:
|
||||
cmd = "SET PASSWORD FOR '" + username + \
|
||||
"'@'" + x + "' = PASSWORD('" + newpassword + "')"
|
||||
r = pdb.execute(cmd)
|
||||
# print(cmd, r)
|
||||
|
||||
pdb.execute("flush privileges")
|
||||
psdb.where("id=?", (uid,)).setField('password', newpassword)
|
||||
return mw.returnJson(True, mw.getInfo('修改数据库[{1}]密码成功!', (name,)))
|
||||
|
||||
orm = pMysqlDb()
|
||||
orm.execute("flush privileges")
|
||||
return mw.returnJson(True, mw.getInfo('修改数据库[{1}]密码成功!', (data['name'],)))
|
||||
except Exception as ex:
|
||||
return mw.returnJson(False, mw.getInfo('修改数据库[{1}]密码失败[{2}]!', (name, str(ex),)))
|
||||
return mw.returnJson(False, mw.getInfo('修改数据库[{1}]密码失败[{2}]!', (data['name'], str(ex),)))
|
||||
|
||||
|
||||
def setDbPs():
|
||||
@@ -1022,7 +1038,7 @@ def delDb():
|
||||
id = args['id']
|
||||
name = args['name']
|
||||
psdb = pSqliteDb('databases')
|
||||
pdb = pMysqlDb()
|
||||
pdb = pMysqlDb('mysql')
|
||||
find = psdb.where("id=?", (id,)).field(
|
||||
'id,pid,name,username,password,accept,ps,addtime').find()
|
||||
accept = find['accept']
|
||||
@@ -1031,7 +1047,7 @@ def delDb():
|
||||
# 删除MYSQL
|
||||
result = pdb.execute("drop database `" + name + "`")
|
||||
|
||||
users = pdb.query("select Host from mysql.user where User='" +
|
||||
users = pdb.query("select Host from user where User='" +
|
||||
username + "' AND Host!='localhost'")
|
||||
pdb.execute("drop user '" + username + "'@'localhost'")
|
||||
for us in users:
|
||||
@@ -1051,9 +1067,9 @@ def getDbAccess():
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
username = args['username']
|
||||
pdb = pMysqlDb()
|
||||
pdb = pMysqlDb('mysql')
|
||||
|
||||
users = pdb.query("select Host from mysql.user where User='" +
|
||||
users = pdb.query("select Host from user where User='" +
|
||||
username + "' AND Host!='localhost'")
|
||||
|
||||
if len(users) < 1:
|
||||
@@ -1072,7 +1088,7 @@ def setDbAccess():
|
||||
return data[1]
|
||||
name = args['username']
|
||||
access = args['access']
|
||||
pdb = pMysqlDb()
|
||||
pdb = pMysqlDb('mysql')
|
||||
psdb = pSqliteDb('databases')
|
||||
|
||||
dbname = psdb.where('username=?', (name,)).getField('name')
|
||||
@@ -1083,7 +1099,7 @@ def setDbAccess():
|
||||
else:
|
||||
password = psdb.where("username=?", (name,)).getField('password')
|
||||
|
||||
users = pdb.query("select Host from mysql.user where User='" +
|
||||
users = pdb.query("select Host from user where User='" +
|
||||
name + "' AND Host!='localhost'")
|
||||
|
||||
for us in users:
|
||||
@@ -1105,11 +1121,11 @@ def setDbRw(version=''):
|
||||
uid = args['id']
|
||||
rw = args['rw']
|
||||
|
||||
pdb = pMysqlDb()
|
||||
pdb = pMysqlDb('mysql')
|
||||
psdb = pSqliteDb('databases')
|
||||
dbname = psdb.where("id=?", (uid,)).getField('name')
|
||||
users = pdb.query(
|
||||
"select Host from mysql.user where User='" + username + "'")
|
||||
"select Host from user where User='" + username + "'")
|
||||
|
||||
# show grants for demo@"127.0.0.1";
|
||||
for x in users:
|
||||
@@ -1374,7 +1390,7 @@ def setDbMasterAccess():
|
||||
pdb = pMysqlDb()
|
||||
psdb = pSqliteDb('master_replication_user')
|
||||
password = psdb.where("username=?", (username,)).getField('password')
|
||||
users = pdb.query("select Host from mysql.user where User='" +
|
||||
users = pdb.query("select Host from user where User='" +
|
||||
username + "' AND Host!='localhost'")
|
||||
for us in users:
|
||||
pdb.execute("drop user '" + username + "'@'" + us["Host"] + "'")
|
||||
@@ -1706,7 +1722,7 @@ def delMasterRepSlaveUser(version=''):
|
||||
pdb.execute("drop user '" + name + "'@'%'")
|
||||
pdb.execute("drop user '" + name + "'@'localhost'")
|
||||
|
||||
users = pdb.query("select Host from mysql.user where User='" +
|
||||
users = pdb.query("select Host from user where User='" +
|
||||
name + "' AND Host!='localhost'")
|
||||
for us in users:
|
||||
pdb.execute("drop user '" + name + "'@'" + us["Host"] + "'")
|
||||
|
||||
@@ -445,10 +445,9 @@ function syncToDatabase(type){
|
||||
|
||||
function setRootPwd(type, pwd){
|
||||
if (type==1){
|
||||
var data = $("#mod_pwd").serialize();
|
||||
myPost('set_root_pwd', data, function(data){
|
||||
var password = $("#MyPassword").val();
|
||||
myPost('set_root_pwd', {password:password}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
// console.log(rdata);
|
||||
showMsg(rdata.msg,function(){
|
||||
dbList();
|
||||
$('.layui-layer-close1').click();
|
||||
@@ -459,26 +458,23 @@ function setRootPwd(type, pwd){
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
skin: 'demo-class',
|
||||
area: '500px',
|
||||
title: '修改数据库密码',
|
||||
closeBtn: 1,
|
||||
shift: 5,
|
||||
btn:["提交","关闭"],
|
||||
shadeClose: true,
|
||||
content: "<form class='bt-form pd20 pb70' id='mod_pwd'>\
|
||||
content: "<form class='bt-form pd20' id='mod_pwd'>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>root密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+pwd+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
</div>\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button id='my_mod_close' type='button' class='btn btn-danger btn-sm btn-title'>关闭</button>\
|
||||
<button type='button' class='btn btn-success btn-sm btn-title' onclick=\"setRootPwd(1)\" >提交</button>\
|
||||
<span class='tname'>root密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+pwd+"' />\
|
||||
<span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span>\
|
||||
</div>\
|
||||
</div>\
|
||||
</form>",
|
||||
});
|
||||
|
||||
$('#my_mod_close').click(function(){
|
||||
$('.layui-layer-close1').click();
|
||||
yes:function(){
|
||||
setRootPwd(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -632,12 +628,17 @@ function setDbPass(id, username, password){
|
||||
</div>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
<div class='info-r'>\
|
||||
<input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' />\
|
||||
<span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
</div>\
|
||||
<input type='hidden' name='id' value='"+id+"'>\
|
||||
</form>",
|
||||
yes:function(index){
|
||||
var data = $("#mod_pwd").serialize();
|
||||
var data = {};
|
||||
data['name'] = $('input[name=name]').val();
|
||||
data['password'] = $('#MyPassword').val();
|
||||
data['id'] = $('input[name=id]').val();
|
||||
myPost('set_user_pwd', data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
showMsg(rdata.msg,function(){
|
||||
@@ -809,7 +810,14 @@ function openPhpmyadmin(name,username,password){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
// console.log(data);
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose != 'mariadb'){
|
||||
layer.msg('当前为['+rdata.choose+']模式,若要使用请切换模式.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
|
||||
@@ -71,10 +71,15 @@ Install_app()
|
||||
if [ "$sysName" == "Darwin" ];then
|
||||
OPTIONS='-DPLUGIN_TOKUDB=NO'
|
||||
fi
|
||||
|
||||
|
||||
INSTALL_CMD=cmake
|
||||
CMAKE3=`which cmake3`
|
||||
if [ "$?" == "0" ];then
|
||||
INSTALL_CMD=cmake3
|
||||
fi
|
||||
|
||||
if [ ! -d $serverPath/mariadb ];then
|
||||
cd ${mariadbDir}/mariadb-${MY_VER} && cmake \
|
||||
cd ${mariadbDir}/mariadb-${MY_VER} && $INSTALL_CMD \
|
||||
-DCMAKE_INSTALL_PREFIX=$serverPath/mariadb \
|
||||
-DMYSQL_DATADIR=$serverPath/mariadb/data/ \
|
||||
-DMYSQL_USER=mysql \
|
||||
|
||||
@@ -86,7 +86,7 @@ Install_app()
|
||||
make -j${cpuCore} && make install && make clean
|
||||
|
||||
if [ -d $serverPath/mariadb ];then
|
||||
echo '10.7' > $serverPath/mariadb/version.pl
|
||||
echo '10.8' > $serverPath/mariadb/version.pl
|
||||
echo '安装完成' > $install_tmp
|
||||
else
|
||||
# rm -rf ${mariadbDir}/mariadb-${MY_VER}
|
||||
|
||||
@@ -1,97 +0,0 @@
|
||||
[client]
|
||||
user = root
|
||||
#password = your_password
|
||||
port = 3376
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
default-character-set = UTF8MB4
|
||||
|
||||
[mysqld]
|
||||
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
|
||||
user = mysql
|
||||
port = 3376
|
||||
mysqlx_port = 33760
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
datadir = {$SERVER_APP_PATH}/data
|
||||
log-error = {$SERVER_APP_PATH}/data/error.log
|
||||
default_storage_engine = MyISAM
|
||||
|
||||
key_buffer_size = 8M
|
||||
table_open_cache = 32
|
||||
sort_buffer_size = 256K
|
||||
net_buffer_length = 4K
|
||||
read_buffer_size = 128K
|
||||
read_rnd_buffer_size = 256K
|
||||
myisam_sort_buffer_size = 4M
|
||||
thread_cache_size = 4
|
||||
lower_case_table_names=0
|
||||
tmp_table_size = 8M
|
||||
character-set-server = UTF8MB4
|
||||
|
||||
max_connections = 500
|
||||
max_connect_errors = 100
|
||||
open_files_limit = 2560
|
||||
max_allowed_packet = 128M
|
||||
|
||||
#skip-external-locking
|
||||
#skip-grant-tables
|
||||
#loose-skip-innodb
|
||||
#skip-networking
|
||||
#skip-name-resolve
|
||||
|
||||
log-bin=mysql-bin
|
||||
binlog_format=mixed
|
||||
server-id = 1
|
||||
slow_query_log=1
|
||||
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
|
||||
long_query_time=3
|
||||
#log_queries_not_using_indexes=on
|
||||
|
||||
relay-log=mdserver
|
||||
relay-log-index=mdserver
|
||||
|
||||
#master
|
||||
#binlog-do-db
|
||||
binlog-ignore-db = test
|
||||
binlog-ignore-db = mysql
|
||||
binlog-ignore-db = information_schema
|
||||
binlog-ignore-db = performance_schema
|
||||
|
||||
#slave
|
||||
log-slave-updates
|
||||
#replicate-do-db
|
||||
replicate-ignore-db = information_schema
|
||||
replicate-ignore-db = performance_schema
|
||||
replicate-ignore-db = mysql
|
||||
replicate-ignore-db = test
|
||||
|
||||
default_storage_engine = InnoDB
|
||||
innodb_data_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_data_file_path = ibdata1:10M:autoextend
|
||||
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_buffer_pool_size = 16M
|
||||
innodb_log_file_size = 5M
|
||||
innodb_log_buffer_size = 8M
|
||||
innodb_flush_log_at_trx_commit = 1
|
||||
innodb_lock_wait_timeout = 120
|
||||
innodb_max_dirty_pages_pct = 90
|
||||
innodb_read_io_threads = 1
|
||||
innodb_write_io_threads = 1
|
||||
innodb_file_per_table=1
|
||||
binlog_expire_logs_seconds=2592000
|
||||
|
||||
secure-file-priv={$SERVER_APP_PATH}/tmp
|
||||
|
||||
[mysqldump]
|
||||
quick
|
||||
|
||||
[mysql]
|
||||
no-auto-rehash
|
||||
|
||||
[myisamchk]
|
||||
key_buffer_size = 20M
|
||||
sort_buffer_size = 20M
|
||||
read_buffer = 2M
|
||||
write_buffer = 2M
|
||||
|
||||
[mysqlhotcopy]
|
||||
interactive-timeout
|
||||
@@ -1,98 +0,0 @@
|
||||
[client]
|
||||
user = root
|
||||
#password = your_password
|
||||
port = 3386
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
default-character-set = UTF8MB4
|
||||
|
||||
[mysqld]
|
||||
default_authentication_plugin=mysql_native_password
|
||||
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
|
||||
user = mysql
|
||||
port = 3386
|
||||
mysqlx_port = 33860
|
||||
socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
datadir = {$SERVER_APP_PATH}/data
|
||||
log-error = {$SERVER_APP_PATH}/data/error.log
|
||||
default_storage_engine = MyISAM
|
||||
|
||||
key_buffer_size = 8M
|
||||
table_open_cache = 32
|
||||
sort_buffer_size = 256K
|
||||
net_buffer_length = 4K
|
||||
read_buffer_size = 128K
|
||||
read_rnd_buffer_size = 256K
|
||||
myisam_sort_buffer_size = 4M
|
||||
thread_cache_size = 4
|
||||
lower_case_table_names=0
|
||||
tmp_table_size = 8M
|
||||
character-set-server = UTF8MB4
|
||||
|
||||
max_connections = 500
|
||||
max_connect_errors = 100
|
||||
open_files_limit = 2560
|
||||
max_allowed_packet = 128M
|
||||
|
||||
#skip-external-locking
|
||||
#skip-grant-tables
|
||||
#loose-skip-innodb
|
||||
#skip-networking
|
||||
#skip-name-resolve
|
||||
|
||||
log-bin=mysql-bin
|
||||
binlog_format=mixed
|
||||
server-id = 1
|
||||
slow_query_log=1
|
||||
slow-query-log-file={$SERVER_APP_PATH}/data/mysql-slow.log
|
||||
long_query_time=3
|
||||
#log_queries_not_using_indexes=on
|
||||
|
||||
relay-log=mdserver
|
||||
relay-log-index=mdserver
|
||||
|
||||
#master
|
||||
#binlog-do-db
|
||||
binlog-ignore-db = test
|
||||
binlog-ignore-db = mysql
|
||||
binlog-ignore-db = information_schema
|
||||
binlog-ignore-db = performance_schema
|
||||
|
||||
#slave
|
||||
log_replica_updates
|
||||
#replicate-do-db
|
||||
replicate-ignore-db = information_schema
|
||||
replicate-ignore-db = performance_schema
|
||||
replicate-ignore-db = mysql
|
||||
replicate-ignore-db = test
|
||||
|
||||
default_storage_engine = InnoDB
|
||||
innodb_data_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_data_file_path = ibdata1:10M:autoextend
|
||||
innodb_log_group_home_dir = {$SERVER_APP_PATH}/data
|
||||
innodb_buffer_pool_size = 16M
|
||||
innodb_log_file_size = 5M
|
||||
innodb_log_buffer_size = 8M
|
||||
innodb_flush_log_at_trx_commit = 1
|
||||
innodb_lock_wait_timeout = 120
|
||||
innodb_max_dirty_pages_pct = 90
|
||||
innodb_read_io_threads = 1
|
||||
innodb_write_io_threads = 1
|
||||
innodb_file_per_table=1
|
||||
binlog_expire_logs_seconds=2592000
|
||||
|
||||
secure-file-priv={$SERVER_APP_PATH}/tmp
|
||||
|
||||
[mysqldump]
|
||||
quick
|
||||
|
||||
[mysql]
|
||||
no-auto-rehash
|
||||
|
||||
[myisamchk]
|
||||
key_buffer_size = 20M
|
||||
sort_buffer_size = 20M
|
||||
read_buffer = 2M
|
||||
write_buffer = 2M
|
||||
|
||||
[mysqlhotcopy]
|
||||
interactive-timeout
|
||||
@@ -1,28 +0,0 @@
|
||||
CREATE TABLE IF NOT EXISTS `config` (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`mysql_root` TEXT
|
||||
);
|
||||
|
||||
INSERT INTO `config` (`id`, `mysql_root`) VALUES (1, 'admin');
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `databases` (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`pid` INTEGER,
|
||||
`name` TEXT,
|
||||
`username` TEXT,
|
||||
`password` TEXT,
|
||||
`accept` TEXT,
|
||||
`ps` TEXT,
|
||||
`addtime` TEXT
|
||||
);
|
||||
|
||||
CREATE TABLE IF NOT EXISTS `master_replication_user` (
|
||||
`id` INTEGER PRIMARY KEY AUTOINCREMENT,
|
||||
`username` TEXT,
|
||||
`password` TEXT,
|
||||
`accept` TEXT,
|
||||
`ps` TEXT,
|
||||
`addtime` TEXT
|
||||
);
|
||||
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.1 KiB |
@@ -1,58 +0,0 @@
|
||||
<div class="bt-form">
|
||||
<div class='plugin_version'></div>
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<script type="text/javascript">console.log($('.plugin_version').attr('version'));</script>
|
||||
<p class="bgw" onclick="pluginService('mysql-yum', $('.plugin_version').attr('version'));">服务</p>
|
||||
<p onclick="pluginInitD('mysql-yum', $('.plugin_version').attr('version'));">自启动</p>
|
||||
<p onclick="pluginConfig('mysql-yum', $('.plugin_version').attr('version'));">配置文件</p>
|
||||
<p onclick="myDbPos();">存储位置</p>
|
||||
<p onclick="myPort();">端口</p>
|
||||
<p onclick="runInfo();">当前状态</p>
|
||||
<p onclick="myPerfOpt();">性能优化</p>
|
||||
<p onclick="myLogs();">日志</p>
|
||||
<p onclick="pluginLogs('mysql-yum',$('.plugin_version').attr('version'),'error_log');">错误日志</p>
|
||||
<p onclick="pluginLogs('mysql-yum',$('.plugin_version').attr('version'),'show_log');">慢日志</p>
|
||||
<p onclick="dbList()">管理列表</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con"></div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
|
||||
|
||||
<style type="text/css">
|
||||
.db_list{
|
||||
padding: 0px 0 10px 0;
|
||||
font-size: 13px;
|
||||
line-height: 35px;
|
||||
height: 45px;
|
||||
}
|
||||
.db_list a{
|
||||
margin-right: 15px;
|
||||
color: #555;
|
||||
font-weight: 600;
|
||||
}
|
||||
.db_list span:nth-child(1){
|
||||
display: block;
|
||||
float: left;
|
||||
padding-left: 15px;
|
||||
background: #ececec;
|
||||
border-radius: 3px;
|
||||
}
|
||||
|
||||
#db_tools button {
|
||||
margin-right: 10px;
|
||||
}
|
||||
#db_tools button:last-child{
|
||||
margin-right: 0;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript">
|
||||
resetPluginWinWidth(800);
|
||||
$.getScript( "/plugins/file?name=mysql-yum&f=js/mysql-yum.js", function(){
|
||||
pluginService('mysql-yum',$('.plugin_version').attr('version'));
|
||||
});
|
||||
</script>
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,17 +0,0 @@
|
||||
{
|
||||
"title":"MySQL[YUM]",
|
||||
"tip":"soft",
|
||||
"name":"mysql-yum",
|
||||
"type":"运行环境",
|
||||
"ps":"一种关系数据库管理系统(极速安装)[YUM]!",
|
||||
"todo_versions":["5.7","8.0"],
|
||||
"versions":["5.7","8.0"],
|
||||
"shell":"install.sh",
|
||||
"install_pre_inspection":true,
|
||||
"checks":"server/mysql-yum",
|
||||
"path":"server/mysql-yum",
|
||||
"author":"mysql",
|
||||
"home":"https://dev.mysql.com/downloads/mysql",
|
||||
"date":"2022-06-29",
|
||||
"pid": "6"
|
||||
}
|
||||
@@ -1,63 +0,0 @@
|
||||
# It's not recommended to modify this file in-place, because it will be
|
||||
# overwritten during package upgrades. If you want to customize, the
|
||||
# best way is to use systemctl edit:
|
||||
#
|
||||
# $ systemctl edit mysqld.service
|
||||
#
|
||||
# this will create file
|
||||
#
|
||||
# /etc/systemd/system/mysqld.service.d/override.conf
|
||||
#
|
||||
# which be parsed after the file mysqld.service itself is parsed.
|
||||
#
|
||||
# For example, if you want to increase mysql's open-files-limit to 20000
|
||||
# add following when editing with command above:
|
||||
#
|
||||
# [Service]
|
||||
# LimitNOFILE=20000
|
||||
#
|
||||
# Or if you require to execute pre and post scripts in the unit file as root, set
|
||||
# PermissionsStartOnly=true
|
||||
#
|
||||
# For more info about custom unit files, see systemd.unit(5) or
|
||||
# http://fedoraproject.org/wiki/Systemd#How_do_I_customize_a_unit_file.2F_add_a_custom_unit_file.3F
|
||||
#
|
||||
# Don't forget to reload systemd daemon after you change unit configuration:
|
||||
# root> systemctl --system daemon-reload
|
||||
|
||||
[Unit]
|
||||
Description=MySQL 8.0 database server
|
||||
After=syslog.target
|
||||
After=network.target
|
||||
|
||||
[Service]
|
||||
Type=notify
|
||||
User=mysql
|
||||
Group=mysql
|
||||
|
||||
ExecStartPre=/usr/libexec/mysql-check-socket
|
||||
ExecStartPre=/usr/libexec/mysql-prepare-db-dir %n
|
||||
# Note: we set --basedir to prevent probes that might trigger SELinux alarms,
|
||||
# per bug #547485
|
||||
ExecStart=/usr/libexec/mysqld --defaults-file={$SERVER_PATH}/mysql-ya/etc/my.cnf --basedir=/usr --user=mysql
|
||||
ExecStartPost=/usr/libexec/mysql-check-upgrade
|
||||
ExecStopPost=/usr/libexec/mysql-wait-stop
|
||||
|
||||
# Give a reasonable amount of time for the server to start up/shut down
|
||||
TimeoutSec=300
|
||||
|
||||
# Place temp files in a secure directory, not /tmp
|
||||
PrivateTmp=false
|
||||
|
||||
Restart=on-failure
|
||||
|
||||
RestartPreventExitStatus=1
|
||||
|
||||
# Sets open_files_limit
|
||||
LimitNOFILE = 10000
|
||||
|
||||
# Set enviroment variable MYSQLD_PARENT_PID. This is required for SQL restart command.
|
||||
Environment=MYSQLD_PARENT_PID=1
|
||||
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
@@ -1,46 +0,0 @@
|
||||
#!/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")
|
||||
|
||||
|
||||
# cd /www/server/mdserver-web/plugins/mysql-yum && bash install.sh install 8.0
|
||||
# cd /www/server/mdserver-web/plugins/mysql-yum && bash install.sh uninstall 8.0
|
||||
# cd /www/server/mdserver-web && python3 /www/server/mdserver-web/plugins/mysql-yum/index.py start 8.0
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
|
||||
|
||||
action=$1
|
||||
type=$2
|
||||
|
||||
|
||||
|
||||
if [ "${2}" == "" ];then
|
||||
echo '缺少安装脚本...' > $install_tmp
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ ! -d $curPath/versions/$2 ];then
|
||||
echo '缺少安装脚本2...' > $install_tmp
|
||||
exit 0
|
||||
fi
|
||||
|
||||
if [ "${action}" == "uninstall" ];then
|
||||
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mysql-yum/index.py stop ${type}
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mysql-yum/index.py initd_uninstall ${type}
|
||||
cd $curPath
|
||||
fi
|
||||
|
||||
sh -x $curPath/versions/$2/install.sh $1
|
||||
|
||||
if [ "${action}" == "install" ];then
|
||||
# #初始化
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mysql-yum/index.py start ${type}
|
||||
cd ${rootPath} && python3 ${rootPath}/plugins/mysql-yum/index.py initd_install ${type}
|
||||
fi
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,119 +0,0 @@
|
||||
# coding: utf-8
|
||||
#-----------------------------
|
||||
# 网站备份工具
|
||||
#-----------------------------
|
||||
|
||||
import sys
|
||||
import os
|
||||
|
||||
if sys.platform != 'darwin':
|
||||
os.chdir('/www/server/mdserver-web')
|
||||
|
||||
|
||||
chdir = os.getcwd()
|
||||
sys.path.append(chdir + '/class/core')
|
||||
|
||||
# reload(sys)
|
||||
# sys.setdefaultencoding('utf-8')
|
||||
|
||||
|
||||
import mw
|
||||
import db
|
||||
import time
|
||||
|
||||
|
||||
class backupTools:
|
||||
|
||||
def backupDatabase(self, name, count):
|
||||
db_path = mw.getServerDir() + '/mysql-ya'
|
||||
db_name = 'mysql'
|
||||
name = mw.M('databases').dbPos(db_path, 'mysql').where(
|
||||
'name=?', (name,)).getField('name')
|
||||
startTime = time.time()
|
||||
if not name:
|
||||
endDate = time.strftime('%Y/%m/%d %X', time.localtime())
|
||||
log = "数据库[" + name + "]不存在!"
|
||||
print("★[" + endDate + "] " + log)
|
||||
print(
|
||||
"----------------------------------------------------------------------------")
|
||||
return
|
||||
|
||||
backup_path = mw.getRootDir() + '/backup/database'
|
||||
if not os.path.exists(backup_path):
|
||||
mw.execShell("mkdir -p " + backup_path)
|
||||
|
||||
filename = backup_path + "/db_" + name + "_" + \
|
||||
time.strftime('%Y%m%d_%H%M%S', time.localtime()) + ".sql.gz"
|
||||
|
||||
import re
|
||||
mysql_root = mw.M('config').dbPos(db_path, db_name).where(
|
||||
"id=?", (1,)).getField('mysql_root')
|
||||
|
||||
mycnf = mw.readFile(db_path + '/etc/my.cnf')
|
||||
rep = "\[mysqldump\]\nuser=root"
|
||||
sea = "[mysqldump]\n"
|
||||
subStr = sea + "user=root\npassword=" + mysql_root + "\n"
|
||||
mycnf = mycnf.replace(sea, subStr)
|
||||
if len(mycnf) > 100:
|
||||
mw.writeFile(db_path + '/etc/my.cnf', mycnf)
|
||||
|
||||
mw.execShell(
|
||||
db_path + "/bin/mysqldump --opt --default-character-set=utf8 " + name + " | gzip > " + filename)
|
||||
|
||||
if not os.path.exists(filename):
|
||||
endDate = time.strftime('%Y/%m/%d %X', time.localtime())
|
||||
log = "数据库[" + name + "]备份失败!"
|
||||
print("★[" + endDate + "] " + log)
|
||||
print(
|
||||
"----------------------------------------------------------------------------")
|
||||
return
|
||||
|
||||
mycnf = mw.readFile(db_path + '/etc/my.cnf')
|
||||
mycnf = mycnf.replace(subStr, sea)
|
||||
if len(mycnf) > 100:
|
||||
mw.writeFile(db_path + '/etc/my.cnf', mycnf)
|
||||
|
||||
endDate = time.strftime('%Y/%m/%d %X', time.localtime())
|
||||
outTime = time.time() - startTime
|
||||
pid = mw.M('databases').dbPos(db_path, db_name).where(
|
||||
'name=?', (name,)).getField('id')
|
||||
|
||||
mw.M('backup').add('type,name,pid,filename,addtime,size', (1, os.path.basename(
|
||||
filename), pid, filename, endDate, os.path.getsize(filename)))
|
||||
log = "数据库[" + name + "]备份成功,用时[" + str(round(outTime, 2)) + u"]秒"
|
||||
mw.writeLog('计划任务', log)
|
||||
print("★[" + endDate + "] " + log)
|
||||
print("|---保留最新的[" + count + "]份备份")
|
||||
print("|---文件名:" + filename)
|
||||
|
||||
# 清理多余备份
|
||||
backups = mw.M('backup').where(
|
||||
'type=? and pid=?', ('1', pid)).field('id,filename').select()
|
||||
|
||||
num = len(backups) - int(count)
|
||||
if num > 0:
|
||||
for backup in backups:
|
||||
mw.execShell("rm -f " + backup['filename'])
|
||||
mw.M('backup').where('id=?', (backup['id'],)).delete()
|
||||
num -= 1
|
||||
print("|---已清理过期备份文件:" + backup['filename'])
|
||||
if num < 1:
|
||||
break
|
||||
|
||||
def backupDatabaseAll(self, save):
|
||||
db_path = mw.getServerDir() + '/mysql-ya'
|
||||
db_name = 'mysql'
|
||||
databases = mw.M('databases').dbPos(
|
||||
db_path, db_name).field('name').select()
|
||||
for database in databases:
|
||||
self.backupDatabase(database['name'], save)
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
backup = backupTools()
|
||||
type = sys.argv[1]
|
||||
if type == 'database':
|
||||
if sys.argv[2] == 'ALL':
|
||||
backup.backupDatabaseAll(sys.argv[3])
|
||||
else:
|
||||
backup.backupDatabase(sys.argv[2], sys.argv[3])
|
||||
@@ -1,119 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/bin/bash
|
||||
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
#https://dev.mysql.com/downloads/mysql/5.7.html
|
||||
#https://dev.mysql.com/downloads/file/?id=489855
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sysName=`uname`
|
||||
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mysqlDir=${serverPath}/source/mysql
|
||||
|
||||
|
||||
_os=`uname`
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
|
||||
OSNAME='aliyun'
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
elif grep -Eqi "Amazon Linux AMI" /etc/issue || grep -Eq "Amazon Linux AMI" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
elif grep -Eqi "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
|
||||
OSNAME='deepin'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
|
||||
|
||||
YUM_INSTALL()
|
||||
{
|
||||
#######
|
||||
#http://repo.mysql.com/
|
||||
|
||||
if [ "${OSNAME}" == "centos" ] && [ "${VERSION_ID}" -le "7" ] ;then
|
||||
wget -O /tmp/mysql57-community-release-el${VERSION_ID}.rpm http://repo.mysql.com/mysql57-community-release-el${VERSION_ID}.rpm
|
||||
rpm -ivh /tmp/mysql57-community-release-el${VERSION_ID}.rpm
|
||||
yum -y install mysql-server
|
||||
rm -rf /tmp/mysql57-community-release-el${VERSION_ID}.rpm
|
||||
fi
|
||||
#######
|
||||
}
|
||||
|
||||
YUM_UNINSTALL()
|
||||
{
|
||||
### YUM卸载 START ########
|
||||
yum remove -y mysql-server
|
||||
### YUM卸载 END ########
|
||||
}
|
||||
|
||||
|
||||
|
||||
Install_mysql()
|
||||
{
|
||||
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
if id mysql &> /dev/null ;then
|
||||
echo "mysql UID is `id -u mysql`"
|
||||
echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
|
||||
else
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
fi
|
||||
|
||||
isYum=`which yum`
|
||||
if [ "$isYum" != "" ];then
|
||||
YUM_INSTALL
|
||||
fi
|
||||
|
||||
if [ "$?" == "0" ];then
|
||||
mkdir -p $serverPath/mysql-yum
|
||||
echo '5.7' > $serverPath/mysql-yum/version.pl
|
||||
echo '安装完成' > $install_tmp
|
||||
else
|
||||
echo "暂时不支持该系统" > $install_tmp
|
||||
fi
|
||||
}
|
||||
|
||||
Uninstall_mysql()
|
||||
{
|
||||
isYum=`which yum`
|
||||
if [ "$isYum" != "" ];then
|
||||
YUM_UNINSTALL
|
||||
fi
|
||||
|
||||
|
||||
rm -rf $serverPath/mysql-yum
|
||||
echo '卸载完成' > $install_tmp
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_mysql
|
||||
else
|
||||
Uninstall_mysql
|
||||
fi
|
||||
@@ -1,121 +0,0 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
#!/bin/bash
|
||||
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
|
||||
#https://dev.mysql.com/downloads/mysql/5.7.html
|
||||
#https://dev.mysql.com/downloads/file/?id=489855
|
||||
|
||||
curPath=`pwd`
|
||||
rootPath=$(dirname "$curPath")
|
||||
rootPath=$(dirname "$rootPath")
|
||||
serverPath=$(dirname "$rootPath")
|
||||
sysName=`uname`
|
||||
|
||||
|
||||
install_tmp=${rootPath}/tmp/mw_install.pl
|
||||
mysqlDir=${serverPath}/source/mysql
|
||||
|
||||
|
||||
_os=`uname`
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
elif grep -Eqi "Red Hat Enterprise Linux Server" /etc/issue || grep -Eq "Red Hat Enterprise Linux Server" /etc/*-release; then
|
||||
OSNAME='rhel'
|
||||
elif grep -Eqi "Aliyun" /etc/issue || grep -Eq "Aliyun" /etc/*-release; then
|
||||
OSNAME='aliyun'
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
elif grep -Eqi "Amazon Linux AMI" /etc/issue || grep -Eq "Amazon Linux AMI" /etc/*-release; then
|
||||
OSNAME='amazon'
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
elif grep -Eqi "Deepin" /etc/issue || grep -Eq "Deepin" /etc/*-release; then
|
||||
OSNAME='deepin'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
|
||||
|
||||
YUM_INSTALL()
|
||||
{
|
||||
#######
|
||||
|
||||
if [ "${OSNAME}" == "centos" ];then
|
||||
wget -O /tmp/mysql80-community-release.rpm http://repo.mysql.com/mysql80-community-release-el${VERSION}.rpm
|
||||
else
|
||||
wget -O /tmp/mysql80-community-release.rpm http://repo.mysql.com/mysql80-community-release-el8.rpm
|
||||
fi
|
||||
rpm -ivh /tmp/mysql80-community-release.rpm
|
||||
yum -y install mysql-server
|
||||
|
||||
rm -rf /tmp/mysql80-community-release.rpm
|
||||
#######
|
||||
}
|
||||
|
||||
YUM_UNINSTALL()
|
||||
{
|
||||
### YUM卸载 START ########
|
||||
yum -y remove mysql-server
|
||||
### YUM卸载 END ########
|
||||
}
|
||||
|
||||
|
||||
Install_mysql()
|
||||
{
|
||||
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
if id mysql &> /dev/null ;then
|
||||
echo "mysql UID is `id -u mysql`"
|
||||
echo "mysql Shell is `grep "^mysql:" /etc/passwd |cut -d':' -f7 `"
|
||||
else
|
||||
groupadd mysql
|
||||
useradd -g mysql mysql
|
||||
fi
|
||||
|
||||
isYum=`which yum`
|
||||
if [ "$isYum" != "" ];then
|
||||
YUM_INSTALL
|
||||
fi
|
||||
|
||||
|
||||
if [ "$?" == "0" ];then
|
||||
mkdir -p $serverPath/mysql-yum
|
||||
echo '8.0' > $serverPath/mysql-yum/version.pl
|
||||
echo '安装完成' > $install_tmp
|
||||
else
|
||||
echo "暂时不支持该系统" > $install_tmp
|
||||
fi
|
||||
}
|
||||
|
||||
Uninstall_mysql()
|
||||
{
|
||||
isYum=`which yum`
|
||||
if [ "$isYum" != "" ];then
|
||||
YUM_UNINSTALL
|
||||
fi
|
||||
|
||||
|
||||
rm -rf $serverPath/mysql-ya
|
||||
echo '卸载完成' > $install_tmp
|
||||
}
|
||||
|
||||
action=$1
|
||||
if [ "${1}" == 'install' ];then
|
||||
Install_mysql
|
||||
else
|
||||
Uninstall_mysql
|
||||
fi
|
||||
@@ -7,8 +7,8 @@ socket = {$SERVER_APP_PATH}/mysql.sock
|
||||
[mysqld]
|
||||
!include {$SERVER_APP_PATH}/etc/mode/classic.cnf
|
||||
|
||||
sha256_password_private_key_path=mysql.pem
|
||||
sha256_password_public_key_path=mysql.pub
|
||||
;sha256_password_private_key_path=mysql.pem
|
||||
;sha256_password_public_key_path=mysql.pub
|
||||
|
||||
pid-file = {$SERVER_APP_PATH}/data/mysql.pid
|
||||
user = mysql
|
||||
|
||||
@@ -821,8 +821,8 @@ def importDbBackup():
|
||||
mw.execShell(cmd)
|
||||
|
||||
pwd = pSqliteDb('config').where('id=?', (1,)).getField('mysql_root')
|
||||
|
||||
mysql_cmd = mw.getRootDir() + '/server/mysql/bin/mysql -uroot -p' + pwd + \
|
||||
sock = getSocketFile()
|
||||
mysql_cmd = getServerDir() + '/bin/mysql -S ' + sock + ' -uroot -p' + pwd + \
|
||||
' ' + name + ' < ' + file_path_sql
|
||||
|
||||
# print(mysql_cmd)
|
||||
@@ -2421,7 +2421,7 @@ if __name__ == "__main__":
|
||||
print(getDbAccess())
|
||||
elif func == 'set_db_access':
|
||||
print(setDbAccess())
|
||||
elif func == 'get_db_rw':
|
||||
elif func == 'set_db_rw':
|
||||
print(setDbRw(version))
|
||||
elif func == 'set_db_ps':
|
||||
print(setDbPs())
|
||||
|
||||
+28
-18
@@ -445,10 +445,9 @@ function syncToDatabase(type){
|
||||
|
||||
function setRootPwd(type, pwd){
|
||||
if (type==1){
|
||||
var data = $("#mod_pwd").serialize();
|
||||
myPost('set_root_pwd', data, function(data){
|
||||
var password = $("#MyPassword").val();
|
||||
myPost('set_root_pwd', {password:password}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
// console.log(rdata);
|
||||
showMsg(rdata.msg,function(){
|
||||
dbList();
|
||||
$('.layui-layer-close1').click();
|
||||
@@ -459,26 +458,23 @@ function setRootPwd(type, pwd){
|
||||
|
||||
var index = layer.open({
|
||||
type: 1,
|
||||
skin: 'demo-class',
|
||||
area: '500px',
|
||||
title: '修改数据库密码',
|
||||
closeBtn: 1,
|
||||
shift: 5,
|
||||
btn:["提交","关闭"],
|
||||
shadeClose: true,
|
||||
content: "<form class='bt-form pd20 pb70' id='mod_pwd'>\
|
||||
content: "<form class='bt-form pd20' id='mod_pwd'>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>root密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+pwd+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
</div>\
|
||||
<div class='bt-form-submit-btn'>\
|
||||
<button id='my_mod_close' type='button' class='btn btn-danger btn-sm btn-title'>关闭</button>\
|
||||
<button type='button' class='btn btn-success btn-sm btn-title' onclick=\"setRootPwd(1)\" >提交</button>\
|
||||
<span class='tname'>root密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+pwd+"' />\
|
||||
<span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span>\
|
||||
</div>\
|
||||
</div>\
|
||||
</form>",
|
||||
});
|
||||
|
||||
$('#my_mod_close').click(function(){
|
||||
$('.layui-layer-close1').click();
|
||||
yes:function(){
|
||||
setRootPwd(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
@@ -527,7 +523,7 @@ function checkSelect(){
|
||||
}
|
||||
|
||||
function setDbRw(id,username,val){
|
||||
myPost('get_db_rw',{id:id,username:username,rw:val}, function(data){
|
||||
myPost('set_db_rw',{id:id,username:username,rw:val}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
// layer.msg(rdata.msg,{icon:rdata.status ? 1 : 5,shade: [0.3, '#000']});
|
||||
showMsg(rdata.msg, function(){
|
||||
@@ -632,12 +628,18 @@ function setDbPass(id, username, password){
|
||||
</div>\
|
||||
<div class='line'>\
|
||||
<span class='tname'>密码</span>\
|
||||
<div class='info-r'><input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' /><span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
<div class='info-r'>\
|
||||
<input class='bt-input-text mr5' type='text' name='password' id='MyPassword' style='width:330px' value='"+password+"' />\
|
||||
<span title='随机密码' class='glyphicon glyphicon-repeat cursor' onclick='repeatPwd(16)'></span></div>\
|
||||
</div>\
|
||||
<input type='hidden' name='id' value='"+id+"'>\
|
||||
</form>",
|
||||
yes:function(index){
|
||||
var data = $("#mod_pwd").serialize();
|
||||
// var data = $("#mod_pwd").serialize();
|
||||
var data = {};
|
||||
data['name'] = $('input[name=name]').val();
|
||||
data['password'] = $('#MyPassword').val();
|
||||
data['id'] = $('input[name=id]').val();
|
||||
myPost('set_user_pwd', data, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
showMsg(rdata.msg,function(){
|
||||
@@ -809,6 +811,14 @@ function openPhpmyadmin(name,username,password){
|
||||
layer.msg('phpMyAdmin未启动',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_cfg'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (rdata.choose == 'mariadb'){
|
||||
layer.msg('当前为[mariadb]模式,若要使用请切换模式.',{icon:2,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
// console.log(data);
|
||||
data = syncPost('/plugins/run',{'name':'phpmyadmin','func':'get_home_page'});
|
||||
var rdata = $.parseJSON(data.data);
|
||||
|
||||
@@ -57,10 +57,7 @@ fi
|
||||
VERSION_ID=`cat /etc/*-release | grep VERSION_ID | awk -F = '{print $2}' | awk -F "\"" '{print $2}'`
|
||||
|
||||
|
||||
|
||||
VERSION=8.0.29
|
||||
|
||||
|
||||
VERSION=8.0.28
|
||||
Install_mysql()
|
||||
{
|
||||
mkdir -p ${mysqlDir}
|
||||
@@ -114,7 +111,7 @@ Install_mysql()
|
||||
fi
|
||||
|
||||
#检测文件是否损坏.
|
||||
md5_mysql_ok=42fbfe0569089c20f9aa457b3f367d50
|
||||
md5_mysql_ok=362b8141ecaf425b803fe55292e2df98
|
||||
if [ -f ${mysqlDir}/mysql-boost-${VERSION}.tar.gz ];then
|
||||
md5_mysql=`md5sum ${mysqlDir}/mysql-boost-${VERSION}.tar.gz | awk '{print $1}'`
|
||||
if [ "${md5_mysql_ok}" == "${md5_mysql}" ]; then
|
||||
|
||||
@@ -901,8 +901,11 @@ def getWafConf():
|
||||
return mw.readFile(conf)
|
||||
|
||||
|
||||
def getWafSite():
|
||||
return ''
|
||||
def installPreInspection():
|
||||
check_op = mw.getServerDir() + "/openresty"
|
||||
if not os.path.exists(check_op):
|
||||
return "请先安装OpenResty"
|
||||
return 'ok'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
@@ -917,6 +920,8 @@ if __name__ == "__main__":
|
||||
print(restart())
|
||||
elif func == 'reload':
|
||||
print(reload())
|
||||
elif func == 'install_pre_inspection':
|
||||
print(installPreInspection())
|
||||
elif func == 'conf':
|
||||
print(getConf())
|
||||
elif func == 'get_rule':
|
||||
|
||||
@@ -18,9 +18,13 @@ Install_of(){
|
||||
|
||||
echo '0.1' > $serverPath/op_waf/version.pl
|
||||
echo 'install ok' > $install_tmp
|
||||
|
||||
cd ${rootPath} && python3 plugins/op_waf/index.py start
|
||||
}
|
||||
|
||||
Uninstall_of(){
|
||||
|
||||
cd ${rootPath} && python3 plugins/op_waf/index.py stop
|
||||
rm -rf $serverPath/op_waf
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,37 @@ config = C:read_file_body_decode(cpath .. 'config.json')
|
||||
local site_config = C:read_file_body_decode(cpath .. 'site.json')
|
||||
C:setConfData(config, site_config)
|
||||
|
||||
-- D func
|
||||
local function D(msg)
|
||||
local _msg = ''
|
||||
if type(msg) == 'table' then
|
||||
for key, val in pairs(msg) do
|
||||
_msg = key..':'..val.."\n"
|
||||
end
|
||||
elseif type(msg) == 'string' then
|
||||
_msg = msg
|
||||
elseif type(msg) == 'nil' then
|
||||
_msg = 'nil'
|
||||
else
|
||||
_msg = msg
|
||||
end
|
||||
|
||||
if not debug_mode then return true end
|
||||
local fp = io.open(cpath..'debug.log', 'ab')
|
||||
if fp == nil then
|
||||
return nil
|
||||
end
|
||||
local localtime = os.date("%Y-%m-%d %H:%M:%S")
|
||||
if server_name then
|
||||
fp:write(tostring(_msg) .. "\n")
|
||||
else
|
||||
fp:write(localtime..":"..tostring(_msg) .. "\n")
|
||||
end
|
||||
fp:flush()
|
||||
fp:close()
|
||||
return true
|
||||
end
|
||||
|
||||
function initParams()
|
||||
local data = {}
|
||||
data['ip'] = C:get_client_ip()
|
||||
@@ -314,6 +345,7 @@ end
|
||||
function post_data_chekc()
|
||||
if params['method'] =="POST" then
|
||||
if C:return_post_data() then return false end
|
||||
ngx.req.read_body()
|
||||
request_args = ngx.req.get_post_args()
|
||||
if not request_args then return false end
|
||||
|
||||
|
||||
@@ -296,6 +296,10 @@ def errorLogPath():
|
||||
return getServerDir() + '/nginx/logs/error.log'
|
||||
|
||||
|
||||
def installPreInspection():
|
||||
return 'ok'
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
func = sys.argv[1]
|
||||
if func == 'status':
|
||||
@@ -314,6 +318,8 @@ if __name__ == "__main__":
|
||||
print(initdInstall())
|
||||
elif func == 'initd_uninstall':
|
||||
print(initdUinstall())
|
||||
elif func == 'install_pre_inspection':
|
||||
print(installPreInspection())
|
||||
elif func == 'conf':
|
||||
print(getConf())
|
||||
elif func == 'get_os':
|
||||
|
||||
@@ -5,12 +5,13 @@
|
||||
"type":"其他插件",
|
||||
"ps":"轻量级,占有内存少,并发能力强",
|
||||
"shell":"install.sh",
|
||||
"install_pre_inspection":true,
|
||||
"checks":"server/openresty",
|
||||
"path":"server/openresty",
|
||||
"author":"agentzh",
|
||||
"home":"http://openresty.org",
|
||||
"date":"2017-11-24",
|
||||
"pid": "1",
|
||||
"versions": ["1.15.8.3","1.17.8.2","1.19.3.1","1.21.4.1"],
|
||||
"updates": ["1.15.8.3","1.17.8.2","1.19.3.1","1.21.4.1"]
|
||||
"versions": ["1.17.8.2","1.19.3.1","1.21.4.1"],
|
||||
"updates": ["1.17.8.2","1.19.3.1","1.21.4.1"]
|
||||
}
|
||||
@@ -15,9 +15,7 @@
|
||||
{
|
||||
"name": "mysqlnd",
|
||||
"versions": [
|
||||
"53",
|
||||
"54",
|
||||
"56",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
@@ -30,9 +28,7 @@
|
||||
{
|
||||
"name": "oci8",
|
||||
"versions": [
|
||||
"53",
|
||||
"54",
|
||||
"56",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
@@ -45,9 +41,7 @@
|
||||
{
|
||||
"name": "odbc",
|
||||
"versions": [
|
||||
"53",
|
||||
"54",
|
||||
"56",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
"82"
|
||||
@@ -101,14 +95,6 @@
|
||||
{
|
||||
"name": "opcache",
|
||||
"versions": [
|
||||
"53",
|
||||
"54",
|
||||
"55",
|
||||
"56",
|
||||
"70",
|
||||
"71",
|
||||
"72",
|
||||
"73",
|
||||
"74",
|
||||
"80",
|
||||
"81",
|
||||
|
||||
@@ -146,7 +146,7 @@ def contentReplace(content, version):
|
||||
|
||||
def makeOpenrestyConf():
|
||||
phpversions = ['00', '52', '53', '54', '55', '56',
|
||||
'70', '71', '72', '73', '74', '80', '81']
|
||||
'70', '71', '72', '73', '74', '80', '81', '82']
|
||||
|
||||
sdir = mw.getServerDir()
|
||||
|
||||
|
||||
@@ -12,7 +12,7 @@ serverPath=$(dirname "$rootPath")
|
||||
sourcePath=${serverPath}/source/php
|
||||
|
||||
LIBNAME=redis
|
||||
LIBV=5.3.7
|
||||
LIBV=5.3.6
|
||||
sysName=`uname`
|
||||
actionType=$1
|
||||
version=$2
|
||||
|
||||
@@ -2,10 +2,11 @@
|
||||
$cfg['blowfish_secret'] = '{$BLOWFISH_SECRET}';
|
||||
$i = 0;
|
||||
$i++;
|
||||
$cfg['Servers'][$i]['verbose'] = '{$CHOOSE_DB}';
|
||||
$cfg['Servers'][$i]['auth_type'] = 'cookie';
|
||||
// $cfg['Servers'][$i]['host'] = '127.0.0.1';
|
||||
// $cfg['Servers'][$i]['connect_type'] = 'tcp';
|
||||
$cfg['Servers'][$i]['socket'] = '{$SERVER_PATH}/mysql/mysql.sock';
|
||||
$cfg['Servers'][$i]['socket'] = '{$SERVER_PATH}/{$CHOOSE_DB_DIR}/mysql.sock';
|
||||
$cfg['Servers'][$i]['connect_type'] = 'socket';
|
||||
$cfg['Servers'][$i]['compress'] = false;
|
||||
$cfg['Servers'][$i]['AllowNoPassword'] = false;
|
||||
|
||||
@@ -8,6 +8,11 @@ server
|
||||
#error_page 404 /404.html;
|
||||
include {$PHP_CONF_PATH}/enable-php-{$PHP_VER}.conf;
|
||||
|
||||
#AUTH_START
|
||||
auth_basic "Authorization";
|
||||
auth_basic_user_file {$SERVER_PATH}/phpmyadmin/pma.pass;
|
||||
#AUTH_END
|
||||
|
||||
location ~ .*\.(gif|jpg|jpeg|png|bmp|swf)$
|
||||
{
|
||||
expires 30d;
|
||||
@@ -18,7 +23,7 @@ server
|
||||
expires 12h;
|
||||
}
|
||||
|
||||
location ~ /.*\.log$ {
|
||||
location ~ /.*\.(log|pass|json|pl)$ {
|
||||
deny all;
|
||||
}
|
||||
|
||||
|
||||
+137
-6
@@ -5,6 +5,7 @@ import io
|
||||
import os
|
||||
import time
|
||||
import re
|
||||
import json
|
||||
|
||||
sys.path.append(os.getcwd() + "/class/core")
|
||||
import mw
|
||||
@@ -44,6 +45,13 @@ def getArgs():
|
||||
return tmp
|
||||
|
||||
|
||||
def checkArgs(data, ck=[]):
|
||||
for i in range(len(ck)):
|
||||
if not ck[i] in data:
|
||||
return (False, mw.returnJson(False, '参数:(' + ck[i] + ')没有!'))
|
||||
return (True, mw.returnJson(True, 'ok'))
|
||||
|
||||
|
||||
def getConf():
|
||||
return mw.getServerDir() + '/web_conf/nginx/vhost/phpmyadmin.conf'
|
||||
|
||||
@@ -107,9 +115,50 @@ def contentReplace(content):
|
||||
content = content.replace('{$PHP_CONF_PATH}', php_conf_dir)
|
||||
content = content.replace('{$PHP_VER}', php_ver)
|
||||
content = content.replace('{$BLOWFISH_SECRET}', blowfish_secret)
|
||||
|
||||
cfg = getCfg()
|
||||
if (cfg['choose'] == ""):
|
||||
content = content.replace('{$CHOOSE_DB}', 'mysql')
|
||||
content = content.replace('{$CHOOSE_DB_DIR}', 'mysql')
|
||||
else:
|
||||
content = content.replace('{$CHOOSE_DB}', 'MariaDB')
|
||||
content = content.replace('{$CHOOSE_DB_DIR}', 'mariadb')
|
||||
|
||||
return content
|
||||
|
||||
|
||||
def initCfg():
|
||||
cfg = getServerDir() + "/cfg.json"
|
||||
if not os.path.exists(cfg):
|
||||
data = {}
|
||||
data['port'] = '888'
|
||||
data['choose'] = ''
|
||||
data['username'] = 'admin'
|
||||
data['password'] = 'admin'
|
||||
mw.writeFile(cfg, json.dumps(data))
|
||||
|
||||
|
||||
def setCfg(key, val):
|
||||
cfg = getServerDir() + "/cfg.json"
|
||||
data = mw.readFile(cfg)
|
||||
data = json.loads(data)
|
||||
data[key] = val
|
||||
mw.writeFile(cfg, json.dumps(data))
|
||||
|
||||
|
||||
def getCfg():
|
||||
cfg = getServerDir() + "/cfg.json"
|
||||
data = mw.readFile(cfg)
|
||||
data = json.loads(data)
|
||||
return data
|
||||
|
||||
|
||||
def returnCfg():
|
||||
cfg = getServerDir() + "/cfg.json"
|
||||
data = mw.readFile(cfg)
|
||||
return data
|
||||
|
||||
|
||||
def status():
|
||||
conf = getConf()
|
||||
conf_inc = getServerDir() + '/phpmyadmin/config.inc.php'
|
||||
@@ -120,6 +169,8 @@ def status():
|
||||
|
||||
|
||||
def start():
|
||||
initCfg()
|
||||
|
||||
file_tpl = getPluginDir() + '/conf/phpmyadmin.conf'
|
||||
file_run = getConf()
|
||||
|
||||
@@ -128,6 +179,14 @@ def start():
|
||||
centent = contentReplace(centent)
|
||||
mw.writeFile(file_run, centent)
|
||||
|
||||
pma_path = getServerDir() + '/pma.pass'
|
||||
if not os.path.exists(pma_path):
|
||||
username = mw.getRandomString(10)
|
||||
pass_cmd = username + ':' + mw.hasPwd(username)
|
||||
setCfg('username', username)
|
||||
setCfg('password', username)
|
||||
mw.writeFile(pma_path, pass_cmd)
|
||||
|
||||
tmp = getServerDir() + '/phpmyadmin/tmp'
|
||||
if not os.path.exists(tmp):
|
||||
os.mkdir(tmp)
|
||||
@@ -179,12 +238,11 @@ def setPhpVer():
|
||||
file_tpl = getPluginDir() + '/conf/phpmyadmin.conf'
|
||||
file_run = getConf()
|
||||
|
||||
centent = mw.readFile(file_tpl)
|
||||
centent = contentReplace(centent)
|
||||
mw.writeFile(file_run, centent)
|
||||
content = mw.readFile(file_tpl)
|
||||
content = contentReplace(content)
|
||||
mw.writeFile(file_run, content)
|
||||
|
||||
mw.restartWeb()
|
||||
|
||||
return 'ok'
|
||||
|
||||
|
||||
@@ -195,6 +253,11 @@ def getSetPhpVer():
|
||||
return ''
|
||||
|
||||
|
||||
def getPmaOption():
|
||||
data = getCfg()
|
||||
return mw.returnJson(True, 'ok', data)
|
||||
|
||||
|
||||
def getPmaPort():
|
||||
try:
|
||||
port = getPort()
|
||||
@@ -206,8 +269,9 @@ def getPmaPort():
|
||||
|
||||
def setPmaPort():
|
||||
args = getArgs()
|
||||
if not 'port' in args:
|
||||
return mw.returnJson(False, 'port missing!')
|
||||
data = checkArgs(args, ['port'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
port = args['port']
|
||||
if port == '80':
|
||||
@@ -224,6 +288,63 @@ def setPmaPort():
|
||||
return mw.returnJson(True, '修改成功!')
|
||||
|
||||
|
||||
def setPmaChoose():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['choose'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
choose = args['choose']
|
||||
setCfg('choose', choose)
|
||||
|
||||
conf_run = getServerDir() + '/phpmyadmin/config.inc.php'
|
||||
conf_tpl = getPluginDir() + '/conf/config.inc.php'
|
||||
centent = mw.readFile(conf_tpl)
|
||||
centent = contentReplace(centent)
|
||||
mw.writeFile(conf_run, centent)
|
||||
|
||||
mw.restartWeb()
|
||||
return mw.returnJson(True, '修改成功!')
|
||||
|
||||
|
||||
def setPmaUsername():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['username'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
username = args['username']
|
||||
setCfg('username', username)
|
||||
|
||||
cfg = getCfg()
|
||||
pma_path = getServerDir() + '/pma.pass'
|
||||
username = mw.getRandomString(10)
|
||||
pass_cmd = cfg['username'] + ':' + mw.hasPwd(cfg['password'])
|
||||
mw.writeFile(pma_path, pass_cmd)
|
||||
|
||||
mw.restartWeb()
|
||||
return mw.returnJson(True, '修改成功!')
|
||||
|
||||
|
||||
def setPmaPassword():
|
||||
args = getArgs()
|
||||
data = checkArgs(args, ['password'])
|
||||
if not data[0]:
|
||||
return data[1]
|
||||
|
||||
password = args['password']
|
||||
setCfg('password', password)
|
||||
|
||||
cfg = getCfg()
|
||||
pma_path = getServerDir() + '/pma.pass'
|
||||
username = mw.getRandomString(10)
|
||||
pass_cmd = cfg['username'] + ':' + mw.hasPwd(cfg['password'])
|
||||
mw.writeFile(pma_path, pass_cmd)
|
||||
|
||||
mw.restartWeb()
|
||||
return mw.returnJson(True, '修改成功!')
|
||||
|
||||
|
||||
def accessLog():
|
||||
return getServerDir() + '/access.log'
|
||||
|
||||
@@ -252,6 +373,8 @@ if __name__ == "__main__":
|
||||
print(getConf())
|
||||
elif func == 'version':
|
||||
print(Version())
|
||||
elif func == 'get_cfg':
|
||||
print(returnCfg())
|
||||
elif func == 'config_inc':
|
||||
print(getConfInc())
|
||||
elif func == 'get_home_page':
|
||||
@@ -264,6 +387,14 @@ if __name__ == "__main__":
|
||||
print(getPmaPort())
|
||||
elif func == 'set_pma_port':
|
||||
print(setPmaPort())
|
||||
elif func == 'get_pma_option':
|
||||
print(getPmaOption())
|
||||
elif func == 'set_pma_choose':
|
||||
print(setPmaChoose())
|
||||
elif func == 'set_pma_username':
|
||||
print(setPmaUsername())
|
||||
elif func == 'set_pma_password':
|
||||
print(setPmaPassword())
|
||||
elif func == 'access_log':
|
||||
print(accessLog())
|
||||
elif func == 'error_log':
|
||||
|
||||
@@ -90,24 +90,68 @@ function phpVerChange(type, msg) {
|
||||
|
||||
//phpmyadmin安全设置
|
||||
function safeConf() {
|
||||
var data = pmaAsyncPost('get_pma_port');
|
||||
var rdata = $.parseJSON(data.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
var con = '<div class="ver line">\
|
||||
<span style="margin-right:10px">访问端口</span>\
|
||||
<input class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="' + rdata['data'] + '" placeholder="phpmyadmin访问端口" maxlength="5" type="number">\
|
||||
<button class="btn btn-success btn-sm" onclick="phpmyadminPort()">保存</button>\
|
||||
pmaPost('get_pma_option', {}, function(rdata){
|
||||
var rdata = $.parseJSON(rdata.data);
|
||||
if (!rdata.status){
|
||||
layer.msg(rdata.msg,{icon:2,time:2000,shade: [0.3, '#000']});
|
||||
return;
|
||||
}
|
||||
|
||||
var cfg = rdata.data;
|
||||
var con = '<div class="ver line">\
|
||||
<span class="tname">访问端口</span>\
|
||||
<input style="width:110px" class="bt-input-text phpmyadmindk mr20" name="Name" id="pmport" value="' + cfg['port'] + '" placeholder="phpmyadmin访问端口" maxlength="5" type="number">\
|
||||
<button class="btn btn-success btn-sm" onclick="setPamPort()">保存</button>\
|
||||
</div>\
|
||||
<div class="ver line">\
|
||||
<span class="tname">访问切换</span>\
|
||||
<select id="access_choose" class="bt-input-text mr20" name="choose" style="width:110px">\
|
||||
<option value="mariadb" '+(cfg['choose']=="mariadb"?"selected='selected'":"")+'>MariaDB</option>\
|
||||
<option value="mysql" '+ (cfg['choose']==""?"selected='selected'":"")+'>MySQL</option>\
|
||||
</select>\
|
||||
<button class="btn btn-success btn-sm" onclick="setPmaChoose()">保存</button>\
|
||||
</div>\
|
||||
<div class="ver line">\
|
||||
<span class="tname">用户名</span>\
|
||||
<input style="width:110px" class="bt-input-text mr20" name="username" id="pmport" value="' + cfg['username'] + '" placeholder="认证用户名" type="text">\
|
||||
<button class="btn btn-success btn-sm" onclick="setPmaUsername()">保存</button>\
|
||||
</div>\
|
||||
<div class="ver line">\
|
||||
<span class="tname">密码</span>\
|
||||
<input style="width:110px" class="bt-input-text mr20" name="password" id="pmport" value="' + cfg['password'] + '" placeholder="密码" type="text">\
|
||||
<button class="btn btn-success btn-sm" onclick="setPmaPassword()">保存</button>\
|
||||
</div>';
|
||||
$(".soft-man-con").html(con);
|
||||
$(".soft-man-con").html(con);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
function setPmaChoose(){
|
||||
var choose = $("#access_choose").val();
|
||||
pmaPost('set_pma_choose',{'choose':choose}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
|
||||
});
|
||||
}
|
||||
|
||||
function setPmaUsername(){
|
||||
var username = $("input[name=username]").val();
|
||||
pmaPost('set_pma_username',{'username':username}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
|
||||
});
|
||||
}
|
||||
|
||||
function setPmaPassword(){
|
||||
var password = $("input[name=password]").val();
|
||||
pmaPost('set_pma_password',{'password':password}, function(data){
|
||||
var rdata = $.parseJSON(data.data);
|
||||
layer.msg(rdata.msg, { icon: rdata.status ? 1 : 2 });
|
||||
});
|
||||
}
|
||||
|
||||
//修改phpmyadmin端口
|
||||
function phpmyadminPort() {
|
||||
function setPamPort() {
|
||||
var pmport = $("#pmport").val();
|
||||
if (pmport < 80 || pmport > 65535) {
|
||||
layer.msg('端口范围不合法!', { icon: 2 });
|
||||
|
||||
@@ -9,16 +9,24 @@ import psycopg2
|
||||
|
||||
class ORM:
|
||||
__DB_PASS = None
|
||||
__DB_USER = 'root'
|
||||
__DB_USER = 'postgres'
|
||||
__DB_PORT = 5432
|
||||
__DB_HOST = 'localhost'
|
||||
__DB_CONN = None
|
||||
__DB_CUR = None
|
||||
__DB_ERR = None
|
||||
__DB_CNF = '/etc/my.cnf'
|
||||
__DB_CNF = '/etc/postgresql.cnf'
|
||||
__DB_SOCKET = '/www/server/postgresql/mysql.sock'
|
||||
__DB_CHARSET = "utf8"
|
||||
|
||||
__DB_TABLE = "" # 被操作的表名称
|
||||
__OPT_WHERE = "" # where条件
|
||||
__OPT_LIMIT = "" # limit条件
|
||||
__OPT_GROUP = "" # group条件
|
||||
__OPT_ORDER = "" # order条件
|
||||
__OPT_FIELD = "*" # field条件
|
||||
__OPT_PARAM = () # where值
|
||||
|
||||
def __Conn(self):
|
||||
'''连接数据库'''
|
||||
try:
|
||||
@@ -31,7 +39,9 @@ class ORM:
|
||||
self.__DB_CONN = psycopg2.connect(database='postgres', user=self.__DB_USER, password=self.__DB_PASS,
|
||||
host=self.__DB_HOST, port=int(self.__DB_PORT))
|
||||
|
||||
self.__DB_CONN.autocommit = True
|
||||
self.__DB_CUR = self.__DB_CONN.cursor()
|
||||
|
||||
return True
|
||||
except Exception as e:
|
||||
self.__DB_ERR = e
|
||||
@@ -55,6 +65,83 @@ class ORM:
|
||||
def getPwd(self):
|
||||
return self.__DB_PASS
|
||||
|
||||
def table(self, table):
|
||||
# 设置表名
|
||||
self.__DB_TABLE = table
|
||||
return self
|
||||
|
||||
def where(self, where, param=()):
|
||||
# WHERE条件
|
||||
if where:
|
||||
self.__OPT_WHERE = " WHERE " + where
|
||||
self.__OPT_PARAM = param
|
||||
return self
|
||||
|
||||
def andWhere(self, where, param):
|
||||
# WHERE条件
|
||||
if where:
|
||||
self.__OPT_WHERE = self.__OPT_WHERE + " and " + where
|
||||
# print(param)
|
||||
# print(self.__OPT_PARAM)
|
||||
self.__OPT_PARAM = self.__OPT_PARAM + param
|
||||
return self
|
||||
|
||||
def order(self, order):
|
||||
# ORDER条件
|
||||
if len(order):
|
||||
self.__OPT_ORDER = " ORDER BY " + order
|
||||
else:
|
||||
self.__OPT_ORDER = ""
|
||||
return self
|
||||
|
||||
def group(self, group):
|
||||
if len(group):
|
||||
self.__OPT_GROUP = " GROUP BY " + group
|
||||
else:
|
||||
self.__OPT_GROUP = ""
|
||||
return self
|
||||
|
||||
def limit(self, limit):
|
||||
# LIMIT条件
|
||||
if len(limit):
|
||||
self.__OPT_LIMIT = " LIMIT " + limit
|
||||
else:
|
||||
self.__OPT_LIMIT = ""
|
||||
return self
|
||||
|
||||
def field(self, field):
|
||||
# FIELD条件
|
||||
if len(field):
|
||||
self.__OPT_FIELD = field
|
||||
return self
|
||||
|
||||
def select(self):
|
||||
# 查询数据集
|
||||
if not self.__Conn():
|
||||
return self.__DB_ERR
|
||||
try:
|
||||
sql = "SELECT " + self.__OPT_FIELD + " FROM " + self.__DB_TABLE + \
|
||||
self.__OPT_WHERE + self.__OPT_GROUP + self.__OPT_ORDER + self.__OPT_LIMIT
|
||||
# print(sql)
|
||||
result = self.__DB_CUR.execute(sql, self.__OPT_PARAM)
|
||||
data = self.__DB_CUR.fetchall()
|
||||
ret = []
|
||||
if self.__OPT_FIELD != "*":
|
||||
field = self.__OPT_FIELD.split(',')
|
||||
for row in data:
|
||||
i = 0
|
||||
field_k = {}
|
||||
for key in field:
|
||||
field_k[key] = row[i]
|
||||
i += 1
|
||||
ret.append(field_k)
|
||||
else:
|
||||
ret = map(list, data)
|
||||
self.__Close()
|
||||
return ret
|
||||
except Exception as ex:
|
||||
return "error: " + str(ex)
|
||||
|
||||
def execute(self, sql):
|
||||
# 执行SQL语句返回受影响行
|
||||
if not self.__Conn():
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
# PostgreSQL Client Authentication Configuration File
|
||||
|
||||
# TYPE DATABASE USER ADDRESS METHOD
|
||||
# "local" is for Unix domain socket connections only
|
||||
local all all trust
|
||||
host all all 0.0.0.0/0 md5
|
||||
host all all ::1/128 md5
|
||||
local replication all trust
|
||||
host replication all 0.0.0.0/0 md5
|
||||
host replication all ::1/128 md5
|
||||
@@ -1,11 +1,49 @@
|
||||
port = 5432
|
||||
listen_addresses='*'
|
||||
unix_socket_directories='{$APP_PATH}/tmp'
|
||||
unix_socket_directories='/tmp'
|
||||
|
||||
max_connections=200
|
||||
max_wal_size = 1GB
|
||||
min_wal_size = 80MB
|
||||
shared_buffers = 128MB
|
||||
work_mem = 4MB
|
||||
effective_cache_size = 4GB
|
||||
temp_buffers = 8MB
|
||||
max_prepared_transactions = 0
|
||||
max_stack_depth = 2MB
|
||||
bgwriter_lru_maxpages = 100
|
||||
max_worker_processes = 8
|
||||
dynamic_shared_memory_type = posix
|
||||
|
||||
|
||||
log_timezone = 'Asia/Shanghai'
|
||||
datestyle = 'iso, ymd'
|
||||
timezone = 'Asia/Shanghai'
|
||||
default_text_search_config = 'pg_catalog.simple'
|
||||
|
||||
|
||||
# 主配置
|
||||
#archive_mode = on
|
||||
#archive_command = 'test ! -f {$APP_PATH}/archivelog/%f && cp %p {$APP_PATH}/archivelog/%f'
|
||||
#wal_level = replica
|
||||
#max_wal_senders = 10
|
||||
#wal_sender_timeout = 60s
|
||||
|
||||
|
||||
# 从配置
|
||||
#hot_standby = on
|
||||
#primary_conninfo = 'host=192.168.0.100 port=5432 user=replica password=123456'
|
||||
#max_standby_streaming_delay = 30s
|
||||
#wal_receiver_status_interval = 10s
|
||||
#hot_standby_feedback = on
|
||||
#recovery_target_timeline= 'latest'
|
||||
|
||||
|
||||
logging_collector = on
|
||||
log_destination = 'stderr'
|
||||
log_directory = '{$APP_PATH}/logs'
|
||||
log_filename = 'postgresql-%Y-%m-%d.log'
|
||||
log_statement = all
|
||||
log_rotation_age = 7d
|
||||
log_rotation_size = 100MB
|
||||
log_min_duration_statement = 5000
|
||||
|
||||
@@ -2,18 +2,17 @@
|
||||
<div class='plugin_version'></div>
|
||||
<div class="bt-w-main">
|
||||
<div class="bt-w-menu">
|
||||
<!-- <script type="text/javascript">console.log($('.plugin_version').attr('version'));</script> -->
|
||||
<p class="bgw" onclick="pluginService('postgresql', $('.plugin_version').attr('version'));">服务</p>
|
||||
<p onclick="pluginInitD('postgresql', $('.plugin_version').attr('version'));">自启动</p>
|
||||
<p onclick="pluginConfigTpl('postgresql');">配置文件</p>
|
||||
<!--<p onclick="myDbPos();">存储位置</p> -->
|
||||
<p onclick="pluginConfigTpl('postgresql');">配置文件</p>
|
||||
<p onclick="pluginConfig('postgresql','','pg_hba_conf');">客服端认证</p>
|
||||
<p onclick="pgPort();">端口</p>
|
||||
<!-- <p onclick="runInfo();">当前状态</p>
|
||||
<p onclick="myPerfOpt();">性能优化</p> -->
|
||||
<p onclick="runInfo();">当前状态</p>
|
||||
<p onclick="pgPerfOpt();">性能优化</p>
|
||||
<p onclick="pluginLogs('postgresql',$('.plugin_version').attr('version'),'run_log');">日志</p>
|
||||
<!--<p onclick="pluginLogs('postgresql',$('.plugin_version').attr('version'),'show_log');">慢日志</p>-->
|
||||
<p onclick="pluginLogs('postgresql',$('.plugin_version').attr('version'),'slow_log');">慢日志</p>
|
||||
<p onclick="dbList()">管理列表</p>
|
||||
<!--<p onclick="masterOrSlaveConf($('.plugin_version').attr('version'))">主从配置</p> -->
|
||||
<p onclick="masterOrSlaveConf($('.plugin_version').attr('version'))">主从配置</p>
|
||||
</div>
|
||||
<div class="bt-w-con pd15">
|
||||
<div class="soft-man-con" style="height: 530px; overflow: auto;"></div>
|
||||
|
||||
+1030
-207
File diff suppressed because it is too large
Load Diff
@@ -4,8 +4,8 @@ After=network.target
|
||||
|
||||
[Service]
|
||||
Type=forking
|
||||
User=postgresql
|
||||
Group=postgresql
|
||||
User=postgres
|
||||
Group=postgres
|
||||
WorkingDirectory={$APP_PATH}
|
||||
ExecStart={$APP_PATH}/bin/pg_ctl start -D {$APP_PATH}/data
|
||||
ExecReload={$APP_PATH}/bin/pg_ctl restart -D {$APP_PATH}/data
|
||||
|
||||
+177
-801
File diff suppressed because it is too large
Load Diff
@@ -20,12 +20,12 @@ Install_App()
|
||||
mkdir -p ${postgreDir}
|
||||
echo '正在安装脚本文件...' > $install_tmp
|
||||
|
||||
if id postgresql &> /dev/null ;then
|
||||
echo "postgresql UID is `id -u postgresql`"
|
||||
echo "postgresql Shell is `grep "^postgresql:" /etc/passwd |cut -d':' -f7 `"
|
||||
if id postgres &> /dev/null ;then
|
||||
echo "postgres UID is `id -u postgres`"
|
||||
echo "postgres Shell is `grep "^postgres:" /etc/passwd |cut -d':' -f7 `"
|
||||
else
|
||||
groupadd postgresql
|
||||
useradd -g postgresql postgresql
|
||||
groupadd postgres
|
||||
useradd -g postgres postgres
|
||||
fi
|
||||
|
||||
if [ "$sysName" != "Darwin" ];then
|
||||
@@ -68,13 +68,13 @@ Install_App()
|
||||
|
||||
if [ ! -d $serverPath/postgresql ];then
|
||||
cd ${postgreDir}/postgresql-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/postgresql
|
||||
# --with-openssl \
|
||||
--prefix=$serverPath/postgresql \
|
||||
--with-openssl
|
||||
# --with-pgport=33206
|
||||
|
||||
echo "cd ${postgreDir}/postgresql-${VERSION} && ./configure \
|
||||
--prefix=$serverPath/postgresql"
|
||||
# --with-openssl \
|
||||
--prefix=$serverPath/postgresql \
|
||||
--with-openssl"
|
||||
# --with-pgport=33206
|
||||
make -j${cpuCore} && make install && make clean
|
||||
fi
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
"name": "redis",
|
||||
"title": "Redis",
|
||||
"shell": "install.sh",
|
||||
"versions":["4.0.11","5.0.8","6.0.4","6.2.7"],
|
||||
"updates":["4.0.11","5.0.8","6.0.4","6.2.7"],
|
||||
"versions":["4.0.11","5.0.8","6.0.4","6.2.7","7.0.4"],
|
||||
"updates":["4.0.11","5.0.8","6.0.4","6.2.7","7.0.4"],
|
||||
"tip": "soft",
|
||||
"checks": "server/redis",
|
||||
"path": "server/redis",
|
||||
|
||||
@@ -56,7 +56,7 @@ def getArgs():
|
||||
tmp[t[0]] = t[1]
|
||||
elif args_len > 1:
|
||||
for i in range(len(args)):
|
||||
t = args[i].split(':')
|
||||
t = args[i].split(':', 1)
|
||||
tmp[t[0]] = t[1]
|
||||
|
||||
return tmp
|
||||
|
||||
+186
-119
@@ -1,4 +1,4 @@
|
||||
console.log(lan);
|
||||
// console.log(lan);
|
||||
|
||||
//判断磁盘数量超出宽度
|
||||
function isDiskWidth(){
|
||||
@@ -305,7 +305,7 @@ function getFiles(Path) {
|
||||
if(!showRow) {
|
||||
showRow = '100';
|
||||
}
|
||||
var Body = '';
|
||||
var body = '';
|
||||
var data = 'path=' + Path;
|
||||
var loadT = layer.load();
|
||||
var totalSize = 0;
|
||||
@@ -340,9 +340,10 @@ function getFiles(Path) {
|
||||
if(getCookie('rank') == 'a'){
|
||||
$("#set_list").addClass("active");
|
||||
$("#set_icon").removeClass("active");
|
||||
Body += "<tr class='folderBoxTr' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir'>\
|
||||
body += "<tr class='folderBoxTr' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir'>\
|
||||
<td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
<td class='column-name'><span class='cursor' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\"><span class='ico ico-folder'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></span></td>\
|
||||
<td class='column-name'><span class='cursor' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\">\
|
||||
<span class='ico ico-folder'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></span></td>\
|
||||
<td>"+toSize(fmp[1])+"</td>\
|
||||
<td>"+getLocalTime(fmp[2])+"</td>\
|
||||
<td>"+fmp[3]+"</td>\
|
||||
@@ -358,7 +359,8 @@ function getFiles(Path) {
|
||||
} else {
|
||||
$("#set_icon").addClass("active");
|
||||
$("#set_list").removeClass("active");
|
||||
Body += "<div class='file folderBox menufolder' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir' title='"+lan.files.file_name+":" + fmp[0]+" "+lan.files.file_size+":" + toSize(fmp[1])+" "+lan.files.file_etime+":"+getLocalTime(fmp[2])+" "+lan.files.file_auth+":"+fmp[3]+" "+lan.files.file_own+":"+fmp[4]+"'>\
|
||||
body += "<div class='file folderBox menufolder' data-path='" + rdata.PATH + "/" + fmp[0] + "' filetype='dir' title='"+lan.files.file_name+":" + fmp[0]+" "+lan.files.file_size+":"
|
||||
+ toSize(fmp[1])+" "+lan.files.file_etime+":"+getLocalTime(fmp[2])+" "+lan.files.file_auth+":"+fmp[3]+" "+lan.files.file_own+":"+fmp[4]+"'>\
|
||||
<input type='checkbox' name='id' value='"+fmp[0]+"'>\
|
||||
<div class='ico ico-folder' ondblclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\"></div>\
|
||||
<div class='titleBox' onclick=\"getFiles('" + rdata.PATH + "/" + fmp[0] + "')\"><span class='tname'>" + fmp[0] + "</span></div>\
|
||||
@@ -397,7 +399,7 @@ function getFiles(Path) {
|
||||
|
||||
totalSize += parseInt(fmp[1]);
|
||||
if(getCookie("rank")=="a"){
|
||||
Body += "<tr class='folderBoxTr' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='" + fmp[0] + "'><td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
body += "<tr class='folderBoxTr' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='" + fmp[0] + "'><td><input type='checkbox' name='id' value='"+fmp[0]+"'></td>\
|
||||
<td class='column-name'><span class='ico ico-"+(getExtName(fmp[0]))+"'></span><a class='text' title='" + fmp[0] + fmp[5] + "'>" + cnametext + "</a></td>\
|
||||
<td>" + (toSize(fmp[1])) + "</td>\
|
||||
<td>" + ((fmp[2].length > 11)?fmp[2]:getLocalTime(fmp[2])) + "</td>\
|
||||
@@ -414,14 +416,16 @@ function getFiles(Path) {
|
||||
</span></td></tr>";
|
||||
}
|
||||
else{
|
||||
Body += "<div class='file folderBox menufile' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='"+fmp[0]+"' title='文件名:" + fmp[0]+" 大小:" + toSize(fmp[1])+" 修改时间:"+getLocalTime(fmp[2])+" 权限:"+fmp[3]+" 所有者:"+fmp[4]+"'>\
|
||||
body += "<div class='file folderBox menufile' data-path='" + rdata.PATH +"/"+ fmp[0] + "' filetype='"+fmp[0]+"' title='文件名:" + fmp[0]+" 大小:"
|
||||
+ toSize(fmp[1])+" 修改时间:"+getLocalTime(fmp[2])+" 权限:"+fmp[3]+" 所有者:"+fmp[4]+"'>\
|
||||
<input type='checkbox' name='id' value='"+fmp[0]+"'>\
|
||||
<div class='ico ico-"+(getExtName(fmp[0]))+"'></div>\
|
||||
<div class='titleBox'><span class='tname'>" + fmp[0] + "</span></div>\
|
||||
</div>";
|
||||
}
|
||||
}
|
||||
var dirInfo = '(共{1}个目录与{2}个文件,大小:'.replace('{1}',rdata.DIR.length+'').replace('{2}',rdata.DIR.length+'')+'<font id="pathSize">'+(toSize(totalSize))+'<a class="btlink ml5" onClick="getPathSize()">获取</a></font>)';
|
||||
var dirInfo = '(共{1}个目录与{2}个文件,大小:'.replace('{1}',rdata.DIR.length+'').replace('{2}',rdata.DIR.length+'')+'<font id="pathSize">'
|
||||
+ (toSize(totalSize))+'<a class="btlink ml5" onClick="getPathSize()">获取</a></font>)';
|
||||
$("#DirInfo").html(dirInfo);
|
||||
if(getCookie('rank')=='a'){
|
||||
var tablehtml = '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="table table-hover">\
|
||||
@@ -436,13 +440,13 @@ function getFiles(Path) {
|
||||
<th style="text-align: right;" width="330">操作</th>\
|
||||
</tr>\
|
||||
</thead>\
|
||||
<tbody id="filesBody" class="list-list">'+Body+'</tbody>\
|
||||
<tbody id="filesBody" class="list-list">'+body+'</tbody>\
|
||||
</table>';
|
||||
$("#fileCon").removeClass("fileList").html(tablehtml);
|
||||
$("#tipTools").width($("#fileCon").width());
|
||||
}
|
||||
else{
|
||||
$("#fileCon").addClass("fileList").html(Body);
|
||||
$("#fileCon").addClass("fileList").html(body);
|
||||
$("#tipTools").width($("#fileCon").width());
|
||||
}
|
||||
$("#DirPathPlace input").val(rdata.PATH);
|
||||
@@ -464,19 +468,20 @@ function getFiles(Path) {
|
||||
var copyName = getCookie('copyFileName');
|
||||
var cutName = getCookie('cutFileName');
|
||||
var isPaste = (copyName == 'null') ? cutName : copyName;
|
||||
console.log('isPaste:',isPaste);
|
||||
// console.log('isPaste:',isPaste);
|
||||
//---
|
||||
if (isPaste != 'null' && isPaste != undefined) {
|
||||
BarTools += ' <button onclick="javascript:pasteFile(\'' + (getFileName(isPaste)) + '\');" class="btn btn-Warning btn-sm">粘贴</button>';
|
||||
}
|
||||
|
||||
$("#Batch").html('');
|
||||
var BatchTools = '';
|
||||
var batchTools = '';
|
||||
var isBatch = getCookie('BatchSelected');
|
||||
if (isBatch == 1 || isBatch == '1') {
|
||||
BatchTools += ' <button onclick="javascript:batchPaste();" class="btn btn-default btn-sm">粘贴所有</button>';
|
||||
batchTools += ' <button onclick="javascript:batchPaste();" class="btn btn-default btn-sm">粘贴所有</button>';
|
||||
}
|
||||
$("#Batch").html(BatchTools);
|
||||
$("#Batch").html(batchTools);
|
||||
|
||||
$("#setBox").prop("checked", false);
|
||||
|
||||
$("#BarTools").html(BarTools);
|
||||
@@ -511,32 +516,38 @@ function getFiles(Path) {
|
||||
$("input[name=id]").dblclick(function(e){
|
||||
e.stopPropagation();
|
||||
});
|
||||
//禁用右键
|
||||
$("#fileCon").bind("contextmenu",function(e){
|
||||
return false;
|
||||
});
|
||||
bindselect();
|
||||
//绑定右键
|
||||
$("#fileCon").mousedown(function(e){
|
||||
var count = totalFile();
|
||||
if(e.which == 3) {
|
||||
if(count>1){
|
||||
RClickAll(e);
|
||||
}
|
||||
else{
|
||||
return
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
// //禁用右键
|
||||
// $("#fileCon").bind("contextmenu",function(e){
|
||||
// return false;
|
||||
// });
|
||||
// bindselect();
|
||||
|
||||
|
||||
// //绑定右键
|
||||
// $("#fileCon").mousedown(function(e){
|
||||
// var count = totalFile();
|
||||
// if(e.which == 3) {
|
||||
// if(count>1){
|
||||
// RClickAll(e);
|
||||
// }
|
||||
// else{
|
||||
// return
|
||||
// }
|
||||
// }
|
||||
// });
|
||||
|
||||
$(".folderBox,.folderBoxTr").mousedown(function(e){
|
||||
// console.log(e);
|
||||
var count = totalFile();
|
||||
if(e.which == 3) {
|
||||
if(count <= 1){
|
||||
var a = $(this);
|
||||
a.contextify(RClick(a.attr("filetype"),a.attr("data-path"),a.find("input").val()));
|
||||
}
|
||||
else{
|
||||
RClickAll(e);
|
||||
var option = rightMenuClick(a.attr("filetype"),a.attr("data-path"),a.find("input").val());
|
||||
a.contextify(option);
|
||||
} else{
|
||||
rightMenuClickAll(e);
|
||||
}
|
||||
}
|
||||
});
|
||||
@@ -600,18 +611,17 @@ function bindselect(){
|
||||
//选择操作
|
||||
function showSeclect(){
|
||||
var count = totalFile();
|
||||
var BatchTools = '';
|
||||
var batchTools = '';
|
||||
if(count > 1){
|
||||
BatchTools = '<button onclick="javascript:batch(1);" class="btn btn-default btn-sm">复制</button>\
|
||||
batchTools = '<button onclick="javascript:batch(1);" class="btn btn-default btn-sm">复制</button>\
|
||||
<button onclick="javascript:batch(2);" class="btn btn-default btn-sm">剪切</button>\
|
||||
<button onclick="javascript:batch(3);" class="btn btn-default btn-sm">权限</button>\
|
||||
<button onclick="javascript:batch(5);" class="btn btn-default btn-sm">压缩</button>\
|
||||
<button onclick="javascript:batch(4);" class="btn btn-default btn-sm">删除</button>'
|
||||
$("#Batch").html(BatchTools);
|
||||
<button onclick="javascript:batch(4);" class="btn btn-default btn-sm">删除</button>';
|
||||
}else{
|
||||
$("#Batch").html(BatchTools);
|
||||
//setCookie('BatchSelected', null);
|
||||
}
|
||||
$("#Batch").html(batchTools);
|
||||
}
|
||||
|
||||
//滚动条事件
|
||||
@@ -739,7 +749,18 @@ function batchPasteTo(data,path){
|
||||
//取扩展名
|
||||
function getExtName(fileName){
|
||||
var extArr = fileName.split(".");
|
||||
var exts = ['folder','folder-unempty','sql','c','cpp','cs','flv','css','js','htm','html','java','log','mht','php','url','xml','ai','bmp','cdr','gif','ico','jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4','mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','rtf','docx','fdf','potm','pptx','txt','xlsb','xlsx','7z','cab','iso','rar','zip','gz','bt','file','apk','bookfolder','folder','folder-empty','folder-unempty','fromchromefolder','documentfolder','fromphonefolder','mix','musicfolder','picturefolder','videofolder','sefolder','access','mdb','accdb','sql','c','cpp','cs','js','fla','flv','htm','html','java','log','mht','php','url','xml','ai','bmp','cdr','gif','ico','jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4','mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','doc','docm','dotx','dotm','dot','rtf','docx','pdf','fdf','ppt','pptm','pot','potm','pptx','txt','xls','csv','xlsm','xlsb','xlsx','7z','gz','cab','iso','rar','zip','bt','file','apk','css'];
|
||||
var exts = ['folder','folder-unempty','sql','c','cpp','cs','flv','css','js',
|
||||
'htm','html','java','log','mht','php','url','xml','ai','bmp','cdr','gif','ico',
|
||||
'jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4',
|
||||
'mpeg','mpg','rm','rmvb','swf','wav','webm','wma','wmv','rtf','docx','fdf','potm',
|
||||
'pptx','txt','xlsb','xlsx','7z','cab','iso','rar','zip','gz','bt','file','apk','bookfolder',
|
||||
'folder','folder-empty','folder-unempty','fromchromefolder','documentfolder','fromphonefolder',
|
||||
'mix','musicfolder','picturefolder','videofolder','sefolder','access','mdb','accdb','sql','c',
|
||||
'cpp','cs','js','fla','flv','htm','html','java','log','mht','php','url','xml','ai','bmp','cdr',
|
||||
'gif','ico','jpeg','jpg','JPG','png','psd','webp','ape','avi','flv','mkv','mov','mp3','mp4','mpeg',
|
||||
'mpg','rm','rmvb','swf','wav','webm','wma','wmv','doc','docm','dotx','dotm','dot','rtf','docx','pdf',
|
||||
'fdf','ppt','pptm','pot','potm','pptx','txt','xls','csv','xlsm','xlsb','xlsx','7z','gz','cab','iso',
|
||||
'rar','zip','bt','file','apk','css'];
|
||||
var extLastName = extArr[extArr.length - 1];
|
||||
for(var i=0; i<exts.length; i++){
|
||||
if(exts[i]==extLastName){
|
||||
@@ -759,20 +780,16 @@ function ShowEditMenu(){
|
||||
})
|
||||
}
|
||||
|
||||
// //取文件名
|
||||
// function GetFileName(fileNameFull) {
|
||||
// var pName = fileNameFull.split('/');
|
||||
// return pName[pName.length - 1];
|
||||
// }
|
||||
|
||||
//取磁盘
|
||||
function getDisk() {
|
||||
var LBody = '';
|
||||
$.get('/system/disk_info', function(rdata) {
|
||||
for (var i = 0; i < rdata.length; i++) {
|
||||
LBody += "<span onclick=\"getFiles('" + rdata[i].path + "')\"><span class='glyphicon glyphicon-hdd'></span> " + (rdata[i].path=='/'?lan.files.path_root:rdata[i].path) + "(" + rdata[i].size[2] + ")</span>";
|
||||
LBody += "<span onclick=\"getFiles('" + rdata[i].path + "')\">\
|
||||
<span class='glyphicon glyphicon-hdd'></span> " + (rdata[i].path=='/'?lan.files.path_root:rdata[i].path) + "(" + rdata[i].size[2] + ")</span>";
|
||||
}
|
||||
var trash = '<span id="recycle_bin" onclick="recycleBin(\'open\')" title="回收站" style="position: absolute; border-color: #ccc; right: 77px;"><span class="glyphicon glyphicon-trash"></span> 回收站</span>';
|
||||
var trash = '<span id="recycle_bin" onclick="recycleBin(\'open\')" title="回收站" style="position: absolute; border-color: #ccc; right: 77px;">\
|
||||
<span class="glyphicon glyphicon-trash"></span> 回收站</span>';
|
||||
$("#comlist").html(LBody+trash);
|
||||
isDiskWidth();
|
||||
},'json');
|
||||
@@ -835,11 +852,14 @@ function createFile(type, path) {
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>\
|
||||
<button id="createFileBtn" type="button" class="btn btn-success btn-sm" onclick="createFile(1,\'' + path + '\')">新建</button>\
|
||||
</div>\
|
||||
</div>'
|
||||
});
|
||||
$("#newFileName").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) $("#createFileBtn").click();
|
||||
</div>',
|
||||
success:function(){
|
||||
$("#newFileName").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) $("#createFileBtn").click();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//新建目录
|
||||
function createDir(type, path) {
|
||||
@@ -872,11 +892,14 @@ function createDir(type, path) {
|
||||
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\
|
||||
<button type="button" id="createDirBtn" class="btn btn-success btn-sm btn-title" onclick="createDir(1,\'' + path + '\')">新建</button>\
|
||||
</div>\
|
||||
</div>'
|
||||
});
|
||||
$("#newDirName").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) $("#createDirBtn").click();
|
||||
</div>',
|
||||
success:function(){
|
||||
$("#newDirName").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) $("#createDirBtn").click();
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
//删除文件
|
||||
@@ -886,7 +909,7 @@ function deleteFile(fileName){
|
||||
$.post('/files/delete', 'path=' + encodeURIComponent(fileName), function(rdata) {
|
||||
layer.closeAll();
|
||||
layer.msg(rdata.msg, {
|
||||
icon: rdata.status ? 1 : 2
|
||||
icon: rdata.status ? 1 : 2,
|
||||
});
|
||||
getFiles($("#DirPathPlace input").val());
|
||||
},'json');
|
||||
@@ -933,10 +956,18 @@ function downloadFile(action){
|
||||
if(action == 1){
|
||||
var fUrl = $("#mUrl").val();
|
||||
fUrl = encodeURIComponent(fUrl);
|
||||
fpath = $("#dpath").val();
|
||||
|
||||
var fpath = $("#dpath").val();
|
||||
fname = encodeURIComponent($("#dfilename").val());
|
||||
|
||||
if (fUrl == "" ){
|
||||
layer.msg("URL地址不能为空!",{icon:2});
|
||||
return;
|
||||
}
|
||||
|
||||
layer.closeAll();
|
||||
layer.msg(lan.files.down_task,{time:0,icon:16,shade: [0.3, '#000']});
|
||||
|
||||
$.post('/files/download_file','path='+fpath+'&url='+fUrl+'&filename='+fname,function(rdata){
|
||||
layer.closeAll();
|
||||
getFiles(fpath);
|
||||
@@ -945,38 +976,42 @@ function downloadFile(action){
|
||||
},'json');
|
||||
return;
|
||||
}
|
||||
|
||||
var path = $("#DirPathPlace input").val();
|
||||
layer.open({
|
||||
type: 1,
|
||||
shift: 5,
|
||||
closeBtn: 2,
|
||||
area: '500px',
|
||||
btn:["确定","关闭"],
|
||||
title: lan.files.down_title,
|
||||
content: '<form class="bt-form pd20 pb70">\
|
||||
content: '<form class="bt-form pd20">\
|
||||
<div class="line">\
|
||||
<span class="tname">URL地址:</span><input type="text" class="bt-input-text" name="url" id="mUrl" placeholder="URL地址" style="width:330px" />\
|
||||
<span class="tname">URL地址:</span>\
|
||||
<input type="text" class="bt-input-text" name="url" id="mUrl" placeholder="URL地址" style="width:330px" />\
|
||||
</div>\
|
||||
<div class="line">\
|
||||
<span class="tname ">下载到:</span><input type="text" class="bt-input-text" name="path" id="dpath" value="'+path+'" placeholder="下载到" style="width:330px" />\
|
||||
<span class="tname ">下载到:</span>\
|
||||
<input type="text" class="bt-input-text" name="path" id="dpath" value="'+path+'" placeholder="下载到" style="width:330px" />\
|
||||
</div>\
|
||||
<div class="line">\
|
||||
<span class="tname">文件名:</span><input type="text" class="bt-input-text" name="filename" id="dfilename" value="" placeholder="文件名" style="width:330px" />\
|
||||
<span class="tname">文件名:</span>\
|
||||
<input type="text" class="bt-input-text" name="filename" id="dfilename" value="" placeholder="文件名" style="width:330px" />\
|
||||
</div>\
|
||||
<div class="bt-form-submit-btn">\
|
||||
<button type="button" class="btn btn-danger btn-sm" onclick="layer.closeAll()">关闭</button>\
|
||||
<button type="button" id="dlok" class="btn btn-success btn-sm dlok" onclick="downloadFile(1)">确定</button>\
|
||||
</div>\
|
||||
</form>'
|
||||
});
|
||||
$("#mUrl").keyup(function(){
|
||||
durl = $(this).val();
|
||||
tmp = durl.split('/');
|
||||
$("#dfilename").val(tmp[tmp.length-1]);
|
||||
</form>',
|
||||
success:function(){
|
||||
$("#mUrl").keyup(function(){
|
||||
durl = $(this).val();
|
||||
tmp = durl.split('/');
|
||||
$("#dfilename").val(tmp[tmp.length-1]);
|
||||
});
|
||||
},
|
||||
yes:function(){
|
||||
downloadFile(1);
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
|
||||
//重命名
|
||||
function reName(type, fileName) {
|
||||
if (type == 1) {
|
||||
@@ -1002,19 +1037,22 @@ function reName(type, fileName) {
|
||||
closeBtn: 2,
|
||||
area: '320px',
|
||||
title: '重命名',
|
||||
content: '<div class="bt-form pd20 pb70">\
|
||||
btn:["确定","保存"],
|
||||
content: '<div class="bt-form pd20">\
|
||||
<div class="line">\
|
||||
<input type="text" class="bt-input-text" name="Name" id="newFileName" value="' + fileName + '" placeholder="文件名" style="width:100%" />\
|
||||
</div>\
|
||||
<div class="bt-form-submit-btn">\
|
||||
<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">关闭</button>\
|
||||
<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="reName(1,\'' + fileName.replace(/'/,"\\'") + '\')">保存</button>\
|
||||
</div>\
|
||||
</div>'
|
||||
});
|
||||
$("#newFileName").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) $("#ReNameBtn").click();
|
||||
</div>',
|
||||
success:function(){
|
||||
$("#newFileName").focus().keyup(function(e){
|
||||
if(e.keyCode == 13) $("#ReNameBtn").click();
|
||||
});
|
||||
},
|
||||
yes:function(){
|
||||
reName(1,fileName.replace(/'/,"\\'"));
|
||||
}
|
||||
});
|
||||
|
||||
}
|
||||
//剪切
|
||||
function cutFile(fileName) {
|
||||
@@ -1023,7 +1061,7 @@ function cutFile(fileName) {
|
||||
setCookie('copyFileName', null);
|
||||
layer.msg('已剪切', {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
time: 1000,
|
||||
});
|
||||
setTimeout(function(){
|
||||
getFiles(path);
|
||||
@@ -1036,7 +1074,7 @@ function copyFile(fileName) {
|
||||
setCookie('cutFileName', null);
|
||||
layer.msg('已复制', {
|
||||
icon: 1,
|
||||
time: 1000
|
||||
time: 1000,
|
||||
});
|
||||
|
||||
setTimeout(function(){
|
||||
@@ -1140,8 +1178,8 @@ function zip(dirName,submits) {
|
||||
|
||||
param = dirName;
|
||||
if(dirName.indexOf(',') != -1){
|
||||
tmp = path.split('/')
|
||||
dirName = path + '/' + tmp[tmp.length-1]
|
||||
tmp = path.split('/');
|
||||
dirName = path + '/' + tmp[tmp.length-1];
|
||||
}
|
||||
|
||||
layer.open({
|
||||
@@ -1153,28 +1191,29 @@ function zip(dirName,submits) {
|
||||
content: '<div class="bt-form pd20 pb70">'
|
||||
+'<div class="line noborder">'
|
||||
+'<input type="text" class="form-control" id="sfile" value="' +param + '" placeholder="" style="display:none" />'
|
||||
+'<span>'+lan.files.zip_to+'</span><input type="text" class="bt-input-text" id="dfile" value="'+dirName + '.tar.gz" placeholder="'+lan.files.zip_to+'" style="width: 75%; display: inline-block; margin: 0px 10px 0px 20px;" /><span class="glyphicon glyphicon-folder-open cursor" onclick="ChangePath(\'dfile\')"></span>'
|
||||
+'<span>'+lan.files.zip_to+'</span>\
|
||||
<input type="text" class="bt-input-text" id="dfile" value="'+dirName + '.tar.gz" placeholder="'+lan.files.zip_to+'" style="width: 75%; display: inline-block; margin: 0px 10px 0px 20px;" />\
|
||||
<span class="glyphicon glyphicon-folder-open cursor" onclick="changePath(\'dfile\')"></span>'
|
||||
+'</div>'
|
||||
+'<div class="bt-form-submit-btn">'
|
||||
+'<button type="button" class="btn btn-danger btn-sm btn-title" onclick="layer.closeAll()">'+lan.public.close+'</button>'
|
||||
+'<button type="button" id="ReNameBtn" class="btn btn-success btn-sm btn-title" onclick="zip(\'' + param + '\',1)">'+lan.files.file_menu_zip+'</button>'
|
||||
+'</div>'
|
||||
+'</div>'
|
||||
+'</div>',
|
||||
success:function(){
|
||||
$("#dfile").change(function(){
|
||||
var dfile = $(this).val()
|
||||
tmp = dfile.split('.');
|
||||
if(tmp[tmp.length-1] != 'gz'){
|
||||
var path = $("#DirPathPlace input").val();
|
||||
tmp = path.split('/');
|
||||
dfile += '/' + tmp[tmp.length-1] + '.tar.gz'
|
||||
$(this).val(dfile.replace(/\/\//g,'/'))
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
setTimeout(function(){
|
||||
$("#dfile").change(function(){
|
||||
var dfile = $(this).val()
|
||||
tmp = dfile.split('.');
|
||||
if(tmp[tmp.length-1] != 'gz'){
|
||||
var path = $("#DirPathPlace input").val();
|
||||
tmp = path.split('/');
|
||||
dfile += '/' + tmp[tmp.length-1] + '.tar.gz'
|
||||
$(this).val(dfile.replace(/\/\//g,'/'))
|
||||
}
|
||||
});
|
||||
},100);
|
||||
|
||||
}
|
||||
|
||||
//解压目录
|
||||
@@ -1208,8 +1247,8 @@ function unZip(fileName,type) {
|
||||
content: '<div class="bt-form pd20 pb70">'
|
||||
+'<div class="line unzipdiv">'
|
||||
+'<span class="tname">'+lan.files.unzip_name+'</span><input type="text" class="bt-input-text" id="sfile" value="' +fileName + '" placeholder="'+lan.files.unzip_name_title+'" style="width:330px" /></div>'
|
||||
+'<div class="line"><span class="tname">'+lan.files.unzip_to+'</span><input type="text" class="bt-input-text" id="dfile" value="'+path + '" placeholder="'+lan.files.unzip_to+'" style="width:330px" /></div>' + umpass
|
||||
+'<div class="line"><span class="tname">'+lan.files.unzip_coding+'</span><select class="bt-input-text" name="coding">'
|
||||
+'<div class="line"><span class="tname">'+lan.files.unzip_to+'</span><input type="text" class="bt-input-text" id="dfile" value="'+path + '" placeholder="'+lan.files.unzip_to+'" style="width:330px" /></div>'
|
||||
+ umpass +'<div class="line"><span class="tname">'+lan.files.unzip_coding+'</span><select class="bt-input-text" name="coding">'
|
||||
+'<option value="UTF-8">UTF-8</option>'
|
||||
+'<option value="gb18030">GBK</option>'
|
||||
+'</select>'
|
||||
@@ -1233,7 +1272,8 @@ function isZip(fileName){
|
||||
|
||||
//是否文本文件
|
||||
function isText(fileName){
|
||||
var exts = ['rar','zip','tar.gz','gz','iso','xsl','doc','xdoc','jpeg','jpg','png','gif','bmp','tiff','exe','so','7z','bz'];
|
||||
var exts = ['rar','zip','tar.gz','gz','iso','xsl','doc','xdoc','jpeg',
|
||||
'jpg','png','gif','bmp','tiff','exe','so','7z','bz'];
|
||||
return isExts(fileName,exts)?false:true;
|
||||
}
|
||||
|
||||
@@ -1424,36 +1464,63 @@ function onAccess(){
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
//右键菜单
|
||||
function RClick(type,path,name){
|
||||
function rightMenuClick(type,path,name){
|
||||
console.log(type,path,name);
|
||||
var displayZip = isZip(type);
|
||||
var options = {items:[
|
||||
{text: lan.files.file_menu_copy, onclick: function() {copyFile(path)}},
|
||||
{text: lan.files.file_menu_mv, onclick: function() {cutFile(path)}},
|
||||
{text: lan.files.file_menu_rename, onclick: function() {reName(0,name)}},
|
||||
{text: lan.files.file_menu_auth, onclick: function() {setChmod(0,path)}},
|
||||
{text: lan.files.file_menu_zip, onclick: function() {zip(path)}}
|
||||
|
||||
{text: "复制", onclick: function() {copyFile(path)}},
|
||||
{text: "剪切", onclick: function() {cutFile(path)}},
|
||||
{text: "重命名", onclick: function() {reName(0,name)}},
|
||||
{text: lan.files.file_menu_auth, onclick: function() {setChmod(0,path)}},
|
||||
{text: lan.files.file_menu_zip, onclick: function() {zip(path)}},
|
||||
]};
|
||||
if(type == "dir"){
|
||||
options.items.push({text: lan.files.file_menu_del, onclick: function() {DeleteDir(path)}});
|
||||
options.items.push({text: lan.files.file_menu_del, onclick: function() {
|
||||
deleteDir(path)}
|
||||
});
|
||||
}
|
||||
else if(isText(type)){
|
||||
options.items.push({text: lan.files.file_menu_edit, onclick: function() {onlineEditFile(0,path)}},{text: lan.files.file_menu_down, onclick: function() {GetFileBytes(path)}},{text: lan.files.file_menu_del, onclick: function() {deleteFile(path)}});
|
||||
options.items.push({text: lan.files.file_menu_edit, onclick: function() {
|
||||
onlineEditFile(0,path);
|
||||
}},{text: lan.files.file_menu_down, onclick: function() {
|
||||
getFileBytes(path);
|
||||
}},{ text: lan.files.file_menu_del, onclick: function() {
|
||||
deleteFile(path);
|
||||
}});
|
||||
}
|
||||
else if(displayZip != -1){
|
||||
options.items.push({text: lan.files.file_menu_unzip, onclick: function() {unZip(path,displayZip)}},{text: lan.files.file_menu_down, onclick: function() {GetFileBytes(path)}},{text: lan.files.file_menu_del, onclick: function() {deleteFile(path)}});
|
||||
options.items.push({text: lan.files.file_menu_unzip, onclick: function() {
|
||||
unZip(path,displayZip);
|
||||
}},{text: lan.files.file_menu_down, onclick: function() {
|
||||
getFileBytes(path);
|
||||
}},{text: lan.files.file_menu_del, onclick: function() {
|
||||
deleteFile(path);
|
||||
}});
|
||||
}
|
||||
else if(isImage(type)){
|
||||
options.items.push({text: lan.files.file_menu_img, onclick: function() {GetImage(path)}},{text: lan.files.file_menu_down, onclick: function() {GetFileBytes(path)}},{text: lan.files.file_menu_del, onclick: function() {deleteFile(path)}});
|
||||
options.items.push({text: lan.files.file_menu_img, onclick: function() {
|
||||
getImage(path);
|
||||
}},{text: lan.files.file_menu_down, onclick: function() {
|
||||
getFileBytes(path);
|
||||
}},{text: lan.files.file_menu_del, onclick: function() {
|
||||
deleteFile(path);
|
||||
}});
|
||||
}
|
||||
else{
|
||||
options.items.push({text: lan.files.file_menu_down, onclick: function() {GetFileBytes(path)}},{text: lan.files.file_menu_del, onclick: function() {deleteFile(path)}});
|
||||
options.items.push({text: lan.files.file_menu_down, onclick: function() {
|
||||
getFileBytes(path);
|
||||
}},{text: lan.files.file_menu_del, onclick: function() {
|
||||
deleteFile(path);
|
||||
}});
|
||||
}
|
||||
return options;
|
||||
}
|
||||
|
||||
//右键批量操作
|
||||
function RClickAll(e){
|
||||
function rightMenuClickAll(e){
|
||||
var menu = $("#rmenu");
|
||||
var windowWidth = $(window).width(),
|
||||
windowHeight = $(window).height(),
|
||||
|
||||
+2
-5
@@ -1,9 +1,6 @@
|
||||
/*!
|
||||
* jQuery Contextify v1.0.8 (http://contextify.js.org)
|
||||
* jQuery Contextify v1.0.7 (http://contextify.js.org)
|
||||
* Copyright (c) 2016 Adam Bouqdib
|
||||
* Licensed under GPL-2.0 (http://abemedia.co.uk/license)
|
||||
*/
|
||||
|
||||
|
||||
!function(a){"function"==typeof define&&define.amd?define(["jquery"],a):a(jQuery,window)}(function(a,b){function c(b,c){this.element=b,this.options=a.extend({},e,c),this._defaults=e,this._name=d,this.init()}var d="contextify",e={items:[],action:"contextmenu",menuId:"contextify-menu",menuClass:"dropdown-menu",headerClass:"dropdown-header",dividerClass:"divider",before:!1},f=0,g=a(b);c.prototype.init=function(){var b=a.extend({},this.options,a(this.element).data());b.id=f,a(this.element).attr("data-contextify-id",b.id).on("contextmenu",function(c){c.preventDefault(),"function"==typeof b.before&&b.before(this,b);var d=a('<ul class="'+b.menuClass+'" role="menu" id="'+b.menuId+'" data-contextify-id="'+b.id+'"/>');d.data(b);var e,f=b.items.length;for(e=0;e<f;e++){var h=b.items[e],i=a("<li/>");if(h.divider)i.addClass(b.dividerClass);else if(h.header)i.addClass(b.headerClass),i.html(h.header);else{i.append("<a/>");var j=i.find("a");if(h.href&&j.attr("href",h.href),h.onclick&&(j.on("click",b,h.onclick),j.css("cursor","pointer")),h.data){for(var k in h.data)d.attr("data-"+k,h.data[k]);j.data(h.data)}j.html(h.text)}d.append(i)}var l=a("#"+b.menuId);l.length>0?l!==d&&l.replaceWith(d):a("body").append(d);var m=g.width(),n=g.height(),o=d.outerWidth(),p=d.outerHeight(),q=o+c.clientX<m?c.clientX:m-o,r=p+c.clientY<n?c.clientY:n-p;d.css("top",r).css("left",q).css("position","fixed").show();if($("#rmenu").is(":visible")) d.hide()}).parents().on("mouseup",function(){a("#"+b.menuId).hide()}),g.on("scroll",function(){a("#"+b.menuId).hide()}),f++},c.prototype.destroy=function(){var b=a(this.element),c=a.extend({},this.options,b.data());b.removeAttr("data-contextify-id").off("contextmenu").parents().off("mouseup",function(){a("#"+c.menuId).hide()}),g.off("scroll",function(){a("#"+c.menuId).hide()}),a("#"+c.menuId).remove()},a.fn[d]=function(b){return this.each(function(){a.data(this,"plugin_"+d)&&"[object String]"===Object.prototype.toString.call(b)?a.data(this,"plugin_"+d)[b]():a.data(this,"plugin_"+d)||a.data(this,"plugin_"+d,new c(this,b))})}});
|
||||
//# sourceMappingURL=jquery.contextify.min.js.map
|
||||
(function(factory){if(typeof define==="function"&&define.amd){define(["jquery"],factory)}else{factory(jQuery,window)}}(function($,window){var pluginName="contextify",defaults={items:[],action:"contextmenu",menuId:"contextify-menu",menuClass:"dropdown-menu",headerClass:"dropdown-header",dividerClass:"divider",before:false},contextifyId=0;function Plugin(element,options){this.element=element;this.options=$.extend({},defaults,options);this._defaults=defaults;this._name=pluginName;this.init()}Plugin.prototype.init=function(){var options=$.extend({},this.options,$(this.element).data()),that=$(this);options.id=contextifyId;$(this.element).attr("data-contextify-id",options.id).on("contextmenu",function(e){e.preventDefault();if(typeof(options.before)==="function"){options.before(this,options)}var menu=$('<ul class="'+options.menuClass+'" role="menu" id="'+options.menuId+'" data-contextify-id="'+options.id+'"/>');menu.data(options);var l=options.items.length;var i;for(i=0;i<l;i++){var item=options.items[i];var el=$("<li/>");if(item.divider){el.addClass(options.dividerClass)}else{if(item.header){el.addClass(options.headerClass);el.html(item.header)}else{el.append("<a/>");var a=el.find("a");if(item.href){a.attr("href",item.href)}if(item.onclick){a.on("click",options,item.onclick);a.css("cursor","pointer")}if(item.data){for(var data in item.data){menu.attr("data-"+data,item.data[data])}a.data(item.data)}a.html(item.text)}}menu.append(el)}var currentMenu=$("#"+options.menuId);if(currentMenu.length>0){if(currentMenu!==menu){currentMenu.replaceWith(menu)}}else{$("body").append(menu)}var clientTop=$(window).scrollTop()+e.clientY,x=(menu.width()+e.clientX<$(window).width())?e.clientX:e.clientX-menu.width(),y=(menu.height()+e.clientY<$(window).height())?clientTop:clientTop-menu.height();menu.css("top",y).css("left",x).css("position","fixed").show();$(document).one("click",function(e){$("#"+options.menuId).hide();e.preventDefault()})}).one("click",function(e){$("#"+options.menuId).hide();e.preventDefault()});contextifyId++};Plugin.prototype.destroy=function(){var el=$(this.element),options=$.extend({},this.options,el.data()),menu=$("#"+options.menuId);el.removeAttr("data-contextify-id").off("contextmenu").parents().off("mouseup",function(){menu.hide()});menu.remove()};$.fn[pluginName]=function(options){return this.each(function(){if($.data(this,"plugin_"+pluginName)&&Object.prototype.toString.call(options)==="[object String]"){$.data(this,"plugin_"+pluginName)[options]()}else{if(!$.data(this,"plugin_"+pluginName)){$.data(this,"plugin_"+pluginName,new Plugin(this,options))}}})}}));
|
||||
@@ -25,7 +25,7 @@
|
||||
</div>
|
||||
<div class="clearfix ptb10">
|
||||
<button class="btn btn-default btn-sm pull-left" onclick="uploadFiles()">上传</button>
|
||||
<button class="btn btn-default btn-sm pull-left" onclick="downloadFile()" title="$tData['lan']['TI1']" style="margin:0 5px">远程下载</button>
|
||||
<button class="btn btn-default btn-sm pull-left" onclick="downloadFile()" title="远程下载" style="margin:0 5px">远程下载</button>
|
||||
<span id='BarTools'></span>
|
||||
<span id='Batch' style="background-color:#fff;position:absolute;right:190px;z-index:10"></span>
|
||||
<span id='comlist' class="comlist"></span>
|
||||
@@ -54,14 +54,18 @@
|
||||
<li onclick="javascript:batch(3);"><a style="cursor: pointer;">压缩</a></li>
|
||||
<li onclick="javascript:batch(4);"><a style="cursor: pointer;">删除</a></li>
|
||||
</ul>
|
||||
|
||||
<script src="/static/js/jquery-ui.min.js?v={{config.version}}"></script>
|
||||
<script src="/static/js/jquery.contextify.min.js?v={{config.version}}"></script>
|
||||
<script src="/static/app/files.js?v={{config.version}}"></script>
|
||||
<script src="/static/app/upload.js?v={{config.version}}"></script>
|
||||
<script type="text/javascript">
|
||||
|
||||
setTimeout(function() {
|
||||
getDisk();
|
||||
}, 500);
|
||||
|
||||
|
||||
var xPath = getCookie('open_dir_path');
|
||||
setTimeout(function() {
|
||||
getFiles((xPath != undefined ? xPath : '/www/wwwroot'));
|
||||
@@ -72,18 +76,21 @@ setCookie('uploadSize', 1024 * 1024 * 1024);
|
||||
if (getCookie('rank') == undefined || getCookie('rank') == null) {
|
||||
setCookie('rank', 'a');
|
||||
}
|
||||
|
||||
$("#set_icon").click(function() {
|
||||
setCookie('rank', 'b');
|
||||
$(this).addClass("active");
|
||||
$("#set_list").removeClass("active");
|
||||
getFiles(getCookie('open_dir_path'));
|
||||
});
|
||||
|
||||
$("#set_list").click(function() {
|
||||
setCookie('rank', 'a');
|
||||
$(this).addClass("active");
|
||||
$("#set_icon").removeClass("active");
|
||||
getFiles(getCookie('open_dir_path'));
|
||||
})
|
||||
|
||||
$(".refreshBtn").click(function() {
|
||||
getFiles(getCookie('open_dir_path'));
|
||||
})
|
||||
|
||||
@@ -92,6 +92,7 @@ yum install -y openldap openldap-devel
|
||||
yum install -y bison re2c cmake
|
||||
yum install -y cmake3
|
||||
yum install -y autoconf
|
||||
yum install -y expect
|
||||
|
||||
yum install -y curl curl-devel
|
||||
yum install -y zlib zlib-devel
|
||||
|
||||
@@ -37,6 +37,7 @@ echo y | pacman -Sy mariadb-clients
|
||||
echo y | pacman -Sy rpcsvc-proto
|
||||
echo y | pacman -Sy lemon
|
||||
echo y | pacman -Sy which
|
||||
echo y | pacman -Sy expect
|
||||
|
||||
## gd start
|
||||
echo y | pacman -Sy gd
|
||||
|
||||
@@ -20,6 +20,7 @@ yum install -y python-devel
|
||||
yum install -y vixie-cron
|
||||
yum install -y curl-devel libmcrypt libmcrypt-devel
|
||||
yum install -y mysql-devel
|
||||
yum install -y expect
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -17,6 +17,7 @@ if grep -Eq "Debian" /etc/*-release; then
|
||||
fi
|
||||
|
||||
apt update -y
|
||||
apt-get update -y
|
||||
|
||||
|
||||
apt install -y wget curl lsof unzip
|
||||
@@ -24,6 +25,7 @@ apt install -y python3-pip
|
||||
apt install -y python3-dev
|
||||
apt install -y python3-venv
|
||||
apt install -y cron
|
||||
apt install -y expect
|
||||
|
||||
apt install -y locate
|
||||
locale-gen en_US.UTF-8
|
||||
|
||||
@@ -14,6 +14,7 @@ setenforce 0
|
||||
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
|
||||
|
||||
yum install -y wget curl lsof unzip
|
||||
yum install -y expect
|
||||
dnf install crontabs -y
|
||||
|
||||
#https need
|
||||
|
||||
@@ -26,6 +26,7 @@ pkg install -y cmake
|
||||
pkg install -y libxslt
|
||||
pkg install -y libunwind
|
||||
pkg install -y influxpkg-config
|
||||
pkg install -y expect
|
||||
|
||||
pkg install -y pcre
|
||||
pkg install -y webp
|
||||
|
||||
@@ -27,6 +27,7 @@ zypper install -y libjpeg-devel libpng-devel
|
||||
zypper install -y libevent-devel
|
||||
zypper install -y libtirpc-devel
|
||||
zypper install -y rpcgen
|
||||
zypper install -y expect
|
||||
|
||||
zypper install -y libzip libzip-devel
|
||||
zypper install -y libmemcached libmemcached-devel
|
||||
|
||||
@@ -17,6 +17,7 @@ yum install -y wget lsof
|
||||
yum install -y python3-devel
|
||||
yum install -y python-devel
|
||||
yum install -y crontabs
|
||||
yum install -y expect
|
||||
yum install -y curl curl-devel libcurl libcurl-devel
|
||||
#https need
|
||||
|
||||
|
||||
@@ -10,12 +10,13 @@ fi
|
||||
|
||||
|
||||
apt update -y
|
||||
apt-get update -y
|
||||
|
||||
apt install -y wget curl lsof unzip
|
||||
apt install -y python3-pip
|
||||
apt install -y python3-venv
|
||||
apt install -y python3-dev
|
||||
|
||||
apt install -y expect
|
||||
|
||||
apt install -y cron
|
||||
|
||||
|
||||
@@ -1,85 +0,0 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
# LANG=en_US.UTF-8
|
||||
is64bit=`getconf LONG_BIT`
|
||||
|
||||
if [ -f /etc/motd ];then
|
||||
echo "welcome to mdserver-web panel" > /etc/motd
|
||||
fi
|
||||
|
||||
startTime=`date +%s`
|
||||
|
||||
_os=`uname`
|
||||
echo "use system: ${_os}"
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root!"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
OSNAME='opensuse'
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt update -y
|
||||
apt install -y devscripts
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
apt install -y wget zip unzip
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
|
||||
if [ $OSNAME != "macos" ];then
|
||||
mkdir -p /www/server
|
||||
mkdir -p /www/wwwroot
|
||||
mkdir -p /www/wwwlogs
|
||||
mkdir -p /www/backup/database
|
||||
mkdir -p /www/backup/site
|
||||
|
||||
if [ ! -d /www/server/mdserver-web ];then
|
||||
wget -O /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||
cd /tmp && unzip /tmp/master.zip
|
||||
mv -f /tmp/mdserver-web-master /www/server/mdserver-web
|
||||
rm -rf /tmp/master.zip
|
||||
rm -rf /tmp/mdserver-web-master
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "use system version: ${OSNAME}"
|
||||
cd /www/server/mdserver-web && bash scripts/install/${OSNAME}.sh
|
||||
|
||||
chmod +x /www/server/mdserver-web/mw-cli
|
||||
if [ ! -e /usr/bin/mw-cli ]; then
|
||||
ln -s /www/server/mdserver-web/mw-cli /usr/bin/mw-cli
|
||||
fi
|
||||
|
||||
endTime=`date +%s`
|
||||
((outTime=(${endTime}-${startTime})/60))
|
||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||
|
||||
systemctl daemon-reload
|
||||
|
||||
|
||||
@@ -102,6 +102,14 @@ venv.bak/
|
||||
# mypy
|
||||
scripts/.git/*
|
||||
.git/*
|
||||
.github/*
|
||||
bin/*
|
||||
lib/*
|
||||
include/*
|
||||
pyvenv.cfg
|
||||
__pycache__
|
||||
|
||||
docker/*
|
||||
.mypy_cache/
|
||||
.gitignore
|
||||
.git
|
||||
@@ -117,5 +125,15 @@ data/system.db
|
||||
data/default.pl
|
||||
data/control.conf
|
||||
data/iplist.txt
|
||||
data/osname.pl
|
||||
data/edate.pl
|
||||
data/backup.pl
|
||||
data/default_site.pl
|
||||
data/port.pl
|
||||
data/api_login.txt
|
||||
data/json/index.json
|
||||
data/sessions/*
|
||||
|
||||
|
||||
|
||||
script/init.d/mw
|
||||
|
||||
@@ -1,62 +0,0 @@
|
||||
#!/bin/bash
|
||||
PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
|
||||
export PATH
|
||||
# LANG=en_US.UTF-8
|
||||
is64bit=`getconf LONG_BIT`
|
||||
|
||||
startTime=`date +%s`
|
||||
|
||||
_os=`uname`
|
||||
echo "use system: ${_os}"
|
||||
|
||||
if [ "$EUID" -ne 0 ]
|
||||
then echo "Please run as root!"
|
||||
exit
|
||||
fi
|
||||
|
||||
|
||||
|
||||
if [ ${_os} == "Darwin" ]; then
|
||||
OSNAME='macos'
|
||||
elif grep -Eq "openSUSE" /etc/*-release; then
|
||||
OSNAME='opensuse'
|
||||
zypper refresh
|
||||
elif grep -Eq "FreeBSD" /etc/*-release; then
|
||||
OSNAME='freebsd'
|
||||
elif grep -Eqi "CentOS" /etc/issue || grep -Eq "CentOS" /etc/*-release; then
|
||||
OSNAME='centos'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Fedora" /etc/issue || grep -Eq "Fedora" /etc/*-release; then
|
||||
OSNAME='fedora'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Rocky" /etc/issue || grep -Eq "Rocky" /etc/*-release; then
|
||||
OSNAME='rocky'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "AlmaLinux" /etc/issue || grep -Eq "AlmaLinux" /etc/*-release; then
|
||||
OSNAME='alma'
|
||||
yum install -y wget zip unzip
|
||||
elif grep -Eqi "Debian" /etc/issue || grep -Eq "Debian" /etc/*-release; then
|
||||
OSNAME='debian'
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Ubuntu" /etc/issue || grep -Eq "Ubuntu" /etc/*-release; then
|
||||
OSNAME='ubuntu'
|
||||
apt install -y wget zip unzip
|
||||
elif grep -Eqi "Raspbian" /etc/issue || grep -Eq "Raspbian" /etc/*-release; then
|
||||
OSNAME='raspbian'
|
||||
else
|
||||
OSNAME='unknow'
|
||||
fi
|
||||
|
||||
wget -O /tmp/master.zip https://gitee.com/midoks/mdserver-web/repository/archive/master.zip
|
||||
cd /tmp && unzip /tmp/master.zip
|
||||
cp -rf /tmp/mdserver-web-master/* /www/server/mdserver-web
|
||||
rm -rf /tmp/master.zip
|
||||
rm -rf /tmp/mdserver-web-master
|
||||
|
||||
#pip uninstall public
|
||||
echo "use system version: ${OSNAME}"
|
||||
cd /www/server/mdserver-web && bash scripts/update/${OSNAME}.sh
|
||||
|
||||
endTime=`date +%s`
|
||||
((outTime=($endTime-$startTime)/60))
|
||||
echo -e "Time consumed:\033[32m $outTime \033[0mMinute!"
|
||||
+12
-32
@@ -1,42 +1,22 @@
|
||||
[
|
||||
{
|
||||
"version": "0.8.6",
|
||||
"content": "* mysql主从配置。<br/> * swap插件[虚拟内存]。<br/> * 部分优化。",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.8.6/mdserver-web.zip"
|
||||
"version": "0.9.9",
|
||||
"content": "* 目标版本。",
|
||||
},
|
||||
{
|
||||
"version": "0.8.5",
|
||||
"content": "* 添加PHP80版本-Alpha <br/> * 自动识别IP地址 <br/> * 增加xhprof插件",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.8.5/mdserver-web.zip"
|
||||
"version": "0.9.2",
|
||||
"content": "* 批量域名添加修复。<br/> * 常用命令说明。",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.9.2/mdserver-web.zip"
|
||||
},
|
||||
{
|
||||
"version": "0.7.3",
|
||||
"content": "* 修复自动更新错误 <br/> * 优化文件批量处理 <br/> * 添加PHP守护插件",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.7.3/mdserver-web.zip"
|
||||
"version": "0.9.1",
|
||||
"content": "* 菜单修复。<br/> * 更新修复",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.9.1/mdserver-web.zip",
|
||||
"purge":"https://purge.jsdelivr.net/gh/midoks/mdserver-web@latest/scripts/update.sh"
|
||||
},
|
||||
{
|
||||
"version": "0.5.6",
|
||||
"content": "* openresty,php,mysql,memcached,redis,pureftp,sphinx自启动添加 <br/> * 修复rsync自启动问题",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.5.6/mdserver-web.zip"
|
||||
},
|
||||
{
|
||||
"version": "0.4.2",
|
||||
"content": "* ssh工具优化<br/>* 面板收藏功能完成<br/>* 网站子目录绑定<br/>* 网站备份<br/>* 自动更新优化",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.4.2/mdserver-web.zip"
|
||||
},
|
||||
{
|
||||
"version": "0.0.6",
|
||||
"content": "1.修复重复js方法",
|
||||
"path": "https://github.com//midoks/mdserver-web/archive/0.0.6.zip"
|
||||
},
|
||||
{
|
||||
"version": "0.0.5",
|
||||
"content": "1.基本功能OK<br/>,2.网站HTTPS功能验证!",
|
||||
"path": "https://github.com//midoks/mdserver-web/archive/0.0.5.zip"
|
||||
},
|
||||
{
|
||||
"version": "0.0.1.2",
|
||||
"content": "1.项目初建!<br/>2.面板更新功能!",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.0.1/mdserver-web.zip"
|
||||
"version": "0.9.0",
|
||||
"content": "* 主流系统支持。<br/> * 插件支持更多参数。<br/>* MySQL主从支持GTID和经典模式。<br/>* MariaDB主从支持GTID和经典模式。<br/>* Rsyncd更新。<br/>* 添加网站统计的插件。<br/>* 添加varnish插件。",
|
||||
"path": "https://github.com/midoks/mdserver-web/releases/download/0.9.0/mdserver-web.zip"
|
||||
}
|
||||
]
|
||||
Reference in New Issue
Block a user