' . lang('Systeminfo_Network_IP') . '
-
' . shell_exec("curl https://ifconfig.co") . '
+
Loading...
' . lang('Systeminfo_Network_IP_Connection') . '
@@ -274,19 +274,35 @@ function renderAvailableIpsTable(allIps, usedIps) {
// INIT
$(document).ready(function() {
+
+ // available IPs
fetchUsedIps(usedIps => {
const allIps = inferNetworkRange(usedIps);
renderAvailableIpsTable(allIps, usedIps);
});
setTimeout(() => {
+ // Available IPs datatable
$('#networkTable').DataTable({
- searching: true,
- order: [[0, "desc"]],
- initComplete: function(settings, json) {
- hideSpinner(); // Called after the DataTable is fully initialized
- }
- });
+ searching: true,
+ order: [[0, "desc"]],
+ initComplete: function(settings, json) {
+ hideSpinner(); // Called after the DataTable is fully initialized
+ }
+ });
+
+ // external IP
+ $.ajax({
+ url: 'https://api64.ipify.org?format=json',
+ method: 'GET',
+ timeout: 10000, // 10 seconds timeout
+ success: function (response) {
+ $('#external-ip').text(response.ip);
+ },
+ error: function() {
+ $('#external-ip').text('ERROR');
+ }
+ });
}, 200);
});