mirror of
https://github.com/Squidly271/community.applications.git
synced 2025-06-03 14:52:13 +08:00
Better docker not enabled warnings
This commit is contained in:
parent
b79a972951
commit
f99fa3c234
BIN
archive/community.applications-2022.03.20-x86_64-1.txz
Normal file
BIN
archive/community.applications-2022.03.20-x86_64-1.txz
Normal file
Binary file not shown.
@ -1844,8 +1844,19 @@ function scrollToTop() {
|
|||||||
|
|
||||||
function addDockerWarning(enableDisable) {
|
function addDockerWarning(enableDisable) {
|
||||||
if (enableDisable) {
|
if (enableDisable) {
|
||||||
|
switch (enableDisable) {
|
||||||
|
case 1:
|
||||||
|
var msg = "<?tr('Docker Service Not Enabled - Only Plugins Available To Be Installed Or Managed')?>";
|
||||||
|
break;
|
||||||
|
case 2:
|
||||||
|
var msg = "<?tr('Docker system failed to start - Only Plugins Available To Be Installed Or Managed')?>";
|
||||||
|
break;
|
||||||
|
case 3:
|
||||||
|
var msg = "<?tr('Array not started - Only Plugins Available To Be Installed Or Managed')?>";
|
||||||
|
break;
|
||||||
|
}
|
||||||
if ( dockerWarningAdded === false) {
|
if ( dockerWarningAdded === false) {
|
||||||
dockerWarningAdded = addBannerWarning("<?tr('Docker Service Not Enabled - Only Plugins Available To Be Installed Or Managed')?>",true,false);
|
dockerWarningAdded = addBannerWarning(msg,true,false);
|
||||||
$(".dockerSpecific").removeClass("caMenuEnabled").addClass("caMenuDisabled");
|
$(".dockerSpecific").removeClass("caMenuEnabled").addClass("caMenuDisabled");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
990d0b76efb0311cf30163fa798455ce ./Apps.page
|
b136e7a969b1cf316bbfe602c4deb476 ./Apps.page
|
||||||
4e55f7483b661af21a25b677179baffe ./CA_notices.page
|
4e55f7483b661af21a25b677179baffe ./CA_notices.page
|
||||||
42a1658a916a3a3eed2a9f2af80603c4 ./ca_settings.page
|
42a1658a916a3a3eed2a9f2af80603c4 ./ca_settings.page
|
||||||
e718d7825dbdc96a17a915079222b098 ./default.cfg
|
e718d7825dbdc96a17a915079222b098 ./default.cfg
|
||||||
@ -21,4 +21,4 @@ da3b4f9b73c5c3bf65be6c42d68b51f9 ./scripts/showStatistics.php
|
|||||||
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
|
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
|
||||||
62494acd8ae889cf55688a22852eadb0 ./skins/Narrow/css.php
|
62494acd8ae889cf55688a22852eadb0 ./skins/Narrow/css.php
|
||||||
639c5146c5880a617fe15f603b1cffa3 ./skins/Narrow/skin.html
|
639c5146c5880a617fe15f603b1cffa3 ./skins/Narrow/skin.html
|
||||||
5b758ac9bdddb89e9dd97a8f92517c5a ./skins/Narrow/skin.php
|
12c6c841d2e0eb87bf1961c254288c2f ./skins/Narrow/skin.php
|
||||||
|
@ -45,9 +45,21 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
|||||||
if ( ! $selectedApps )
|
if ( ! $selectedApps )
|
||||||
$selectedApps = array();
|
$selectedApps = array();
|
||||||
|
|
||||||
$dockerNotEnabled = (! $caSettings['dockerRunning'] && ! $caSettings['NoInstalls']) ? "true" : "false";
|
$dockerWarningFlag = $dockerNotEnabled = (! $caSettings['dockerRunning'] && ! $caSettings['NoInstalls']) ? "true" : "false";
|
||||||
$displayHeader = "<script>addDockerWarning($dockerNotEnabled);var dockerNotEnabled = $dockerNotEnabled;</script>";
|
|
||||||
|
|
||||||
|
if ( $dockerNotEnabled == "true" ) {
|
||||||
|
$unRaidVars = parse_ini_file($caPaths['unRaidVars']);
|
||||||
|
$dockerVars = parse_ini_file($caPaths['docker_cfg']);
|
||||||
|
file_put_contents("/tmp/blah",print_r($dockerVars,true));
|
||||||
|
if ( $unRaidVars['mdState'] == "STARTED" && $dockerVars['DOCKER_ENABLED'] !== "yes" )
|
||||||
|
$dockerNotEnabled = 1; // Array started, docker not enabled
|
||||||
|
if ( $unRaidVars['mdState'] == "STARTED" && $dockerVars['DOCKER_ENABLED'] == "yes" )
|
||||||
|
$dockerNotEnabled = 2; // Docker failed to start
|
||||||
|
if ( $unRaidVars['mdState'] !== "STARTED" )
|
||||||
|
$dockerNotEnabled = 3; // Array not started
|
||||||
|
}
|
||||||
|
$displayHeader = "<script>addDockerWarning($dockerNotEnabled);var dockerNotEnabled = $dockerWarningFlag;</script>";
|
||||||
|
|
||||||
$pinnedApps = readJsonFile($caPaths['pinnedV2']);
|
$pinnedApps = readJsonFile($caPaths['pinnedV2']);
|
||||||
|
|
||||||
$checkedOffApps = arrayEntriesToObject(@array_merge(@array_values($selectedApps['docker']),@array_values($selectedApps['plugin'])));
|
$checkedOffApps = arrayEntriesToObject(@array_merge(@array_values($selectedApps['docker']),@array_values($selectedApps['plugin'])));
|
||||||
@ -120,7 +132,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
|||||||
$actionsContext[] = array("icon"=>"ca_fa-globe","text"=>"WebUI","action"=>"openNewWindow('{$info[$ind]['url']}','_blank');");
|
$actionsContext[] = array("icon"=>"ca_fa-globe","text"=>"WebUI","action"=>"openNewWindow('{$info[$ind]['url']}','_blank');");
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( $dockerUpdateStatus[$tmpRepo]['status'] == "true" ) {
|
if ( $dockerUpdateStatus[$tmpRepo]['status'] == "false" ) {
|
||||||
$template['UpdateAvailable'] = true;
|
$template['UpdateAvailable'] = true;
|
||||||
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
|
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
|
||||||
}
|
}
|
||||||
@ -534,7 +546,7 @@ function getPopupDescriptionSkin($appNumber) {
|
|||||||
}
|
}
|
||||||
$tmpRepo = strpos($template['Repository'],":") ? $template['Repository'] : $template['Repository'].":latest";
|
$tmpRepo = strpos($template['Repository'],":") ? $template['Repository'] : $template['Repository'].":latest";
|
||||||
$tmpRepo = strpos($tmpRepo,"/") ? $tmpRepo : "library/$tmpRepo";
|
$tmpRepo = strpos($tmpRepo,"/") ? $tmpRepo : "library/$tmpRepo";
|
||||||
if ( $dockerUpdateStatus[$tmpRepo]['status'] == "true" ) {
|
if ( $dockerUpdateStatus[$tmpRepo]['status'] == "false" ) {
|
||||||
$template['UpdateAvailable'] = true;
|
$template['UpdateAvailable'] = true;
|
||||||
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
|
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user