Below
Re-add dockerHub searches Include donate on context menu if app is installedpull/11/head
parent
4cc844d721
commit
572f15a7e8
Binary file not shown.
Binary file not shown.
|
@ -363,6 +363,8 @@ $(function(){
|
|||
|
||||
|
||||
$('body').on("click",".ca_appPopup,.cardDescription,.homespotlightIconArea",function() {
|
||||
if ( $(this).hasClass("dockerCardBackground") || $(this).hasClass("noClick") )
|
||||
return;
|
||||
if ( $(".dropdown-menu").is(":visible") ) {
|
||||
$(".dropdown-menu").hide();
|
||||
return;
|
||||
|
@ -375,7 +377,11 @@ $(function(){
|
|||
appname = stripTags(appname);
|
||||
|
||||
showSidebarApp(apppath,appname);
|
||||
});
|
||||
|
||||
$('body').on("click",".dockerPopup", function() {
|
||||
var url = $(this).data("dockerhub");
|
||||
openNewWindow(url,'_blank');
|
||||
});
|
||||
|
||||
$('.menuItems').on("click",'.categoryMenu',function() {
|
||||
|
@ -920,21 +926,6 @@ function awesompleteSearch() {
|
|||
doSearch(false);
|
||||
}
|
||||
|
||||
function mySearch(filter) {
|
||||
filter = filter.replace(/<(?:.|\n)*?>/gm, '');
|
||||
$('#searchBox').val(filter);
|
||||
|
||||
if ( $("#searchButton").hasClass('fa-search') ) {
|
||||
$('#searchButton').toggleClass('fa-search fa-remove');
|
||||
}
|
||||
initDockerSearch(1);
|
||||
}
|
||||
|
||||
function initDockerSearch() {
|
||||
var filter = $('#searchBox').val();
|
||||
filter = filter.replace(" ","%20");
|
||||
window.open("https://hub.docker.com/search?q="+filter+"&type=image","_blank");
|
||||
}
|
||||
|
||||
function openNewWindow(newURL,target='_self') {
|
||||
var popUp = window.open(newURL,target);
|
||||
|
@ -2180,6 +2171,36 @@ function checkSortOrder() {
|
|||
}
|
||||
}
|
||||
|
||||
function initDockerSearch() {
|
||||
dockerSearch(1);
|
||||
data.docker = "searching docker";
|
||||
data.section = "";
|
||||
data.selected_category = "";
|
||||
$(".selectedMenu").removeClass("selectedMenu");
|
||||
$(".nonDockerSearch").removeClass("caMenuEnabled").addClass("caMenuDisabled");
|
||||
hideSortIcons();
|
||||
$(".subCategory").hide();
|
||||
}
|
||||
|
||||
function dockerSearch(pageNumber) {
|
||||
var filter = $('#searchBox').val();
|
||||
var dockerURL = "https://registry.hub.docker.com/search?q=" + filter;
|
||||
data.docker = "searching docker";
|
||||
$(".dockerSearch,.multi_installDiv").hide();
|
||||
$("#Category").html(sprintf(tr("DockerHub Search for %s"),filter)+" <span id='pageNumber'></span>");
|
||||
post({action:'search_dockerhub',filter:filter,page:pageNumber},function(result) {
|
||||
updateDisplay(result.display);
|
||||
});
|
||||
}
|
||||
|
||||
function dockerConvert(dockerID) {
|
||||
post({action:'convert_docker',ID:dockerID},function(result) {
|
||||
myCloseAlert();
|
||||
templateURL = "/Apps/AddContainer?xmlTemplate=default:" + $.trim(result.xml);
|
||||
openNewWindow(templateURL);
|
||||
});
|
||||
}
|
||||
|
||||
</script>
|
||||
|
||||
<?include "/usr/local/emhttp/plugins/$plugin/skins/Narrow/skin.html"?>
|
||||
|
|
|
@ -1,10 +1,10 @@
|
|||
d19eac2f726127f36e8951fe08050a9b ./Apps.page
|
||||
a234e996c1eef4dddfc4133d64ad34a1 ./Apps.page
|
||||
83b3f89cd42e8601c7c217d5b4889c81 ./CA_notices.page
|
||||
7ee0b23dbd92ed55f611360a983f9565 ./ca_settings.page
|
||||
1b49ec9797713ce869ea0c1066a109f2 ./default.cfg
|
||||
13bc7def9742a2cbf6fc355437e6c7c3 ./include/exec.php
|
||||
b7ab76bd389b70d23751f597e6592b16 ./include/exec.php
|
||||
5810179d140aadc0a17b2d8782a32cba ./include/helpers.php
|
||||
aeec70878e94eead3aef390110e786e8 ./include/paths.php
|
||||
6113f62fd4fe2afd03bd5f082a6f5f29 ./include/paths.php
|
||||
eb76c1b6ed3da5e5b393f22d2ec18430 ./javascript/libraries.js
|
||||
8c24d585c7dd3ff9ef961bb2c2705711 ./PluginAPI.page
|
||||
b398273cf7daa62ab00d2de2336ca25f ./README.md
|
||||
|
@ -20,6 +20,6 @@ b398273cf7daa62ab00d2de2336ca25f ./README.md
|
|||
9eba209fba4bbf1a02e57ddafebfdf8c ./scripts/showStatistics.php
|
||||
4425f8fd4ef662a7dc65cee01de3e419 ./scripts/updatePLG.sh
|
||||
2bd671daecaf01549f8cc0202cb184b3 ./scripts/updatePluginSupport.php
|
||||
7f2f01fc196a16137a6ba8557a4a5f12 ./skins/Narrow/css.php
|
||||
4ff34c148d3dde1a420303faecd414ae ./skins/Narrow/skin.html
|
||||
d611974ff062a2b69dce42986f8cbc4b ./skins/Narrow/skin.php
|
||||
dec2bf4cf4d3d57619d2c3ba49d59b9f ./skins/Narrow/css.php
|
||||
e965c8fafd1eae7a0387e37cee3aeaf9 ./skins/Narrow/skin.html
|
||||
42ac1f766f0493837024f11d801c6c33 ./skins/Narrow/skin.php
|
||||
|
|
|
@ -174,6 +174,12 @@ switch ($_POST['action']) {
|
|||
case 'onStartupScreen':
|
||||
onStartupScreen();
|
||||
break;
|
||||
case 'convert_docker':
|
||||
convert_docker();
|
||||
break;
|
||||
case 'search_dockerhub':
|
||||
search_dockerhub();
|
||||
break;
|
||||
###############################################
|
||||
# Return an error if the action doesn't exist #
|
||||
###############################################
|
||||
|
@ -1599,11 +1605,11 @@ function get_categories() {
|
|||
usort($newCat,"mySort"); // Sort it alphabetically according to the language. May not work right in non-roman charsets
|
||||
|
||||
foreach ($newCat as $category) {
|
||||
$cat .= "<li class='categoryMenu caMenuItem' data-category='{$category['Cat']}'>".$category['Des']."</li>";
|
||||
$cat .= "<li class='categoryMenu caMenuItem nonDockerSearch' data-category='{$category['Cat']}'>".$category['Des']."</li>";
|
||||
if (is_array($category['Sub'])) {
|
||||
$cat .= "<ul class='subCategory'>";
|
||||
foreach($category['Sub'] as $subcategory) {
|
||||
$cat .= "<li class='categoryMenu caMenuItem' data-category='{$subcategory['Cat']}'>".$subcategory['Des']."</li>";
|
||||
$cat .= "<li class='categoryMenu caMenuItem nonDockerSearch' data-category='{$subcategory['Cat']}'>".$subcategory['Des']."</li>";
|
||||
}
|
||||
$cat .= "</ul>";
|
||||
}
|
||||
|
@ -1611,7 +1617,7 @@ function get_categories() {
|
|||
$templates = readJsonFile($caPaths['community-templates-info']);
|
||||
foreach ($templates as $template) {
|
||||
if ($template['Private'] == true && ! $template['Blacklist']) {
|
||||
$cat .= "<li class='categoryMenu caMenuItem' data-category='PRIVATE'>".tr("Private Apps")."</li>";
|
||||
$cat .= "<li class='categoryMenu caMenuItem nonDockerSearch' data-category='PRIVATE'>".tr("Private Apps")."</li>";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1902,6 +1908,93 @@ function onStartupScreen() {
|
|||
|
||||
postReturn(['status'=>is_file($caPaths['startupDisplayed'])]);
|
||||
}
|
||||
|
||||
#######################################################################
|
||||
# convert_docker - called when system adds a container from dockerHub #
|
||||
#######################################################################
|
||||
function convert_docker() {
|
||||
global $caPaths;
|
||||
|
||||
$dockerID = getPost("ID","");
|
||||
|
||||
$file = readJsonFile($caPaths['dockerSearchResults']);
|
||||
$dockerIndex = searchArray($file['results'],"ID",$dockerID);
|
||||
$docker = $file['results'][$dockerIndex];
|
||||
$docker['Description'] = str_replace("&", "&", $docker['Description']);
|
||||
|
||||
$dockerfile['Name'] = $docker['Name'];
|
||||
$dockerfile['Support'] = $docker['DockerHub'];
|
||||
$dockerfile['Description'] = $docker['Description']."\n\nConverted By Community Applications Always verify this template (and values) against the dockerhub support page for the container\n\n{$docker['DockerHub']}";
|
||||
$dockerfile['Overview'] = $dockerfile['Description'];
|
||||
$dockerfile['Registry'] = $docker['DockerHub'];
|
||||
$dockerfile['Repository'] = $docker['Repository'];
|
||||
$dockerfile['BindTime'] = "true";
|
||||
$dockerfile['Privileged'] = "false";
|
||||
$dockerfile['Networking']['Mode'] = "bridge";
|
||||
$dockerfile['Icon'] = "/plugins/dynamix.docker.manager/images/question.png";
|
||||
$dockerXML = makeXML($dockerfile);
|
||||
|
||||
file_put_contents($caPaths['dockerSearchInstall'],$dockerXML);
|
||||
postReturn(['xml'=>$caPaths['dockerSearchInstall']]);
|
||||
}
|
||||
|
||||
#########################################################
|
||||
# search_dockerhub - returns the results from dockerHub #
|
||||
#########################################################
|
||||
function search_dockerhub() {
|
||||
global $caPaths;
|
||||
|
||||
$filter = getPost("filter","");
|
||||
$pageNumber = getPost("page","1");
|
||||
|
||||
$communityTemplates = readJsonFile($caPaths['community-templates-info']);
|
||||
$filter = str_replace(" ","%20",$filter);
|
||||
$filter = str_replace("/","%20",$filter);
|
||||
$jsonPage = shell_exec("curl -s -X GET 'https://registry.hub.docker.com/v1/search?q=$filter&page=$pageNumber'");
|
||||
$pageresults = json_decode($jsonPage,true);
|
||||
$num_pages = $pageresults['num_pages'];
|
||||
|
||||
if ($pageresults['num_results'] == 0) {
|
||||
$o['display'] = "<div class='ca_NoDockerAppsFound'>".tr("No Matching Applications Found On Docker Hub")."</div>";
|
||||
$o['script'] = "$('#dockerSearch').hide();";
|
||||
postReturn($o);
|
||||
@unlink($caPaths['dockerSerchResults']);
|
||||
return;
|
||||
}
|
||||
|
||||
$i = 0;
|
||||
foreach ($pageresults['results'] as $result) {
|
||||
unset($o);
|
||||
$o['IconFA'] = "docker";
|
||||
$o['Repository'] = $result['name'];
|
||||
$details = explode("/",$result['name']);
|
||||
$o['Author'] = $details[0];
|
||||
$o['Name'] = $details[1];
|
||||
$o['Description'] = $result['description'];
|
||||
$o['Automated'] = $result['is_automated'];
|
||||
$o['Stars'] = $result['star_count'];
|
||||
$o['Official'] = $result['is_official'];
|
||||
$o['Trusted'] = $result['is_trusted'];
|
||||
if ( $o['Official'] ) {
|
||||
$o['DockerHub'] = "https://hub.docker.com/_/".$result['name']."/";
|
||||
$o['Name'] = $o['Author'];
|
||||
} else
|
||||
$o['DockerHub'] = "https://hub.docker.com/r/".$result['name']."/";
|
||||
|
||||
$o['ID'] = $i;
|
||||
$searchName = str_replace("docker-","",$o['Name']);
|
||||
$searchName = str_replace("-docker","",$searchName);
|
||||
|
||||
$dockerResults[$i] = $o;
|
||||
$i=++$i;
|
||||
}
|
||||
$dockerFile['num_pages'] = $num_pages;
|
||||
$dockerFile['page_number'] = $pageNumber;
|
||||
$dockerFile['results'] = $dockerResults;
|
||||
|
||||
writeJsonFile($caPaths['dockerSearchResults'],$dockerFile);
|
||||
postReturn(['display'=>displaySearchResults($pageNumber)]);
|
||||
}
|
||||
#######################################
|
||||
# Logs Javascript errors being caught #
|
||||
#######################################
|
||||
|
|
|
@ -63,4 +63,6 @@ $caPaths['languageInstalled'] = "/usr/local/emhttp/languages/"
|
|||
$caPaths['updateTime'] = "/tmp/$CA/checkForUpdatesTime"; # can't be in /tmp/community.applications/tempFiles because new feed downloads erases everything there
|
||||
$caPaths['dockerWriteTest'] = "/var/lib/docker/communityApplicationsWriteTest";
|
||||
$caPaths['info'] = $caPaths['tempFiles']."/info.json";
|
||||
$caPaths['dockerSearchResults'] = $caPaths['tempFiles']."/dockerSearch.json";
|
||||
$caPaths['dockerSearchInstall'] = $caPaths['tempFiles']."/docksearch.xml";
|
||||
?>
|
|
@ -184,6 +184,7 @@ a.ca_fa-delete{text-decoration:none;margin-left:1rem;font-size:2rem;margin-top:-
|
|||
.ca_fa-globe::before {content:"\f0ac";font-family:fontAwesome;}
|
||||
.ca_fa-info::before {content:"\f05a";font-family:fontAwesome;}
|
||||
.ca_fa-install::before {content:"\f019";font-family:fontAwesome;}
|
||||
.ca_fa-money::before {content:"\f0d6";font-family:fontAwesome;}
|
||||
.ca_fa-pluginSettings::before {content:"\f013";font-family:fontAwesome;}
|
||||
.ca_fa-project::before {content:"\e953";font-family:Unraid;}
|
||||
.ca_fa-readme::before {content:"\f02d";font-family:fontAwesome;}
|
||||
|
@ -264,6 +265,7 @@ i.displayIcon {font-size:5.5rem;color:#626868;padding-top:0.25rem;}
|
|||
img.displayIcon {height:6.4rem;width:6.4rem;border-radius:1rem 1rem 1rem 1rem;}
|
||||
#cookieWarning {display:none;}
|
||||
.docker::after{font-family:'Unraid';content:'\e90b';font-size:2.5rem;}
|
||||
.dockerCardBackground{height:18.5rem;cursor:default !important;}
|
||||
.dockerHubStar {font-size:1rem;}
|
||||
.dockerHubStar::before{content:"\e95a";font-family:UnRaid;}
|
||||
.dockerSearch{display:inline-block;float:right;}
|
||||
|
@ -287,12 +289,13 @@ img.displayIcon {height:6.4rem;width:6.4rem;border-radius:1rem 1rem 1rem 1rem;}
|
|||
.infoIcon::before{content:"\f05a";font-family:fontAwesome;}
|
||||
.infoButton {line-height:2rem;cursor:pointer;display:inline-block;color:<?=$donateText?>!important;background: <?=$donateBackground?>;background: -webkit-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%),-webkit-linear-gradient(left, lighten(<?=$donateBackground?>, 15%) 0%, <?=$donateBackground?> 50%, lighten(<?=$donateBackground?>, 15%) 100%); background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%),linear-gradient(to right, lighten(#E68321, 15%) 0%, #E68321 50%, lighten(#E68321, 15%) 100%); background-position: 0 0; background-size: 100% 100%; border-radius: 15px; color: #fff; padding: 1px 10px 1px 10px;}
|
||||
.infoButton:hover{background:<?=$unRaid66color?>}
|
||||
.infoButton_docker {line-height:2rem;cursor:pointer;display:inline-block;color:<?=$donateText?>!important;background: <?=$donateBackground?>;background: -webkit-linear-gradient(top, transparent 0%, rgba(0,0,0,0.4) 100%),-webkit-linear-gradient(left, lighten(<?=$donateBackground?>, 15%) 0%, <?=$donateBackground?> 50%, lighten(<?=$donateBackground?>, 15%) 100%); background: linear-gradient(to bottom, transparent 0%, rgba(0,0,0,0.4) 100%),linear-gradient(to right, lighten(#E68321, 15%) 0%, #E68321 50%, lighten(#E68321, 15%) 100%); background-position: 0 0; background-size: 100% 100%; border-radius: 15px; color: #fff; padding: 1px 10px 1px 10px;}
|
||||
.infoButton_docker:hover{background:<?=$unRaid66color?>}
|
||||
.initDockerSearch{cursor:pointer;text-decoration:none;font-size:1.5rem;}
|
||||
.initDockerSearch:hover{color:<?=$unRaid66color?>}
|
||||
a.initDockerSearch{cursor:pointer;text-decoration:none;color:unset;}
|
||||
.installedCardBackground{clip-path: polygon(0 0,100% 0, 100% 100%);background-color: #322fff;top:0px;height:9rem;width:9rem;position: relative;left:-10rem;margin-right:-9rem;}
|
||||
.installedCardText{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.5rem;right:-1rem;width:100%;overflow:hidden;height:2rem;}
|
||||
|
||||
input[type=checkbox] {width:2rem;height:2rem;margin-left:0rem;}
|
||||
input[type=button]{background:none;font-size:1.5rem;}
|
||||
input:hover[type=button]{color:<?=$unRaid66color?>;background:none !important;}
|
||||
|
@ -309,12 +312,13 @@ input[type=button][disabled]{background:none;}
|
|||
.moderationLink {color:<?=$linkColor?>;font-weight:normal;}
|
||||
.multi_installDiv {width:100%; display:none;padding-bottom:20px;}
|
||||
.myReadmoreButton {color:#6363ca;}
|
||||
.noClick{cursor:default !important;}
|
||||
.notice.shift {margin-top:0px;}
|
||||
p {margin:auto;text-align:left;margin-bottom:10px;} /* override dynamix styling for popup */
|
||||
.pageDots::after {content:"...";}
|
||||
.pageDots{color:grey;cursor:default;}
|
||||
.pageLeft::after {content:"\f137";font-family:fontAwesome;}
|
||||
.pageNavigation {font-size:1.5rem;padding-bottom:20rem;}
|
||||
.pageNavigation {font-size:1.5rem;}
|
||||
.pageNavNoClick {font-size:1.5rem;cursor:default !important;}
|
||||
.pageNavNoClick:hover{color:initial !important;}
|
||||
.pageNumber{margin-left:1rem;margin-right:1rem;cursor:pointer;text-decoration:none !important;}
|
||||
|
|
|
@ -18,9 +18,9 @@
|
|||
<hr class='onlyShowWithFeed'>
|
||||
|
||||
<span id='category_list' class='onlyShowWithFeed'></span>
|
||||
<li class='categoryMenu caMenuItem allApps onlyShowWithFeed' data-category='All'><?tr("All Apps");?></li>
|
||||
<li class='categoryMenu caMenuItem allApps onlyShowWithFeed nonDockerSearch' data-category='All'><?tr("All Apps");?></li>
|
||||
<hr class='category_hr'>
|
||||
<li class='categoryMenu caMenuItem caRepositoryMenu onlyShowWithFeed' data-category='repos'><?tr("Repositories");?></li>
|
||||
<li class='categoryMenu caMenuItem caRepositoryMenu onlyShowWithFeed nonDockerSearch' data-category='repos'><?tr("Repositories");?></li>
|
||||
<hr class='category_hr onlyShowWithFeed'>
|
||||
<li class='caMenuItem' onclick='window.location="/Apps/ca_settings"'><?tr("Settings");?></a></li>
|
||||
<li class='caMenuItem statistics' onclick='disableSort();scrollToTop();showStatistics();'><?tr("Statistics");?></li>
|
||||
|
|
|
@ -131,7 +131,10 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
|||
$actionsContext[] = array("icon"=>"ca_fa-edit","text"=>tr("Edit"),"action"=>"popupInstallXML('".addslashes($info[$ind]['template'])."','edit');");
|
||||
$actionsContext[] = array("divider"=>true);
|
||||
$actionsContext[] = array("icon"=>"ca_fa-delete","text"=>tr("Uninstall"),"action"=>"uninstallDocker('".addslashes($info[$ind]['template'])."','{$template['Name']}');");
|
||||
|
||||
if ( $template['DonateLink'] ) {
|
||||
$actionsContext[] = array("divider"=>true);
|
||||
$actionsContext[] = array("icon"=>"ca_fa-money","text"=>tr("Donate"),"action"=>"openNewWindow('".addslashes($template['DonateLink'])."','_blank');");
|
||||
}
|
||||
} elseif ( ! $template['Blacklist'] || ! $template['Compatible']) {
|
||||
if ( $template['InstallPath'] ) {
|
||||
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>tr("Reinstall"),"action"=>"popupInstallXML('".addslashes($template['InstallPath'])."','user');");
|
||||
|
@ -164,12 +167,17 @@ function my_display_apps($file,$pageNumber=1,$selectedApps=false,$startup=false)
|
|||
if ( $pluginSettings ) {
|
||||
$actionsContext[] = array("icon"=>"ca_fa-pluginSettings","text"=>tr("Settings"),"action"=>"openNewWindow('/Apps/$pluginSettings');");
|
||||
}
|
||||
|
||||
if ( $pluginName != "community.applications.plg" ) {
|
||||
if ( ! empty($actionsContext) )
|
||||
$actionsContext[] = array("divider"=>true);
|
||||
|
||||
$actionsContext[] = array("icon"=>"ca_fa-delete","text"=>tr("Uninstall"),"action"=>"uninstallApp('/var/log/plugins/$pluginName','".str_replace(" "," ",$template['Name'])."');");
|
||||
}
|
||||
if ( $template['DonateLink'] ) {
|
||||
$actionsContext[] = array("divider"=>true);
|
||||
$actionsContext[] = array("icon"=>"ca_fa-money","text"=>tr("Donate"),"action"=>"openNewWindow('".addslashes($template['DonateLink'])."','_blank');");
|
||||
}
|
||||
} elseif ( ! $template['Blacklist'] || ! $template['Compatible'] ) {
|
||||
$buttonTitle = $template['InstallPath'] ? tr("Reinstall") : tr("Install");
|
||||
$actionsContext[] = array("icon"=>"ca_fa-install","text"=>$buttonTitle,"action"=>"installPlugin('{$template['PluginURL']}');");
|
||||
|
@ -774,6 +782,44 @@ function getRepoDescriptionSkin($repository) {
|
|||
return array("description"=>$t);
|
||||
}
|
||||
|
||||
########################################################################################
|
||||
# function used to display the navigation (page up/down buttons) for dockerHub results #
|
||||
########################################################################################
|
||||
function dockerNavigate($num_pages, $pageNumber) {
|
||||
return getPageNavigation($pageNumber,$num_pages * 25, true);
|
||||
}
|
||||
|
||||
##############################################################
|
||||
# function that actually displays the results from dockerHub #
|
||||
##############################################################
|
||||
function displaySearchResults($pageNumber) {
|
||||
global $caPaths, $caSettings, $plugin;
|
||||
|
||||
$tempFile = readJsonFile($caPaths['dockerSearchResults']);
|
||||
$num_pages = $tempFile['num_pages'];
|
||||
$file = $tempFile['results'];
|
||||
$templates = readJsonFile($caPaths['community-templates-info']);
|
||||
|
||||
$ct = dockerNavigate($num_pages,$pageNumber)."<br>";
|
||||
$ct .= "<div class='ca_templatesDisplay'>";
|
||||
|
||||
$columnNumber = 0;
|
||||
foreach ($file as $result) {
|
||||
$result['Icon'] = "/plugins/dynamix.docker.manager/images/question.png";
|
||||
$result['display_dockerName'] = "<a class='ca_tooltip ca_applicationName' style='cursor:pointer;' onclick='mySearch(this.innerText);' title='".tr("Search for similar containers")."'>{$result['Name']}</a>";
|
||||
$result['Category'] = "Docker Hub Search";
|
||||
$result['Description'] = $result['Description'] ?: "No description present";
|
||||
$result['Compatible'] = true;
|
||||
$result['actionsContext'] = [["icon"=>"ca_fa-install","text"=>tr("Install"),"action"=>"dockerConvert($ID);"]];
|
||||
|
||||
|
||||
$ct .= displayCard($result);
|
||||
$count++;
|
||||
}
|
||||
$ct .= "</div>";
|
||||
|
||||
return $ct.dockerNavigate($num_pages,$pageNumber);
|
||||
}
|
||||
###########################
|
||||
# Generate the app's card #
|
||||
###########################
|
||||
|
@ -782,7 +828,7 @@ function displayCard($template) {
|
|||
$appName = str_replace("-"," ",$template['display_dockerName']);
|
||||
|
||||
$popupType = $template['RepositoryTemplate'] ? "ca_repoPopup" : "ca_appPopup";
|
||||
if ( $template['Category'] == "Docker Hub Search" )
|
||||
if ( $template['DockerHub'] )
|
||||
unset($popupType);
|
||||
|
||||
if ($template['Language']) {
|
||||
|
@ -820,7 +866,11 @@ function displayCard($template) {
|
|||
$Category = explode(" ",$Category)[0];
|
||||
$Category = explode(":",$Category)[0];
|
||||
|
||||
if ( ! $DockerHub )
|
||||
$author = $RepoShort ?: $RepoName;
|
||||
else
|
||||
$author = $Author;
|
||||
|
||||
if ( $Plugin )
|
||||
$author = $Author;
|
||||
if ( $Language )
|
||||
|
@ -865,11 +915,20 @@ function displayCard($template) {
|
|||
$display_repoName = str_replace("' Repository","",str_replace("'s Repository","",$display_repoName));
|
||||
|
||||
$bottomClass = $class ? "ca_bottomLineSpotLight" : "";
|
||||
if ( $DockerHub ) {
|
||||
$backgroundClickable = "dockerCardBackground";
|
||||
$card .= "
|
||||
<div class='ca_holder $class'>
|
||||
<div class='ca_bottomLine $bottomClass'>
|
||||
<div class='infoButton_docker dockerPopup' data-dockerHub='$DockerHub'>".tr("Info")."</div>";
|
||||
} else {
|
||||
$backgroundClickable = "ca_backgroundClickable";
|
||||
$card .= "
|
||||
<div class='ca_holder $class'>
|
||||
<div class='ca_bottomLine $bottomClass'>
|
||||
<div class='infoButton $cardClass' data-apppath='$Path' data-appname='$Name' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'>".tr("Info")."</div>
|
||||
";
|
||||
}
|
||||
if ( $class == "spotlightHome" ) {
|
||||
if ( $actionsContext ) {
|
||||
if ( count($actionsContext) == 1)
|
||||
|
@ -904,16 +963,19 @@ function displayCard($template) {
|
|||
$card .= "<input class='ca_multiselect ca_tooltip' title='".tr("Check off to select multiple reinstalls")."' type='checkbox' data-name='$previousAppName' data-humanName='$Name' data-type='$type' data-deletepath='$InstallPath' $checked>";
|
||||
}
|
||||
$card .= "</div>";
|
||||
$card .= "<div class='$cardClass ca_backgroundClickable' data-apppath='$Path' data-appname='$Name' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'>";
|
||||
$card .= "<div class='$cardClass $backgroundClickable' data-apppath='$Path' data-appname='$Name' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'>";
|
||||
$card .= "<div class='ca_iconArea'>";
|
||||
if ( $DockerHub )
|
||||
$imageNoClick = "noClick";
|
||||
|
||||
if ( ! $IconFA )
|
||||
$card .= "
|
||||
<img class='ca_displayIcon' src='$Icon'></img>
|
||||
<img class='ca_displayIcon $imageNoClick' src='$Icon'></img>
|
||||
";
|
||||
else {
|
||||
$displayIcon = $template['IconFA'] ?: $template['Icon'];
|
||||
$displayIconClass = startsWith($displayIcon,"icon-") ? $displayIcon : "fa fa-$displayIcon";
|
||||
$card .= "<i class='ca_appPopup $displayIconClass displayIcon' data-apppath='$Path' data-appname='$Name'></i>";
|
||||
$card .= "<i class='ca_appPopup $displayIconClass displayIcon $imageNoClick' data-apppath='$Path' data-appname='$Name'></i>";
|
||||
}
|
||||
$card .= "</div>";
|
||||
|
||||
|
@ -958,7 +1020,7 @@ function displayCard($template) {
|
|||
# $Overview = explode("<br>",$ovr)[0];
|
||||
$Overview = str_replace("<br>"," ",$ovr);
|
||||
$descClass= $RepositoryTemplate ? "cardDescriptionRepo" : "cardDescription";
|
||||
$card .= "<div class='$descClass ca_backgroundClickable' data-apppath='$Path' data-appname='$Name' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'><div class='cardDesc'>$Overview</div></div>";
|
||||
$card .= "<div class='$descClass $backgroundClickable' data-apppath='$Path' data-appname='$Name' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'><div class='cardDesc'>$Overview</div></div>";
|
||||
if ( $RecommendedDate ) {
|
||||
$card .= "
|
||||
<div class='homespotlightIconArea ca_center' data-apppath='$Path' data-appname='$Name' data-repository='".htmlentities($RepoName,ENT_QUOTES)."'>
|
||||
|
@ -970,17 +1032,34 @@ function displayCard($template) {
|
|||
}
|
||||
$card .= "</div>";
|
||||
if ( $Installed || $Uninstall) {
|
||||
$card .= "<div class='installedCardBackground'>";
|
||||
$card .= "<div class='installedCardText ca_center'>".tr("INSTALLED")."</div>";
|
||||
$card .= "</div>";
|
||||
$card .= "
|
||||
<div class='installedCardBackground'>
|
||||
<div class='installedCardText ca_center'>".tr("INSTALLED")."</div>
|
||||
</div>";
|
||||
} else if ( $Beta ) {
|
||||
$card .= "<div class='betaCardBackground'>";
|
||||
$card .= "<div class='betaPopupText ca_center'>".tr("BETA")."</div>";
|
||||
$card .= "</div>";
|
||||
$card .= "
|
||||
<div class='betaCardBackground'>
|
||||
<div class='betaPopupText ca_center'>".tr("BETA")."</div>
|
||||
</div>
|
||||
";
|
||||
} else if ( $RecommendedDate ) {
|
||||
$card .= "<div class='spotlightCardBackground'>";
|
||||
$card .= "<div class='spotlightPopupText' title='".tr("This is a spotlight application")."'></div>";
|
||||
$card .= "</div>";
|
||||
$card .= "
|
||||
<div class='spotlightCardBackground'>
|
||||
<div class='spotlightPopupText' title='".tr("This is a spotlight application")."'></div>
|
||||
</div>
|
||||
";
|
||||
} else if ( $Official ) {
|
||||
$card .= "
|
||||
<div class='betaCardBackground'>
|
||||
<div class='betaPopupText ca_center' title='This is an official container'>".tr("OFFICIAL")."</div>
|
||||
</div>
|
||||
";
|
||||
} else if ( $Trusted ) {
|
||||
$card .= "
|
||||
<div class='spotlightCardBackground'>
|
||||
<div class='betaPopupText ca_center' title='This container is digitally signed'>".tr("Digitally Signed")."</div>
|
||||
</div>
|
||||
";
|
||||
}
|
||||
return str_replace(["\t","\n"],"",$card);
|
||||
}
|
||||
|
@ -1164,6 +1243,7 @@ function displayPopup($template) {
|
|||
<div class='spotlightPopupText'></div>
|
||||
";
|
||||
}
|
||||
|
||||
$card .= "</div>";
|
||||
|
||||
return $card;
|
||||
|
|
Loading…
Reference in New Issue