nonebot-plugin-l4d2-server 0.5.1__py3-none-any.whl → 0.5.3__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- LICENSE +674 -674
- README.md +373 -359
- nonebot_plugin_l4d2_server/__init__.py +13 -13
- nonebot_plugin_l4d2_server/command.py +232 -232
- nonebot_plugin_l4d2_server/config.py +209 -210
- nonebot_plugin_l4d2_server/data/L4D2/image/template/anne.html +60 -60
- nonebot_plugin_l4d2_server/data/L4D2/image/template/fingerprint.svg +15 -15
- nonebot_plugin_l4d2_server/data/L4D2/image/template/help.html +233 -233
- nonebot_plugin_l4d2_server/data/L4D2/image/template/help_dack.html +231 -231
- nonebot_plugin_l4d2_server/data/L4D2/image/template/ip.html +48 -48
- nonebot_plugin_l4d2_server/data/L4D2/image/template/l.svg +9 -9
- nonebot_plugin_l4d2_server/l4d2_anne/__init__.py +251 -251
- nonebot_plugin_l4d2_server/l4d2_anne/analysis.py +51 -51
- nonebot_plugin_l4d2_server/l4d2_anne/anne_telecom.py +75 -75
- nonebot_plugin_l4d2_server/l4d2_anne/server.py +65 -65
- nonebot_plugin_l4d2_server/l4d2_anne/startand.py +17 -17
- nonebot_plugin_l4d2_server/l4d2_data/__init__.py +91 -91
- nonebot_plugin_l4d2_server/l4d2_data/config.py +17 -17
- nonebot_plugin_l4d2_server/l4d2_data/database.py +0 -0
- nonebot_plugin_l4d2_server/l4d2_data/players.py +87 -87
- nonebot_plugin_l4d2_server/l4d2_data/serverip.py +32 -32
- nonebot_plugin_l4d2_server/l4d2_file/__init__.py +122 -122
- nonebot_plugin_l4d2_server/l4d2_file/ayromote.py +56 -56
- nonebot_plugin_l4d2_server/l4d2_file/remote.py +63 -63
- nonebot_plugin_l4d2_server/l4d2_image/__init__.py +103 -103
- nonebot_plugin_l4d2_server/l4d2_image/download.py +101 -101
- nonebot_plugin_l4d2_server/l4d2_image/htmlimg.py +32 -32
- nonebot_plugin_l4d2_server/l4d2_image/image.py +292 -0
- nonebot_plugin_l4d2_server/l4d2_image/send_image_tool.py +32 -32
- nonebot_plugin_l4d2_server/l4d2_image/steam.py +83 -83
- nonebot_plugin_l4d2_server/l4d2_image/vtfs.py +40 -40
- nonebot_plugin_l4d2_server/l4d2_queries/__init__.py +114 -114
- nonebot_plugin_l4d2_server/l4d2_queries/api.py +43 -43
- nonebot_plugin_l4d2_server/l4d2_queries/ohter.py +35 -35
- nonebot_plugin_l4d2_server/l4d2_queries/qqgroup.py +288 -288
- nonebot_plugin_l4d2_server/l4d2_server/__init__.py +61 -61
- nonebot_plugin_l4d2_server/l4d2_server/index.py +0 -0
- nonebot_plugin_l4d2_server/l4d2_server/rcon.py +28 -28
- nonebot_plugin_l4d2_server/l4d2_server/workshop.py +50 -50
- nonebot_plugin_l4d2_server/l4d2_update/__init__.py +143 -0
- nonebot_plugin_l4d2_server/l4d2_update/draw_update_log.py +41 -0
- nonebot_plugin_l4d2_server/l4d2_update/restart.py +67 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/art.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/bento.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/bug.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/feat.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/log_title.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/other.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/texture2d/zap.png +0 -0
- nonebot_plugin_l4d2_server/l4d2_update/update.py +65 -0
- nonebot_plugin_l4d2_server/l4d2_web/web.py +234 -252
- nonebot_plugin_l4d2_server/l4d2_web/webUI.py +241 -245
- nonebot_plugin_l4d2_server/message.py +58 -58
- nonebot_plugin_l4d2_server/rule.py +15 -0
- nonebot_plugin_l4d2_server/seach.py +33 -33
- nonebot_plugin_l4d2_server/txt_to_img.py +64 -64
- nonebot_plugin_l4d2_server/utils.py +297 -272
- {nonebot_plugin_l4d2_server-0.5.1.dist-info → nonebot_plugin_l4d2_server-0.5.3.dist-info}/LICENSE +674 -674
- {nonebot_plugin_l4d2_server-0.5.1.dist-info → nonebot_plugin_l4d2_server-0.5.3.dist-info}/METADATA +19 -4
- nonebot_plugin_l4d2_server-0.5.3.dist-info/RECORD +68 -0
- {nonebot_plugin_l4d2_server-0.5.1.dist-info → nonebot_plugin_l4d2_server-0.5.3.dist-info}/WHEEL +1 -1
- nonebot_plugin_l4d2_server/chrome.py +0 -45
- nonebot_plugin_l4d2_server-0.5.1.dist-info/RECORD +0 -54
@@ -1,245 +1,241 @@
|
|
1
|
-
from amis import ActionType, TableCRUD, TableColumn
|
2
|
-
from amis import PageSchema, Switch, InputNumber, InputTag, Action, App
|
3
|
-
from amis import Form, InputText, InputPassword, DisplayModeEnum, Horizontal, Remark, Html, Page, AmisAPI, Wrapper
|
4
|
-
from amis import LevelEnum, Select, Alert, Tpl, Flex
|
5
|
-
|
6
|
-
|
7
|
-
from ..config import NICKNAME
|
8
|
-
|
9
|
-
logo = Html(html='''
|
10
|
-
<p align="center">
|
11
|
-
<a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server">
|
12
|
-
<img src="https://raw.githubusercontent.com/Agnes4m/nonebot_plugin_l4d2_server/main/image/logo.png"
|
13
|
-
width="256" height="256" alt="l4d2-server">
|
14
|
-
</a>
|
15
|
-
</p>
|
16
|
-
<h1 align="center">Nonebot-Plugin-L4d2-Server 控制台</h1>
|
17
|
-
<div align="center">
|
18
|
-
<a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server/" target="_blank">
|
19
|
-
Github仓库</a>
|
20
|
-
</div>
|
21
|
-
<br>
|
22
|
-
<br>
|
23
|
-
''')
|
24
|
-
login_api = AmisAPI(
|
25
|
-
url='/l4d2/api/login',
|
26
|
-
method='post',
|
27
|
-
adaptor='''
|
28
|
-
if (payload.status == 0) {
|
29
|
-
localStorage.setItem("token", payload.data.token);
|
30
|
-
}
|
31
|
-
return payload;
|
32
|
-
'''
|
33
|
-
)
|
34
|
-
|
35
|
-
login_form = Form(api=login_api, title='', body=[
|
36
|
-
InputText(name='username', label='用户名',
|
37
|
-
labelRemark=Remark(shape='circle', content='后台管理用户名,默认为l4d2')),
|
38
|
-
InputPassword(name='password', label='密码',
|
39
|
-
labelRemark=Remark(shape='circle', content='后台管理密码,默认为admin')),
|
40
|
-
], mode=DisplayModeEnum.horizontal, horizontal=Horizontal(left=3, right=9, offset=5), redirect='/l4d2/admin')
|
41
|
-
body = Wrapper(className='w-2/5 mx-auto my-0 m:w-full', body=login_form)
|
42
|
-
login_page = Page(title='', body=[logo, body])
|
43
|
-
|
44
|
-
global_config_form = Form(
|
45
|
-
title='全局配置',
|
46
|
-
name='global_config',
|
47
|
-
initApi='/l4d2/api/l4d2_global_config',
|
48
|
-
api='post:/l4d2/api/l4d2_global_config',
|
49
|
-
body=[
|
50
|
-
Switch(label='控制总开关(摆设)', name='total_enable', value='${total_enable}', onText='开启', offText='关闭',
|
51
|
-
labelRemark=Remark(shape='circle',
|
52
|
-
content='关闭后,禁用网页控制台,请参考文档启动方法')),
|
53
|
-
InputText(label='后台管理用户名', name='web_username', value='${web_username}',
|
54
|
-
labelRemark=Remark(shape='circle',
|
55
|
-
content='登录本后台管理所需要的用户名。')),
|
56
|
-
InputPassword(label='后台管理密码', name='web_password', value='${web_password}',
|
57
|
-
labelRemark=Remark(shape='circle',
|
58
|
-
content='登录本后台管理所需要的密码。')),
|
59
|
-
InputText(label='后台管理token密钥', name='web_secret_key', value='${web_secret_key}',
|
60
|
-
labelRemark=Remark(shape='circle',
|
61
|
-
content='用于本后台管理加密验证token的密钥。')),
|
62
|
-
InputText(label='查询key', name='l4_key', value='${l4_key}',
|
63
|
-
labelRemark=Remark(shape='circle',
|
64
|
-
content='用于获取拓展功能的key,加q群399365126领取。')),
|
65
|
-
InputText(label='字体', name='l4_font', value='${l4_font}',
|
66
|
-
labelRemark=Remark(shape='circle',
|
67
|
-
content='机器人返回图片中文字的字体。')),
|
68
|
-
Select(label='图片风格', name='l4_style', value='${l4_style}',source='${l4_styles}',
|
69
|
-
labelRemark=Remark(shape='circle',
|
70
|
-
content='仅仅是批量查询的风格')),
|
71
|
-
InputTag(label='查询的远程服务器tag', name='l4_tag', value='${l4_tag}',
|
72
|
-
enableBatchAdd=True,
|
73
|
-
placeholder='添加qq号', visibleOn='${total_enable}', joinValues=False, extractValue=True,
|
74
|
-
labelRemark=Remark(shape='circle',
|
75
|
-
content='在这里加入的用户,才能上传地图')),
|
76
|
-
InputTag(label='求生上传地图用户', name='l4_master', value='${l4_master}',
|
77
|
-
enableBatchAdd=True,
|
78
|
-
placeholder='添加qq号', visibleOn='${total_enable}', joinValues=False, extractValue=True,
|
79
|
-
labelRemark=Remark(shape='circle',
|
80
|
-
content='在这里加入的用户,才能上传地图')),
|
81
|
-
|
82
|
-
],
|
83
|
-
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
84
|
-
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
85
|
-
)
|
86
|
-
|
87
|
-
upload_map_form = Form(
|
88
|
-
title='全局配置',
|
89
|
-
name='global_config',
|
90
|
-
api='post:/l4d2/api/l4d2_map_config',
|
91
|
-
body=[
|
92
|
-
InputText(label='服务器host', name='web_username', value='${web_username}',
|
93
|
-
labelRemark=Remark(shape='circle',
|
94
|
-
content='127.0.0.1')),
|
95
|
-
InputPassword(label='服务器', name='web_password', value='${web_password}',
|
96
|
-
labelRemark=Remark(shape='circle',
|
97
|
-
content='登录本后台管理所需要的密码。')),
|
98
|
-
InputText(label='后台管理token密钥', name='web_secret_key', value='${web_secret_key}',
|
99
|
-
labelRemark=Remark(shape='circle',
|
100
|
-
content='用于本后台管理加密验证token的密钥。')),
|
101
|
-
InputText(label='查询key', name='l4_key', value='${l4_key}',
|
102
|
-
labelRemark=Remark(shape='circle',
|
103
|
-
content='用于获取拓展功能的key。')),
|
104
|
-
|
105
|
-
],
|
106
|
-
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
107
|
-
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
108
|
-
)
|
109
|
-
|
110
|
-
|
111
|
-
group_select = Select(label='分群配置(暂未完成)', name='group_id', source='${group_list}',
|
112
|
-
placeholder='选择群')
|
113
|
-
group_config_form = Form(
|
114
|
-
title='分群配置(暂未完成)',
|
115
|
-
visibleOn='group_id != null',
|
116
|
-
initApi='/l4d2/api/l4d2_group_config?group_id=${group_id}',
|
117
|
-
api='post:/l4d2/api/l4d2_group_config?group_id=${group_id}',
|
118
|
-
body=[
|
119
|
-
Switch(label='分群开关', name='enable', value='${enable}', onText='开启', offText='关闭',
|
120
|
-
labelRemark=Remark(shape='circle', content='针对该群的群聊学习开关,关闭后,仅该群不会学习和回复。')),
|
121
|
-
InputNumber(label='占位符', name='answer_threshold', value='${answer_threshold}', visibleOn='${enable}',
|
122
|
-
min=2,
|
123
|
-
labelRemark=Remark(shape='circle', content='单文本')),
|
124
|
-
InputTag(label='占位符', name='ban_words', value='${ban_words}', enableBatchAdd=True,
|
125
|
-
placeholder='占位符,词条', visibleOn='${enable}', joinValues=False, extractValue=True,
|
126
|
-
labelRemark=Remark(shape='circle', content='占位符词条')),
|
127
|
-
|
128
|
-
],
|
129
|
-
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
130
|
-
ActionType.Ajax(
|
131
|
-
label='保存至所有群',
|
132
|
-
level=LevelEnum.primary,
|
133
|
-
confirmText='确认将当前配置保存至所有群?',
|
134
|
-
api='post:/l4d2/api/l4d2_group_config?group_id=all'
|
135
|
-
),
|
136
|
-
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
137
|
-
)
|
138
|
-
|
139
|
-
server_control = Select(label='服务器设置', name='id_rank', source='${server_list}',
|
140
|
-
placeholder='选择服务器')
|
141
|
-
|
142
|
-
server_ditail= Form(
|
143
|
-
title='',
|
144
|
-
api='post:/l4d2/api/l4d2_server_config?id_rank=${id_rank}',
|
145
|
-
initApi='/l4d2/api/l4d2_server_config?id_rank=${id_rank}',
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
160
|
-
|
161
|
-
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
171
|
-
|
172
|
-
labelRemark=Remark(shape='circle',
|
173
|
-
content='
|
174
|
-
|
175
|
-
|
176
|
-
|
177
|
-
|
178
|
-
|
179
|
-
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
185
|
-
|
186
|
-
|
187
|
-
|
188
|
-
|
189
|
-
|
190
|
-
|
191
|
-
|
192
|
-
|
193
|
-
|
194
|
-
|
195
|
-
|
196
|
-
|
197
|
-
|
198
|
-
|
199
|
-
TableColumn(label='
|
200
|
-
TableColumn(label='
|
201
|
-
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
214
|
-
|
215
|
-
|
216
|
-
|
217
|
-
|
218
|
-
|
219
|
-
|
220
|
-
|
221
|
-
|
222
|
-
|
223
|
-
|
224
|
-
|
225
|
-
|
226
|
-
|
227
|
-
|
228
|
-
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
234
|
-
|
235
|
-
|
236
|
-
|
237
|
-
header
|
238
|
-
|
239
|
-
|
240
|
-
|
241
|
-
|
242
|
-
pages=[{
|
243
|
-
'children': [config_page, database_page]
|
244
|
-
}],
|
245
|
-
footer='<div class="p-2 text-center bg-blue-100">Copyright © 2022 - 2023 <a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server" target="_blank" class="link-secondary">AGNES_DIGIAL</a> X<a target="_blank" href="https://github.com/baidu/amis" class="link-secondary" rel="noopener"> amis v2.2.0</a></div>')
|
1
|
+
from amis import ActionType, TableCRUD, TableColumn
|
2
|
+
from amis import PageSchema, Switch, InputNumber, InputTag, Action, App
|
3
|
+
from amis import Form, InputText, InputPassword, DisplayModeEnum, Horizontal, Remark, Html, Page, AmisAPI, Wrapper
|
4
|
+
from amis import LevelEnum, Select, Alert, Tpl, Flex
|
5
|
+
|
6
|
+
|
7
|
+
from ..config import NICKNAME
|
8
|
+
|
9
|
+
logo = Html(html='''
|
10
|
+
<p align="center">
|
11
|
+
<a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server">
|
12
|
+
<img src="https://raw.githubusercontent.com/Agnes4m/nonebot_plugin_l4d2_server/main/image/logo.png"
|
13
|
+
width="256" height="256" alt="l4d2-server">
|
14
|
+
</a>
|
15
|
+
</p>
|
16
|
+
<h1 align="center">Nonebot-Plugin-L4d2-Server 控制台</h1>
|
17
|
+
<div align="center">
|
18
|
+
<a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server/" target="_blank">
|
19
|
+
Github仓库</a>
|
20
|
+
</div>
|
21
|
+
<br>
|
22
|
+
<br>
|
23
|
+
''')
|
24
|
+
login_api = AmisAPI(
|
25
|
+
url='/l4d2/api/login',
|
26
|
+
method='post',
|
27
|
+
adaptor='''
|
28
|
+
if (payload.status == 0) {
|
29
|
+
localStorage.setItem("token", payload.data.token);
|
30
|
+
}
|
31
|
+
return payload;
|
32
|
+
'''
|
33
|
+
)
|
34
|
+
|
35
|
+
login_form = Form(api=login_api, title='', body=[
|
36
|
+
InputText(name='username', label='用户名',
|
37
|
+
labelRemark=Remark(shape='circle', content='后台管理用户名,默认为l4d2')),
|
38
|
+
InputPassword(name='password', label='密码',
|
39
|
+
labelRemark=Remark(shape='circle', content='后台管理密码,默认为admin')),
|
40
|
+
], mode=DisplayModeEnum.horizontal, horizontal=Horizontal(left=3, right=9, offset=5), redirect='/l4d2/admin')
|
41
|
+
body = Wrapper(className='w-2/5 mx-auto my-0 m:w-full', body=login_form)
|
42
|
+
login_page = Page(title='', body=[logo, body])
|
43
|
+
|
44
|
+
global_config_form = Form(
|
45
|
+
title='全局配置',
|
46
|
+
name='global_config',
|
47
|
+
initApi='/l4d2/api/l4d2_global_config',
|
48
|
+
api='post:/l4d2/api/l4d2_global_config',
|
49
|
+
body=[
|
50
|
+
Switch(label='控制总开关(摆设)', name='total_enable', value='${total_enable}', onText='开启', offText='关闭',
|
51
|
+
labelRemark=Remark(shape='circle',
|
52
|
+
content='关闭后,禁用网页控制台,请参考文档启动方法')),
|
53
|
+
InputText(label='后台管理用户名', name='web_username', value='${web_username}',
|
54
|
+
labelRemark=Remark(shape='circle',
|
55
|
+
content='登录本后台管理所需要的用户名。')),
|
56
|
+
InputPassword(label='后台管理密码', name='web_password', value='${web_password}',
|
57
|
+
labelRemark=Remark(shape='circle',
|
58
|
+
content='登录本后台管理所需要的密码。')),
|
59
|
+
InputText(label='后台管理token密钥', name='web_secret_key', value='${web_secret_key}',
|
60
|
+
labelRemark=Remark(shape='circle',
|
61
|
+
content='用于本后台管理加密验证token的密钥。')),
|
62
|
+
InputText(label='查询key', name='l4_key', value='${l4_key}',
|
63
|
+
labelRemark=Remark(shape='circle',
|
64
|
+
content='用于获取拓展功能的key,加q群399365126领取。')),
|
65
|
+
InputText(label='字体', name='l4_font', value='${l4_font}',
|
66
|
+
labelRemark=Remark(shape='circle',
|
67
|
+
content='机器人返回图片中文字的字体。')),
|
68
|
+
Select(label='图片风格', name='l4_style', value='${l4_style}',source='${l4_styles}',
|
69
|
+
labelRemark=Remark(shape='circle',
|
70
|
+
content='仅仅是批量查询的风格')),
|
71
|
+
InputTag(label='查询的远程服务器tag', name='l4_tag', value='${l4_tag}',
|
72
|
+
enableBatchAdd=True,
|
73
|
+
placeholder='添加qq号', visibleOn='${total_enable}', joinValues=False, extractValue=True,
|
74
|
+
labelRemark=Remark(shape='circle',
|
75
|
+
content='在这里加入的用户,才能上传地图')),
|
76
|
+
InputTag(label='求生上传地图用户', name='l4_master', value='${l4_master}',
|
77
|
+
enableBatchAdd=True,
|
78
|
+
placeholder='添加qq号', visibleOn='${total_enable}', joinValues=False, extractValue=True,
|
79
|
+
labelRemark=Remark(shape='circle',
|
80
|
+
content='在这里加入的用户,才能上传地图')),
|
81
|
+
|
82
|
+
],
|
83
|
+
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
84
|
+
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
85
|
+
)
|
86
|
+
|
87
|
+
upload_map_form = Form(
|
88
|
+
title='全局配置',
|
89
|
+
name='global_config',
|
90
|
+
api='post:/l4d2/api/l4d2_map_config',
|
91
|
+
body=[
|
92
|
+
InputText(label='服务器host', name='web_username', value='${web_username}',
|
93
|
+
labelRemark=Remark(shape='circle',
|
94
|
+
content='127.0.0.1')),
|
95
|
+
InputPassword(label='服务器', name='web_password', value='${web_password}',
|
96
|
+
labelRemark=Remark(shape='circle',
|
97
|
+
content='登录本后台管理所需要的密码。')),
|
98
|
+
InputText(label='后台管理token密钥', name='web_secret_key', value='${web_secret_key}',
|
99
|
+
labelRemark=Remark(shape='circle',
|
100
|
+
content='用于本后台管理加密验证token的密钥。')),
|
101
|
+
InputText(label='查询key', name='l4_key', value='${l4_key}',
|
102
|
+
labelRemark=Remark(shape='circle',
|
103
|
+
content='用于获取拓展功能的key。')),
|
104
|
+
|
105
|
+
],
|
106
|
+
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
107
|
+
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
108
|
+
)
|
109
|
+
|
110
|
+
|
111
|
+
group_select = Select(label='分群配置(暂未完成)', name='group_id', source='${group_list}',
|
112
|
+
placeholder='选择群')
|
113
|
+
group_config_form = Form(
|
114
|
+
title='分群配置(暂未完成)',
|
115
|
+
visibleOn='group_id != null',
|
116
|
+
initApi='/l4d2/api/l4d2_group_config?group_id=${group_id}',
|
117
|
+
api='post:/l4d2/api/l4d2_group_config?group_id=${group_id}',
|
118
|
+
body=[
|
119
|
+
Switch(label='分群开关', name='enable', value='${enable}', onText='开启', offText='关闭',
|
120
|
+
labelRemark=Remark(shape='circle', content='针对该群的群聊学习开关,关闭后,仅该群不会学习和回复。')),
|
121
|
+
InputNumber(label='占位符', name='answer_threshold', value='${answer_threshold}', visibleOn='${enable}',
|
122
|
+
min=2,
|
123
|
+
labelRemark=Remark(shape='circle', content='单文本')),
|
124
|
+
InputTag(label='占位符', name='ban_words', value='${ban_words}', enableBatchAdd=True,
|
125
|
+
placeholder='占位符,词条', visibleOn='${enable}', joinValues=False, extractValue=True,
|
126
|
+
labelRemark=Remark(shape='circle', content='占位符词条')),
|
127
|
+
|
128
|
+
],
|
129
|
+
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
130
|
+
ActionType.Ajax(
|
131
|
+
label='保存至所有群',
|
132
|
+
level=LevelEnum.primary,
|
133
|
+
confirmText='确认将当前配置保存至所有群?',
|
134
|
+
api='post:/l4d2/api/l4d2_group_config?group_id=all'
|
135
|
+
),
|
136
|
+
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
137
|
+
)
|
138
|
+
|
139
|
+
server_control = Select(label='服务器设置', name='id_rank', source='${server_list}',
|
140
|
+
placeholder='选择服务器')
|
141
|
+
|
142
|
+
server_ditail= Form(
|
143
|
+
title='',
|
144
|
+
api='post:/l4d2/api/l4d2_server_config?id_rank=${id_rank}',
|
145
|
+
initApi='/l4d2/api/l4d2_server_config?id_rank=${id_rank}',
|
146
|
+
visibleOn='id_rank != null',
|
147
|
+
body=[
|
148
|
+
Switch(label='是否是远程服务器', name='place', value='${place}', onText='是的', offText='不是',
|
149
|
+
labelRemark=Remark(shape='circle',
|
150
|
+
content='开启则确认为远程服务器')),
|
151
|
+
InputText(label='服务器名称', name='server_id', value='${server_id}',
|
152
|
+
labelRemark=Remark(shape='circle',
|
153
|
+
content='服务器名字')),
|
154
|
+
InputText(label='服务器ip地址', name='host', value='${host}',
|
155
|
+
labelRemark=Remark(shape='circle',
|
156
|
+
content='服务端所在ip地址,也可以是域名')),
|
157
|
+
InputText(label='所在端口', name='port', value='${port}',
|
158
|
+
labelRemark=Remark(shape='circle',
|
159
|
+
content='服务端所在端口')),
|
160
|
+
InputPassword(label='rcon控制台密码', name='rcon', value='${rcon}',
|
161
|
+
labelRemark=Remark(shape='circle',
|
162
|
+
content='服务端rcon密码')),
|
163
|
+
InputText(label='服务器本地文件位置', name='location', value='${location}',
|
164
|
+
labelRemark=Remark(shape='circle',
|
165
|
+
content='求生服务器所在路径,该路径下有文件srcds_run')),
|
166
|
+
InputText(label='远程账户', name='account', value='${account}',
|
167
|
+
visibleOn='${place}',
|
168
|
+
labelRemark=Remark(shape='circle',
|
169
|
+
content='远程服务器的登录账户名')),
|
170
|
+
InputPassword(label='远程密码', name='password', value='${password}',
|
171
|
+
visibleOn='${place}',
|
172
|
+
labelRemark=Remark(shape='circle',
|
173
|
+
content='远程服务器的登录密码')),
|
174
|
+
],
|
175
|
+
actions=[Action(label='保存', level=LevelEnum.success, type='submit'),
|
176
|
+
Action(label='重置', level=LevelEnum.warning, type='reset')]
|
177
|
+
)
|
178
|
+
|
179
|
+
query_table = TableCRUD(mode='table',
|
180
|
+
title='',
|
181
|
+
syncLocation=False,
|
182
|
+
api='/l4d2/api/get_query_contexts',
|
183
|
+
interval=60000,
|
184
|
+
footable=True,
|
185
|
+
itemActions=[ActionType.Url(
|
186
|
+
tooltip='加入游戏',
|
187
|
+
icon='fa fa-gamepad',
|
188
|
+
confirmText = "加入steam://connect/"+'${ip}',
|
189
|
+
url= "steam://connect/"+'${ip}',
|
190
|
+
# url= "http://"+'${ip}',
|
191
|
+
blank= True
|
192
|
+
),
|
193
|
+
],
|
194
|
+
columns = [
|
195
|
+
TableColumn(label='服主', name='master', searchable=True),
|
196
|
+
TableColumn(label='名称', name='name', searchable=True),
|
197
|
+
TableColumn(label='地图', name='map_', searchable=True),
|
198
|
+
TableColumn(label='玩家', name='rank_players', searchable=True),
|
199
|
+
TableColumn(label='延迟', name='ping', searchable=True),
|
200
|
+
TableColumn(label='IP 地址', name='ip', searchable=True),
|
201
|
+
])
|
202
|
+
|
203
|
+
server_page = PageSchema(url='/messages', icon='fa fa-comment', label='本地服务器管理',
|
204
|
+
schema=Page(title='本地服务器管理',
|
205
|
+
interval=120000,
|
206
|
+
initApi='/l4d2/api/get_l4d2_messages',
|
207
|
+
body=[
|
208
|
+
Alert(level=LevelEnum.info,
|
209
|
+
className='white-space-pre-wrap',
|
210
|
+
body=(f'此数据库记录了{NICKNAME}所在服务器下的求生服务器。\n'
|
211
|
+
|
212
|
+
f'· 功能暂未完善')),
|
213
|
+
server_control,server_ditail]))
|
214
|
+
query_page = PageSchema(url='/contexts', icon='fa fa-comments', label='远程服务器查询',
|
215
|
+
schema=Page(title='远程服务器查询',
|
216
|
+
body=[Alert(level=LevelEnum.info,
|
217
|
+
className='white-space-pre-wrap',
|
218
|
+
body=(f'此数据库记录了{NICKNAME}所记录可查询的服务器ip。\n'
|
219
|
+
# '· 点击"回复列表"可以查看该条内容已学习到的可能的回复。\n'
|
220
|
+
# '· 点击"禁用"可以将该学习进行禁用,以后不会再学。\n'
|
221
|
+
f'· 功能暂未完善')),
|
222
|
+
query_table]))
|
223
|
+
|
224
|
+
database_page = PageSchema(label='数据库', icon='fa fa-database',
|
225
|
+
children=[server_page, query_page])
|
226
|
+
config_page = PageSchema(url='/configs', isDefaultPage=True, icon='fa fa-wrench', label='配置',
|
227
|
+
schema=Page(title='配置', initApi='/l4d2/api/get_group_list',
|
228
|
+
body=[global_config_form,group_select, group_config_form]))
|
229
|
+
l4d2_page = PageSchema(label='求生之路', icon='fa fa-wechat (alias)', children=[config_page, database_page])
|
230
|
+
|
231
|
+
github_logo = Tpl(className='w-full',
|
232
|
+
tpl='<div class="flex justify-between"><div></div><div><a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server" target="_blank" title="Copyright"><i class="fa fa-github fa-2x"></i></a></div></div>')
|
233
|
+
header = Flex(className='w-full', justify='flex-end', alignItems='flex-end', items=[github_logo])
|
234
|
+
|
235
|
+
admin_app = App(brandName='L4d2-Server',
|
236
|
+
logo='https://raw.githubusercontent.com/Agnes4m/nonebot_plugin_l4d2_server/main/image/logo.png',
|
237
|
+
header=header,
|
238
|
+
pages=[{
|
239
|
+
'children': [config_page, database_page]
|
240
|
+
}],
|
241
|
+
footer='<div class="p-2 text-center bg-blue-100">Copyright © 2022 - 2023 <a href="https://github.com/Agnes4m/nonebot_plugin_l4d2_server" target="_blank" class="link-secondary">AGNES_DIGIAL</a> X<a target="_blank" href="https://github.com/baidu/amis" class="link-secondary" rel="noopener"> amis v2.2.0</a></div>')
|
@@ -1,59 +1,59 @@
|
|
1
|
-
# 坐牢
|
2
|
-
PRISON = {
|
3
|
-
1:[
|
4
|
-
'⭐低级牢房',
|
5
|
-
'⭐牢动最光荣',
|
6
|
-
'⭐能者多牢',
|
7
|
-
'⭐年年有牢',
|
8
|
-
],
|
9
|
-
2:[
|
10
|
-
'⭐⭐中级牢房',
|
11
|
-
'⭐⭐牢不可破',
|
12
|
-
'⭐⭐牢不可破联盟',
|
13
|
-
'⭐⭐牢底坐穿联盟',
|
14
|
-
'⭐⭐牢饭恰饱联盟',
|
15
|
-
'⭐⭐个个都是人才说话又好听',
|
16
|
-
'⭐⭐来点狱卒',
|
17
|
-
],
|
18
|
-
3:[
|
19
|
-
'⭐⭐⭐曼德拉的前半生',
|
20
|
-
'⭐⭐⭐肖申克的救赎',
|
21
|
-
'⭐⭐⭐甲级战犯',
|
22
|
-
'⭐⭐⭐刘培强正在尝试逃离冷冻仓',
|
23
|
-
]
|
24
|
-
}
|
25
|
-
|
26
|
-
QUEREN ={
|
27
|
-
1:[
|
28
|
-
'📞📞1Q3速来坐牢',
|
29
|
-
'📞📞📞发起了anne坐牢',
|
30
|
-
'📞📞📞摇人摇人,一个人玩个锤子',
|
31
|
-
'📞📞📞1=3速来坐牢',
|
32
|
-
'📞📞📞差三个速来',
|
33
|
-
],
|
34
|
-
2:[
|
35
|
-
'📞📞2Q2速来坐牢',
|
36
|
-
'📞📞2=2这牢十分的珍贵,让同志们先做',
|
37
|
-
'📞📞牢房过半,速速人牢',
|
38
|
-
'📞📞2Q2有大佬带逛街速来',
|
39
|
-
'📞📞2=2速来坐牢',
|
40
|
-
],
|
41
|
-
3:[
|
42
|
-
'📞牢房三缺一,速来',
|
43
|
-
'📞3Q1来个大佬带逛街',
|
44
|
-
'📞3Q1就等你了',
|
45
|
-
'📞别来他们三个还没一个人分高',
|
46
|
-
],
|
47
|
-
4:[
|
48
|
-
'📞有人旁观,速来',
|
49
|
-
'📞有人越狱,呼叫支援',
|
50
|
-
'📞别让牢房成为寂寞',
|
51
|
-
'📞有人还没进,希望你网络比他好',
|
52
|
-
]
|
53
|
-
}
|
54
|
-
KAILAO = [
|
55
|
-
'🏠又来坐牢了?',
|
56
|
-
'🏠已经变成牢房的样子了!',
|
57
|
-
'🏠是谁在呼唤牢房?',
|
58
|
-
'🏠牢房青云阁雅座四位',
|
1
|
+
# 坐牢
|
2
|
+
PRISON = {
|
3
|
+
1:[
|
4
|
+
'⭐低级牢房',
|
5
|
+
'⭐牢动最光荣',
|
6
|
+
'⭐能者多牢',
|
7
|
+
'⭐年年有牢',
|
8
|
+
],
|
9
|
+
2:[
|
10
|
+
'⭐⭐中级牢房',
|
11
|
+
'⭐⭐牢不可破',
|
12
|
+
'⭐⭐牢不可破联盟',
|
13
|
+
'⭐⭐牢底坐穿联盟',
|
14
|
+
'⭐⭐牢饭恰饱联盟',
|
15
|
+
'⭐⭐个个都是人才说话又好听',
|
16
|
+
'⭐⭐来点狱卒',
|
17
|
+
],
|
18
|
+
3:[
|
19
|
+
'⭐⭐⭐曼德拉的前半生',
|
20
|
+
'⭐⭐⭐肖申克的救赎',
|
21
|
+
'⭐⭐⭐甲级战犯',
|
22
|
+
'⭐⭐⭐刘培强正在尝试逃离冷冻仓',
|
23
|
+
]
|
24
|
+
}
|
25
|
+
|
26
|
+
QUEREN ={
|
27
|
+
1:[
|
28
|
+
'📞📞1Q3速来坐牢',
|
29
|
+
'📞📞📞发起了anne坐牢',
|
30
|
+
'📞📞📞摇人摇人,一个人玩个锤子',
|
31
|
+
'📞📞📞1=3速来坐牢',
|
32
|
+
'📞📞📞差三个速来',
|
33
|
+
],
|
34
|
+
2:[
|
35
|
+
'📞📞2Q2速来坐牢',
|
36
|
+
'📞📞2=2这牢十分的珍贵,让同志们先做',
|
37
|
+
'📞📞牢房过半,速速人牢',
|
38
|
+
'📞📞2Q2有大佬带逛街速来',
|
39
|
+
'📞📞2=2速来坐牢',
|
40
|
+
],
|
41
|
+
3:[
|
42
|
+
'📞牢房三缺一,速来',
|
43
|
+
'📞3Q1来个大佬带逛街',
|
44
|
+
'📞3Q1就等你了',
|
45
|
+
'📞别来他们三个还没一个人分高',
|
46
|
+
],
|
47
|
+
4:[
|
48
|
+
'📞有人旁观,速来',
|
49
|
+
'📞有人越狱,呼叫支援',
|
50
|
+
'📞别让牢房成为寂寞',
|
51
|
+
'📞有人还没进,希望你网络比他好',
|
52
|
+
]
|
53
|
+
}
|
54
|
+
KAILAO = [
|
55
|
+
'🏠又来坐牢了?',
|
56
|
+
'🏠已经变成牢房的样子了!',
|
57
|
+
'🏠是谁在呼唤牢房?',
|
58
|
+
'🏠牢房青云阁雅座四位',
|
59
59
|
]
|