From e0d2a6d689d25cefbeb81ad4dbf8074a868e7187 Mon Sep 17 00:00:00 2001 From: jsavargas Date: Thu, 29 Sep 2022 18:08:58 -0300 Subject: [PATCH] VERSION: 2022.09.29 - source code --- .../NerdPack/NerdPack.page => NerdTools.page} | 22 ++--- .../emhttp/plugins/NerdPack => }/README.md | 0 .../css/NerdPack.css => css/NerdTools.css} | 0 .../NerdPack => }/css/tablesorter-black.css | 0 .../NerdPack => }/css/tablesorter-white.css | 0 .../plugins/NerdPack => }/css/tablesorter.css | 0 .../NerdPack.png => images/NerdTools.png} | Bin .../NerdPack => }/include/ClearConfig.php | 0 .../NerdPack => }/include/DownloadHelpers.php | 0 .../NerdPack => }/include/NerdPackHelpers.php | 16 ++-- .../NerdPack => }/include/PackageQuery.php | 7 +- .../plugins/NerdTools/install/doinst.sh | 3 - .../plugins/NerdTools/install/slack-desc | 19 ----- .../jquery.NerdTools.js} | 79 ++++++++++-------- .../js/jquery.tablesorter.combined.min.js | 0 .../NerdPack => }/js/parser-metric.min.js | 0 .../emhttp/plugins/NerdTools/pkg_build.sh | 21 ----- .../NerdPack => }/scripts/packagemanager | 12 +-- 18 files changed, 74 insertions(+), 105 deletions(-) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack/NerdPack.page => NerdTools.page} (72%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/README.md (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack/css/NerdPack.css => css/NerdTools.css} (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/css/tablesorter-black.css (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/css/tablesorter-white.css (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/css/tablesorter.css (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack/images/NerdPack.png => images/NerdTools.png} (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/include/ClearConfig.php (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/include/DownloadHelpers.php (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/include/NerdPackHelpers.php (89%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/include/PackageQuery.php (95%) delete mode 100644 source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/doinst.sh delete mode 100644 source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/slack-desc rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack/js/jquery.NerdPack.js => js/jquery.NerdTools.js} (75%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/js/jquery.tablesorter.combined.min.js (100%) rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/js/parser-metric.min.js (100%) delete mode 100755 source/NerdTools/usr/local/emhttp/plugins/NerdTools/pkg_build.sh rename source/NerdTools/usr/local/emhttp/plugins/NerdTools/{usr/local/emhttp/plugins/NerdPack => }/scripts/packagemanager (91%) mode change 100755 => 100644 diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/NerdPack.page b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/NerdTools.page similarity index 72% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/NerdPack.page rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/NerdTools.page index 0b1b1ff..d64b4bc 100644 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/NerdPack.page +++ b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/NerdTools.page @@ -1,12 +1,12 @@ -Icon="dropbox" +Icon="cog" Menu="UserPreferences" Title="NerdTools" -Tag="dropbox" +Tag="cog" --- - - + + - +
- +
@@ -29,7 +29,7 @@ table.tablesorter tbody tr:nth-child(even) { - + @@ -38,10 +38,10 @@ table.tablesorter tbody tr:nth-child(even) { : - + - - + + - \ No newline at end of file + \ No newline at end of file diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/README.md b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/README.md similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/README.md rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/README.md diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/NerdPack.css b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/NerdTools.css similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/NerdPack.css rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/NerdTools.css diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/tablesorter-black.css b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/tablesorter-black.css similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/tablesorter-black.css rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/tablesorter-black.css diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/tablesorter-white.css b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/tablesorter-white.css similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/tablesorter-white.css rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/tablesorter-white.css diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/tablesorter.css b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/tablesorter.css similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/css/tablesorter.css rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/css/tablesorter.css diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/images/NerdPack.png b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/images/NerdTools.png similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/images/NerdPack.png rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/images/NerdTools.png diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/ClearConfig.php b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/ClearConfig.php similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/ClearConfig.php rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/ClearConfig.php diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/DownloadHelpers.php b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/DownloadHelpers.php similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/DownloadHelpers.php rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/DownloadHelpers.php diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdPackHelpers.php similarity index 89% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdPackHelpers.php index b95c97d..c6aa827 100644 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/include/NerdPackHelpers.php +++ b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/include/NerdPackHelpers.php @@ -1,21 +1,23 @@ $pkgs_array, 'empty' => empty($pkgs_downloaded) diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/doinst.sh b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/doinst.sh deleted file mode 100644 index 6d0ebe2..0000000 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/doinst.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/sh -ln -sf /usr/local/emhttp/plugins/NerdPack/scripts/packagemanager /usr/sbin/packagemanager -chmod +0755 /usr/sbin/packagemanager diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/slack-desc b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/slack-desc deleted file mode 100644 index a6fe468..0000000 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/install/slack-desc +++ /dev/null @@ -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: diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/jquery.NerdPack.js b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/jquery.NerdTools.js similarity index 75% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/jquery.NerdPack.js rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/jquery.NerdTools.js index cb67ba0..c075ac2 100644 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/jquery.NerdPack.js +++ b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/jquery.NerdTools.js @@ -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(""); - $.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 } + } diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/jquery.tablesorter.combined.min.js b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/jquery.tablesorter.combined.min.js similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/jquery.tablesorter.combined.min.js rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/jquery.tablesorter.combined.min.js diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/parser-metric.min.js b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/parser-metric.min.js similarity index 100% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/js/parser-metric.min.js rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/js/parser-metric.min.js diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/pkg_build.sh b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/pkg_build.sh deleted file mode 100755 index aa7d4cf..0000000 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/pkg_build.sh +++ /dev/null @@ -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 \ No newline at end of file diff --git a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/scripts/packagemanager b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/scripts/packagemanager old mode 100755 new mode 100644 similarity index 91% rename from source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/scripts/packagemanager rename to source/NerdTools/usr/local/emhttp/plugins/NerdTools/scripts/packagemanager index ab505de..761e9d6 --- a/source/NerdTools/usr/local/emhttp/plugins/NerdTools/usr/local/emhttp/plugins/NerdPack/scripts/packagemanager +++ b/source/NerdTools/usr/local/emhttp/plugins/NerdTools/scripts/packagemanager @@ -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...');
Downloaded Installed Plugins Installed

Please wait, retrieving plugin information ...