@name @author wzz <2024/5/29 下午6:08> @param "data":{"参数名":""} <数据类型> 参数描述 @return dict{"status":True/False,"msg":"提示信息"}
()
| 1038 | |
| 1039 | # 2024/5/29 下午6:08 获取面板反代的信息 |
| 1040 | def get_reverse_proxy(): |
| 1041 | ''' |
| 1042 | @name |
| 1043 | @author wzz <2024/5/29 下午6:08> |
| 1044 | @param "data":{"参数名":""} <数据类型> 参数描述 |
| 1045 | @return dict{"status":True/False,"msg":"提示信息"} |
| 1046 | ''' |
| 1047 | from mod.project.proxy.comMod import main as proxyMod |
| 1048 | pMod = proxyMod() |
| 1049 | |
| 1050 | site_name = "" |
| 1051 | try: |
| 1052 | args = public.to_dict_obj({}) |
| 1053 | proxy_list = pMod.get_list(args) |
| 1054 | if proxy_list["data"] is None: |
| 1055 | return public.returnResult(True, '', data={"siteName": site_name}) |
| 1056 | |
| 1057 | panel_port = str(public.get_panel_port()) |
| 1058 | for proxy in proxy_list["data"]["data"]: |
| 1059 | if panel_port == proxy["proxy_pass"].split(":")[-1].strip(): |
| 1060 | site_name = proxy["name"] |
| 1061 | break |
| 1062 | |
| 1063 | # if site_name != "": |
| 1064 | # args.site_name = site_name |
| 1065 | # global_conf = pMod.get_global_conf(args) |
| 1066 | # |
| 1067 | # password = "" |
| 1068 | # if os.path.exists("data/http_auth.pwd"): |
| 1069 | # password = public.readFile("data/http_auth.pwd") |
| 1070 | # |
| 1071 | # if password == "": |
| 1072 | # return public.returnResult(True, '', data={"siteName": site_name}) |
| 1073 | # |
| 1074 | # return_result = { |
| 1075 | # "username": global_conf["data"]["basic_auth"][0]["username"], |
| 1076 | # "password": password, |
| 1077 | # "siteName": site_name |
| 1078 | # } |
| 1079 | |
| 1080 | # return public.returnResult(True, '', data=return_result) |
| 1081 | |
| 1082 | return public.returnResult(True, '', data={"siteName": site_name}) |
| 1083 | except Exception as e: |
| 1084 | import traceback |
| 1085 | print(traceback.format_exc()) |
| 1086 | return public.returnMsg(False, '获取失败,错误{}!'.format(str(e)), data={"siteName": site_name}) |
| 1087 | |
| 1088 | |
| 1089 | # 2025/2/17 14:29 检测如果磁盘剩余空间是否小于500M,是就返回False |
no test coverage detected