mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-09-13 13:07:39 +02:00
v6.8.12
1. Add disk IO information to the homepage 2. Add a clear list button in the upload window 3. Optimize the background task overhead of the panel 4. Optimize the disk information caching mechanism 5. Panel Pro edition is online 6. Optimize panel resource usage 7. Optimize SSL certificate renewal 8. Fix the problem of reporting an error when the security entrance is empty 9. Fix the problem of infinite recursion when copying directories in extreme cases
This commit is contained in:
+40
-30
@@ -8,6 +8,7 @@
|
||||
# +-------------------------------------------------------------------
|
||||
from BTPanel import session, cache , request, redirect, g
|
||||
from datetime import datetime
|
||||
from public import dict_obj
|
||||
import os
|
||||
import public
|
||||
import json
|
||||
@@ -15,17 +16,6 @@ import sys
|
||||
import time
|
||||
|
||||
|
||||
class dict_obj:
|
||||
def __contains__(self, key):
|
||||
return getattr(self, key, None)
|
||||
|
||||
def __setitem__(self, key, value): setattr(self, key, value)
|
||||
def __getitem__(self, key): return getattr(self, key, None)
|
||||
def __delitem__(self, key): delattr(self, key)
|
||||
def __delattr__(self, key): delattr(self, key)
|
||||
def get_items(self): return self
|
||||
|
||||
|
||||
class panelSetup:
|
||||
def init(self):
|
||||
ua = request.headers.get('User-Agent','')
|
||||
@@ -33,7 +23,7 @@ class panelSetup:
|
||||
ua = ua.lower()
|
||||
if ua.find('spider') != -1 or ua.find('bot') != -1:
|
||||
return redirect('https://www.google.com')
|
||||
g.version = '6.8.8'
|
||||
g.version = '6.8.12'
|
||||
g.title = public.GetConfigValue('title')
|
||||
g.uri = request.path
|
||||
g.debug = os.path.exists('data/debug.pl')
|
||||
@@ -50,22 +40,28 @@ class panelSetup:
|
||||
else:
|
||||
g.cdn_url = '/static'
|
||||
session['title'] = g.title
|
||||
dirPath = '/www/server/phpmyadmin/pma'
|
||||
if os.path.exists(dirPath):
|
||||
public.ExecShell("rm -rf {}".format(dirPath))
|
||||
|
||||
dirPath = '/www/server/adminer'
|
||||
if os.path.exists(dirPath):
|
||||
public.ExecShell("rm -rf {}".format(dirPath))
|
||||
|
||||
dirPath = '/www/server/panel/adminer'
|
||||
if os.path.exists(dirPath):
|
||||
public.ExecShell("rm -rf {}".format(dirPath))
|
||||
|
||||
g.is_aes = False
|
||||
self.other_import()
|
||||
return None
|
||||
|
||||
|
||||
def other_import(self):
|
||||
g.o = public.readFile('data/o.pl')
|
||||
g.other_css = []
|
||||
g.other_js = []
|
||||
if g.o:
|
||||
s_path = 'BTPanel/static/other/{}'
|
||||
css_name = "css/{}.css".format(g.o)
|
||||
css_file = s_path.format(css_name)
|
||||
if os.path.exists(css_file): g.other_css.append('/static/other/{}'.format(css_name))
|
||||
|
||||
js_name = "js/{}.js".format(g.o)
|
||||
js_file = s_path.format(js_name)
|
||||
if os.path.exists(js_file): g.other_js.append('/static/other/{}'.format(js_name))
|
||||
|
||||
|
||||
|
||||
class panelAdmin(panelSetup):
|
||||
setupPath = '/www/server'
|
||||
|
||||
@@ -110,7 +106,7 @@ class panelAdmin(panelSetup):
|
||||
if not 'lan' in session:
|
||||
session['lan'] = public.GetLanguage()
|
||||
if not 'home' in session:
|
||||
session['home'] = 'https://console.aapanel.com'
|
||||
session['home'] = 'https://brandnew.aapanel.com'
|
||||
return False
|
||||
|
||||
# 检查Web服务器类型
|
||||
@@ -276,15 +272,29 @@ class panelAdmin(panelSetup):
|
||||
def GetOS(self):
|
||||
if not 'server_os' in session:
|
||||
tmp = {}
|
||||
if os.path.exists('/etc/redhat-release'):
|
||||
issue_file = '/etc/issue'
|
||||
redhat_release = '/etc/redhat-release'
|
||||
if os.path.exists(redhat_release):
|
||||
tmp['x'] = 'RHEL'
|
||||
tmp['osname'] = public.ReadFile(
|
||||
'/etc/redhat-release').split()[0]
|
||||
tmp['osname'] = self.get_osname(redhat_release)
|
||||
elif os.path.exists('/usr/bin/yum'):
|
||||
tmp['x'] = 'RHEL'
|
||||
tmp['osname'] = public.ReadFile('/etc/issue').split()[0]
|
||||
elif os.path.exists('/etc/issue'):
|
||||
tmp['osname'] = self.get_osname(issue_file)
|
||||
elif os.path.exists(issue_file):
|
||||
tmp['x'] = 'Debian'
|
||||
tmp['osname'] = public.ReadFile('/etc/issue').split()[0]
|
||||
tmp['osname'] = self.get_osname(issue_file)
|
||||
session['server_os'] = tmp
|
||||
return False
|
||||
|
||||
|
||||
def get_osname(self,i_file):
|
||||
'''
|
||||
@name 从指定文件中获取系统名称
|
||||
@author hwliang<2021-04-07>
|
||||
@param i_file<string> 指定文件全路径
|
||||
@return string
|
||||
'''
|
||||
if not os.path.exists(i_file): return ''
|
||||
issue_str = public.ReadFile(i_file).strip()
|
||||
if issue_str: return issue_str.split()[0]
|
||||
return ''
|
||||
|
||||
Reference in New Issue
Block a user