mirror of
https://github.com/Squidly271/community.applications.git
synced 2025-06-03 14:52:13 +08:00
more port in use stuff
This commit is contained in:
parent
e7e6ff4e3a
commit
e32df7b3f4
Binary file not shown.
@ -1153,8 +1153,11 @@ function uninstallDocker(application,humanName) {
|
|||||||
$(menuItem).addClass("selectedMenu");
|
$(menuItem).addClass("selectedMenu");
|
||||||
$(menuItem).next().show("slow");
|
$(menuItem).next().show("slow");
|
||||||
}
|
}
|
||||||
|
post({action:'getPortsInUse'},function(data) {
|
||||||
|
portsInUse = data.portsInUse;
|
||||||
previousApps(true,false,data.previousAppsSection);
|
previousApps(true,false,data.previousAppsSection);
|
||||||
});
|
});
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
enableSearch();
|
enableSearch();
|
||||||
}
|
}
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
8c0556f3cbebc296709cd3ef7622fae3 ./Apps.page
|
4a058a16952b7d817d2f30f39ce0c18b ./Apps.page
|
||||||
4e55f7483b661af21a25b677179baffe ./CA_notices.page
|
4e55f7483b661af21a25b677179baffe ./CA_notices.page
|
||||||
c7c6da0a4a4a7ac33f387ea178319bae ./ca_settings.page
|
c7c6da0a4a4a7ac33f387ea178319bae ./ca_settings.page
|
||||||
ed2883d6c44c19304c431079596a1731 ./default.cfg
|
ed2883d6c44c19304c431079596a1731 ./default.cfg
|
||||||
afe60a2b41646f7904be1db8c836f851 ./include/exec.php
|
edbb4969472efb9084a8f2e5b8688783 ./include/exec.php
|
||||||
fb3835932cb817d530eb0fde0c788dc5 ./include/helpers.php
|
d1309ffcf426230cf8a1f43dd96cb2e0 ./include/helpers.php
|
||||||
d827ebdf8c29aa6a9818df043a37721e ./include/paths.php
|
d827ebdf8c29aa6a9818df043a37721e ./include/paths.php
|
||||||
532fffdf939594c143e679da02bd841e ./javascript/libraries.js
|
532fffdf939594c143e679da02bd841e ./javascript/libraries.js
|
||||||
b398273cf7daa62ab00d2de2336ca25f ./README.md
|
b398273cf7daa62ab00d2de2336ca25f ./README.md
|
||||||
|
@ -181,6 +181,9 @@ switch ($_POST['action']) {
|
|||||||
case 'search_dockerhub':
|
case 'search_dockerhub':
|
||||||
search_dockerhub();
|
search_dockerhub();
|
||||||
break;
|
break;
|
||||||
|
case 'getPortsInUse':
|
||||||
|
postReturn(["portsInUse"=>getPortsInUse()]);
|
||||||
|
break;
|
||||||
###############################################
|
###############################################
|
||||||
# Return an error if the action doesn't exist #
|
# Return an error if the action doesn't exist #
|
||||||
###############################################
|
###############################################
|
||||||
|
@ -690,10 +690,10 @@ function getPortsInUse() {
|
|||||||
|
|
||||||
$bind = $var['BIND_MGT']=='yes';
|
$bind = $var['BIND_MGT']=='yes';
|
||||||
$list = is_array($addr) ? array_merge(['*'],$addr) : ['*',$addr];
|
$list = is_array($addr) ? array_merge(['*'],$addr) : ['*',$addr];
|
||||||
$addr = ipaddr("eth0");
|
$addr = ca_ipaddr("eth0");
|
||||||
|
|
||||||
foreach ($output as $line) {
|
foreach ($output as $line) {
|
||||||
[$ip, $port] = my_explode(':', $line);
|
[$ip, $port] = ca_explode(':', $line);
|
||||||
if (!in_array($port,$portsInUse) && (!$bind || in_array(plain($ip),$list)))
|
if (!in_array($port,$portsInUse) && (!$bind || in_array(plain($ip),$list)))
|
||||||
if ( is_numeric($port) )
|
if ( is_numeric($port) )
|
||||||
$portsInUse[] = $port;
|
$portsInUse[] = $port;
|
||||||
@ -704,8 +704,7 @@ function getPortsInUse() {
|
|||||||
####################################################
|
####################################################
|
||||||
# Define ipaddr if it doesn't already exist < 6.10 #
|
# Define ipaddr if it doesn't already exist < 6.10 #
|
||||||
####################################################
|
####################################################
|
||||||
if (!function_exists('ipaddr')) {
|
function ca_ipaddr($ethX='eth0') {
|
||||||
function ipaddr($ethX='eth0') {
|
|
||||||
global $caPaths;
|
global $caPaths;
|
||||||
|
|
||||||
$net = parse_ini_file($caPaths['network_ini'],true);
|
$net = parse_ini_file($caPaths['network_ini'],true);
|
||||||
@ -720,7 +719,9 @@ if (!function_exists('ipaddr')) {
|
|||||||
default:
|
default:
|
||||||
return $eth['IPADDR:0'];
|
return $eth['IPADDR:0'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
function ca_explode($split,$text,$count=2) {
|
||||||
|
return array_pad(explode($split,$text,$count),$count,'');
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @copyright Copyright 2006-2012, Miles Johnson - http://milesj.me
|
* @copyright Copyright 2006-2012, Miles Johnson - http://milesj.me
|
||||||
|
Loading…
x
Reference in New Issue
Block a user