Sort plugin status on ranking

This commit is contained in:
bergware
2017-08-23 11:37:56 +02:00
parent c50df04360
commit 37d2f191c7
3 changed files with 22 additions and 7 deletions

View File

@@ -58,7 +58,12 @@ $(function() {
resize();
$(window).bind('resize',function(){resize(true);});
<?endif;?>
$('#plugin_table').tablesorter({sortList:[[4,0],[1,0]],sortAppend:[[1,0]],headers:{0:{sorter:false},5:{sorter:false}}});
$('#plugin_table').tablesorter({
sortList:[[4,0],[1,0]],
sortAppend:[[1,0]],
headers:{0:{sorter:false},5:{sorter:false}},
textExtraction:function(n,t,i){return $(n).attr('data')||$(n).text();}
});
$('.desc_readmore').readmore({maxHeight:58});
});
$('#plugin_tree').fileTree({root:'/boot/',filter:'plg'}, function(file) {$('#plugin_file').val(file);});

View File

@@ -41,7 +41,12 @@ function update_table(branch) {
$(function() {
$.get('/plugins/dynamix.plugin.manager/include/ShowPlugins.php',{system:'true',audit:<?=$audit?>},function(data) {
if (data) $('#os_list').html(data);
$('#os_table').tablesorter({sortList:[[1,0]],headers:{0:{sorter:false},5:{sorter:false}}});
$('#os_table').tablesorter({
sortList:[[4,0],[1,0]],
sortAppend:[[1,0]],
headers:{0:{sorter:false},5:{sorter:false}},
textExtraction:function(n,t,i){return $(n).attr('data')||$(n).text();}
});
<?if (preg_match("/^\*\*REBOOT REQUIRED\!\*\*/",@file_get_contents("$docroot/plugins/unRAIDServer/README.md"))):?>
$('#change_branch').prop('disabled',true);
<?endif;?>

View File

@@ -92,6 +92,11 @@ foreach (glob("/var/log/plugins/*.plg",GLOB_NOSORT) as $plugin_link) {
}
}
}
if (strpos($status,'update')!==false) $rank = '0';
elseif (strpos($status,'install')!==false) $rank = '1';
elseif ($status=='need check') $rank = '2';
elseif ($status=='up-to-date') $rank = '3';
else $rank = '4';
$changes = plugin('changes',$changes_file);
if ($changes !== false) {
$txtfile = "/tmp/plugins/".basename($plugin_file,'.plg').".txt";
@@ -101,11 +106,11 @@ foreach (glob("/var/log/plugins/*.plg",GLOB_NOSORT) as $plugin_link) {
//write plugin information
$empty = false;
echo "<tr>";
echo "<td style='vertical-align:top;width:64px'><p style='text-align:center'>{$link}</p></td>";
echo "<td><span class='desc_readmore' style='display:block'>{$desc}</span></td>";
echo "<td>{$author}</td>";
echo "<td>{$version}</td>";
echo "<td>{$status}</td>";
echo "<td style='vertical-align:top;width:64px'><p style='text-align:center'>$link</p></td>";
echo "<td><span class='desc_readmore' style='display:block'>$desc</span></td>";
echo "<td>$author</td>";
echo "<td>$version</td>";
echo "<td data='$rank'>$status</td>";
echo "<td>";
if ($system) {
if ($os) {