fiberhome: add remove onu option
Signed-off-by: Rodrigo Bertoldo de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
e5f8bcf546
commit
41a8d1b6c5
3 files changed
+333
No files matched your search
@@ -16,6 +16,7 @@ class NLPProcessor {
|
||||
'adicionar_onu': ['adicionar onu', 'add onu', 'criar onu', 'cadastrar onu', 'registrar onu'],
|
||||
'adicionar_onu_vlan': ['adicionar onu vlan', 'add onu vlan', 'criar onu vlan', 'cadastrar onu vlan'],
|
||||
'adicionar_onu_fiberhome': ['adicionar onu fiberhome', 'add onu fiberhome', 'criar onu fiberhome', 'cadastrar onu fiberhome', 'registrar onu fiberhome'],
|
||||
'remover_onu_fiberhome': ['remover onu fiberhome', 'deletar onu fiberhome', 'apagar onu fiberhome', 'remove onu fiberhome', 'delete onu fiberhome'],
|
||||
'ping': ['ping', 'testar', 'test', 'conectividade'],
|
||||
'admin': ['admin', 'administração', 'administracao', 'painel'],
|
||||
'usuarios_autorizados': ['usuarios autorizados', 'users autorizados', 'lista usuarios', 'listar usuarios autorizados'],
|
||||
@@ -63,6 +64,9 @@ class NLPProcessor {
|
||||
// Padrões específicos para adicionar ONU Fiberhome via TL1
|
||||
/^(adicionar|add|criar|cadastrar|registrar)\s+(onu|ont)\s+fiberhome\s+([A-Z0-9]+)$/i,
|
||||
/^(fiberhome)\s+(onu|ont)\s+([A-Z0-9]+)$/i,
|
||||
// Padrões específicos para remover ONU Fiberhome via TL1
|
||||
/^(remover|deletar|apagar|remove|delete)\s+(onu|ont)\s+fiberhome\s+([A-Z0-9]+)$/i,
|
||||
/^(fiberhome)\s+(remover|deletar|apagar|remove|delete)\s+(onu|ont)\s+([A-Z0-9]+)$/i,
|
||||
// Padrões específicos para adicionar ONU
|
||||
/^(adicionar|add|criar|cadastrar|registrar)\s+(onu|ont)\s+([A-Z0-9]+)$/i,
|
||||
/^(adicionar|add|criar|cadastrar|registrar)\s+([A-Z0-9]+)$/i,
|
||||
@@ -364,6 +368,29 @@ class NLPProcessor {
|
||||
|
||||
// Padrões específicos para remover ONU
|
||||
if (/remover|deletar|apagar|remove|delete/i.test(action)) {
|
||||
// Padrão especial: "remover onu fiberhome SERIAL"
|
||||
if (/fiberhome/i.test(fullMatch)) {
|
||||
let serialNumber;
|
||||
|
||||
// Formato: "remover onu fiberhome SERIAL"
|
||||
if (match.length === 4 && /onu|ont/i.test(fullMatch)) {
|
||||
serialNumber = match[3]; // Serial
|
||||
}
|
||||
// Formato: "fiberhome remover onu SERIAL"
|
||||
else if (match.length === 5 && match[1] === 'fiberhome') {
|
||||
serialNumber = match[4]; // Serial
|
||||
}
|
||||
|
||||
if (serialNumber) {
|
||||
return {
|
||||
action: 'remover_onu_fiberhome',
|
||||
target: serialNumber.trim().toUpperCase(),
|
||||
confidence: 0.95,
|
||||
type: 'remove_onu_fiberhome_pattern'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Padrão 1: "remover onu SERIAL" ou "remover ont SERIAL"
|
||||
if (/onu|ont/i.test(fullMatch)) {
|
||||
let serialNumber = match[3]; // Terceiro grupo capturado (serial após "onu/ont")
|
||||
|
||||
Reference in new issue
Block a user