karin-plugin-teamspeak 1.2.0 → 1.3.0
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.
- package/lib/web.config.d.ts +1 -1
- package/lib/web.config.js +100 -2
- package/package.json +3 -1
package/lib/web.config.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { Config } from "config/config/config";
|
|
|
2
2
|
declare const _default: {
|
|
3
3
|
info: {};
|
|
4
4
|
/** 动态渲染的组件 */
|
|
5
|
-
components: () => import("node-karin").
|
|
5
|
+
components: () => (import("node-karin").InputProps | import("node-karin").InputGroupProps | import("node-karin").RadioGroupProps)[];
|
|
6
6
|
/** 前端点击保存之后调用的方法 */
|
|
7
7
|
save: (config: Config) => {
|
|
8
8
|
success: boolean;
|
package/lib/web.config.js
CHANGED
|
@@ -1,15 +1,113 @@
|
|
|
1
|
-
import { components } from "node-karin";
|
|
1
|
+
import { components, logger } from "node-karin";
|
|
2
2
|
export default {
|
|
3
3
|
info: {
|
|
4
4
|
// 插件信息配置
|
|
5
5
|
},
|
|
6
6
|
/** 动态渲染的组件 */
|
|
7
7
|
components: () => [
|
|
8
|
-
components.
|
|
8
|
+
components.input.string("HOST", {
|
|
9
|
+
label: "teamspeak 服务器地址(不带端口)",
|
|
10
|
+
variant: "underlined",
|
|
11
|
+
placeholder: "请输入服务器地址",
|
|
12
|
+
rules: [
|
|
13
|
+
{
|
|
14
|
+
regex: /^((\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])\.){3}(\d|[1-9]\d|1\d\d|2[0-4]\d|25[0-5])$/,
|
|
15
|
+
error: "请输入正确的IP地址",
|
|
16
|
+
},
|
|
17
|
+
],
|
|
18
|
+
}),
|
|
19
|
+
components.input.string("SERVER_NAME", {
|
|
20
|
+
label: "展示的服务器名(不填写则显示服务器地址)",
|
|
21
|
+
placeholder: "请输入展示的服务器名",
|
|
22
|
+
variant: "underlined",
|
|
23
|
+
isRequired: false,
|
|
24
|
+
}),
|
|
25
|
+
components.radio.group("PROTOCOL", {
|
|
26
|
+
defaultValue: "RAW",
|
|
27
|
+
label: "teamspeak 服务器查询 (一般使用默认的RAW即可)",
|
|
28
|
+
size: "sm",
|
|
29
|
+
orientation: "horizontal",
|
|
30
|
+
radio: [
|
|
31
|
+
{
|
|
32
|
+
componentType: "radio",
|
|
33
|
+
key: "PROTOCOL_RAW",
|
|
34
|
+
value: "RAW",
|
|
35
|
+
label: "RAW",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
componentType: "radio",
|
|
39
|
+
key: "PROTOCOL_SSH",
|
|
40
|
+
value: "SSH",
|
|
41
|
+
label: "SSH",
|
|
42
|
+
},
|
|
43
|
+
],
|
|
44
|
+
}),
|
|
45
|
+
components.input.number("QUERY_PORT", {
|
|
46
|
+
label: "teamspeak 服务器查询端口 (一般使用默认 10011 即可)",
|
|
47
|
+
type: "number",
|
|
48
|
+
placeholder: "请输入服务器查询端口",
|
|
49
|
+
variant: "underlined",
|
|
50
|
+
defaultValue: "10011",
|
|
51
|
+
rules: [{ min: 1, max: 65535 }],
|
|
52
|
+
}),
|
|
53
|
+
components.input.number("SERVER_PORT", {
|
|
54
|
+
label: "teamspeak 服务器语音端口 (一般使用默认 9987 即可)",
|
|
55
|
+
defaultValue: "9987",
|
|
56
|
+
placeholder: "请输入服务器语音端口",
|
|
57
|
+
variant: "underlined",
|
|
58
|
+
rules: [{ min: 1, max: 65535 }],
|
|
59
|
+
}),
|
|
60
|
+
components.input.number("RECONNECT_TIMER", {
|
|
61
|
+
label: "teamspeak 连接断开后重连次数 (-1表示将不断尝试)",
|
|
62
|
+
defaultValue: "5",
|
|
63
|
+
placeholder: "请输入重连次数",
|
|
64
|
+
variant: "underlined",
|
|
65
|
+
rules: [{ min: -1 }],
|
|
66
|
+
}),
|
|
67
|
+
components.input.string("USERNAME", {
|
|
68
|
+
label: "teamspeak 管理员用户名 (建服时出现的,没修改时默认是 serveradmin )",
|
|
69
|
+
defaultValue: "serveradmin",
|
|
70
|
+
placeholder: "请输入管理员用户名",
|
|
71
|
+
variant: "underlined",
|
|
72
|
+
}),
|
|
73
|
+
components.input.string("PASSWORD", {
|
|
74
|
+
label: "teamspeak 管理员密码 (建服时出现的,每个服务器都不一样)",
|
|
75
|
+
placeholder: "请输入管理员密码",
|
|
76
|
+
variant: "underlined",
|
|
77
|
+
}),
|
|
78
|
+
components.input.string("NICKNAME", {
|
|
79
|
+
label: "插件连接进服务器时使用的昵称 (默认为TSBOT,···客户端看不到该用户···) ",
|
|
80
|
+
placeholder: "请输入连接昵称",
|
|
81
|
+
defaultValue: "TSBOT",
|
|
82
|
+
variant: "underlined",
|
|
83
|
+
}),
|
|
84
|
+
components.input.group("NOTICE_GROUP_NO", {
|
|
85
|
+
label: "通知用户进出ts3的群号 可多个",
|
|
86
|
+
template: {
|
|
87
|
+
componentType: "input",
|
|
88
|
+
key: "NOTICE_GROUP_NO",
|
|
89
|
+
type: "number",
|
|
90
|
+
variant: "faded",
|
|
91
|
+
placeholder: "请输入群号",
|
|
92
|
+
},
|
|
93
|
+
data: [],
|
|
94
|
+
}),
|
|
95
|
+
components.input.group("DIS_NOTIFY_NAME_LIST", {
|
|
96
|
+
label: "不提醒的昵称列表 可多个 (不会提醒当前机器人,无需添加当前机器人昵称)",
|
|
97
|
+
template: {
|
|
98
|
+
componentType: "input",
|
|
99
|
+
key: "DIS_NOTIFY_NAME",
|
|
100
|
+
type: "text",
|
|
101
|
+
variant: "faded",
|
|
102
|
+
placeholder: "请输入昵称",
|
|
103
|
+
},
|
|
104
|
+
data: [],
|
|
105
|
+
}),
|
|
9
106
|
],
|
|
10
107
|
/** 前端点击保存之后调用的方法 */
|
|
11
108
|
save: (config) => {
|
|
12
109
|
console.log("保存的配置:", config);
|
|
110
|
+
logger.info("保存的配置:", config);
|
|
13
111
|
// 在这里处理保存逻辑
|
|
14
112
|
return {
|
|
15
113
|
success: true,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "karin-plugin-teamspeak",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.3.0",
|
|
4
4
|
"description": "karin 的 teamspeak3 插件",
|
|
5
5
|
"homepage": "https://github.com/jacksixth/karin-plugin-teamspeak3",
|
|
6
6
|
"bugs": {
|
|
@@ -29,6 +29,8 @@
|
|
|
29
29
|
"static": [
|
|
30
30
|
"resources"
|
|
31
31
|
],
|
|
32
|
+
"web": "./lib/web.config.js",
|
|
33
|
+
"ts-web": "./src/web.config.ts",
|
|
32
34
|
"files": [
|
|
33
35
|
"config",
|
|
34
36
|
"data",
|