Speed up gathering of last updated when going to sidebar
Under extremely rare circumstances a task could be spawned that never completed
In Stats, Errors ignore and don't display duplicated templates from same maintainers
Minor skin tweaking
This commit is contained in:
Squidly271 2022-02-24 04:05:20 -05:00
parent 9697233c3c
commit 116bb6d10c
6 changed files with 20 additions and 13 deletions

Binary file not shown.

View File

@ -2,8 +2,8 @@ e09e3baad003519ebba28645b59c818c ./Apps.page
4e55f7483b661af21a25b677179baffe ./CA_notices.page
c7c6da0a4a4a7ac33f387ea178319bae ./ca_settings.page
ed2883d6c44c19304c431079596a1731 ./default.cfg
cb6953e87dbe2fecef6c47e390ed8722 ./include/exec.php
d8d73b3a280f3d1dc173a5315f15433c ./include/helpers.php
bcc506ac33d97fd3643adc7626bf4996 ./include/exec.php
51a726cbd05fecf5ec30000b29581de7 ./include/helpers.php
d827ebdf8c29aa6a9818df043a37721e ./include/paths.php
532fffdf939594c143e679da02bd841e ./javascript/libraries.js
b398273cf7daa62ab00d2de2336ca25f ./README.md
@ -15,9 +15,9 @@ f1e435bc2543dd7a9f6495fbc2533f2b ./scripts/installUpdate.php
5846421e95b475e1156c3f68164ccc4f ./scripts/languageInstall.sh
d4770cba925e913500e0085b79267d3e ./scripts/notices.php
a1401a0bed89c182b69f0c7508282c1f ./scripts/pluginInstall.php
36556fb8fcd17118600d3d226c50567d ./scripts/showStatistics.php
e19c8f05c687dcf03ea0ba2ed7099a6e ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
34554a56611dfe625889c82afd5138de ./scripts/updatePluginSupport.php
549fb44e30554bfba0a6ead71ececa65 ./skins/Narrow/css.php
7d827147dc8ede3d518b2cacae1d385b ./skins/Narrow/skin.html
c0ae3b8aac9f508493adfa5aa6e1a427 ./skins/Narrow/skin.php
7cbc48b9a57f4bf7bf15690f8f1cf6ce ./skins/Narrow/skin.php

View File

@ -1532,6 +1532,7 @@ function removePrivateApp() {
####################################################
function populateAutoComplete() {
global $caPaths, $caSettings;
$templates = readJsonFile($caPaths['community-templates-info']);
$autoComplete = array_map(function($x){return str_replace(":","",tr($x['Cat']));},readJsonFile($caPaths['categoryList']));
foreach ($templates as $template) {
@ -2066,8 +2067,10 @@ function search_dockerhub() {
function getLastUpdate($ID) {
global $caPaths;
while ( ! $templates ) {
$count = 0;
while ( $count < 5 ) {
$templates = readJsonFile($caPaths['community-templates-info']);
if ( $templates ) break;
sleep(1); # keep trying in case of a collision between reading and writing
}
$index = searchArray($templates,"ID",$ID);
@ -2091,14 +2094,18 @@ function getLastUpdate($ID) {
if ( !strpos($reg[0],"/") )
$reg[0] = "library/{$reg[0]}";
$count = 0;
while ( ! $registry && $count < 5 ) {
if ( $registry ) break;
sleep(1);
$count++;
$registry = download_url("https://registry.hub.docker.com/v2/repositories/{$reg[0]}");
if ( ! $registry ) {
$count++;
sleep(1);
continue;
}
$registry_json = json_decode($registry,true);
if ( ! $registry_json['last_updated'] )
return;
}
$lastUpdated = $registry_json['last_updated'] ? tr(date("M j, Y",strtotime($registry_json['last_updated'])),0) : "Unknown";

View File

@ -44,8 +44,6 @@ function readJsonFile($filename) {
global $caSettings, $caPaths;
debug("CA Read JSON file $filename");
debug(print_r(debug_backtrace(),true));
$json = json_decode(@file_get_contents($filename),true);
if ( $json === false ) {

View File

@ -105,6 +105,7 @@ switch ($_GET['arg1']) {
}
$templates = readJsonFile($caPaths['community-templates-info']);
foreach ($templates as $template) {
unset($dupe);
$template['Repository'] = str_replace(":latest","",$template['Repository']);
$count = 0;
foreach ($templates as $searchTemplates) {
@ -113,10 +114,11 @@ switch ($_GET['arg1']) {
if ( $searchTemplates['BranchName'] || $searchTemplates['Blacklist'] || $searchTemplates['Deprecated']) {
continue;
}
$dupe[$searchTemplates['Repository']][$searchTemplates['RepoName']]++;
$count++;
}
}
if ($count > 1) {
if ($count > 1 && $dupe[$template['Repository']][$template['RepoName']] !== $count) {
$dupeRepos .= "Duplicated Template: {$template['RepoName']} - {$template['Repository']} - {$template['Name']}<br>";
}
}

View File

@ -1080,7 +1080,7 @@ function displayCard($template) {
$ovr = str_replace(["[","]"],["<",">"],$ovr);
$ovr = str_replace("\n","<br>",$ovr);
$ovr = str_replace(" ","&nbsp;&nbsp;&nbsp;&nbsp;",$ovr);
// $ovr = str_replace(" ","&nbsp;&nbsp;&nbsp;&nbsp;",$ovr);
$ovr = markdown(strip_tags($ovr,"<br>"));
$ovr = str_replace("\n","<br>",$ovr);
@ -1091,7 +1091,7 @@ function displayCard($template) {
if ( $RecommendedDate ) {
$card .= "
<div class='homespotlightIconArea ca_center''>
<div><img class='spotlightIcon' src='{$caPaths['SpotlightIcon']}'></img></div>
<div><img class='spotlightIcon' src='{$caPaths['SpotlightIcon']}'></img></div>
<div class='spotlightDate'>".tr(date("M Y",$RecommendedDate),0)."</div>
</div>
";