Identify on card if app is pinned
Fixed: In certain situations, after an appfeed update CA wouldn't think any containers were installed
This commit is contained in:
Squidly271 2021-10-31 11:14:29 -04:00
parent 1d11647fb8
commit 08989aaeb9
7 changed files with 28 additions and 35 deletions

Binary file not shown.

View File

@ -26,6 +26,8 @@ $DockerTemplates = new DockerTemplates();
// Restart logging over at start of every session // Restart logging over at start of every session
exec("rm -rf {$caPaths['CA_logs']}"); exec("rm -rf {$caPaths['CA_logs']}");
exec("mkdir -p {$caPaths['CA_logs']}"); exec("mkdir -p {$caPaths['CA_logs']}");
exec("mkdir -p {$caPaths['tempFiles']}");
$diagnosticsFile = htmlspecialchars(str_replace(' ','_',strtolower($var['NAME']))); $diagnosticsFile = htmlspecialchars(str_replace(' ','_',strtolower($var['NAME'])));
$cfg = parse_plugin_cfg($plugin); $cfg = parse_plugin_cfg($plugin);
@ -41,9 +43,6 @@ if ( ! is_file($caPaths['docker_cfg']) ) {
exec("logger -t 'Community Applications' 'Fatal Flash Drive Error: /boot/config/docker.cfg does not exist'"); exec("logger -t 'Community Applications' 'Fatal Flash Drive Error: /boot/config/docker.cfg does not exist'");
} }
/* if ( is_file("/var/run/dockerd.pid") && is_dir("/proc/".@file_get_contents("/var/run/dockerd.pid")) )
$writeTest = @file_put_contents($caPaths['dockerWriteTest'],"Oscar");
*/
$unRaidSettings = parse_ini_file($caPaths['unRaidVersion']); $unRaidSettings = parse_ini_file($caPaths['unRaidVersion']);
$unRaid610 = version_compare($unRaidSettings['version'],"6.10.0-beta17",">"); $unRaid610 = version_compare($unRaidSettings['version'],"6.10.0-beta17",">");
@ -105,6 +104,7 @@ if ( is_file("/var/run/dockerd.pid") && is_dir("/proc/".@file_get_contents("/var
$caSettings['dockerSearch'] = "no"; $caSettings['dockerSearch'] = "no";
unset($caSettings['dockerRunning']); unset($caSettings['dockerRunning']);
} }
getAllInfo(true); getAllInfo(true);
function tr($string,$ret=false) { function tr($string,$ret=false) {
@ -131,7 +131,6 @@ function tr($string,$ret=false) {
</script> </script>
<?endif;?> <?endif;?>
<script> <script>
var searchBoxInput; var searchBoxInput;
var searchBoxAwesomplete; var searchBoxAwesomplete;
var pluginInstallIntervalTimer; var pluginInstallIntervalTimer;
@ -194,23 +193,6 @@ $(function(){
return; return;
<?endif;?> <?endif;?>
//abort execution if a write to the docker image failed
/* <? if ( $writeTest === false ): ?>
$(".mainArea,.menuItems").html("");
swal({
title: "<?tr("Fatal Docker Image Error")?>",
text: "<?tr("Your docker image or folder is either read-only or completely full. Issues will result because of this. You should create a new post in the Unraid forums and include your diagnostics")?>",
html: true,
type: 'error',
showCancelButton: false,
showConfirmationButton: true,
confirmButtonText: "<?tr("OK")?>"
}, function (isConfirm) {
location.replace("/Main");
});
return;
<?endif;?> */
caPluginUpdateCheck("community.applications.plg",{ caPluginUpdateCheck("community.applications.plg",{
noDismiss:true, noDismiss:true,
name:"Community Applications", name:"Community Applications",
@ -1210,6 +1192,10 @@ function pinApp(button,repository,name) {
$(button).toggleClass("pinned unpinned"); $(button).toggleClass("pinned unpinned");
var pinned = ( $(button).hasClass("unpinned") ) ? "<?tr("Click to pin this application")?>" : "<?tr("Click to unpin this application")?>"; var pinned = ( $(button).hasClass("unpinned") ) ? "<?tr("Click to pin this application")?>" : "<?tr("Click to unpin this application")?>";
$(button).attr('title',pinned); $(button).attr('title',pinned);
var app = $.find(".pinnedCard[data-pindata='"+repository+name+"']");
$(app).toggle("slow");
post({action:'pinApp',repository:repository,name:name},function(data) { post({action:'pinApp',repository:repository,name:name},function(data) {
if ( data.status ) { if ( data.status ) {
$('.caPinnedMenu').removeClass('caMenuDisabled').addClass('caMenuEnabled'); $('.caPinnedMenu').removeClass('caMenuDisabled').addClass('caMenuEnabled');
@ -1923,9 +1909,9 @@ function setFavourite(button) {
},5000); },5000);
$(".favCardBackground").each(function() { $(".favCardBackground").each(function() {
if ( $(this).data("repository") == data.fav ) if ( $(this).data("repository") == data.fav )
$(this).show(); $(this).show("slow");
else else
$(this).hide(); $(this).hide("slow");
}); });
setFavRepoSearch(); setFavRepoSearch();
}); });

View File

@ -1,9 +1,9 @@
7d2b3197d81d89b703460f922304cbf6 ./Apps.page d19eac2f726127f36e8951fe08050a9b ./Apps.page
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page 83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page 7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page
1b49ec9797713ce869ea0c1066a109f2 ./default.cfg 1b49ec9797713ce869ea0c1066a109f2 ./default.cfg
41067a7aecc80c2885f4b6d8287d1077 ./include/exec.php 13bc7def9742a2cbf6fc355437e6c7c3 ./include/exec.php
aee2d4e715238cef7938587ec497ad20 ./include/helpers.php c4e21e3f5b0db01cd0c8ee2a04158440 ./include/helpers.php
aeec70878e94eead3aef390110e786e8 ./include/paths.php aeec70878e94eead3aef390110e786e8 ./include/paths.php
eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js
8c24d585c7dd3ff9ef961bb2c2705711 ./PluginAPI.page 8c24d585c7dd3ff9ef961bb2c2705711 ./PluginAPI.page
@ -20,6 +20,6 @@ b398273cf7daa62ab00d2de2336ca25f ./README.md
9eba209fba4bbf1a02e57ddafebfdf8c ./scripts/showStatistics.php 9eba209fba4bbf1a02e57ddafebfdf8c ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh 4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php 2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php
f1c0357c72a6b92cfaf3f3ad4c8088bb ./skins/Narrow/css.php 42b3e7863b57a84ca2076dd197701d23 ./skins/Narrow/css.php
4ff34c148d3dde1a420303faecd414ae ./skins/Narrow/skin.html 4ff34c148d3dde1a420303faecd414ae ./skins/Narrow/skin.html
1ff9666b927c3e7d09c4a31e91668bc8 ./skins/Narrow/skin.php 32026de1302c167101ca8a1dca84149f ./skins/Narrow/skin.php

View File

@ -186,8 +186,10 @@ switch ($_POST['action']) {
function DownloadApplicationFeed() { function DownloadApplicationFeed() {
global $caPaths, $caSettings, $statistics; global $caPaths, $caSettings, $statistics;
$info = readJsonFile($caPaths['info']);
exec("rm -rf '{$caPaths['tempFiles']}'"); exec("rm -rf '{$caPaths['tempFiles']}'");
@mkdir($caPaths['templates-community'],0777,true); @mkdir($caPaths['templates-community'],0777,true);
writeJsonFile($caPaths['info'],$info);
$currentFeed = "Primary Server"; $currentFeed = "Primary Server";
$downloadURL = randomFile(); $downloadURL = randomFile();
@ -969,6 +971,7 @@ function previous_apps() {
@unlink($caPaths['startupDisplayed']); @unlink($caPaths['startupDisplayed']);
$file = readJsonFile($caPaths['community-templates-info']); $file = readJsonFile($caPaths['community-templates-info']);
# $info contains all installed containers # $info contains all installed containers
# now correlate that to a template; # now correlate that to a template;
# this section handles containers that have not been renamed from the appfeed # this section handles containers that have not been renamed from the appfeed
@ -1891,6 +1894,9 @@ function defaultSortOrder() {
postReturn(['status'=>"ok"]); postReturn(['status'=>"ok"]);
} }
###################################################################
# Checks whether we're on the startup screen when restoring state #
###################################################################
function onStartupScreen() { function onStartupScreen() {
global $caPaths; global $caPaths;

View File

@ -625,7 +625,6 @@ function write_ini_file($file,$array) {
} }
file_put_contents($file,implode("\r\n", $res),LOCK_EX); file_put_contents($file,implode("\r\n", $res),LOCK_EX);
} }
################################################### ###################################################
# Gets all the information about what's installed # # Gets all the information about what's installed #
################################################### ###################################################

View File

@ -275,8 +275,8 @@ img.displayIcon {height:6.4rem;width:6.4rem;border-radius:1rem 1rem 1rem 1rem;}
.fav{background-color:#009900;} .fav{background-color:#009900;}
.nonfav{background-color: <?=$supportPopupBackground?>;} .nonfav{background-color: <?=$supportPopupBackground?>;}
.favCardSpotlight{left:-40.25rem !important;} .favCardSpotlight{left:-40.25rem !important;}
.favCardBackground{float:right;color:#bb0000;padding-top:.25rem;margin-left:1rem;} .favCardBackground{float:right;color:#bb0000;padding-top:.25rem;margin-left:1rem;}
.favCardBackground::before{content:"\f004";font-family:fontAwesome;} .favCardBackground::before{content:"\f004";font-family:fontAwesome;}
.homeMore{color:<?=$unRaid66color?>;cursor:pointer;} .homeMore{color:<?=$unRaid66color?>;cursor:pointer;}
.homeMore:hover{color:#d67777;} .homeMore:hover{color:#d67777;}
.homespotlightIconArea{display: inline-block;position: relative;top: -25rem;left: 24rem;cursor:pointer;} .homespotlightIconArea{display: inline-block;position: relative;top: -25rem;left: 24rem;cursor:pointer;}
@ -320,7 +320,7 @@ p {margin:auto;text-align:left;margin-bottom:10px;} /* override dynamix styling
.pageSelected {cursor:default;color:<?=$unRaid66color?>;} .pageSelected {cursor:default;color:<?=$unRaid66color?>;}
.pinned {margin-left:1rem;font-size:2rem;cursor:pointer;padding-left:.5rem;padding-right:.5rem;cursor:pointer;color:#1fa67a;padding:.3rem;} .pinned {margin-left:1rem;font-size:2rem;cursor:pointer;padding-left:.5rem;padding-right:.5rem;cursor:pointer;color:#1fa67a;padding:.3rem;}
.pinned::after {content:"\f08d";font-family:fontAwesome;} .pinned::after {content:"\f08d";font-family:fontAwesome;}
.pinnedCard{float:right;color:#1fa67a;padding-top:.25rem;font-size:1.5rem;} .pinnedCard{float:right;color:#1fa67a;font-size:1.75rem;}
.pinnedCard::before{content:"\f08d";font-family:fontAwesome;} .pinnedCard::before{content:"\f08d";font-family:fontAwesome;}
.pinned:hover {text-decoration:none;color:<?=$unRaid66color?>;} .pinned:hover {text-decoration:none;color:<?=$unRaid66color?>;}
.plugin::after {font-family:'Unraid';content:'\e986';font-size:2.5rem;} .plugin::after {font-family:'Unraid';content:'\e986';font-size:2.5rem;}

View File

@ -892,8 +892,10 @@ function displayCard($template) {
$card .= "<span class='favCardBackground' title='".htmlentities($favText)."' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'></span>"; $card .= "<span class='favCardBackground' title='".htmlentities($favText)."' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'></span>";
} else } else
$card .= "<span class='favCardBackground' title='".htmlentities($favText)."' style='display:none;' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'></span>"; $card .= "<span class='favCardBackground' title='".htmlentities($favText)."' style='display:none;' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'></span>";
if ( $Pinned ) if ( ! $Pinned )
$card .= "<span class='pinnedCard'></span>"; $pinStyle = "display:none;";
$card .= "<span class='pinnedCard' title='".htmlentities(tr("This application is pinned for later viewing"))."' data-pindata='$Repository$SortName' style='$pinStyle'></span>";
if ($Removable && !$DockerInfo && ! $Installed) { if ($Removable && !$DockerInfo && ! $Installed) {