Add in ability to show all repository url's within stats. Show duplicated plg names within fixed

pull/2/head
Squidly271 2017-09-22 13:50:08 -04:00
parent 60141ea898
commit 9ae9c05614
5 changed files with 43 additions and 9 deletions

View File

@ -1977,7 +1977,7 @@ case 'statistics':
echo "<table>";
echo "<tr><td><b>{$color}Application List Current As Of</b></td><td>$color$updateTime</td></tr>";
echo "<tr><td><b>{$color}Total Number Of Templates</b></td><td>$color{$statistics['totalApplications']}</td></tr>";
echo "<tr><td><b>{$color}Total Number Of Repositories</b></td><td>$color{$statistics['repository']}</td></tr>";
echo "<tr><td><b>{$color}<a onclick='showModeration(&quot;showRepositories.php&quot;,&quot;Repository List&quot;);' style='cursor:pointer;'>Total Number Of Repositories</a></b></td><td>$color{$statistics['repository']}</td></tr>";
echo "<tr><td><b>{$color}Total Number Of Docker Applications</b></td><td>$color{$statistics['docker']}</td></tr>";
echo "<tr><td><b>{$color}Total Number Of Plugins</b></td><td>$color{$statistics['plugin']}</td></tr>";
echo "<tr><td><b>{$color}<a href='/Main/Browse?dir=/boot/config/plugins/community.applications/private' target='_blank'><b>Total Number Of Private Docker Applications</b></a></td><td>$color{$statistics['private']}</td></tr>";

View File

@ -686,14 +686,15 @@ function pluginDupe($templates) {
function checkInstalledPlugin($template) {
global $communityPaths;
if ( ! file_exists("/var/log/plugins/".basename($template['PluginURL'])) ) {
$pluginName = basename($template['PluginURL']);
if ( ! file_exists("/var/log/plugins/$pluginName") ) {
return false;
}
$dupeList = readJsonFile($communityPaths['pluginDupes']);
if ( ! $dupeList[basename($template['PluginURL'])] ) {
if ( ! $dupeList[$pluginName] ) {
return true;
}
if ( strtolower(trim(plugin("pluginURL","/var/log/plugins/".basename($template['PluginURL'])))) != strtolower(trim($template['PluginURL']))) {
if ( strtolower(trim(plugin("pluginURL","/var/log/plugins/$pluginName"))) != strtolower(trim($template['PluginURL']))) {
return false;
} else {
return true;

View File

@ -2,12 +2,28 @@
require_once("/usr/local/emhttp/plugins/community.applications/include/paths.php");
$moderation = @file_get_contents($communityPaths['fixedTemplates_txt']);
echo "<body bgcolor='white'>";
if ( ! $moderation ) {
echo "<br><br><center><b>No templates were automatically fixed</b></center>";
return;
} else {
$moderation = str_replace(" ","&nbsp;",$moderation);
$moderation = str_replace("\n","<br>",$moderation);
echo "All of these errors found have been fixed automatically. These errors only affect the operation of Community Applications. <b>The template <em>may</em> have other errors present</b><br><br><tt>$moderation";
}
$moderation = str_replace(" ","&nbsp;",$moderation);
$moderation = str_replace("\n","<br>",$moderation);
echo "All of these errors found have been fixed automatically. These errors only affect the operation of Community Applications. <b>The template <em>may</em> have other errors present</b><br><br><tt>$moderation";
?>
$dupeList = json_decode(file_get_contents($communityPaths['pluginDupes']),true);
if ($dupeList) {
$templates = json_decode(file_get_contents($communityPaths['community-templates-info']),true);
echo "<br><br><b></tt>The following plugins have duplicated filenames and are not able to be installed simultaneously:</b><br><br>";
foreach (array_keys($dupeList) as $dupe) {
echo "<b>$dupe</b><br>";
foreach ($templates as $template) {
if ( basename($template['PluginURL']) == $dupe ) {
echo "<tt>{$template['Author']} - {$template['Name']}<br></tt>";
}
}
echo "<br>";
}
echo "<br><br>";
}
?>

View File

@ -0,0 +1,17 @@
<?PHP
require_once("/usr/local/emhttp/plugins/community.applications/include/paths.php");
$repositories = json_decode(file_get_contents($communityPaths['Repositories']),true);
echo "<tt>";
foreach ($repositories as $repo) {
$repos[$repo['name']] = $repo['url'];
}
ksort($repos,SORT_FLAG_CASE | SORT_NATURAL);
echo "<table>";
foreach (array_keys($repos) as $repo) {
echo "<tr><td><b>$repo</td><td><a href='{$repos[$repo]}' target='_blank'>{$repos[$repo]}</a></td></tr>";
}
echo "</table>";
echo "</tt>";
?>