almost. Need to wait for more updates to be issued

pull/11/head
Squidly271 2021-07-12 15:25:47 -04:00
parent 09283e616f
commit e55631029b
8 changed files with 44 additions and 57 deletions

View File

@ -79,19 +79,14 @@ if ( is_file($caPaths['addConverted']) ) {
}
$date = (date("n/d"));
// Force check for updates to apps (run in background) - Only check once per day when entering in CA
if ( ( time() - @filemtime("/tmp/plugins/community.applications.plg") ) > 86400 ) {
exec("echo '$docroot/plugins/dynamix.docker.manager/scripts/dockerupdate check nonotify > /dev/null 2>&1' | at now >/dev/null");
foreach (glob("/var/log/plugins/*.plg") as $plg) {
if ( $plg == "/var/log/plugins/community.applications.plg" || $plg == "unRAIDServer.plg" )
continue; // avoid possible race condition
exec("echo '$docroot/plugins/dynamix.plugin.manager/scripts/plugin check ".basename($plg)." > /dev/null 2>&1' | at now >/dev/null");
// Only check for updates to containers / plugins max once per hour
if ( $cfg['checkForUpdates'] == "yes" ) {
if ( ( time() - @filemtime($caPaths['updateTime']) ) > 3600 ) {
touch($caPaths['updateTime']);
exec("echo '/usr/local/emhttp/plugins/community.applications/scripts/checkForUpdates.php >/dev/null 2>&1' | at now >/dev/null");
}
}
function tr($string,$ret=false) {
if ( function_exists("_") )
$string = str_replace('"',""",str_replace("'","'",_($string)));
@ -267,46 +262,6 @@ $(function(){
});
});
$('.mainArea').on("click",".dockerUpdate",function() {
if ( popupVisible(this) ) return;
var container = $(this).attr("data-name");
var docker = [container];
execUpContainer(container);
});
function execUpContainer(container) {
var title = _('Updating the container')+': '+container;
var cmd = '/plugins/dynamix.docker.manager/include/CreateDocker.php?updateContainer=true&ct[]='+encodeURIComponent(container);
popupWithIframe(title, cmd, true, 'refreshDisplay');
}
function popupWithIframe(title, cmd, reload, func) {
pauseEvents();
$('#iframe-popup').html('<iframe id="myIframe" frameborder="0" scrolling="yes" width="100%" height="99%"></iframe>');
$('#iframe-popup').dialog({
autoOpen:true,
title:title,
draggable:true,
width:800,
height:((screen.height / 5) * 4) || 0,
resizable:true,
modal:true,
show:{effect:'fade', duration:250},
hide:{effect:'fade', duration:250},
open:function(ev, ui) {
$('#myIframe').attr('src', cmd);
},
close:function(event, ui) {
if (reload && !$('#myIframe').contents().find('#canvas').length) {
if (func) setTimeout(func+'()',0); else location = window.location.href;
} else {
resumeEvents();
}
}
});
$('.ui-dialog .ui-dialog-titlebar').addClass('menu');
$('.ui-dialog .ui-dialog-title').css('text-align', 'center').css('width', '100%');
$('.ui-dialog .ui-dialog-content').css('padding', '12');
}
$('.mainArea').on("click",".ca_href",function() {
if ( popupVisible() ) return;
var href = $(this).attr("data-href");
@ -315,6 +270,10 @@ function popupWithIframe(title, cmd, reload, func) {
window.open(href,target);
});
$('.mainArea').on("click",".dockerUpdate",function() {
var container = $(this).attr("data-name");
openBox('/plugins/dynamix.docker.manager/include/CreateDocker.php?updateContainer=true&ct[]='+encodeURIComponent(container),tr('Update Container'),600,1100,true,refreshDisplay);
});
$('.mainArea').on("click",".ca_non_favouriteRepo",function() {
if ( popupVisible(this) ) return;
setFavourite(this);

View File

@ -1,10 +1,10 @@
767d6f2203fed9541daeb57bbf7b58b3 ./Apps.page
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
e4ba7ca68bc2b1e384fb73851ae7c3cb ./CommunityApps.page
fb20889fd933fe9511975455d71559c2 ./CommunityApps.page
6db73582f22dab13d329e862067ee84e ./PluginAPI.page
b398273cf7daa62ab00d2de2336ca25f ./README.md
a9d4cd0e4e1f37cbe3806b952a96ddb1 ./ca_settings.page
411b835e910b987ecdf4293cf351f79b ./default.cfg
2cdb7da0d67a11278ada7fd029707738 ./ca_settings.page
7c88ace586933a4a60b0ef2f8a97a662 ./default.cfg
4344942541019c3b5464d508c7f0dd30 ./images/community.applications.png
6e48a62b91bdd066f023f46c6b491afd ./images/discord-azure.svg
389e13f48a67895377189b855b950497 ./images/discord-black.svg
@ -13,11 +13,11 @@ a9d4cd0e4e1f37cbe3806b952a96ddb1 ./ca_settings.page
54e46db492ddb033dfeb2827c5efd4a8 ./images/discord-white.svg
e1b21f84d170c618893784002be3e4ad ./include/exec.php
06b55b88a6ed1834a15c7fd72b2c819d ./include/helpers.php
8f1129e0cdb994c6d1900192252433d8 ./include/paths.php
255dc18c0d28e65e3a23eb7a80969802 ./include/paths.php
eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js
e29c13353bc1277fc2c3597782d7c954 ./skins/Narrow/css.php
adc2d62d429accb264cedad58e6ef7a5 ./skins/Narrow/skin.html
01a2b427ddd0eb019d7166d1356037fe ./skins/Narrow/skin.php
2759ebf01131ddedffa08e44523724ea ./skins/Narrow/skin.php
430966e5646376b62905b63a30de7102 ./scripts/PluginAPI.php
11eecc7264a3057ee70cc00a24c8299b ./scripts/installMulti.php
ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh
@ -28,3 +28,4 @@ ce2c904b6a40c4677a3ff3484776959e ./scripts/installMultiPlugin.sh
f9c3f431935fb20801f3fef152dc7b58 ./scripts/showStatistics.php
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
02759ea835ee4ce5a051fead96ab9b9b ./scripts/updatePluginSupport.php
0a4b291ae29b73cea0437a11ba28c8d9 ./scripts/checkForUpdates.php

View File

@ -73,6 +73,14 @@ function tr($string,$ret=false) {
> <?tr("This setting enables CA to retrieve additional search results from dockerHub. Note that docker must be enabled for this to be operational");?>
<?tr("Allow CA to check for updates to applications:");?>
: <select name="updateCheck" size="1">
<?=mk_option($cfg['updateCheck'],"yes",tr("Yes",true))?>
<?=mk_option($cfg['updateCheck'],"no",tr("No",true))?>
</select>
> <?tr("This setting enables CA to check for updates to applications");?>
<?tr("Allow CA to send any emergency notifications:");?>
: <select name='notifications' size='1'>
<?=mk_option($cfg['notifications'],"yes",tr("Yes",true))?>

View File

@ -3,4 +3,5 @@ dockerSearch="no"
hideDeprecated="true"
defaultReinstall="false"
notifications="no"
debugging="no"
debugging="no"
updateCheck="yes"

View File

@ -63,4 +63,5 @@ $caPaths['LanguageErrors'] = "https://squidly271.github.io/
$caPaths['CA_languageBase'] = "https://raw.githubusercontent.com/Squidly271/AppFeed/master/languages/";
$caPaths['CA_logs'] = "/tmp/CA_logs";
$caPaths['logging'] = "{$caPaths['CA_logs']}/ca_log.txt";
$caPaths['updateTime'] = "{$caPaths['tempFiles']}/checkForUpdatesTime";
?>

View File

@ -0,0 +1,17 @@
#!/usr/bin/php
<?
###############################################################
# #
# Community Applications copyright 2015-2021, Andrew Zawadzki #
# Licenced under GPLv2 #
# #
###############################################################
$docroot = $docroot ?? $_SERVER['DOCUMENT_ROOT'] ?: "/usr/local/emhttp";
exec("$docroot/plugins/dynamix.docker.manager/scripts/dockerupdate check nonotify > /dev/null 2>&1");
foreach (glob("/var/log/plugins/*.plg") as $plg) {
if ( $plg == "/var/log/plugins/community.applications.plg" || $plg == "unRAIDServer.plg" || $plg == "gui.search.plg")
continue; // avoid possible race condition since CA / gui.search automatically check for updates for themselves
exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin check ".escapeshellarg(basename($plg))." > /dev/null 2>&1");
}
?>

View File

@ -221,7 +221,7 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
$template['display_dockerDefaultIcon'] = $template['BranchID'] ? "<a class='ca_tooltip ca_fa-install appIcons' type='button' style='margin:0px' title='".tr("Click to reinstall the application using default values")."' onclick='displayTags(&quot;$ID&quot;);'></a>" : $template['display_dockerDefaultIcon'];
$template['display_dockerEditIcon'] = "<a class='ca_tooltip appIcons ca_fa-edit xmlInstall' title='".tr("Click to edit the application values")."' data-type='edit' data-xml='".addslashes($info[$name]['template'])."'></a>";
$template['display_dockerReinstallIcon'] = $caSettings['defaultReinstall'] == "true" ? "<a class='ca_tooltip ca_fa-install appIcons xmlInstall' title='".tr("Click to reinstall")."' data-type='default' data-xml='".addslashes($template['Path'])."'></a>" : "";
$template['display_dockerUpdate'] = $template['UpdateAvailable'] ? "<a class='ca_tooltip appIcons ca_fa-update dockerUpdate' data-name='{$template['Name']}' title='".tr("Update container")."'></a>" : "";
$template['display_dockerUpdate'] = $template['UpdateAvailable'] ? "<a class='ca_tooltip appIcons ca_fa-update dockerUpdate' data-name='$name' title='".tr("Update container")."'></a>" : "";
unset($template['display_multi_install']);
if ( $info[$name]['url'] && $info[$name]['running'] )