diff --git a/src/bot/handler.js b/src/bot/handler.js index 2461162..a6b7c6e 100644 --- a/src/bot/handler.js +++ b/src/bot/handler.js @@ -1169,8 +1169,10 @@ Digite /help para ver todos os comandos disponíveis! msgCPE += ` 🔧 SW: ${esc(d.softwareVersion)}\n`; if (tagLabel) msgCPE += ` 🏷️ TAG: \`${tagLabel}\`\n`; if (d.ssid24) msgCPE += ` 📶 SSID 2.4GHz: ${esc(d.ssid24)} (Canal ${esc(d.channel24)}, Auto: ${esc(d.autoChannel24)})\n`; + if (d.senha24) msgCPE += ` 🔑 Senha 2.4GHz: \`${esc(d.senha24)}\`\n`; if (d.clients24 !== null && d.clients24 !== undefined) msgCPE += ` 👥 Clientes 2.4GHz: ${esc(d.clients24)}\n`; if (d.ssid5) msgCPE += ` 📶 SSID 5GHz: ${esc(d.ssid5)} (Canal ${esc(d.channel5)}, Auto: ${esc(d.autoChannel5)})\n`; + if (d.senha5) msgCPE += ` 🔑 Senha 5GHz: \`${esc(d.senha5)}\`\n`; if (d.clients5 !== null && d.clients5 !== undefined) msgCPE += ` 👥 Clientes 5GHz: ${esc(d.clients5)}\n`; // PPPoE WAN @@ -7450,11 +7452,13 @@ Digite /help para ver todos os comandos disponíveis! `└ SW: ${esc(d.softwareVersion)}\n\n` + `📶 *Wi-Fi 2.4 GHz*\n` + `├ SSID: ${esc(d.ssid24)}\n` + + `├ Senha: \`${esc(d.senha24)}\`\n` + `├ Canal: ${esc(d.channel24)}\n` + `├ Auto-Canal: ${esc(d.autoChannel24)}\n` + `└ Clientes: ${d.clients24 !== null && d.clients24 !== undefined ? esc(d.clients24) : 'N/A'}\n\n` + `📶 *Wi-Fi 5 GHz*\n` + `├ SSID: ${esc(d.ssid5)}\n` + + `├ Senha: \`${esc(d.senha5)}\`\n` + `├ Canal: ${esc(d.channel5)}\n` + `├ Auto-Canal: ${esc(d.autoChannel5)}\n` + `└ Clientes: ${d.clients5 !== null && d.clients5 !== undefined ? esc(d.clients5) : 'N/A'}`; @@ -7500,6 +7504,8 @@ Digite /help para ver todos os comandos disponíveis! return { ssid24: { label: 'SSID 2.4GHz', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.SSID', type: 'xsd:string', toggle: false }, ssid5: { label: 'SSID 5GHz', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.SSID', type: 'xsd:string', toggle: false }, + senha24: { label: 'Senha Wi-Fi 2.4', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.KeyPassphrase', type: 'xsd:string', toggle: false }, + senha5: { label: 'Senha Wi-Fi 5', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.PreSharedKey.1.KeyPassphrase', type: 'xsd:string', toggle: false }, ch24: { label: 'Canal 2.4GHz', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Channel', type: 'xsd:unsignedInt', toggle: false }, ch5: { label: 'Canal 5GHz', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.Channel', type: 'xsd:unsignedInt', toggle: false }, auto24: { label: 'Auto-Canal 2.4', param: 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.AutoChannelEnable', type: 'xsd:boolean', toggle: true }, @@ -7574,9 +7580,11 @@ Digite /help para ver todos os comandos disponíveis! `📌 ${esc(instance)} — \`${esc(device.serial)}\`\n\n` + `📶 *Wi-Fi 2.4 GHz*\n` + `├ SSID: ${esc(device.ssid24)}\n` + + `├ Senha: \`${esc(device.senha24)}\`\n` + `├ Canal: ${esc(device.channel24)} (Auto: ${esc(device.autoChannel24)})\n\n` + `📶 *Wi-Fi 5 GHz*\n` + `├ SSID: ${esc(device.ssid5)}\n` + + `├ Senha: \`${esc(device.senha5)}\`\n` + `├ Canal: ${esc(device.channel5)} (Auto: ${esc(device.autoChannel5)})\n\n` + `🌐 *WAN/PPPoE*\n` + `├ DNS WAN: ${esc(device.dnsWAN)}\n\n` + @@ -7594,6 +7602,10 @@ Digite /help para ver todos os comandos disponíveis! { text: '📶 SSID 2.4GHz', callback_data: 'router_cfg_ssid24' }, { text: '📶 SSID 5GHz', callback_data: 'router_cfg_ssid5' }, ], + [ + { text: '🔑 Senha 2.4GHz', callback_data: 'router_cfg_senha24' }, + { text: '🔑 Senha 5GHz', callback_data: 'router_cfg_senha5' }, + ], [ { text: `${auto24On ? '✅' : '⬜'} Auto-Canal 2.4`, callback_data: 'router_cfg_auto24' }, { text: `${auto5On ? '✅' : '⬜'} Auto-Canal 5`, callback_data: 'router_cfg_auto5' }, @@ -7752,6 +7764,7 @@ Digite /help para ver todos os comandos disponíveis! // Valor atual para mostrar ao usuário const fieldToCurrent = { ssid24: 'ssid24', ssid5: 'ssid5', + senha24: 'senha24', senha5: 'senha5', dnswan: 'dnsWAN', dnslan: 'dnsLAN', dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim', iplan: 'ipLAN', mascaralan: 'mascaraLAN', @@ -7839,6 +7852,7 @@ Digite /help para ver todos os comandos disponíveis! // Atualiza o device local com o novo valor para o menu refletir const fieldToDeviceKey = { ssid24: 'ssid24', ssid5: 'ssid5', + senha24: 'senha24', senha5: 'senha5', ch24: 'channel24', ch5: 'channel5', dnswan: 'dnsWAN', dnslan: 'dnsLAN', dhcpstart: 'dhcpInicio', dhcpend: 'dhcpFim', diff --git a/src/genieacs/api.js b/src/genieacs/api.js index d90e214..3442c00 100644 --- a/src/genieacs/api.js +++ b/src/genieacs/api.js @@ -20,10 +20,12 @@ const DEVICE_PROJECTION = [ 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.AutoChannelEnable', 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Channel', 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.TotalAssociations', + 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.KeyPassphrase', 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.SSID', 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.AutoChannelEnable', 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.Channel', 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.TotalAssociations', + 'InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.PreSharedKey.1.KeyPassphrase', // PPPoE WAN 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Username', 'InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.ConnectionStatus', @@ -285,10 +287,12 @@ class GenieACSApi { autoChannel24 : autoChannel24 === true || autoChannel24 === 'true' || autoChannel24 === '1' ? 'Sim' : 'Não', channel24 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.Channel'), clients24 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.TotalAssociations'), + senha24 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.1.PreSharedKey.1.KeyPassphrase'), ssid5 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.SSID'), autoChannel5 : autoChannel5 === true || autoChannel5 === 'true' || autoChannel5 === '1' ? 'Sim' : 'Não', channel5 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.Channel'), clients5 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.TotalAssociations'), + senha5 : get('InternetGatewayDevice.LANDevice.1.WLANConfiguration.2.PreSharedKey.1.KeyPassphrase'), // PPPoE WAN pppoeUsername : get('InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.Username'), pppoeStatus : get('InternetGatewayDevice.WANDevice.1.WANConnectionDevice.1.WANPPPConnection.1.ConnectionStatus'),