mirror of
https://github.com/UnRAIDES/unRAID-NerdTools
synced 2025-04-05 16:29:18 +00:00
VERSION: 2022.09.29 - source code
This commit is contained in:
parent
0850f907e2
commit
e0d2a6d689
|
@ -1,12 +1,12 @@
|
|||
Icon="dropbox"
|
||||
Icon="cog"
|
||||
Menu="UserPreferences"
|
||||
Title="NerdTools"
|
||||
Tag="dropbox"
|
||||
Tag="cog"
|
||||
---
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/plugins/NerdPack/css/tablesorter.css');?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/plugins/NerdPack/css/tablesorter-'.(($display['theme'] == 'white' || $display['theme'] == 'azure') ? 'white' : 'black').'.css');?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/plugins/NerdTools/css/tablesorter.css');?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/plugins/NerdTools/css/tablesorter-'.(($display['theme'] == 'white' || $display['theme'] == 'azure') ? 'white' : 'black').'.css');?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/webGui/styles/jquery.switchbutton.css');?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/plugins/NerdPack/css/NerdPack.css');?>">
|
||||
<link type="text/css" rel="stylesheet" href="<?=autov('/plugins/NerdTools/css/NerdTools.css');?>">
|
||||
<style>
|
||||
table.tablesorter tbody tr:nth-child(odd) {
|
||||
background-color: #<?=($display['theme'] == 'white' || $display['theme'] == 'azure') ? 'F0F0F0' : '212421';?>;
|
||||
|
@ -17,7 +17,7 @@ table.tablesorter tbody tr:nth-child(even) {
|
|||
</style>
|
||||
|
||||
<form markdown="1" id="package_form" name="package_settings" method="POST" action="/update.php" target="progressFrame">
|
||||
<input type="hidden" id="include" name="#include" value="/plugins/NerdPack/include/ClearConfig.php"/>
|
||||
<input type="hidden" id="include" name="#include" value="/plugins/NerdTools/include/ClearConfig.php"/>
|
||||
|
||||
<div class="wrapper">
|
||||
<table class="tablesorter hover-highlight" id="tblPackages">
|
||||
|
@ -29,7 +29,7 @@ table.tablesorter tbody tr:nth-child(even) {
|
|||
<th class="filter-downloaded" data-placeholder="by download"> Downloaded </th>
|
||||
<th class="filter-installed" data-placeholder="by install"> Installed </th>
|
||||
<th class="filter-plugins" data-placeholder="Search..."> Plugins </th>
|
||||
<th class="filter-false" data-placeholder="by status"> Installed </th>
|
||||
<th class="parser-false filter-false" nowrap="nowrap"><input class="uninstallpkg" type="checkbox"><input class="checkall" type="checkbox"></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
|
@ -38,10 +38,10 @@ table.tablesorter tbody tr:nth-child(even) {
|
|||
</div>
|
||||
<input onclick="packageQuery(1)" value="Check for Updates" type="button"><input class="reset" type="button" title="reset filters" value="Reset Filters">
|
||||
: <input id="btnApply" type="button" value="Apply"><input type="button" value="Done" onClick="done()">
|
||||
<input type="hidden" name="#file" value="NerdPack/NerdPack.cfg">
|
||||
<input type="hidden" name="#file" value="NerdTools/NerdTools.cfg">
|
||||
</form>
|
||||
|
||||
<script src="<?=autov('/plugins/NerdPack/js/jquery.tablesorter.combined.min.js');?>"></script>
|
||||
<script src="<?=autov('/plugins/NerdPack/js/parser-metric.min.js');?>"></script>
|
||||
<script src="<?=autov('/plugins/NerdTools/js/jquery.tablesorter.combined.min.js');?>"></script>
|
||||
<script src="<?=autov('/plugins/NerdTools/js/parser-metric.min.js');?>"></script>
|
||||
<script type="text/javascript" src="<?=autov('/webGui/javascript/jquery.switchbutton.js');?>"></script>
|
||||
<script type="text/javascript" src="<?=autov('/plugins/NerdPack/js/jquery.NerdPack.js');?>"></script>
|
||||
<script type="text/javascript" src="<?=autov('/plugins/NerdTools/js/jquery.NerdTools.js');?>"></script>
|
Before Width: | Height: | Size: 177 KiB After Width: | Height: | Size: 177 KiB |
|
@ -1,21 +1,23 @@
|
|||
<?php
|
||||
$plg_path = '/boot/config/plugins/NerdPack/'; // plugin path
|
||||
$plg_path = '/boot/config/plugins/NerdTools/'; // plugin path
|
||||
$os_version = strtok(parse_ini_file('/etc/unraid-version')['version'], '.') . '.' . strtok('.');
|
||||
#$os_version = '6.10';
|
||||
|
||||
$pkg_path = $plg_path; // package path
|
||||
$pkg_path = $plg_path; // package path
|
||||
$pkg_extra = "/boot/extra/"; // package path
|
||||
if (!is_dir($pkg_path))
|
||||
mkdir($pkg_path);
|
||||
if (!is_dir($pkg_extra))
|
||||
mkdir($pkg_extra);
|
||||
|
||||
|
||||
$pkg_extra_path = "/boot/extra/"; // package path
|
||||
if (!is_dir($pkg_extra_path))
|
||||
mkdir($pkg_extra_path);
|
||||
|
||||
$pkg_desc = 'https://raw.githubusercontent.com/jsavargas/unRAID-NerdTools/2022.09.28/contents/packages-desc';
|
||||
$pkg_repo = "https://raw.githubusercontent.com/jsavargas/unRAID-NerdTools/2022.09.28/contents/packages.$os_version.json";
|
||||
|
||||
|
||||
$desc_file = $pkg_path.'packages-desc';
|
||||
$repo_file = $pkg_path.'packages.json';
|
||||
$config_file = $plg_path.'NerdPack.cfg';
|
||||
$config_file = $plg_path.'NerdTools.cfg';
|
||||
|
||||
// get package configs
|
||||
$pkg_cfg = file_exists($config_file) ? parse_ini_file($config_file) : [];
|
|
@ -1,6 +1,6 @@
|
|||
<?
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/DownloadHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdTools/include/NerdPackHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdTools/include/DownloadHelpers.php';
|
||||
|
||||
// Only download repo update if the current one is 1 hour old or more
|
||||
if (!file_exists($repo_file) || !empty($_GET['force']) || (filemtime($repo_file) < (time() - 3600))) {
|
||||
|
@ -15,6 +15,8 @@ $pkgs_array = [];
|
|||
foreach ($pkgs_github_array as $pkg_github) {
|
||||
$pkg_nameArray = explode('-', $pkg_github['name']); // split package name into array
|
||||
|
||||
|
||||
|
||||
// strip md5 files
|
||||
if(!strpos(end($pkg_nameArray),'.md5')) {
|
||||
|
||||
|
@ -73,6 +75,7 @@ foreach ($pkgs_github_array as $pkg_github) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
$return = [
|
||||
'packages' => $pkgs_array,
|
||||
'empty' => empty($pkgs_downloaded)
|
|
@ -1,3 +0,0 @@
|
|||
#!/bin/sh
|
||||
ln -sf /usr/local/emhttp/plugins/NerdPack/scripts/packagemanager /usr/sbin/packagemanager
|
||||
chmod +0755 /usr/sbin/packagemanager
|
|
@ -1,19 +0,0 @@
|
|||
# HOW TO EDIT THIS FILE:
|
||||
# The "handy ruler" below makes it easier to edit a package description.
|
||||
# Line up the first '|' above the ':' following the base package name, and
|
||||
# the '|' on the right side marks the last column you can put a character in.
|
||||
# You must make exactly 11 lines for the formatting to be correct. It's also
|
||||
# customary to leave one space after the ':' except on otherwise blank lines.
|
||||
|
||||
|-----handy-ruler------------------------------------------------------|
|
||||
NerdPack: Nerd Tools unRAID Plugin
|
||||
NerdPack:
|
||||
NerdPack: unRAID plugin wrapper for extra packages, mostly CLI, for advanced
|
||||
NerdPack: users. Use at your own risk. Not officially supported by LimeTech.
|
||||
NerdPack:
|
||||
NerdPack: Supports: apr, apt-util, bwm-ng, cpio, git, iftop, inotify, iotop,
|
||||
NerdPack: iperf, kbd, lftp, lshw, neon, p7zip, perl, python, readline, screen,
|
||||
NerdPack: sshfs-fuse, strace, subversion, unrar, utempter, vim
|
||||
NerdPack:
|
||||
NerdPack: https://github.com/dmacias72/unRAID-plugins
|
||||
NerdPack:
|
|
@ -28,7 +28,7 @@ $(function(){
|
|||
checked: $.cookie('nerdpack_packages_uninstall') == '--uninstall'
|
||||
})
|
||||
.change(function () {
|
||||
$.cookie('nerdpack_packages_uninstall', '--uninstall', { expires: 3650 });
|
||||
$.cookie('nerdpack_packages_uninstall', $('.uninstallpkg')[0].checked ? '--uninstall' : '', { expires: 3650 });
|
||||
});
|
||||
|
||||
// select all packages switch
|
||||
|
@ -53,7 +53,7 @@ $(function(){
|
|||
//list all available packages in a table
|
||||
function packageQuery(force) {
|
||||
$('#tblPackages tbody').html("<tr><td colspan='6'><br><i class='fa fa-spinner fa-spin icon'></i><em>Please wait, retrieving plugin information ...</em></td><tr>");
|
||||
$.getJSON('/plugins/NerdPack/include/PackageQuery.php', {force: force}, function(data) {
|
||||
$.getJSON('/plugins/NerdTools/include/PackageQuery.php', {force: force}, function(data) {
|
||||
$('#tblPackages tbody').empty();
|
||||
var Ready;
|
||||
var Count = 0;
|
||||
|
@ -150,45 +150,52 @@ function Apply() {
|
|||
checkDepends();
|
||||
var Arg2 = (typeof $.cookie('nerdpack_packages_uninstall') === 'undefined') ? '' : '&arg2='+$.cookie('nerdpack_packages_uninstall');
|
||||
$.post('/update.php', $('#package_form').serializeArray(), function() {
|
||||
openBox('/plugins/NerdPack/scripts/packagemanager&arg1=--download'+ Arg2,
|
||||
openBox('/plugins/NerdTools/scripts/packagemanager&arg1=--download'+ Arg2,
|
||||
'Package Manager', 600, 900, true);
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
function checkDepends() {
|
||||
if ($('#screen')[0].checked) {
|
||||
$('#utempter').switchButton({checked: true});
|
||||
$('#utempter', '.pkgvalue').val('yes');
|
||||
$('#ncurses-terminfo').switchButton({checked: true});
|
||||
$('#ncurses-terminfo', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#tmux')[0].checked) {
|
||||
$('#ncurses-terminfo').switchButton({checked: true});
|
||||
$('#ncurses-terminfo', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#expect')[0].checked) {
|
||||
$('#tcl').switchButton({checked: true});
|
||||
$('#tcl', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#iotop')[0].checked) {
|
||||
$('#python2').switchButton({checked: true});
|
||||
$('#python2', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#vim')[0].checked) {
|
||||
$('#libsodium').switchButton({checked: true});
|
||||
$('#libsodium', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#borgbackup')[0].checked) {
|
||||
$('#python3').switchButton({checked: true});
|
||||
$('#python3', '.pkgvalue').val('yes');
|
||||
$('#python-setuptools').switchButton({checked: true});
|
||||
$('#python-setuptools', '.pkgvalue').val('yes');
|
||||
$('#llfuse').switchButton({checked: true});
|
||||
$('#llfuse', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#irssi')[0].checked) {
|
||||
$('#utf8proc').switchButton({checked: true});
|
||||
$('#utf8proc', '.pkgvalue').val('yes');
|
||||
try {
|
||||
if ($('#screen')[0].checked) {
|
||||
$('#utempter').switchButton({checked: true});
|
||||
$('#utempter', '.pkgvalue').val('yes');
|
||||
$('#ncurses-terminfo').switchButton({checked: true});
|
||||
$('#ncurses-terminfo', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#tmux')[0].checked) {
|
||||
$('#ncurses-terminfo').switchButton({checked: true});
|
||||
$('#ncurses-terminfo', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#expect')[0].checked) {
|
||||
$('#tcl').switchButton({checked: true});
|
||||
$('#tcl', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#iotop')[0].checked) {
|
||||
$('#python2').switchButton({checked: true});
|
||||
$('#python2', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#vim')[0].checked) {
|
||||
$('#libsodium').switchButton({checked: true});
|
||||
$('#libsodium', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#borgbackup')[0].checked) {
|
||||
$('#python3').switchButton({checked: true});
|
||||
$('#python3', '.pkgvalue').val('yes');
|
||||
$('#python-setuptools').switchButton({checked: true});
|
||||
$('#python-setuptools', '.pkgvalue').val('yes');
|
||||
$('#llfuse').switchButton({checked: true});
|
||||
$('#llfuse', '.pkgvalue').val('yes');
|
||||
}
|
||||
if ($('#irssi')[0].checked) {
|
||||
$('#utf8proc').switchButton({checked: true});
|
||||
$('#utf8proc', '.pkgvalue').val('yes');
|
||||
}
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
// expected output: ReferenceError: nonExistentFunction is not defined
|
||||
// Note - error messages will vary depending on browser
|
||||
}
|
||||
|
||||
}
|
|
@ -1,21 +0,0 @@
|
|||
#!/bin/bash
|
||||
DIR="$(dirname "$(readlink -f ${BASH_SOURCE[0]})")"
|
||||
tmpdir=/tmp/tmp.$(( $RANDOM * 19318203981230 + 40 ))
|
||||
plugin=$(basename ${DIR})
|
||||
archive="$(dirname $(dirname ${DIR}))/archive"
|
||||
version=$(date +"%Y.%m.%d")$1
|
||||
|
||||
mkdir -p $tmpdir
|
||||
|
||||
echo $tmpdir
|
||||
echo $archive
|
||||
echo "version $version"
|
||||
echo "version $1"
|
||||
|
||||
cp --parents -f $(find . -type f ! \( -iname "pkg_build.sh" -o -iname "sftp-config.json" \) ) $tmpdir/
|
||||
cd $tmpdir
|
||||
makepkg -l y -c y ${archive}/${plugin}-${version}-x86_64-1.txz
|
||||
rm -rf $tmpdir
|
||||
echo "MD5:"
|
||||
md5sum ${archive}/${plugin}-${version}-x86_64-1.txz
|
||||
md5sum ${archive}/${plugin}-${version}-x86_64-1.txz |awk '{print $1}'| while read line; do echo "$line ${plugin}-${version}-x86_64-1.txz"; done > ${archive}/${plugin}-${version}-x86_64-1.md5
|
|
@ -48,8 +48,8 @@ $argu = (array_key_exists("u", $args) || array_key_exists("uninstall", $args));
|
|||
$argv = (array_key_exists("v", $args) || array_key_exists("verbose", $args));
|
||||
$debug = array_key_exists("debug", $args);
|
||||
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdPack/include/DownloadHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdTools/include/NerdPackHelpers.php';
|
||||
require_once '/usr/local/emhttp/plugins/NerdTools/include/DownloadHelpers.php';
|
||||
|
||||
/* debug */
|
||||
function debug($m){
|
||||
|
@ -80,7 +80,7 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
|
|||
});
|
||||
|
||||
$pkg_gitname = array_values($pkg_matches)[0]['name'];
|
||||
$pkg_file = $pkg_extra.$pkg_gitname;
|
||||
$pkg_file = $pkg_extra_path.$pkg_gitname;
|
||||
$pkg_url = array_values($pkg_matches)[0]['download_url'];
|
||||
$pkg_sha1 = array_values($pkg_matches)[0]['sha'];
|
||||
|
||||
|
@ -120,7 +120,7 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
|
|||
|
||||
if (!$pkg_install_status) { // if package is not installed
|
||||
$pkg_msg = 'Installing';
|
||||
$pkg_cmd = 'upgradepkg --install-new '.$pkg_extra.$pkg_name.'* 2>&1';
|
||||
$pkg_cmd = 'upgradepkg --install-new '.$pkg_extra_path.$pkg_name.'* 2>&1';
|
||||
}
|
||||
|
||||
} elseif ($pkg_pref == 'no' && $pkg_download_status && $argu) {
|
||||
|
@ -128,7 +128,7 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
|
|||
logger("$pkg_name in use by another plugin, not uninstalled.",$argq);
|
||||
}else{
|
||||
$pkg_msg = 'Uninstalling and deleting';
|
||||
$pkg_cmd = 'removepkg '.$pkg_extra.$pkg_name.'* 2>&1; rm '.$pkg_extra.$pkg_name.'* 2>&1';
|
||||
$pkg_cmd = 'removepkg '.$pkg_extra_path.$pkg_name.'* 2>&1; rm '.$pkg_extra_path.$pkg_name.'* 2>&1';
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -155,7 +155,7 @@ foreach ($pkg_cfg as $pkg_name => $pkg_pref) { // get preferences for each packa
|
|||
}
|
||||
logger('Cleaning up packages...');
|
||||
|
||||
$cmd = "find ".$pkg_extra." -type f ! -name 'packages.json' ! -name 'packages-desc'".$pkg_find." -delete 2>&1";
|
||||
$cmd = "find ".$pkg_extra_path." -type f ! -name 'packages.json' ! -name 'packages-desc'".$pkg_find." -delete 2>&1";
|
||||
shell_exec($cmd);
|
||||
|
||||
logger('All packages processed...');
|
Loading…
Reference in New Issue
Block a user