2023-03-12 03:56:01 +00:00
|
|
|
|
from amis import (
|
|
|
|
|
InputText,
|
|
|
|
|
Switch,
|
|
|
|
|
Card,
|
|
|
|
|
CardsCRUD,
|
|
|
|
|
PageSchema,
|
|
|
|
|
Page,
|
2023-07-01 08:42:23 +00:00
|
|
|
|
)
|
2023-01-31 16:24:56 +00:00
|
|
|
|
|
|
|
|
|
card = Card(
|
|
|
|
|
header=Card.Header(
|
2023-03-12 03:56:01 +00:00
|
|
|
|
title="$title",
|
|
|
|
|
description="$id",
|
|
|
|
|
avatarText="$title",
|
|
|
|
|
avatarTextClassName="overflow-hidden",
|
2023-01-31 16:24:56 +00:00
|
|
|
|
),
|
|
|
|
|
actions=[],
|
|
|
|
|
toolbar=[
|
|
|
|
|
Switch(
|
2023-03-12 03:56:01 +00:00
|
|
|
|
name="enable",
|
|
|
|
|
value="${status}",
|
|
|
|
|
onText="已忽略",
|
|
|
|
|
offText="未忽略",
|
2023-01-31 16:24:56 +00:00
|
|
|
|
onEvent={
|
2023-03-12 03:56:01 +00:00
|
|
|
|
"change": {
|
|
|
|
|
"actions": {
|
|
|
|
|
"actionType": "ajax",
|
|
|
|
|
"args": {
|
|
|
|
|
"api": {
|
|
|
|
|
"url": "/pagermaid/api/set_ignore_group_status",
|
|
|
|
|
"method": "post",
|
2023-01-31 16:24:56 +00:00
|
|
|
|
},
|
2023-03-12 03:56:01 +00:00
|
|
|
|
"messages": {
|
|
|
|
|
"success": '成功${IF(event.data.value, "忽略", "取消忽略")}了 ${title}',
|
|
|
|
|
"failed": "操作失败",
|
2023-01-31 16:24:56 +00:00
|
|
|
|
},
|
2023-03-12 03:56:01 +00:00
|
|
|
|
"status": "${event.data.value}",
|
|
|
|
|
"id": "${id}",
|
|
|
|
|
},
|
2023-01-31 16:24:56 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
2023-03-12 03:56:01 +00:00
|
|
|
|
},
|
2023-01-31 16:24:56 +00:00
|
|
|
|
)
|
2023-03-12 03:56:01 +00:00
|
|
|
|
],
|
2023-01-31 16:24:56 +00:00
|
|
|
|
)
|
|
|
|
|
cards_curd = CardsCRUD(
|
2023-03-12 03:56:01 +00:00
|
|
|
|
mode="cards",
|
|
|
|
|
title="",
|
2023-01-31 16:24:56 +00:00
|
|
|
|
syncLocation=False,
|
2023-03-12 03:56:01 +00:00
|
|
|
|
api="/pagermaid/api/get_ignore_group_list",
|
2023-01-31 16:24:56 +00:00
|
|
|
|
loadDataOnce=True,
|
2023-03-12 03:56:01 +00:00
|
|
|
|
source="${groups | filter:title:match:keywords_name}",
|
|
|
|
|
filter={"body": [InputText(name="keywords_name", label="群组名")]},
|
2023-01-31 16:24:56 +00:00
|
|
|
|
perPage=12,
|
|
|
|
|
autoJumpToTopOnPagerChange=True,
|
2023-03-12 03:56:01 +00:00
|
|
|
|
placeholder="群组列表为空",
|
|
|
|
|
footerToolbar=["switch-per-page", "pagination"],
|
2023-01-31 16:24:56 +00:00
|
|
|
|
columnsCount=3,
|
2023-03-12 03:56:01 +00:00
|
|
|
|
card=card,
|
2023-01-31 16:24:56 +00:00
|
|
|
|
)
|
|
|
|
|
page = PageSchema(
|
2023-03-12 03:56:01 +00:00
|
|
|
|
url="/bot_config/ignore_groups",
|
|
|
|
|
icon="fa fa-ban",
|
|
|
|
|
label="忽略群组",
|
|
|
|
|
schema=Page(
|
|
|
|
|
title="忽略群组", subTitle="忽略后,Bot 不再响应指定群组的消息(群组列表将会缓存一小时)", body=cards_curd
|
|
|
|
|
),
|
2023-01-31 16:24:56 +00:00
|
|
|
|
)
|