This commit is contained in:
Squidly271 2021-10-19 18:30:10 -04:00
parent baae7befd6
commit 1d2ecbb385
7 changed files with 63 additions and 26 deletions

Binary file not shown.

View File

@ -2,17 +2,23 @@
<!DOCTYPE PLUGIN [
<!ENTITY name "community.applications">
<!ENTITY author "Andrew Zawadzki">
<!ENTITY version "2021.10.17a">
<!ENTITY md5 "dc57c53368af08621d06bc89a4b7e2bd">
<!ENTITY version "2021.10.19">
<!ENTITY md5 "7dea1ce7c5cbe68dac07acb4763cd63c">
<!ENTITY launch "Apps">
<!ENTITY plugdir "/usr/local/emhttp/plugins/&name;">
<!ENTITY github "Squidly271/community.applications">
<!ENTITY pluginURL "https://raw.githubusercontent.com/&github;/master/plugins/&name;.plg">
]>
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.9.0" support="https://lime-technology.com/forums/topic/38582-plug-in-community-applications/" icon="users">
<PLUGIN name="&name;" author="&author;" version="&version;" launch="&launch;" pluginURL="&pluginURL;" min="6.8.0" support="https://lime-technology.com/forums/topic/38582-plug-in-community-applications/" icon="users">
<CHANGES>
###2021.10.19
- Changed: Drop limit of displayed apps on home page from 25 to 7 / 10 depending upon settings
- Added: Ability to display descriptions by default on the cards. (Go to CA's Settings page)
- Changed: Easier access to debugging information in certain cases
- Changed: Re-add compatibility with 6.8+ (Disable feature that requires 6.9)
###2021.10.17a
- Fixed: Certain apps would have the Installed flag showing when in Installed Apps
- Fixed: Pinned Apps were not honoring the sort order when initially going into that section

View File

@ -1,9 +1,9 @@
0617ae7ed4011e05bef9cd6cac85dd5b ./Apps.page
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
f2299b00bd768b7fdadb11d839e4bf15 ./ca_settings.page
7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page
993c0dff1a44225d5070cada0d805f75 ./default.cfg
74a6d735602f95c0354b106644850e12 ./include/exec.php
881abd00cf784d706bba6a06f3b8c810 ./include/helpers.php
d75e14605fb5583cb2bf80598ae271a2 ./include/exec.php
3fddb80cc00d46ff551e9ff42c70ba73 ./include/helpers.php
4eaa5bd1f2e88781133c1571a81e6d0c ./include/paths.php
eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js
8c24d585c7dd3ff9ef961bb2c2705711 ./PluginAPI.page
@ -22,4 +22,4 @@ b398273cf7daa62ab00d2de2336ca25f ./README.md
2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php
94b57ac471c8c4b396379bebb26be22c ./skins/Narrow/css.php
4ff34c148d3dde1a420303faecd414ae ./skins/Narrow/skin.html
6d48505c777bff6a195c4eae77fe3f6c ./skins/Narrow/skin.php
0bdad924ad10400a65a648016ccd703e ./skins/Narrow/skin.php

View File

@ -1,5 +1,6 @@
Menu="hidden"
Menu="Utilities"
Title="Community Applications"
Icon="users"
---
<?
###############################################################
@ -36,6 +37,23 @@ function tr($string,$ret=false) {
echo $string;
}
?>
<script>
$(function() {
<?if ( is_file($caPaths['logging']) ):?>
$("#debugging").show();
<?endif;?>
});
function debug() {
var tzoffset = (new Date()).getTimezoneOffset() * 60000; //offset in milliseconds
var localISOTime = (new Date(Date.now() - tzoffset)).toISOString().slice(0, -1);
var filename='CA-Logging-'+localISOTime.substr(0,16).replace(/[-:]/g,'').replace('T','-')+'.zip';
$.post('/webGui/include/Download.php',{cmd:'save',file:filename,source:"<?=$caPaths['logging']?>"},function(zip) {
location = zip;
});
}
</script>
<form class='js-confirm-leave' markdown="1" method="POST" action="/update.php" target="progressFrame">
<input type="hidden" name="#file" value="<?=$plugin?>/<?=$plugin?>.cfg">
@ -107,6 +125,8 @@ function tr($string,$ret=false) {
> <?tr("This unlocks some extra features within CA generally only used by developers. Not recommended to enable")?>
<input id='debugging' type='button' onclick='debug();' value='DOWNLOAD LOG' style='display:none;'></input>
&nbsp;
: <input type="submit" name="#apply" value="<?tr("Apply");?>" id='Apply'><input type="button" id="DONE" value="<?tr("Done");?>" onclick="done()">

View File

@ -65,7 +65,7 @@ if ($caSettings['debugging'] == "yes") {
$lingo = $_SESSION['locale'] ?: "en_US";
file_put_contents($caPaths['logging'],"Language: $lingo\n\n",FILE_APPEND);
}
file_put_contents($caPaths['logging'],"POST CALLED ({$_POST['action']})\n".print_r($_POST,true),FILE_APPEND);
file_put_contents($caPaths['logging'],date('Y-m-d H:i:s')." POST CALLED ({$_POST['action']})\n".print_r($_POST,true),FILE_APPEND);
}
$sortOrder = readJsonFile($caPaths['sortOrder']);
@ -405,6 +405,8 @@ function appOfDay($file) {
global $caPaths,$caSettings,$sortOrder;
$info = getRunningContainers();
$max = $caSettings['descriptions'] == "yes" ? 7 : 10;
switch ($caSettings['startup']) {
case "random":
@ -429,7 +431,7 @@ function appOfDay($file) {
foreach ($file as $template) {
if ( ! checkRandomApp($template,$info,true) ) continue;
$appOfDay[] = $template['ID'];
if (count($appOfDay) == 25) break;
if (count($appOfDay) == $max) break;
}
}
writeJsonFile($caPaths['appOfTheDay'],$appOfDay);
@ -443,7 +445,7 @@ function appOfDay($file) {
if ( $template['FirstSeen'] > 1538357652 ) {
if ( checkRandomApp($template) ) {
$appOfDay[] = $template['ID'];
if ( count($appOfDay) == 25 ) break;
if ( count($appOfDay) == $max ) break;
}
}
}
@ -463,7 +465,7 @@ function appOfDay($file) {
continue;
$repos[] = $template['Repository'];
$appOfDay[] = $template['ID'];
if ( count($appOfDay) == 25 ) break;
if ( count($appOfDay) == $max ) break;
}
}
}
@ -482,7 +484,7 @@ function appOfDay($file) {
continue;
$repos[] = $template['Repository'];
$appOfDay[] = $template['ID'];
if ( count($appOfDay) == 25 ) break;
if ( count($appOfDay) == $max ) break;
}
}
}
@ -494,7 +496,7 @@ function appOfDay($file) {
foreach($file as $template) {
if ($template['RecommendedDate']) {
$appOfDay[] = $template['ID'];
if ( count($appOfDay) == 25 ) break;
if ( count($appOfDay) == 7 ) break;
} else {
break;
}

View File

@ -570,7 +570,7 @@ function postReturn($retArray) {
flush();
if ($caSettings['debugging'] == "yes") {
file_put_contents($caPaths['logging'],"POST RETURN ({$_POST['action']})\n".var_dump_ret($retArray)."\n",FILE_APPEND);
file_put_contents($caPaths['logging'],date('Y-m-d H:i:s')." POST RETURN ({$_POST['action']})\n".var_dump_ret($retArray)."\n",FILE_APPEND);
}
}
####################################

View File

@ -100,7 +100,8 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
$template['Twitter'] = $repositories[$template['Repo']]['Twitter'];
$template['Reddit'] = $repositories[$template['Repo']]['Reddit'];
$template['Facebook'] = $repositories[$template['Repo']]['Facebook'];
$template['Discord'] = $repositories[$template['RepoName']]['Discord'];
if ( version_compare($caSettings['unRaidVersion'],"6.9.0",">=") )
$template['Discord'] = $repositories[$template['RepoName']]['Discord'];
$template['checked'] = $checkedOffApps[$previousAppName] ? "checked" : "";
@ -199,7 +200,7 @@ function getPopupDescriptionSkin($appNumber) {
$unRaidVars = parse_ini_file($caPaths['unRaidVars']);
$dockerVars = parse_ini_file($caPaths['docker_cfg']);
$caSettings = parse_plugin_cfg("community.applications");
// $caSettings = parse_plugin_cfg("community.applications");
$csrf_token = $unRaidVars['csrf_token'];
$tabMode = '_parent';
@ -233,13 +234,16 @@ function getPopupDescriptionSkin($appNumber) {
$index = searchArray($displayed['community'],"Path",$appNumber);
$ind = $index;
while ( true ) {
$template = $displayed[$ind];
if ( $template['Name'] == $displayed['community'][$ind]['Name'] ) {
$index = $ind;
break;
}
$ind = searchArray($displayed['community'],"Path",$ind+1);
if ( $ind === false )
$ind = searchArray($displayed['community'],"Path",$appNumber,$ind+1);
if ( $ind === false ) {
unset($template);
break;
}
}
}
@ -462,8 +466,10 @@ function getPopupDescriptionSkin($appNumber) {
if ( $template['Project'] )
$supportContext[] = array("icon"=>"ca_fa-project","link"=>$template['Project'],"text"=> tr("Project"));
if ( $allRepositories[$template['Repo']]['Discord'] )
$supportContext[] = array("icon"=>"ca_discord","link"=>$allRepositories[$template['Repo']]['Discord'],"text"=>tr("Discord"));
if ( version_compare($caSettings['unRaidVersion'],"6.9.0",">=") ) {
if ( $allRepositories[$template['Repo']]['Discord'] )
$supportContext[] = array("icon"=>"ca_discord","link"=>$allRepositories[$template['Repo']]['Discord'],"text"=>tr("Discord"));
}
if ( $template['Support'] )
$supportContext[] = array("icon"=>"ca_fa-support","link"=>$template['Support'],"text"=> $template['SupportLanguage'] ?: tr("Support Forum"));
@ -605,9 +611,10 @@ function getRepoDescriptionSkin($repository) {
$t .= "<a class='appIconsPopUp ca_reddit' href='{$repo['Reddit']}' target='_blank'> ".tr("Reddit")."</a>";
if ( $repo['Twitter'] )
$t .= "<a class='appIconsPopUp ca_twitter' href='{$repo['Twitter']}' target='_blank'> ".tr("Twitter")."</a>";
if ( $repo['Discord'] )
$t .= "<a class='appIconsPopUp ca_discord_popup' target='_blank' href='{$repo['Discord']}' target='_blank'> ".tr("Discord")."</a>";
if ( version_compare($caSettings['unRaidVersion'],"6.9.0",">=") ) {
if ( $repo['Discord'] )
$t .= "<a class='appIconsPopUp ca_discord_popup' target='_blank' href='{$repo['Discord']}' target='_blank'> ".tr("Discord")."</a>";
}
$t .= "
</div>
<div class='repoStats'>Statistics</div>
@ -693,8 +700,10 @@ function displayCard($template) {
$supportContext[] = array("icon"=>"ca_fa-readme","link"=>$template['ReadMe'],"text"=>tr("Read Me First"));
if ( $template['Project'] )
$supportContext[] = array("icon"=>"ca_fa-project","link"=>$template['Project'],"text"=> tr("Project"));
if ( $Discord )
$supportContext[] = array("icon"=>"ca_discord","link"=>$Discord,"text"=>tr("Discord"));
if ( version_compare($caSettings['unRaidVersion'],"6.9.0",">=") ) {
if ( $Discord )
$supportContext[] = array("icon"=>"ca_discord","link"=>$Discord,"text"=>tr("Discord"));
}
if ( $template['Support'] )
$supportContext[] = array("icon"=>"ca_fa-support","link"=>$template['Support'],"text"=> $template['SupportLanguage'] ?: tr("Support Forum"));