reinicio: fix phase
Signed-off-by: Rodrigo Martins <rodrigo@martinsevieira.adv.br>
This commit is contained in:
1 parent
3ec5ad73cb
commit
ba6e765107
2 files changed
+11
-13
No files matched your search
+10
-12
@@ -8686,10 +8686,6 @@ Digite /help para ver todos os comandos disponíveis!
|
|||||||
|
|
||||||
const serialEscaped = serial.replace(/_/g, '\\_');
|
const serialEscaped = serial.replace(/_/g, '\\_');
|
||||||
|
|
||||||
// Gerar ID curto para não estourar o limite de 64 bytes do callback_data
|
|
||||||
const restartId = String(++this._restartIdCounter);
|
|
||||||
this.pendingRestarts.set(restartId, { serial, base, location });
|
|
||||||
|
|
||||||
await this.bot.sendMessage(chatId,
|
await this.bot.sendMessage(chatId,
|
||||||
`⚠️ *Confirmar Reinicialização de ONU*\n\n` +
|
`⚠️ *Confirmar Reinicialização de ONU*\n\n` +
|
||||||
`📦 *Serviço:* ${nome}\n` +
|
`📦 *Serviço:* ${nome}\n` +
|
||||||
@@ -8702,7 +8698,7 @@ Digite /help para ver todos os comandos disponíveis!
|
|||||||
reply_markup: {
|
reply_markup: {
|
||||||
inline_keyboard: [
|
inline_keyboard: [
|
||||||
[
|
[
|
||||||
{ text: '✅ SIM, Reiniciar', callback_data: `confirm_rst_${restartId}` },
|
{ text: '✅ SIM, Reiniciar', callback_data: `confirm_restart_onu_${serial}_${base}_${location}` },
|
||||||
{ text: '❌ Cancelar', callback_data: 'cancel_action' }
|
{ text: '❌ Cancelar', callback_data: 'cancel_action' }
|
||||||
]
|
]
|
||||||
]
|
]
|
||||||
@@ -8762,16 +8758,18 @@ Digite /help para ver todos os comandos disponíveis!
|
|||||||
const chatId = callbackQuery.message.chat.id;
|
const chatId = callbackQuery.message.chat.id;
|
||||||
await this.bot.answerCallbackQuery(callbackQuery.id);
|
await this.bot.answerCallbackQuery(callbackQuery.id);
|
||||||
|
|
||||||
// Formato: confirm_rst_ID
|
// Formato: confirm_restart_onu_SERIAL_BASE_LOCATION
|
||||||
const restartId = data.replace('confirm_rst_', '');
|
const rest = data.replace('confirm_restart_onu_', '');
|
||||||
const pending = this.pendingRestarts.get(restartId);
|
// Serial é o primeiro token (12 chars alfanuméricos)
|
||||||
if (!pending) {
|
const serialMatch = rest.match(/^([A-Za-z0-9]+)_(.*)$/);
|
||||||
await this.bot.sendMessage(chatId, '❌ Dados de reinicialização expirados. Tente novamente.');
|
if (!serialMatch) {
|
||||||
|
await this.bot.sendMessage(chatId, '❌ Erro ao processar dados de reinicialização.');
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
this.pendingRestarts.delete(restartId);
|
|
||||||
|
|
||||||
const { serial, base } = pending;
|
const serial = serialMatch[1];
|
||||||
|
const remaining = serialMatch[2]; // BASE_LOCATION
|
||||||
|
const base = remaining; // usa o restante como base (pode conter location junto)
|
||||||
|
|
||||||
const oltHint = this._resolverOLTporBase(base);
|
const oltHint = this._resolverOLTporBase(base);
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ class NLPProcessor {
|
|||||||
'fechar_suporte': ['fechar suporte', 'finalizar suporte', 'encerrar suporte', 'concluir suporte', 'fechar chamado', 'finalizar chamado', 'encerrar chamado', 'concluir chamado', 'fechar ticket', 'finalizar ticket', 'encerrar ticket', 'concluir atendimento', 'fechar atendimento', 'encerrar atendimento'],
|
'fechar_suporte': ['fechar suporte', 'finalizar suporte', 'encerrar suporte', 'concluir suporte', 'fechar chamado', 'finalizar chamado', 'encerrar chamado', 'concluir chamado', 'fechar ticket', 'finalizar ticket', 'encerrar ticket', 'concluir atendimento', 'fechar atendimento', 'encerrar atendimento'],
|
||||||
'consultar_usuario': ['consultar usuario', 'consultar user', 'ver usuario', 'status usuario', 'status user', 'info usuario', 'info user', 'checar usuario', 'verificar usuario', 'pesquisar usuario', 'localizar usuario', 'buscar usuario', 'usuario conectado', 'user conectado', 'usuario online', 'user online', 'usuario ativo', 'user ativo'],
|
'consultar_usuario': ['consultar usuario', 'consultar user', 'ver usuario', 'status usuario', 'status user', 'info usuario', 'info user', 'checar usuario', 'verificar usuario', 'pesquisar usuario', 'localizar usuario', 'buscar usuario', 'usuario conectado', 'user conectado', 'usuario online', 'user online', 'usuario ativo', 'user ativo'],
|
||||||
'diagnosticar': ['diagnosticar', 'diagnostico', 'diagnose', 'diagnosticar cliente', 'diagnostico cliente', 'checar cliente completo', 'verificar cliente completo', 'relatorio cliente', 'relatorio completo', 'status completo cliente', 'analisar cliente', 'inspecionar cliente', 'situacao do cliente', 'situação do cliente'],
|
'diagnosticar': ['diagnosticar', 'diagnostico', 'diagnose', 'diagnosticar cliente', 'diagnostico cliente', 'checar cliente completo', 'verificar cliente completo', 'relatorio cliente', 'relatorio completo', 'status completo cliente', 'analisar cliente', 'inspecionar cliente', 'situacao do cliente', 'situação do cliente'],
|
||||||
'ver_roteador': ['ver roteador', 'info roteador', 'status roteador', 'roteador', 'cpe', 'ver cpe', 'info cpe', 'dados roteador', 'informações roteador', 'informacoes roteador', 'genieacs', 'ver device', 'info device', 'dispositivo cpe'],
|
'ver_roteador': ['ver roteador', 'info roteador', 'status roteador', 'roteador', 'cpe', 'ver cpe', 'info cpe', 'dados roteador', 'informações roteador', 'informacoes roteador', 'genieacs', 'ver device', 'info device', 'dispositivo cpe', 'diagnóstico'],
|
||||||
'mudar_ipoe': ['mudar para ipoe', 'mudar ipoe', 'ipoe', 'converter ipoe', 'ativar ipoe', 'habilitar ipoe', 'migrar ipoe', 'migrar para ipoe', 'converter para ipoe', 'passar para ipoe', 'trocar para ipoe', 'mudar pra ipoe'],
|
'mudar_ipoe': ['mudar para ipoe', 'mudar ipoe', 'ipoe', 'converter ipoe', 'ativar ipoe', 'habilitar ipoe', 'migrar ipoe', 'migrar para ipoe', 'converter para ipoe', 'passar para ipoe', 'trocar para ipoe', 'mudar pra ipoe'],
|
||||||
'configurar_roteador': ['configurar roteador', 'mudar roteador', 'alterar roteador', 'editar roteador', 'config roteador', 'configurar wifi', 'mudar wifi', 'alterar wifi', 'mudar ssid', 'alterar ssid', 'configurar cpe', 'mudar cpe', 'alterar cpe', 'configurar dns', 'mudar dns', 'configurar dhcp', 'mudar dhcp', 'alterar dhcp', 'mudar configuracoes roteador', 'mudar configurações roteador'],
|
'configurar_roteador': ['configurar roteador', 'mudar roteador', 'alterar roteador', 'editar roteador', 'config roteador', 'configurar wifi', 'mudar wifi', 'alterar wifi', 'mudar ssid', 'alterar ssid', 'configurar cpe', 'mudar cpe', 'alterar cpe', 'configurar dns', 'mudar dns', 'configurar dhcp', 'mudar dhcp', 'alterar dhcp', 'mudar configuracoes roteador', 'mudar configurações roteador'],
|
||||||
'reiniciar_onu': ['reiniciar onu', 'reiniciar onu cliente', 'resetar onu', 'resetar onu cliente', 'reboot onu', 'restart onu', 'reiniciar ont', 'resetar ont', 'reboot ont', 'restart ont', 'reiniciar onu do cliente', 'reset onu cliente']
|
'reiniciar_onu': ['reiniciar onu', 'reiniciar onu cliente', 'resetar onu', 'resetar onu cliente', 'reboot onu', 'restart onu', 'reiniciar ont', 'resetar ont', 'reboot ont', 'restart ont', 'reiniciar onu do cliente', 'reset onu cliente']
|
||||||
|
|||||||
Reference in new issue
Block a user