网站管理菜单
(self)
| 1335 | print(Colors.error("无效的选择,请重新输入")) |
| 1336 | |
| 1337 | def site_menu(self): |
| 1338 | """网站管理菜单""" |
| 1339 | while True: |
| 1340 | print("\n" + "-"*50) |
| 1341 | print(Colors.info(" 网站管理")) |
| 1342 | print("-"*50) |
| 1343 | print(" 1. 显示网站列表") |
| 1344 | print(" 2. 添加网站[PHP项目]") |
| 1345 | print(" 3. 添加网站[反代项目]") |
| 1346 | print(" 4. 删除网站") |
| 1347 | print(" 0. 返回上级") |
| 1348 | print("-"*50) |
| 1349 | |
| 1350 | choice = input("\n请选择操作 [0-4]: ").strip() |
| 1351 | |
| 1352 | if choice == '1': |
| 1353 | self.site_mgr.list_sites() |
| 1354 | elif choice == '2': |
| 1355 | print(Colors.info("\n=== 添加网站[PHP项目] ===")) |
| 1356 | domains = input("域名 (必填,如有多个域名请用空格隔开): ").strip() |
| 1357 | |
| 1358 | if not domains: |
| 1359 | print(Colors.error("域名不能为空")) |
| 1360 | continue |
| 1361 | |
| 1362 | domain_list = domains.split(" ") |
| 1363 | domain = domain_list[0] |
| 1364 | domain_list = domain_list[1:] |
| 1365 | domain_count = len(domain_list) |
| 1366 | |
| 1367 | webname={} |
| 1368 | webname["domain"] = domain |
| 1369 | webname["domainlist"] = domain_list |
| 1370 | webname["count"] = domain_count |
| 1371 | |
| 1372 | path = input(f"网站路径 (回车使用默认:/www/wwwroot/{domain}):").strip() |
| 1373 | if not path: |
| 1374 | path = f"/www/wwwroot/{domain}" |
| 1375 | |
| 1376 | print("\nPHP版本选择:") |
| 1377 | |
| 1378 | print(" 00 - 纯静态") |
| 1379 | php_version_list = [ |
| 1380 | "00", |
| 1381 | "52", |
| 1382 | "53", |
| 1383 | "54", |
| 1384 | "55", |
| 1385 | "56", |
| 1386 | "70", |
| 1387 | "71", |
| 1388 | "72", |
| 1389 | "73", |
| 1390 | "74", |
| 1391 | "80", |
| 1392 | "81", |
| 1393 | "82", |
| 1394 | "83" |
no test coverage detected