-
Notifications
You must be signed in to change notification settings - Fork 37
/
main.py
53 lines (44 loc) · 1.65 KB
/
main.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
import argparse
import gradio as gr
from loguru import logger
from tab.go import go_tab
from tab.login import login_tab
from tab.order import order_tab
from tab.problems import problems_tab
from tab.settings import setting_tab
header = """
# CPP 抢票🌈
⚠️此项目完全开源免费 ([项目地址](https://github.com/mikumifa/cppTickerBuy)),切勿进行盈利,所造成的后果与本人无关。
"""
short_js = """
<script src="https://cdn.staticfile.org/jquery/1.10.2/jquery.min.js" rel="external nofollow"></script>
<script src="https://static.geetest.com/static/js/gt.0.4.9.js"></script>
"""
custom_css = """
.pay_qrcode img {
width: 300px !important;
height: 300px !important;
margin-top: 20px; /* 避免二维码头部的说明文字挡住二维码 */
}
"""
if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument("--port", type=int, default=7860, help="server port")
parser.add_argument("--share", type=bool, default=False, help="create a public link")
args = parser.parse_args()
logger.add("app.log")
with gr.Blocks(head=short_js, css=custom_css) as demo:
gr.Markdown(header)
with gr.Tab("配置"):
setting_tab()
with gr.Tab("抢票"):
go_tab()
with gr.Tab("查看订单"):
order_tab()
with gr.Tab("登录管理"):
login_tab()
with gr.Tab("常见问题"):
problems_tab()
print("CPP账号的登录是在此控制台,请留意提示!!")
print("点击下面的网址运行程序 ↓↓↓↓↓↓↓↓↓↓↓↓↓↓")
demo.launch(share=args.share, inbrowser=True)