feat: 新增 XYZ 图层使用人数统计服务

This commit is contained in:
nixevol
2026-09-23 16:44:29 +08:00
parent d8f69a27e8
commit 0ad04fa638
25 changed files with 4293 additions and 0 deletions
+30
View File
@@ -0,0 +1,30 @@
# 用宝塔自己的接口新建网站,使其出现在面板的网站列表里。
# 用法:/www/server/panel/pyenv/bin/python3 bt_addsite.py <域名> <网站根目录>
import json
import os
import sys
os.chdir("/www/server/panel")
sys.path.insert(0, "/www/server/panel/class")
import public # noqa: E402
import panelSite # noqa: E402
domain, root = sys.argv[1], sys.argv[2]
get = public.dict_obj()
get.webname = json.dumps({"domain": domain, "domainlist": [], "count": 0})
get.path = root
get.type_id = "0"
get.type = "PHP"
get.version = "00"
get.port = "80"
get.ps = "XYZ 图层使用人数统计(xyzserver)"
get.ftp = "false"
get.sql = "false"
get.codeing = "utf8mb4"
res = panelSite.panelSite().AddSite(get)
print(json.dumps(res, ensure_ascii=False, default=str))
ok = isinstance(res, dict) and (res.get("siteStatus") is True or res.get("status") is True)
sys.exit(0 if ok else 1)