feat: improve operations diagnostics and channel management
This commit is contained in:
@@ -6,7 +6,7 @@ import { adminApi, type AdminChannel } from '@/api/adminApi';
|
||||
const columns: Array<TableColumn<AdminChannel>> = [
|
||||
{ key: 'id', title: '通道编号', render: (record) => record.id },
|
||||
{ key: 'name', title: '通道名称', render: (record) => record.name },
|
||||
{ key: 'carrier', title: '运营商', render: (record) => record.carrier ?? '-' },
|
||||
{ key: 'carrier', title: '运营商', render: (record) => carrierLabel(record.carrier) },
|
||||
{ key: 'gatewayHost', title: '网关地址', render: (record) => `${record.gatewayHost}:${record.gatewayPort}` },
|
||||
{ key: 'rateLimitPerSecond', title: '限速', render: (record) => `${record.rateLimitPerSecond} 条/秒` },
|
||||
{
|
||||
@@ -16,6 +16,22 @@ const columns: Array<TableColumn<AdminChannel>> = [
|
||||
},
|
||||
];
|
||||
|
||||
const carrierLabels: Record<string, string> = {
|
||||
mobile: '移动',
|
||||
cmcc: '移动',
|
||||
unicom: '联通',
|
||||
cucc: '联通',
|
||||
telecom: '电信',
|
||||
ctcc: '电信',
|
||||
all: '三网',
|
||||
unknown: '未识别',
|
||||
};
|
||||
|
||||
function carrierLabel(value?: string | null) {
|
||||
if (!value) return '-';
|
||||
return carrierLabels[value.trim().toLowerCase()] ?? value;
|
||||
}
|
||||
|
||||
export function AdminMonitorPage() {
|
||||
const [channels, setChannels] = useState<AdminChannel[]>([]);
|
||||
const [monitor, setMonitor] = useState<Record<string, unknown>>({});
|
||||
|
||||
Reference in New Issue
Block a user