Simple Linux Panel
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
mdserver-web/web/utils/config.py

33 lines
1.2 KiB

7 months ago
# coding:utf-8
# ---------------------------------------------------------------------------------
# MW-Linux面板
# ---------------------------------------------------------------------------------
# copyright (c) 2018-∞(https://github.com/midoks/mdserver-web) All rights reserved.
# ---------------------------------------------------------------------------------
# Author: midoks <midoks@163.com>
# ---------------------------------------------------------------------------------
from admin.model import getOption,getSitesCount
import core.mw as mw
def getGlobalVar():
'''
获取全局变量
'''
data = {}
data['title'] = getOption('title', default='后羿面板')
data['ip'] = getOption('server_ip', default='127.0.0.1')
data['site_path'] = getOption('site_path', default=mw.getFatherDir()+'/wwwroot')
data['backup_path'] = getOption('backup_path', default=mw.getFatherDir()+'/backup')
data['admin_path'] = '/'+getOption('admin_path', default='')
data['site_count'] = getSitesCount()
data['port'] = mw.getHostPort()
# 服务器时间
sformat = 'date +"%Y-%m-%d %H:%M:%S %Z %z"'
data['systemdate'] = mw.execShell(sformat)[0].strip()
return data