genieacs: improvements
Signed-off-by: Rodrigo Bertoldo de Sousa Martins <rodrigo.sousa.577@gmail.com>
This commit is contained in:
1 parent
8dd2680838
commit
6e0ad2b42d
2 files changed
+30
-9
No files matched your search
+23
-7
@@ -1188,10 +1188,12 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
}
|
||||
|
||||
// DHCP LAN
|
||||
if (d.dhcpInicio || d.dhcpFim || d.dnsLAN) {
|
||||
msgCPE += `\n 🏠 *DHCP LAN*\n`;
|
||||
if (d.dhcpInicio) msgCPE += ` ├ Início: ${esc(d.dhcpInicio)}\n`;
|
||||
if (d.dhcpFim) msgCPE += ` ├ Fim: ${esc(d.dhcpFim)}\n`;
|
||||
if (d.dhcpInicio || d.dhcpFim || d.dnsLAN || d.ipLAN || d.mascaraLAN) {
|
||||
msgCPE += `\n 🏠 *LAN/DHCP*\n`;
|
||||
if (d.ipLAN) msgCPE += ` ├ IP LAN: \`${esc(d.ipLAN)}\`\n`;
|
||||
if (d.mascaraLAN) msgCPE += ` ├ Máscara: ${esc(d.mascaraLAN)}\n`;
|
||||
if (d.dhcpInicio) msgCPE += ` ├ DHCP Início: ${esc(d.dhcpInicio)}\n`;
|
||||
if (d.dhcpFim) msgCPE += ` ├ DHCP Fim: ${esc(d.dhcpFim)}\n`;
|
||||
if (d.dnsLAN) msgCPE += ` └ DNS LAN: ${esc(d.dnsLAN)}\n`;
|
||||
}
|
||||
|
||||
@@ -7471,9 +7473,11 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
msg += `└ Último Erro: ${esc(d.pppoeLastError)}`;
|
||||
|
||||
// DHCP LAN
|
||||
msg += `\n\n🏠 *DHCP LAN*\n`;
|
||||
msg += `├ Início: ${esc(d.dhcpInicio)}\n`;
|
||||
msg += `├ Fim: ${esc(d.dhcpFim)}\n`;
|
||||
msg += `\n\n🏠 *LAN/DHCP*\n`;
|
||||
msg += `├ IP LAN: \`${esc(d.ipLAN)}\`\n`;
|
||||
msg += `├ Máscara: ${esc(d.mascaraLAN)}\n`;
|
||||
msg += `├ Início DHCP: ${esc(d.dhcpInicio)}\n`;
|
||||
msg += `├ Fim DHCP: ${esc(d.dhcpFim)}\n`;
|
||||
msg += `└ DNS LAN: ${esc(d.dnsLAN)}`;
|
||||
|
||||
await this.bot.sendMessage(chatId, msg, { parse_mode: 'Markdown' });
|
||||
@@ -7504,6 +7508,8 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
dnslan: { label: 'DNS LAN', param: 'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DNSServers', type: 'xsd:string', toggle: false },
|
||||
dhcpstart: { label: 'DHCP Início', param: 'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MinAddress', type: 'xsd:string', toggle: false },
|
||||
dhcpend: { label: 'DHCP Fim', param: 'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MaxAddress', type: 'xsd:string', toggle: false },
|
||||
iplan: { label: 'IP LAN', param: 'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceIPAddress', type: 'xsd:string', toggle: false },
|
||||
mascaralan: { label: 'Máscara LAN', param: 'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceSubnetMask', type: 'xsd:string', toggle: false },
|
||||
};
|
||||
}
|
||||
|
||||
@@ -7575,6 +7581,8 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
`🌐 *WAN/PPPoE*\n` +
|
||||
`├ DNS WAN: ${esc(device.dnsWAN)}\n\n` +
|
||||
`🏠 *LAN/DHCP*\n` +
|
||||
`├ IP LAN: ${esc(device.ipLAN)}\n` +
|
||||
`├ Máscara: ${esc(device.mascaraLAN)}\n` +
|
||||
`├ DNS LAN: ${esc(device.dnsLAN)}\n` +
|
||||
`├ DHCP Início: ${esc(device.dhcpInicio)}\n` +
|
||||
`└ DHCP Fim: ${esc(device.dhcpFim)}\n\n` +
|
||||
@@ -7602,6 +7610,10 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
{ text: '▶ DHCP Início', callback_data: 'router_cfg_dhcpstart' },
|
||||
{ text: '◀ DHCP Fim', callback_data: 'router_cfg_dhcpend' },
|
||||
],
|
||||
[
|
||||
{ text: '🖥️ IP LAN', callback_data: 'router_cfg_iplan' },
|
||||
{ text: '🔢 Máscara LAN', callback_data: 'router_cfg_mascaralan'},
|
||||
],
|
||||
[
|
||||
{ text: '🔄 Atualizar leitura', callback_data: 'router_cfg_refresh' },
|
||||
{ text: '❌ Fechar', callback_data: 'cancel_action' },
|
||||
@@ -7742,6 +7754,7 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
ssid24: 'ssid24', ssid5: 'ssid5',
|
||||
dnswan: 'dnsWAN', dnslan: 'dnsLAN',
|
||||
dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim',
|
||||
iplan: 'ipLAN', mascaralan: 'mascaraLAN',
|
||||
};
|
||||
const atualKey = fieldToCurrent[field];
|
||||
const valorAtual = atualKey ? (session.device[atualKey] || 'N/A') : 'N/A';
|
||||
@@ -7749,6 +7762,8 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
let hint = '';
|
||||
if (field.startsWith('dns')) hint = ' (ex.: 8.8.8.8,8.8.4.4)';
|
||||
else if (field.startsWith('dhcp')) hint = ' (ex.: 192.168.1.100)';
|
||||
else if (field === 'iplan') hint = ' (ex.: 192.168.1.1)';
|
||||
else if (field === 'mascaralan') hint = ' (ex.: 255.255.255.0)';
|
||||
|
||||
// Promove o estado de sessão para aguardar o valor
|
||||
session.action = `router_cfg_wait_${field}`;
|
||||
@@ -7827,6 +7842,7 @@ Digite /help para ver todos os comandos disponíveis!
|
||||
ch24: 'channel24', ch5: 'channel5',
|
||||
dnswan: 'dnsWAN', dnslan: 'dnsLAN',
|
||||
dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim',
|
||||
iplan: 'ipLAN', mascaralan: 'mascaraLAN',
|
||||
};
|
||||
const devKey = fieldToDeviceKey[field];
|
||||
if (devKey) session.device[devKey] = String(valorFinal);
|
||||
|
||||
Reference in new issue
Block a user