fiberhome: add prelimunary add ONU support
Signed-off-by: Rodrigo Bertoldo de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
600555596d
commit
ee22ecf693
4 files changed
+724
No files matched your search
@@ -15,6 +15,7 @@ class NLPProcessor {
|
||||
'remover_onu': ['remover onu', 'deletar onu', 'apagar onu', 'remove onu', 'delete onu'],
|
||||
'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'],
|
||||
'ping': ['ping', 'testar', 'test', 'conectividade'],
|
||||
'admin': ['admin', 'administração', 'administracao', 'painel'],
|
||||
'usuarios_autorizados': ['usuarios autorizados', 'users autorizados', 'lista usuarios', 'listar usuarios autorizados'],
|
||||
@@ -59,6 +60,9 @@ class NLPProcessor {
|
||||
// Padrões específicos para adicionar ONU com VLAN customizada
|
||||
/^(adicionar|add|criar|cadastrar|registrar)\s+(onu|ont)\s+vlan\s+(\d+)\s+([A-Z0-9]+)$/i,
|
||||
/^(adicionar|add|criar)\s+vlan\s+(\d+)\s+([A-Z0-9]+)$/i,
|
||||
// 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 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,
|
||||
@@ -285,6 +289,29 @@ class NLPProcessor {
|
||||
|
||||
// Padrões específicos para adicionar ONU
|
||||
if (/adicionar|add|criar|cadastrar|registrar/i.test(action)) {
|
||||
// Padrão especial: "adicionar onu fiberhome SERIAL"
|
||||
if (/fiberhome/i.test(fullMatch)) {
|
||||
let serialNumber;
|
||||
|
||||
// Formato: "adicionar onu fiberhome SERIAL"
|
||||
if (match.length === 4 && /onu|ont/i.test(fullMatch)) {
|
||||
serialNumber = match[3]; // Serial
|
||||
}
|
||||
// Formato: "fiberhome onu SERIAL"
|
||||
else if (match.length === 4 && match[1] === 'fiberhome') {
|
||||
serialNumber = match[3]; // Serial
|
||||
}
|
||||
|
||||
if (serialNumber) {
|
||||
return {
|
||||
action: 'adicionar_onu_fiberhome',
|
||||
target: serialNumber.trim().toUpperCase(),
|
||||
confidence: 0.95,
|
||||
type: 'add_onu_fiberhome_pattern'
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
// Padrão especial: "adicionar onu vlan XXX SERIAL" ou "add onu vlan XXX SERIAL"
|
||||
if (/vlan/i.test(fullMatch)) {
|
||||
let vlanId, serialNumber;
|
||||
|
||||
Reference in new issue
Block a user