Show Update Available Flag

This commit is contained in:
Squidly271 2022-03-06 15:43:40 -05:00
parent 90462222ec
commit c8364a6f2f
5 changed files with 24 additions and 6 deletions

View File

@ -1705,7 +1705,7 @@ function updateDisplay(content) {
$(this).html(description + "... <span class='card_readmore'><?=tr("Read more")?></span>");
}
});
$(".ca_applicationName,.betaPopupText,.installedCardText").each(function() {
$(".ca_applicationName,.betaPopupText,.installedCardText,.upgradePopupText").each(function() {
while (isOverflown(this)) {
var existingSize = $(this).css("font-size");
var size = existingSize.replace("px","");
@ -2497,7 +2497,7 @@ function showSidebarApp(apppath,appname) {
});
context.attach("#actionsPopup",opts);
}
$(".popupName,.betaPopupText,.popupTableRight,.popupTableLeft").each(function() {
$(".popupName,.betaPopupText,.popupTableRight,.popupTableLeft,.upgradePopupText").each(function() {
while (isOverflown(this)) {
var existingSize = $(this).css("font-size");
var size = existingSize.replace("px","");

View File

@ -1,4 +1,4 @@
c2d980bbcc284d3c906b6edf303adf9b ./Apps.page
af50c424366caf1bc4af63398a0e6adb ./Apps.page
4e55f7483b661af21a25b677179baffe ./CA_notices.page
42a1658a916a3a3eed2a9f2af80603c4 ./ca_settings.page
e718d7825dbdc96a17a915079222b098 ./default.cfg
@ -18,6 +18,6 @@ a1401a0bed89c182b69f0c7508282c1f ./scripts/pluginInstall.php
da3b4f9b73c5c3bf65be6c42d68b51f9 ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
540d0256c5e07ba744bbc92bca25c9ab ./skins/Narrow/css.php
bd7c51effa9aca8bce60e5c88cb84211 ./skins/Narrow/css.php
639c5146c5880a617fe15f603b1cffa3 ./skins/Narrow/skin.html
49efe221dc68bdee5488435029916e15 ./skins/Narrow/skin.php
5e0bcf392899a3df7fa7eca49ca4d009 ./skins/Narrow/skin.php

View File

@ -439,6 +439,8 @@ table {background-color:transparent;}
.trendingDown::before{content:"\f063";font-family:fontAwesome;}
.trendingUp::before{content:"\f062";font-family:fontAwesome;}
.unraidIcon{margin-top:4rem;}
.upgradePopupBackground{clip-path: polygon(0 0,100% 0, 100% 100%);background-color: #FF8C2F;top:<?=$betaPopupOffset?>;height:9rem;width:9rem;position: absolute;right: 0;}
.upgradePopupText{position:absolute;transform:rotate(45deg);-webkit-transform:rotate(45deg);-moz-transform:rotate(45deg);-o-transform: rotate(45deg);color:white;font-size:2rem;position:absolute;top:2.25rem;right:-1rem;width:100%;overflow:hidden;height:2.5rem;}
.vid{display:inline-block;font-size:8rem;position:relative;top:-0.5rem;color:<?=$sidebarText?>;opacity:70%;padding-right:10px;}
.vid:hover{color:<?=$unRaid66color;?>}
.warningCardBackground{clip-path: polygon(0 0,100% 0, 100% 100%);background-color: #810000;top:0px;height:9rem;width:9rem;position: relative;left:-10rem;margin-right:-9rem;}

View File

@ -121,6 +121,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
}
if ( ! filter_var($dockerUpdateStatus[$tmpRepo]['status'],FILTER_VALIDATE_BOOLEAN) ) {
$template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
}
if ( $caSettings['defaultReinstall'] == "true" ) {
@ -165,6 +166,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
if ( file_exists("/var/log/plugins/$pluginName") ) {
if ( plugin("version","/var/log/plugins/$pluginName") != $template['pluginVersion'] && $template['Name'] !== "Community Applications" ) {
@copy($caPaths['pluginTempDownload'],"/tmp/plugins/$pluginName");
$template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"installPlugin('$pluginName',true);");
}
$pluginSettings = ($pluginName == "community.applications.plg") ? "ca_settings" : plugin("launch","/var/log/plugins/$pluginName");
@ -230,6 +232,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
if ( file_exists("/var/log/plugins/lang-$countryCode.xml") ) {
$template['Installed'] = true;
if ( languageCheck($template) ) {
$template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>$template['UpdateLanguage'],"action"=>"updateLanguage('$countryCode');");
}
if ( $currentLanguage != $countryCode ) {
@ -532,6 +535,7 @@ function getPopupDescriptionSkin($appNumber) {
$tmpRepo = strpos($template['Repository'],":") ? $template['Repository'] : $template['Repository'].":latest";
$tmpRepo = strpos($tmpRepo,"/") ? $tmpRepo : "library/$tmpRepo";
if ( ! filter_var($dockerUpdateStatus[$tmpRepo]['status'],FILTER_VALIDATE_BOOLEAN) ) {
$template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"updateDocker('$name');");
}
if ( $caSettings['defaultReinstall'] == "true" ) {
@ -569,6 +573,7 @@ function getPopupDescriptionSkin($appNumber) {
$template['installedVersion'] = plugin("version","/var/log/plugins/$pluginName");
if ( $template['installedVersion'] != $template['pluginVersion'] && $template['Name'] !== "Community Applications") {
@copy($caPaths['pluginTempDownload'],"/tmp/plugins/$pluginName");
$template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>tr("Update"),"action"=>"installPlugin('$pluginName',true);");
}
$pluginSettings = ($pluginName == "community.applications.plg") ? "ca_settings" : plugin("launch","/var/log/plugins/$pluginName");
@ -618,6 +623,7 @@ function getPopupDescriptionSkin($appNumber) {
}
if ( file_exists("/var/log/plugins/lang-$countryCode.xml") ) {
if ( languageCheck($template) ) {
$template['UpdateAvailable'] = true;
$actionsContext[] = array("icon"=>"ca_fa-update","text"=>$template['UpdateLanguage'],"action"=>"updateLanguage('$countryCode');");
}
if ( $currentLanguage != $countryCode ) {
@ -1153,6 +1159,11 @@ function displayCard($template) {
<div class='betaPopupText ca_center' title='".tr("This application template has been deprecated")."'>$flagTextStart".tr("Deprecated")."$flagTextEnd</div>
</div>
";
} elseif ( $UpdateAvailable ) {
$card .= "
<div class='betaCardBackground'>
<div class='installedCardText ca_center'>".tr("Update Available")."</div>
</div>";
} elseif ( $Installed || $Uninstall) {
$card .= "
<div class='installedCardBackground'>
@ -1401,7 +1412,12 @@ function displayPopup($template) {
if ( ! $Plugin && ! $Language ){
$card .= "<div><br><span class='ca_note ca_bold'><span class='ca_fa-asterisk'></span> ".tr("Note: All statistics are only gathered every 30 days")."</span></div>";
}
if ( $Beta ) {
if ( $UpdateAvailable ) {
$card .= "
<div class='upgradePopupBackground'>
<div class='upgradePopupText ca_center'>".tr("Update Available")."</div></div>
";
} elseif ( $Beta ) {
$card .= "
<div class='betaPopupBackground'>
<div class='betaPopupText ca_center'>".tr("BETA")."</div></div>