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
|
// DHCP LAN
|
||||||
if (d.dhcpInicio || d.dhcpFim || d.dnsLAN) {
|
if (d.dhcpInicio || d.dhcpFim || d.dnsLAN || d.ipLAN || d.mascaraLAN) {
|
||||||
msgCPE += `\n 🏠 *DHCP LAN*\n`;
|
msgCPE += `\n 🏠 *LAN/DHCP*\n`;
|
||||||
if (d.dhcpInicio) msgCPE += ` ├ Início: ${esc(d.dhcpInicio)}\n`;
|
if (d.ipLAN) msgCPE += ` ├ IP LAN: \`${esc(d.ipLAN)}\`\n`;
|
||||||
if (d.dhcpFim) msgCPE += ` ├ Fim: ${esc(d.dhcpFim)}\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`;
|
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)}`;
|
msg += `└ Último Erro: ${esc(d.pppoeLastError)}`;
|
||||||
|
|
||||||
// DHCP LAN
|
// DHCP LAN
|
||||||
msg += `\n\n🏠 *DHCP LAN*\n`;
|
msg += `\n\n🏠 *LAN/DHCP*\n`;
|
||||||
msg += `├ Início: ${esc(d.dhcpInicio)}\n`;
|
msg += `├ IP LAN: \`${esc(d.ipLAN)}\`\n`;
|
||||||
msg += `├ Fim: ${esc(d.dhcpFim)}\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)}`;
|
msg += `└ DNS LAN: ${esc(d.dnsLAN)}`;
|
||||||
|
|
||||||
await this.bot.sendMessage(chatId, msg, { parse_mode: 'Markdown' });
|
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 },
|
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 },
|
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 },
|
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` +
|
`🌐 *WAN/PPPoE*\n` +
|
||||||
`├ DNS WAN: ${esc(device.dnsWAN)}\n\n` +
|
`├ DNS WAN: ${esc(device.dnsWAN)}\n\n` +
|
||||||
`🏠 *LAN/DHCP*\n` +
|
`🏠 *LAN/DHCP*\n` +
|
||||||
|
`├ IP LAN: ${esc(device.ipLAN)}\n` +
|
||||||
|
`├ Máscara: ${esc(device.mascaraLAN)}\n` +
|
||||||
`├ DNS LAN: ${esc(device.dnsLAN)}\n` +
|
`├ DNS LAN: ${esc(device.dnsLAN)}\n` +
|
||||||
`├ DHCP Início: ${esc(device.dhcpInicio)}\n` +
|
`├ DHCP Início: ${esc(device.dhcpInicio)}\n` +
|
||||||
`└ DHCP Fim: ${esc(device.dhcpFim)}\n\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 Início', callback_data: 'router_cfg_dhcpstart' },
|
||||||
{ text: '◀ DHCP Fim', callback_data: 'router_cfg_dhcpend' },
|
{ 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: '🔄 Atualizar leitura', callback_data: 'router_cfg_refresh' },
|
||||||
{ text: '❌ Fechar', callback_data: 'cancel_action' },
|
{ text: '❌ Fechar', callback_data: 'cancel_action' },
|
||||||
@@ -7742,6 +7754,7 @@ Digite /help para ver todos os comandos disponíveis!
|
|||||||
ssid24: 'ssid24', ssid5: 'ssid5',
|
ssid24: 'ssid24', ssid5: 'ssid5',
|
||||||
dnswan: 'dnsWAN', dnslan: 'dnsLAN',
|
dnswan: 'dnsWAN', dnslan: 'dnsLAN',
|
||||||
dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim',
|
dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim',
|
||||||
|
iplan: 'ipLAN', mascaralan: 'mascaraLAN',
|
||||||
};
|
};
|
||||||
const atualKey = fieldToCurrent[field];
|
const atualKey = fieldToCurrent[field];
|
||||||
const valorAtual = atualKey ? (session.device[atualKey] || 'N/A') : 'N/A';
|
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 = '';
|
let hint = '';
|
||||||
if (field.startsWith('dns')) hint = ' (ex.: 8.8.8.8,8.8.4.4)';
|
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.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
|
// Promove o estado de sessão para aguardar o valor
|
||||||
session.action = `router_cfg_wait_${field}`;
|
session.action = `router_cfg_wait_${field}`;
|
||||||
@@ -7827,6 +7842,7 @@ Digite /help para ver todos os comandos disponíveis!
|
|||||||
ch24: 'channel24', ch5: 'channel5',
|
ch24: 'channel24', ch5: 'channel5',
|
||||||
dnswan: 'dnsWAN', dnslan: 'dnsLAN',
|
dnswan: 'dnsWAN', dnslan: 'dnsLAN',
|
||||||
dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim',
|
dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim',
|
||||||
|
iplan: 'ipLAN', mascaralan: 'mascaraLAN',
|
||||||
};
|
};
|
||||||
const devKey = fieldToDeviceKey[field];
|
const devKey = fieldToDeviceKey[field];
|
||||||
if (devKey) session.device[devKey] = String(valorFinal);
|
if (devKey) session.device[devKey] = String(valorFinal);
|
||||||
|
|||||||
+7
-2
@@ -39,7 +39,10 @@ const DEVICE_PROJECTION = [
|
|||||||
// DHCP LAN
|
// DHCP LAN
|
||||||
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MinAddress',
|
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MinAddress',
|
||||||
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MaxAddress',
|
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MaxAddress',
|
||||||
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DNSServers'
|
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DNSServers',
|
||||||
|
// IP LAN
|
||||||
|
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceIPAddress',
|
||||||
|
'InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceSubnetMask'
|
||||||
].join(',');
|
].join(',');
|
||||||
|
|
||||||
class GenieACSApi {
|
class GenieACSApi {
|
||||||
@@ -301,7 +304,9 @@ class GenieACSApi {
|
|||||||
// DHCP LAN
|
// DHCP LAN
|
||||||
dhcpInicio : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MinAddress'),
|
dhcpInicio : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MinAddress'),
|
||||||
dhcpFim : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MaxAddress'),
|
dhcpFim : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.MaxAddress'),
|
||||||
dnsLAN : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DNSServers')
|
dnsLAN : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.DNSServers'),
|
||||||
|
ipLAN : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceIPAddress'),
|
||||||
|
mascaraLAN : get('InternetGatewayDevice.LANDevice.1.LANHostConfigManagement.IPInterface.1.IPInterfaceSubnetMask')
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user