koishi-plugin-jscn-aaaquery 1.0.5 → 1.0.7
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/index.js +133 -74
- package/package.json +1 -1
- package/readme.md +26 -32
package/lib/index.js
CHANGED
|
@@ -797,6 +797,98 @@ function apply(ctx, config) {
|
|
|
797
797
|
console.log(`清理了 ${expiredCount} 个超时的消息任务`);
|
|
798
798
|
}
|
|
799
799
|
}, MESSAGE_CLEAN_INTERVAL);
|
|
800
|
+
async function queryTerminalInfo(mac, needDetailedInfo = false) {
|
|
801
|
+
const formattedMac = formatMacAddress(mac);
|
|
802
|
+
try {
|
|
803
|
+
const onuList = await queryOnuList(formattedMac);
|
|
804
|
+
if (!onuList) {
|
|
805
|
+
throw new Error("未找到该MAC地址的设备信息");
|
|
806
|
+
}
|
|
807
|
+
const [onuDetail, vlanInfo] = await Promise.all([
|
|
808
|
+
queryOnuDetailInfo(onuList.id),
|
|
809
|
+
queryOnuDetailVlanInfo(onuList.id)
|
|
810
|
+
]);
|
|
811
|
+
if (needDetailedInfo) {
|
|
812
|
+
const [ccname, order] = await Promise.all([
|
|
813
|
+
queryCCName(formattedMac),
|
|
814
|
+
queryOnuOrder(onuDetail)
|
|
815
|
+
]);
|
|
816
|
+
return {
|
|
817
|
+
onuList,
|
|
818
|
+
onuDetail,
|
|
819
|
+
ccname,
|
|
820
|
+
order,
|
|
821
|
+
vlanInfo
|
|
822
|
+
};
|
|
823
|
+
}
|
|
824
|
+
return {
|
|
825
|
+
onuList,
|
|
826
|
+
onuDetail,
|
|
827
|
+
vlanInfo
|
|
828
|
+
};
|
|
829
|
+
} catch (error) {
|
|
830
|
+
console.error("终端查询过程出错:", error);
|
|
831
|
+
throw error;
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
__name(queryTerminalInfo, "queryTerminalInfo");
|
|
835
|
+
async function smartQueryMacAddress(cleanInput) {
|
|
836
|
+
try {
|
|
837
|
+
const { onuDetail, ccname, order, vlanInfo } = await queryTerminalInfo(cleanInput, true);
|
|
838
|
+
const messages = [
|
|
839
|
+
"🖥️ 终端基本信息",
|
|
840
|
+
"--------------------------------",
|
|
841
|
+
`MAC地址: ${cleanInput}`,
|
|
842
|
+
`状态:${onuDetail.status === 1 ? "在线 ✅" : "不在线 ❌"}`,
|
|
843
|
+
`机房: ${onuDetail.roomName}`,
|
|
844
|
+
`设备名称: `,
|
|
845
|
+
`${onuDetail.deviceName}`,
|
|
846
|
+
`OLT IP: ${onuDetail.oltIp}`,
|
|
847
|
+
`PON端口: ${onuDetail.portName}`,
|
|
848
|
+
`端口逻辑号: ${onuDetail.logicId}`,
|
|
849
|
+
`发射光功率: ${onuDetail.onuSendPower === "设备不在线" ? "设备不在线" : onuDetail.onuSendPower + "dBm"}`,
|
|
850
|
+
`接收光功率: ${onuDetail.onuReceivePower === "设备不在线" ? "设备不在线" : onuDetail.onuReceivePower + "dBm"}${onuDetail.onuReceivePower !== "设备不在线" ? " " + evaluateOpticalPower(onuDetail.onuReceivePower) : ""}`,
|
|
851
|
+
`CCName: ${ccname}`,
|
|
852
|
+
"",
|
|
853
|
+
"📃 工单信息",
|
|
854
|
+
"--------------------------------",
|
|
855
|
+
order ? [
|
|
856
|
+
`工单编号: ${order.orderId}`,
|
|
857
|
+
`创建时间: ${order.createDate}`,
|
|
858
|
+
`更新时间: ${order.updateDate}`
|
|
859
|
+
].join("\n") : "无工单信息",
|
|
860
|
+
"",
|
|
861
|
+
"⚙️ 业务配置信息",
|
|
862
|
+
"--------------------------------"
|
|
863
|
+
];
|
|
864
|
+
const vlanGroups = {};
|
|
865
|
+
vlanInfo.forEach((info) => {
|
|
866
|
+
const key = `${info.VLAN !== void 0 && info.VLAN !== null && info.VLAN !== "-" ? info.VLAN : "未配置"}-${info.actualVlan !== void 0 && info.actualVlan !== null ? info.actualVlan : "未配置"}`;
|
|
867
|
+
if (!vlanGroups[key]) {
|
|
868
|
+
vlanGroups[key] = {
|
|
869
|
+
VLAN: info.VLAN !== void 0 && info.VLAN !== null && info.VLAN !== "-" ? info.VLAN : "未配置",
|
|
870
|
+
actualVlan: info.actualVlan !== void 0 && info.actualVlan !== null ? info.actualVlan : "未配置",
|
|
871
|
+
ports: []
|
|
872
|
+
};
|
|
873
|
+
}
|
|
874
|
+
vlanGroups[key].ports.push(info.LAN);
|
|
875
|
+
});
|
|
876
|
+
Object.values(vlanGroups).forEach((group) => {
|
|
877
|
+
const portsText = group.ports.join(",");
|
|
878
|
+
messages.push(
|
|
879
|
+
`端口 ${portsText}:`,
|
|
880
|
+
` 端口VLAN: ${group.VLAN}`,
|
|
881
|
+
` 工单VLAN: ${group.actualVlan}`
|
|
882
|
+
);
|
|
883
|
+
});
|
|
884
|
+
messages.push("--------------------------------");
|
|
885
|
+
return messages.join("\n");
|
|
886
|
+
} catch (error) {
|
|
887
|
+
console.error("查询MAC地址过程出错:", error);
|
|
888
|
+
return "查询失败,请稍后重试";
|
|
889
|
+
}
|
|
890
|
+
}
|
|
891
|
+
__name(smartQueryMacAddress, "smartQueryMacAddress");
|
|
800
892
|
ctx.middleware(async (session, next) => {
|
|
801
893
|
console.log("原始消息:", session.content);
|
|
802
894
|
const originalInput = session.stripped.content.trim();
|
|
@@ -817,54 +909,7 @@ function apply(ctx, config) {
|
|
|
817
909
|
console.log("处理后的内容:", cleanInput);
|
|
818
910
|
if (isValidMacAddress(cleanInput)) {
|
|
819
911
|
console.log("内容是合法的MAC地址,开始查询");
|
|
820
|
-
|
|
821
|
-
const onuList = await queryOnuList(cleanInput);
|
|
822
|
-
if (!onuList) {
|
|
823
|
-
return "未找到该MAC地址的设备信息";
|
|
824
|
-
}
|
|
825
|
-
const onuDetail = await queryOnuDetailInfo(onuList.id);
|
|
826
|
-
const ccname = await queryCCName(cleanInput);
|
|
827
|
-
const order = await queryOnuOrder(onuDetail);
|
|
828
|
-
const vlanInfo = await queryOnuDetailVlanInfo(onuList.id);
|
|
829
|
-
const messages = [
|
|
830
|
-
"🖥️ 终端基本信息",
|
|
831
|
-
"--------------------------------",
|
|
832
|
-
`MAC地址: ${cleanInput}`,
|
|
833
|
-
`状态:${onuDetail.status === 1 ? "在线 ✅" : "不在线 ❌"}`,
|
|
834
|
-
`机房: ${onuDetail.roomName}`,
|
|
835
|
-
`设备名称: `,
|
|
836
|
-
`${onuDetail.deviceName}`,
|
|
837
|
-
`OLT IP: ${onuDetail.oltIp}`,
|
|
838
|
-
`PON端口: ${onuDetail.portName}`,
|
|
839
|
-
`端口逻辑号: ${onuDetail.logicId}`,
|
|
840
|
-
`发射光功率: ${onuDetail.onuSendPower === "设备不在线" ? "设备不在线" : onuDetail.onuSendPower + "dBm"}`,
|
|
841
|
-
`接收光功率: ${onuDetail.onuReceivePower === "设备不在线" ? "设备不在线" : onuDetail.onuReceivePower + "dBm"}${onuDetail.onuReceivePower !== "设备不在线" ? " " + evaluateOpticalPower(onuDetail.onuReceivePower) : ""}`,
|
|
842
|
-
`CCName: ${ccname}`,
|
|
843
|
-
"",
|
|
844
|
-
"📃 工单信息",
|
|
845
|
-
"--------------------------------",
|
|
846
|
-
order ? [
|
|
847
|
-
`工单编号: ${order.orderId}`,
|
|
848
|
-
`创建时间: ${order.createDate}`,
|
|
849
|
-
`更新时间: ${order.updateDate}`
|
|
850
|
-
].join("\n") : "无工单信息",
|
|
851
|
-
"",
|
|
852
|
-
"⚙️ 业务配置信息",
|
|
853
|
-
"--------------------------------"
|
|
854
|
-
];
|
|
855
|
-
vlanInfo.forEach((info) => {
|
|
856
|
-
messages.push(
|
|
857
|
-
`端口 ${info.LAN}:`,
|
|
858
|
-
` 端口VLAN: ${info.VLAN || "未配置"}`,
|
|
859
|
-
` 工单VLAN: ${info.actualVlan || "未配置"}`
|
|
860
|
-
);
|
|
861
|
-
});
|
|
862
|
-
messages.push("--------------------------------");
|
|
863
|
-
return messages.join("\n");
|
|
864
|
-
} catch (error) {
|
|
865
|
-
console.error("查询MAC地址过程出错:", error);
|
|
866
|
-
return "查询失败,请稍后重试";
|
|
867
|
-
}
|
|
912
|
+
return await smartQueryMacAddress(cleanInput);
|
|
868
913
|
} else {
|
|
869
914
|
console.log("内容不是MAC地址,尝试作为账号查询");
|
|
870
915
|
try {
|
|
@@ -954,7 +999,7 @@ function apply(ctx, config) {
|
|
|
954
999
|
});
|
|
955
1000
|
});
|
|
956
1001
|
});
|
|
957
|
-
ctx.command("账号查询 <account:string>", "查询宽带账号状态").action(async ({ session }, account) => {
|
|
1002
|
+
ctx.command("账号查询 <account:string>", "查询宽带账号状态").alias("/账号查询").action(async ({ session }, account) => {
|
|
958
1003
|
if (!account) return "请输入要查询的账号";
|
|
959
1004
|
return new Promise((resolve) => {
|
|
960
1005
|
addToMessageQueue(session, async () => {
|
|
@@ -1039,7 +1084,7 @@ function apply(ctx, config) {
|
|
|
1039
1084
|
resolve();
|
|
1040
1085
|
});
|
|
1041
1086
|
});
|
|
1042
|
-
ctx.command("账号详情 <account:string>", "查询宽带账号详细记录").action(async ({ session }, account) => {
|
|
1087
|
+
ctx.command("账号详情 <account:string>", "查询宽带账号详细记录").alias("/账号详情").action(async ({ session }, account) => {
|
|
1043
1088
|
if (!account) return "请输入要查询的账号";
|
|
1044
1089
|
return new Promise((resolve) => {
|
|
1045
1090
|
addToMessageQueue(session, async () => {
|
|
@@ -1071,18 +1116,13 @@ function apply(ctx, config) {
|
|
|
1071
1116
|
resolve();
|
|
1072
1117
|
});
|
|
1073
1118
|
});
|
|
1074
|
-
ctx.command("终端查询 <mac:string>", "查询终端基本信息").action(async ({ session }, mac) => {
|
|
1119
|
+
ctx.command("终端查询 <mac:string>", "查询终端基本信息").alias("/终端查询").action(async ({ session }, mac) => {
|
|
1075
1120
|
if (!mac) return "请输入要查询的MAC地址";
|
|
1076
1121
|
return new Promise((resolve) => {
|
|
1077
1122
|
addToMessageQueue(session, async () => {
|
|
1078
1123
|
try {
|
|
1079
1124
|
const formattedMac = formatMacAddress(mac);
|
|
1080
|
-
const
|
|
1081
|
-
if (!onuList) {
|
|
1082
|
-
return "未找到该MAC地址的设备信息";
|
|
1083
|
-
}
|
|
1084
|
-
const onuDetail = await queryOnuDetailInfo(onuList.id);
|
|
1085
|
-
const vlanInfo = await queryOnuDetailVlanInfo(onuList.id);
|
|
1125
|
+
const { onuDetail, vlanInfo } = await queryTerminalInfo(formattedMac, false);
|
|
1086
1126
|
const messages = [
|
|
1087
1127
|
"🖥️ 终端基本信息",
|
|
1088
1128
|
"--------------------------------",
|
|
@@ -1096,11 +1136,24 @@ function apply(ctx, config) {
|
|
|
1096
1136
|
"⚙️ 业务配置信息",
|
|
1097
1137
|
"--------------------------------"
|
|
1098
1138
|
];
|
|
1139
|
+
const vlanGroups = {};
|
|
1099
1140
|
vlanInfo.forEach((info) => {
|
|
1141
|
+
const key = `${info.VLAN !== void 0 && info.VLAN !== null && info.VLAN !== "-" ? info.VLAN : "未配置"}-${info.actualVlan !== void 0 && info.actualVlan !== null ? info.actualVlan : "未配置"}`;
|
|
1142
|
+
if (!vlanGroups[key]) {
|
|
1143
|
+
vlanGroups[key] = {
|
|
1144
|
+
VLAN: info.VLAN !== void 0 && info.VLAN !== null && info.VLAN !== "-" ? info.VLAN : "未配置",
|
|
1145
|
+
actualVlan: info.actualVlan !== void 0 && info.actualVlan !== null ? info.actualVlan : "未配置",
|
|
1146
|
+
ports: []
|
|
1147
|
+
};
|
|
1148
|
+
}
|
|
1149
|
+
vlanGroups[key].ports.push(info.LAN);
|
|
1150
|
+
});
|
|
1151
|
+
Object.values(vlanGroups).forEach((group) => {
|
|
1152
|
+
const portsText = group.ports.join(",");
|
|
1100
1153
|
messages.push(
|
|
1101
|
-
`端口 ${
|
|
1102
|
-
` 端口VLAN: ${
|
|
1103
|
-
` 工单VLAN: ${
|
|
1154
|
+
`端口 ${portsText}:`,
|
|
1155
|
+
` 端口VLAN: ${group.VLAN}`,
|
|
1156
|
+
` 工单VLAN: ${group.actualVlan}`
|
|
1104
1157
|
);
|
|
1105
1158
|
});
|
|
1106
1159
|
messages.push("--------------------------------");
|
|
@@ -1113,20 +1166,13 @@ function apply(ctx, config) {
|
|
|
1113
1166
|
resolve();
|
|
1114
1167
|
});
|
|
1115
1168
|
});
|
|
1116
|
-
ctx.command("终端详细查询 <mac:string>", "查询终端详细信息").action(async ({ session }, mac) => {
|
|
1169
|
+
ctx.command("终端详细查询 <mac:string>", "查询终端详细信息").alias("/终端详细查询").action(async ({ session }, mac) => {
|
|
1117
1170
|
if (!mac) return "请输入要查询的MAC地址";
|
|
1118
1171
|
return new Promise((resolve) => {
|
|
1119
1172
|
addToMessageQueue(session, async () => {
|
|
1120
1173
|
try {
|
|
1121
1174
|
const formattedMac = formatMacAddress(mac);
|
|
1122
|
-
const
|
|
1123
|
-
if (!onuList) {
|
|
1124
|
-
return "未找到该MAC地址的设备信息";
|
|
1125
|
-
}
|
|
1126
|
-
const onuDetail = await queryOnuDetailInfo(onuList.id);
|
|
1127
|
-
const ccname = await queryCCName(formattedMac);
|
|
1128
|
-
const order = await queryOnuOrder(onuDetail);
|
|
1129
|
-
const vlanInfo = await queryOnuDetailVlanInfo(onuList.id);
|
|
1175
|
+
const { onuDetail, ccname, order, vlanInfo } = await queryTerminalInfo(formattedMac, true);
|
|
1130
1176
|
const messages = [
|
|
1131
1177
|
"🖥️ 终端基本信息",
|
|
1132
1178
|
"--------------------------------",
|
|
@@ -1153,11 +1199,24 @@ function apply(ctx, config) {
|
|
|
1153
1199
|
"⚙️ 业务配置信息",
|
|
1154
1200
|
"--------------------------------"
|
|
1155
1201
|
];
|
|
1202
|
+
const vlanGroups = {};
|
|
1156
1203
|
vlanInfo.forEach((info) => {
|
|
1204
|
+
const key = `${info.VLAN !== void 0 && info.VLAN !== null && info.VLAN !== "-" ? info.VLAN : "未配置"}-${info.actualVlan !== void 0 && info.actualVlan !== null ? info.actualVlan : "未配置"}`;
|
|
1205
|
+
if (!vlanGroups[key]) {
|
|
1206
|
+
vlanGroups[key] = {
|
|
1207
|
+
VLAN: info.VLAN !== void 0 && info.VLAN !== null && info.VLAN !== "-" ? info.VLAN : "未配置",
|
|
1208
|
+
actualVlan: info.actualVlan !== void 0 && info.actualVlan !== null ? info.actualVlan : "未配置",
|
|
1209
|
+
ports: []
|
|
1210
|
+
};
|
|
1211
|
+
}
|
|
1212
|
+
vlanGroups[key].ports.push(info.LAN);
|
|
1213
|
+
});
|
|
1214
|
+
Object.values(vlanGroups).forEach((group) => {
|
|
1215
|
+
const portsText = group.ports.join(",");
|
|
1157
1216
|
messages.push(
|
|
1158
|
-
`端口 ${
|
|
1159
|
-
` 端口VLAN: ${
|
|
1160
|
-
` 工单VLAN: ${
|
|
1217
|
+
`端口 ${portsText}:`,
|
|
1218
|
+
` 端口VLAN: ${group.VLAN}`,
|
|
1219
|
+
` 工单VLAN: ${group.actualVlan}`
|
|
1161
1220
|
);
|
|
1162
1221
|
});
|
|
1163
1222
|
messages.push("--------------------------------");
|
|
@@ -1170,7 +1229,7 @@ function apply(ctx, config) {
|
|
|
1170
1229
|
resolve();
|
|
1171
1230
|
});
|
|
1172
1231
|
});
|
|
1173
|
-
ctx.command("日志查询 <mac:string> [startTime:string] [endTime:string]", "查询终端工单日志").action(async ({ session }, mac, startTime, endTime) => {
|
|
1232
|
+
ctx.command("日志查询 <mac:string> [startTime:string] [endTime:string]", "查询终端工单日志").alias("/日志查询").action(async ({ session }, mac, startTime, endTime) => {
|
|
1174
1233
|
if (!mac) return "请输入要查询的MAC地址";
|
|
1175
1234
|
try {
|
|
1176
1235
|
await session?.send("正在查询日志,请稍候...");
|
|
@@ -1227,7 +1286,7 @@ function apply(ctx, config) {
|
|
|
1227
1286
|
return "查询失败,请稍后重试";
|
|
1228
1287
|
}
|
|
1229
1288
|
});
|
|
1230
|
-
ctx.command("用户查询 <account:string>", "查询RADIUS用户信息").action(async ({ session }, account) => {
|
|
1289
|
+
ctx.command("用户查询 <account:string>", "查询RADIUS用户信息").alias("/用户查询").action(async ({ session }, account) => {
|
|
1231
1290
|
if (!account) return "请输入要查询的账号";
|
|
1232
1291
|
return new Promise((resolve) => {
|
|
1233
1292
|
addToMessageQueue(session, async () => {
|
package/package.json
CHANGED
package/readme.md
CHANGED
|
@@ -11,8 +11,8 @@
|
|
|
11
11
|
## 命令列表
|
|
12
12
|
|
|
13
13
|
### 1. 账号查询
|
|
14
|
-
- 命令格式:`账号查询 <账号>`
|
|
15
|
-
- 示例:`账号查询 GDC8510019239048`
|
|
14
|
+
- 命令格式:`账号查询 <账号>` 或 `/账号查询 <账号>`
|
|
15
|
+
- 示例:`账号查询 GDC8510019239048` 或 `/账号查询 GDC8510019239048`
|
|
16
16
|
- 功能:查询宽带账号的基本信息,包括在线状态、IP地址、MAC地址等。
|
|
17
17
|
- 返回信息:
|
|
18
18
|
- RADIUS用户信息:状态、密码等
|
|
@@ -25,14 +25,14 @@
|
|
|
25
25
|
- 备注:账号会自动转换为大写,在线时长会以"天小时分钟"的形式显示。
|
|
26
26
|
|
|
27
27
|
### 2. 账号详情
|
|
28
|
-
- 命令格式:`账号详情 <账号>`
|
|
29
|
-
- 示例:`账号详情 GDC8510019239048`
|
|
28
|
+
- 命令格式:`账号详情 <账号>` 或 `/账号详情 <账号>`
|
|
29
|
+
- 示例:`账号详情 GDC8510019239048` 或 `/账号详情 GDC8510019239048`
|
|
30
30
|
- 功能:查询宽带账号的详细记录,包括登录时间、登出时间等。
|
|
31
31
|
- 备注:账号会自动转换为大写。
|
|
32
32
|
|
|
33
33
|
### 3. 终端查询
|
|
34
|
-
- 命令格式:`终端查询 <MAC地址>`
|
|
35
|
-
- 示例:`终端查询 00:11:22:33:44:55`
|
|
34
|
+
- 命令格式:`终端查询 <MAC地址>` 或 `/终端查询 <MAC地址>`
|
|
35
|
+
- 示例:`终端查询 00:11:22:33:44:55` 或 `/终端查询 00:11:22:33:44:55`
|
|
36
36
|
- 功能:查询终端的基本信息,包括光功率和业务配置信息。
|
|
37
37
|
- 返回信息:
|
|
38
38
|
- 设备基本信息:状态、设备名称等
|
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
- 中文符号分隔:`00:11。22-33|44:55`
|
|
47
47
|
|
|
48
48
|
### 4. 终端详细查询
|
|
49
|
-
- 命令格式:`终端详细查询 <MAC地址>`
|
|
50
|
-
- 示例:`终端详细查询 00:11:22:33:44:55`
|
|
49
|
+
- 命令格式:`终端详细查询 <MAC地址>` 或 `/终端详细查询 <MAC地址>`
|
|
50
|
+
- 示例:`终端详细查询 00:11:22:33:44:55` 或 `/终端详细查询 00:11:22:33:44:55`
|
|
51
51
|
- 功能:查询终端的详细信息,包括机房、设备名称、OLT IP、工单信息等。
|
|
52
52
|
- 返回信息:
|
|
53
53
|
- 设备详细信息:状态、机房、设备名称、OLT IP、PON端口、逻辑号等
|
|
@@ -56,11 +56,11 @@
|
|
|
56
56
|
- 业务配置信息:端口VLAN和工单VLAN配置详情
|
|
57
57
|
|
|
58
58
|
### 5. 日志查询
|
|
59
|
-
- 命令格式:`日志查询 <MAC地址> [开始时间] [结束时间]`
|
|
59
|
+
- 命令格式:`日志查询 <MAC地址> [开始时间] [结束时间]` 或 `/日志查询 <MAC地址> [开始时间] [结束时间]`
|
|
60
60
|
- 示例:
|
|
61
|
-
- `日志查询 00:11:22:33:44:55`
|
|
62
|
-
- `日志查询 00:11:22:33:44:55 2024.3.1 2024.3.10`
|
|
63
|
-
- `日志查询 00:11:22:33:44:55 三月一日`
|
|
61
|
+
- `日志查询 00:11:22:33:44:55` 或 `/日志查询 00:11:22:33:44:55`
|
|
62
|
+
- `日志查询 00:11:22:33:44:55 2024.3.1 2024.3.10` 或 `/日志查询 00:11:22:33:44:55 2024.3.1 2024.3.10`
|
|
63
|
+
- `日志查询 00:11:22:33:44:55 三月一日` 或 `/日志查询 00:11:22:33:44:55 三月一日`
|
|
64
64
|
- 功能:查询终端的上线分析日志。
|
|
65
65
|
- 时间格式支持:
|
|
66
66
|
- 完整日期:`2024.3.1` 或 `2024/3/1`
|
|
@@ -68,8 +68,8 @@
|
|
|
68
68
|
- 中文日期:`三月一日` 或 `三月一号`
|
|
69
69
|
|
|
70
70
|
### 6. 用户查询
|
|
71
|
-
- 命令格式:`用户查询 <账号>`
|
|
72
|
-
- 示例:`用户查询 GDC8510013590471`
|
|
71
|
+
- 命令格式:`用户查询 <账号>` 或 `/用户查询 <账号>`
|
|
72
|
+
- 示例:`用户查询 GDC8510013590471` 或 `/用户查询 GDC8510013590471`
|
|
73
73
|
- 功能:查询RADIUS系统中的用户信息和订购状态。
|
|
74
74
|
- 返回信息:
|
|
75
75
|
- 用户基本信息:账号、密码、状态、漫游设置等
|
|
@@ -104,6 +104,8 @@
|
|
|
104
104
|
7. **超时处理**:设置请求超时,自动处理长时间未响应的请求
|
|
105
105
|
8. **格式优化**:优化消息显示格式,使用直观的图标显示状态信息
|
|
106
106
|
9. **错误处理**:完善的错误处理机制,确保查询失败时有清晰的提示
|
|
107
|
+
10. **并行查询**:终端查询采用并行请求策略,在保持接口依赖关系的同时大幅提升查询速度
|
|
108
|
+
11. **智能合并**:具有相同VLAN配置的多个LAN端口会自动合并显示,提高信息的可读性
|
|
107
109
|
|
|
108
110
|
## 显示优化
|
|
109
111
|
|
|
@@ -126,6 +128,11 @@
|
|
|
126
128
|
- 内容丰富的查询结果使用新行显示
|
|
127
129
|
- 简短提示直接显示在同一行
|
|
128
130
|
|
|
131
|
+
5. **VLAN显示**:
|
|
132
|
+
- 端口VLAN值为"-"时显示为"未配置"
|
|
133
|
+
- 工单VLAN值为0时正确显示为"0"
|
|
134
|
+
- 相同VLAN配置的多个LAN端口合并显示,如"LAN2,LAN3,LAN4"
|
|
135
|
+
|
|
129
136
|
## 注意事项
|
|
130
137
|
1. 所有查询都需要正确的权限和配置。
|
|
131
138
|
2. MAC地址不区分大小写,支持多种分隔符格式,包括中文符号。
|
|
@@ -136,28 +143,15 @@
|
|
|
136
143
|
7. 账号查询时会先检查RADIUS授权,如授权有误将不继续查询账号信息。
|
|
137
144
|
8. 光功率刷新功能将无论设备是否在线都会尝试刷新,确保获取最新数据。
|
|
138
145
|
9. 针对上线失败或离线状态的账号,系统也能提供有用的信息,不会简单报错。
|
|
139
|
-
|
|
140
|
-
## 开发相关
|
|
141
|
-
|
|
142
|
-
为了支持开发过程中的热重载功能,需要确保:
|
|
143
|
-
1. 在`koishi.yml`中正确配置hmr插件
|
|
144
|
-
2. 安装并启用loader服务
|
|
145
|
-
3. 在开发环境下运行Koishi时设置`NODE_ENV=development`
|
|
146
|
-
|
|
147
|
-
```yaml
|
|
148
|
-
# 开发相关配置示例
|
|
149
|
-
group:develop:
|
|
150
|
-
$if: env.NODE_ENV === 'development'
|
|
151
|
-
hmr:
|
|
152
|
-
root:
|
|
153
|
-
- .
|
|
154
|
-
loader:
|
|
155
|
-
watch: true
|
|
156
|
-
```
|
|
146
|
+
10. 所有命令支持带斜杠(如`/账号查询`)和不带斜杠(如`账号查询`)两种触发方式,提高命令输入的灵活性。
|
|
157
147
|
|
|
158
148
|
## 更新日志
|
|
159
149
|
|
|
160
150
|
### 最新更新
|
|
151
|
+
- 优化终端查询性能,实现并行请求,大幅减少查询响应时间
|
|
152
|
+
- 智能合并显示具有相同VLAN配置的LAN端口,使得信息展示更加清晰
|
|
153
|
+
- 优化VLAN值显示:端口VLAN为"-"时显示为"未配置",工单VLAN为0时正确显示为"0"
|
|
154
|
+
- 增加了对双触发词的支持,同时兼容带斜杠(如`/账号查询`)和不带斜杠(如`账号查询`)的命令格式
|
|
161
155
|
- 增加了离线状态和上线失败状态的特殊处理,提供更多有用信息
|
|
162
156
|
- 修复了状态图标显示问题,确保"不在线"状态正确显示❌图标
|
|
163
157
|
- 优化了数据完整性检查,对不同状态采用不同的验证标准
|