mirror of
https://github.com/hansjone/netxops.git
synced 2026-10-10 13:50:47 +08:00
Add Netx Ops i18n and promote settings to a dedicated section.
Localize alarm prompts and UI reason codes for zh/en, and restyle the settings page like uds-auth as its own settings.section. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
parent
909b5d61a7
commit
a4993b2407
18 changed files with 1329 additions and 840 deletions
|
|
@ -35,3 +35,21 @@ test('formatAlarmPrompt keeps human fields without raw sockets', () => {
|
|||
assert.match(text, /PE1 \(10\.0\.0\.1\)/)
|
||||
assert.match(text, /请分析这条关键告警/)
|
||||
})
|
||||
|
||||
test('formatAlarmPrompt switches to English when lang starts with en', () => {
|
||||
const text = formatAlarmPrompt({
|
||||
action: 'deleted',
|
||||
rule_label: 'Power Down',
|
||||
object_name: 'PORT-1',
|
||||
perceived_severity: 'critical',
|
||||
native_probable_cause: 'LOS',
|
||||
time_created: '2026-01-01T00:00:00Z',
|
||||
notification_id: 'n1',
|
||||
alarm_key: 'k1',
|
||||
ne: { host_name: 'PE1', ip_address: '10.0.0.1' },
|
||||
}, 'en-US')
|
||||
assert.match(text, /Alarm Cleared/)
|
||||
assert.match(text, /Device: PE1 \(10\.0\.0\.1\)/)
|
||||
assert.match(text, /Please analyze this key alarm/)
|
||||
assert.doesNotMatch(text, /告警/)
|
||||
})
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue