feat(web): fuse Hub device modules into instance panels with SMS aggregation

- Consolidate cellular, eSIM, network and device module interactions.

- Add aggregate SMS workflows and identity-aware action controls.

- Extend SMSC privacy handling and module action icons.
This commit is contained in:
chick
2026-09-07 00:45:38 +08:00
parent 864e1bd90c
commit 6d251dab7b
17 changed files with 565 additions and 31 deletions
@@ -9,6 +9,8 @@ describe('sensitive field masking', () => {
expect(isSensitiveKey('phone_number')).toBe(true);
expect(isSensitiveKey('phoneNumber')).toBe(true);
expect(isSensitiveKey('phone-number')).toBe(true);
expect(isSensitiveKey('smsc')).toBe(true);
expect(isSensitiveKey('sms_center')).toBe(true);
expect(isSensitiveKey('slot')).toBe(false);
expect(isSensitiveKey('carrier')).toBe(false);
});
@@ -29,5 +31,6 @@ describe('sensitive field masking', () => {
expect(protectValue('phone_number', '13800001234', false)).toBe('138 •••• 1234');
expect(protectValue('msisdn', '13800001234', false)).toBe('138 •••• 1234');
expect(protectValue('phoneNumber', '13800001234', true)).toBe('13800001234');
expect(protectValue('sms_center', '+85255500100', false)).toBe('+852 •••• 0100');
});
});
+15 -1
View File
@@ -13,6 +13,11 @@ export const SENSITIVE_KEYS: ReadonlySet<string> = new Set([
'phone_number',
'msisdn',
'phonenumber',
'smsc',
'sms_center',
'smsc_number',
'service_center',
'center_number',
]);
const MASK = '••••';
@@ -22,7 +27,16 @@ function normalize(key: string): string {
return key.toLocaleLowerCase().replace(/[-\s]/gu, '_');
}
const PHONE_KEYS: ReadonlySet<string> = new Set(['phone_number', 'msisdn', 'phonenumber']);
const PHONE_KEYS: ReadonlySet<string> = new Set([
'phone_number',
'msisdn',
'phonenumber',
'smsc',
'sms_center',
'smsc_number',
'service_center',
'center_number',
]);
export function isSensitiveKey(key: string): boolean {
return SENSITIVE_KEYS.has(normalize(key));