pull/632/head
Mr Chen 5 months ago
parent 0bd476340a
commit ccb02f14a6
  1. 6
      plugins/webstats/index.py
  2. 5
      plugins/webstats/info.json
  3. 2
      plugins/webstats/install.sh
  4. 2
      plugins/webstats/tool_task.py
  5. 13
      web/utils/plugin.py

@ -1398,6 +1398,10 @@ def installPreInspection():
return "请先安装OpenResty"
return 'ok'
def uninstallPreInspection():
stop()
return 'ok'
if __name__ == "__main__":
func = sys.argv[1]
if func == 'status':
@ -1412,6 +1416,8 @@ if __name__ == "__main__":
print(reload())
elif func == 'install_pre_inspection':
print(installPreInspection())
elif func == 'uninstall_pre_inspection':
print(uninstallPreInspection())
elif func == 'run_info':
print(runInfo())
elif func == 'get_global_conf':

@ -16,10 +16,11 @@
"name": "webstats",
"title": "网站统计",
"shell": "install.sh",
"versions":["0.2.5"],
"versions":"0.2.5",
"tip": "soft",
"install_pre_inspection":true,
"checks": "server/webstats",
"uninstall_pre_inspection":true,
"checks": "server/webstats/version.pl",
"path": "server/webstats",
"display": 1,
"author": "midoks",

@ -131,8 +131,8 @@ Install_App()
cp -rf $serverPath/source/webstats/GeoLite2-City.mmdb $serverPath/webstats/GeoLite2-City.mmdb
fi
echo "${VERSION}" > $serverPath/webstats/version.pl
cd $rootPath && python3 plugins/webstats/index.py start
echo "${VERSION}" > $serverPath/webstats/version.pl
echo '网站统计安装完成'

@ -93,7 +93,7 @@ def removeBgTask():
"id=?", (cfg["task_id"],)).find()
if res and res["id"] == cfg["task_id"]:
data = MwCrontab.instance().delete(cfg["task_id"])
if data[0]:
if data['status']:
# print(data[1])
cfg["task_id"] = -1
mw.writeFile(getTaskConf(), json.dumps(cfg))

@ -481,11 +481,13 @@ class plugin(object):
pInfo['setup'] = os.path.exists(pInfo['install_checks'])
if coexist and pInfo['setup']:
pInfo['setup_version'] = info['versions']
else:
elif pInfo['setup']:
if os.path.isdir(pInfo['install_checks']):
pInfo['setup_version'] = self.getVersion(pInfo['install_checks'])
else:
pInfo['setup_version'] = mw.readFile(pInfo['install_checks']).strip()
if 'install_pre_inspection' in info:
pInfo['install_pre_inspection'] = info['install_pre_inspection']
@ -801,6 +803,10 @@ class plugin(object):
args = '',
script = 'index',
):
if mw.inArray(['start','stop','restart','reload','uninstall_pre_inspection','install','uninstall'], func):
self.runByCache(name, func, version)
path = self.__plugin_dir + '/' + name + '/' + script + '.py'
if not os.path.exists(path):
path = self.__plugin_dir + '/' + name + '/' + name + '.py'
@ -816,8 +822,7 @@ class plugin(object):
py_cmd = 'cd ' + mw.getPanelDir() + " && "+ py_cmd
data = mw.execShell(py_cmd)
if mw.inArray(['start','stop','restart','reload'], func):
self.runByCache(name, func, version)
# print(data)
if mw.isDebugMode():

Loading…
Cancel
Save