d528358867
- 新增 player_blacklist collection 迁移 - 添加 PlayerTag/PlayerBlacklistEntry 类型定义和 API - 创建 PlayerBlacklistMain + CreatePlayerBlacklistDialog 组件 - BlacklistView 支持 Tab 切换游戏/玩家黑名单 - 支持搜索、标签筛选、严重程度筛选、实时订阅 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
125 lines
3.1 KiB
JavaScript
125 lines
3.1 KiB
JavaScript
/// <reference path="../pb_data/types.d.ts" />
|
|
migrate((db) => {
|
|
const collection = new Collection({
|
|
"id": "pblacklist_col",
|
|
"created": "2026-04-19 10:00:01.000Z",
|
|
"updated": "2026-04-19 10:00:01.000Z",
|
|
"name": "player_blacklist",
|
|
"type": "base",
|
|
"system": false,
|
|
"schema": [
|
|
{
|
|
"system": false,
|
|
"id": "pb_group",
|
|
"name": "group",
|
|
"type": "relation",
|
|
"required": true,
|
|
"options": {
|
|
"collectionId": "es63bkyiblpnxdf",
|
|
"cascadeDelete": true,
|
|
"minSelect": null,
|
|
"maxSelect": 1,
|
|
"displayFields": null
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_reporter",
|
|
"name": "reporter",
|
|
"type": "relation",
|
|
"required": true,
|
|
"options": {
|
|
"collectionId": "_pb_users_auth_",
|
|
"cascadeDelete": true,
|
|
"minSelect": null,
|
|
"maxSelect": 1,
|
|
"displayFields": null
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_playerid",
|
|
"name": "playerId",
|
|
"type": "text",
|
|
"required": true,
|
|
"options": {
|
|
"min": 1,
|
|
"max": 200,
|
|
"pattern": ""
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_platform",
|
|
"name": "platform",
|
|
"type": "text",
|
|
"required": true,
|
|
"options": {
|
|
"min": 1,
|
|
"max": 100,
|
|
"pattern": ""
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_tags",
|
|
"name": "tags",
|
|
"type": "select",
|
|
"required": true,
|
|
"options": {
|
|
"maxSelect": 5,
|
|
"values": ["afk", "feeder", "toxic", "cheater", "quitter", "noob", "fragile", "other"]
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_customtag",
|
|
"name": "customTag",
|
|
"type": "text",
|
|
"required": false,
|
|
"options": {
|
|
"min": null,
|
|
"max": 50,
|
|
"pattern": ""
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_desc",
|
|
"name": "description",
|
|
"type": "text",
|
|
"required": true,
|
|
"options": {
|
|
"min": 1,
|
|
"max": 500,
|
|
"pattern": ""
|
|
}
|
|
},
|
|
{
|
|
"system": false,
|
|
"id": "pb_severity",
|
|
"name": "severity",
|
|
"type": "select",
|
|
"required": true,
|
|
"options": {
|
|
"maxSelect": 1,
|
|
"values": ["mild", "medium", "severe"]
|
|
}
|
|
}
|
|
],
|
|
"indexes": [],
|
|
"listRule": "@request.auth.id != \"\" && group.members ~ @request.auth.id",
|
|
"viewRule": "@request.auth.id != \"\" && group.members ~ @request.auth.id",
|
|
"createRule": "@request.auth.id != \"\" && group.members ~ @request.auth.id",
|
|
"updateRule": null,
|
|
"deleteRule": "reporter = @request.auth.id || group.owner = @request.auth.id",
|
|
"options": {}
|
|
});
|
|
|
|
return Dao(db).saveCollection(collection);
|
|
}, (db) => {
|
|
const dao = new Dao(db);
|
|
const collection = dao.findCollectionByNameOrId("pblacklist_col");
|
|
return dao.deleteCollection(collection);
|
|
})
|