diff --git a/emhttp/auth-request.php b/emhttp/auth-request.php
index 59f663118..4a82843a1 100644
--- a/emhttp/auth-request.php
+++ b/emhttp/auth-request.php
@@ -14,6 +14,10 @@ if (isset($_COOKIE[session_name()])) {
session_write_close();
}
+// Include JS caching functions
+require_once '/usr/local/emhttp/webGui/include/JSCache.php';
+
+// Base whitelist of files
$arrWhitelist = [
'/webGui/styles/clear-sans-bold-italic.eot',
'/webGui/styles/clear-sans-bold-italic.woff',
@@ -39,8 +43,15 @@ $arrWhitelist = [
'/webGui/images/case-model.png',
'/webGui/images/green-on.png',
'/webGui/images/red-on.png',
- '/webGui/images/yellow-on.png'
+ '/webGui/images/yellow-on.png',
+ '/webGui/images/UN-logotype-gradient.svg'
];
+
+// Add JS files from the unraid-components directory using cache
+$webComponentsDirectory = '/usr/local/emhttp/plugins/dynamix.my.servers/unraid-components/';
+$jsFiles = getCachedJSFiles($webComponentsDirectory);
+$arrWhitelist = array_merge($arrWhitelist, $jsFiles);
+
if (in_array(preg_replace(['/\?v=\d+$/','/\?\d+$/'],'',$_SERVER['REQUEST_URI']),$arrWhitelist)) {
// authorized
http_response_code(200);
diff --git a/emhttp/plugins/dynamix/LogViewer.page b/emhttp/plugins/dynamix/LogViewer.page
new file mode 100644
index 000000000..fb9eb150c
--- /dev/null
+++ b/emhttp/plugins/dynamix/LogViewer.page
@@ -0,0 +1,8 @@
+Menu="UNRAID-OS"
+Title="Log Viewer (new)"
+Icon="icon-log"
+Tag="list"
+---
+
+
+
\ No newline at end of file
diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout.php b/emhttp/plugins/dynamix/include/DefaultPageLayout.php
index 0bdf4ec2c..76b5d2931 100644
--- a/emhttp/plugins/dynamix/include/DefaultPageLayout.php
+++ b/emhttp/plugins/dynamix/include/DefaultPageLayout.php
@@ -28,22 +28,22 @@ $entity = $notify['entity'] & 1 == 1;
$alerts = '/tmp/plugins/my_alerts.txt';
$wlan0 = file_exists('/sys/class/net/wlan0');
-$safemode = _var($var,'safeMode')=='yes';
+$safemode = _var($var, 'safeMode') == 'yes';
$banner = "$config/webGui/banner.png";
$notes = '/var/tmp/unRAIDServer.txt';
if (!file_exists($notes)) {
- file_put_contents($notes, shell_exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin changes $docroot/plugins/unRAIDServer/unRAIDServer.plg"));
+ file_put_contents($notes, shell_exec("$docroot/plugins/dynamix.plugin.manager/scripts/plugin changes $docroot/plugins/unRAIDServer/unRAIDServer.plg"));
}
$taskPages = find_pages('Tasks');
$buttonPages = find_pages('Buttons');
$pages = []; // finds subpages
if (!empty($myPage['text'])) $pages[$myPage['name']] = $myPage;
-if (_var($myPage,'Type')=='xmenu') $pages = array_merge($pages, find_pages($myPage['name']));
+if (_var($myPage, 'Type') == 'xmenu') $pages = array_merge($pages, find_pages($myPage['name']));
// nchan related actions
-$nchan = ['webGui/nchan/notify_poller','webGui/nchan/session_check'];
+$nchan = ['webGui/nchan/notify_poller', 'webGui/nchan/session_check'];
if ($wlan0) $nchan[] = 'webGui/nchan/wlan0';
// build nchan scripts from found pages
$allPages = array_merge($taskPages, $buttonPages, $pages);
@@ -52,96 +52,94 @@ foreach ($allPages as $page) {
}
// act on nchan scripts
if (count($pages)) {
- $running = file_exists($nchan_pid) ? file($nchan_pid,FILE_IGNORE_NEW_LINES|FILE_SKIP_EMPTY_LINES) : [];
+ $running = file_exists($nchan_pid) ? file($nchan_pid, FILE_IGNORE_NEW_LINES | FILE_SKIP_EMPTY_LINES) : [];
$start = array_diff($nchan, $running); // returns any new scripts to be started
$stop = array_diff($running, $nchan); // returns any old scripts to be stopped
$running = array_merge($start, $running); // update list of current running nchan scripts
// start nchan scripts which are new
foreach ($start as $row) {
- $script = explode(':',$row)[0];
+ $script = explode(':', $row)[0];
exec("$docroot/$script &>/dev/null &");
}
// stop nchan scripts with the :stop option
foreach ($stop as $row) {
- [$script,$opt] = my_explode(':',$row);
+ [$script, $opt] = my_explode(':', $row);
if ($opt == 'stop') {
exec("pkill -f $docroot/$script &>/dev/null &");
- array_splice($running,array_search($row,$running),1);
+ array_splice($running, array_search($row, $running), 1);
}
}
- if (count($running)) file_put_contents($nchan_pid,implode("\n",$running)."\n"); else @unlink($nchan_pid);
+ if (count($running)) file_put_contents($nchan_pid, implode("\n", $running) . "\n");
+ else @unlink($nchan_pid);
}
?>
-lang="=strtok($locale, '_') ?: 'en'?>" class="= $themeHelper->getThemeHtmlClass() ?>">
+lang="= strtok($locale, '_') ?: 'en' ?>" class="= $themeHelper->getThemeHtmlClass() ?>">
+
-=_var($var, 'NAME')?>/=_var($myPage, 'name')?>
-
-
-
-
-
-
-
-
-">
-">
-">
-">
-">
-">
+ = _var($var, 'NAME') ?>/= _var($myPage, 'name') ?>
+
+
+
+
+
+
+
+
+ ">
+ ">
+ ">
+ ">
+ ">
+ ">
-">
-">
-">
-">
+ ">
+ ">
+ ">
+ ">
-
+ isSidebarTheme()) {
+ echo generate_sidebar_icon_css($taskPages, $buttonPages);
+ }
+ ?>
+
-
+
-
-
+
+
- require_once "$docroot/webGui/include/DefaultPageLayout/HeadInlineJS.php"; ?>
+ require_once "$docroot/webGui/include/DefaultPageLayout/HeadInlineJS.php"; ?>
+ ' . parse_text($button['text']));
+ }
-'.parse_text($button['text']));
-}
+ foreach ($pages as $page) {
+ annotate($page['file']);
+ includePageStylesheets($page);
+ }
+ ?>
-foreach ($pages as $page) {
- annotate($page['file']);
- includePageStylesheets($page);
-}
-?>
-
-
+ include "$docroot/plugins/dynamix.my.servers/include/myservers1.php" ?>
+ require_once "$docroot/webGui/include/DefaultPageLayout/GUIModeSessionFix.php"; ?>
+
include "$docroot/webGui/include/DefaultPageLayout/Header.php"; ?>
include "$docroot/webGui/include/DefaultPageLayout/Navigation/Main.php"; ?>
@@ -149,5 +147,7 @@ foreach ($pages as $page) {
include "$docroot/webGui/include/DefaultPageLayout/Footer.php"; ?>
include "$docroot/webGui/include/DefaultPageLayout/MiscElements.php"; ?>
include "$docroot/webGui/include/DefaultPageLayout/BodyInlineJS.php"; ?>
+ include "$docroot/webGui/include/DefaultPageLayout/ToastSetup.php"; ?>
-
+
+
\ No newline at end of file
diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php b/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php
index ae5f5eb67..be71c6f72 100644
--- a/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php
+++ b/emhttp/plugins/dynamix/include/DefaultPageLayout/BodyInlineJS.php
@@ -71,32 +71,7 @@ defaultPage.on('message', function(msg,meta) {
$('#statusbar').html(status);
break;
case 2:
- // notifications
- var bell1 = 0, bell2 = 0, bell3 = 0;
- $.each($.parseJSON(msg), function(i, notify){
- switch (notify.importance) {
- case 'alert' : bell1++; break;
- case 'warning': bell2++; break;
- case 'normal' : bell3++; break;
- }
-
- if (notify.show) {
- $.jGrowl(notify.subject+'
'+notify.description,{
- group: notify.importance,
- header: notify.event+': '+notify.timestamp,
- theme: notify.file,
- beforeOpen: function(e,m,o){if ($('div.jGrowl-notification').hasClass(notify.file)) return(false);},
- afterOpen: function(e,m,o){if (notify.link) $(e).css('cursor','pointer');},
- click: function(e,m,o){if (notify.link) location.replace(notify.link);},
- close: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'hide',file:"=$notify['path'].'/unread/'?>"+notify.file,csrf_token:csrf_token},function(){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file,csrf_token:csrf_token});});}
- });
- }
-
- });
- $('#bell').removeClass('red-orb yellow-orb green-orb').prop('title',"=_('Alerts')?> ["+bell1+']\n'+"=_('Warnings')?> ["+bell2+']\n'+"=_('Notices')?> ["+bell3+']');
- if (bell1) $('#bell').addClass('red-orb'); else
- if (bell2) $('#bell').addClass('yellow-orb'); else
- if (bell3) $('#bell').addClass('green-orb');
+ // notifications - moved to the Unraid API
break;
}
});
diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout/GUIModeSessionFix.php b/emhttp/plugins/dynamix/include/DefaultPageLayout/GUIModeSessionFix.php
new file mode 100644
index 000000000..516284e1e
--- /dev/null
+++ b/emhttp/plugins/dynamix/include/DefaultPageLayout/GUIModeSessionFix.php
@@ -0,0 +1,26 @@
+
\ No newline at end of file
diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout/HeadInlineJS.php b/emhttp/plugins/dynamix/include/DefaultPageLayout/HeadInlineJS.php
index 798d1fac5..f4f0b117c 100644
--- a/emhttp/plugins/dynamix/include/DefaultPageLayout/HeadInlineJS.php
+++ b/emhttp/plugins/dynamix/include/DefaultPageLayout/HeadInlineJS.php
@@ -477,32 +477,6 @@ function digits(number) {
return 'three';
}
-function openNotifier() {
- $.post('/webGui/include/Notify.php',{cmd:'get',csrf_token:csrf_token},function(msg) {
- $.each($.parseJSON(msg), function(i, notify){
- $.jGrowl(notify.subject+'
'+notify.description,{
- group: notify.importance,
- header: notify.event+': '+notify.timestamp,
- theme: notify.file,
- sticky: true,
- beforeOpen: function(e,m,o){if ($('div.jGrowl-notification').hasClass(notify.file)) return(false);},
- afterOpen: function(e,m,o){if (notify.link) $(e).css('cursor','pointer');},
- click: function(e,m,o){if (notify.link) location.replace(notify.link);},
- close: function(e,m,o){$.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file,csrf_token:csrf_token});}
- });
- });
- });
-}
-
-function closeNotifier() {
- $.post('/webGui/include/Notify.php',{cmd:'get',csrf_token:csrf_token},function(msg) {
- $.each($.parseJSON(msg), function(i, notify){
- $.post('/webGui/include/Notify.php',{cmd:'archive',file:notify.file,csrf_token:csrf_token});
- });
- $('div.jGrowl').find('div.jGrowl-close').trigger('click');
- });
-}
-
function viewHistory() {
location.replace('/Tools/NotificationsArchive');
}
@@ -536,17 +510,7 @@ $(function() {
}
$('#'+tab).attr('checked', true);
updateTime();
- $.jGrowl.defaults.closeTemplate = '';
- $.jGrowl.defaults.closerTemplate = '=$notify['position'][0]=='b' ? '':'
'?>[ =_("close all notifications")?> ]
';
- $.jGrowl.defaults.position = '=$notify['position']?>';
- $.jGrowl.defaults.theme = '';
- $.jGrowl.defaults.themeState = '';
- $.jGrowl.defaults.pool = 10;
- 0):?>
- $.jGrowl.defaults.life = =$notify['life']*1000?>;
-
- $.jGrowl.defaults.sticky = true;
-
+
Shadowbox.setup('a.sb-enable', {modal:true});
// add any pre-existing reboot notices
$.post('/webGui/include/Report.php',{cmd:'notice'},function(notices){
diff --git a/emhttp/plugins/dynamix/include/DefaultPageLayout/Header.php b/emhttp/plugins/dynamix/include/DefaultPageLayout/Header.php
index 4a33aef78..2bd197073 100644
--- a/emhttp/plugins/dynamix/include/DefaultPageLayout/Header.php
+++ b/emhttp/plugins/dynamix/include/DefaultPageLayout/Header.php
@@ -1,9 +1,5 @@
'),this.interval=setInterval(function(){var t=a(e).data("jGrowl.instance");if(void 0!==t)try{t.update()}catch(e){throw t.shutdown(),e}},parseInt(this.defaults.check,10))},shutdown:function(){try{a(this.element).removeClass("jGrowl").find(".jGrowl-notification").trigger("jGrowl.close").parent().empty()}catch(e){throw e}finally{clearInterval(this.interval)}},close:function(){a(this.element).find(".jGrowl-notification").each(function(){a(this).trigger("jGrowl.beforeClose")})}}),a.jGrowl.defaults=a.fn.jGrowl.prototype.defaults});
-
/* TableSorter - v2.31.3, copyright Rob Garrison LATEST */
!function(A){"use strict";var L=A.tablesorter={version:"2.31.3",parsers:[],widgets:[],defaults:{theme:"default",widthFixed:!1,showProcessing:!1,headerTemplate:"{content}",onRenderTemplate:null,onRenderHeader:null,cancelSelection:!0,tabIndex:!0,dateFormat:"mmddyyyy",sortMultiSortKey:"shiftKey",sortResetKey:"ctrlKey",usNumberFormat:!0,delayInit:!1,serverSideSorting:!1,resort:!0,headers:{},ignoreCase:!0,sortForce:null,sortList:[],sortAppend:null,sortStable:!1,sortInitialOrder:"asc",sortLocaleCompare:!1,sortReset:!1,sortRestart:!1,emptyTo:"bottom",stringTo:"max",duplicateSpan:!0,textExtraction:"basic",textAttribute:"data-text",textSorter:null,numberSorter:null,initWidgets:!0,widgetClass:"widget-{name}",widgets:[],widgetOptions:{zebra:["even","odd"]},initialized:null,tableClass:"",cssAsc:"",cssDesc:"",cssNone:"",cssHeader:"",cssHeaderRow:"",cssProcessing:"",cssChildRow:"tablesorter-childRow",cssInfoBlock:"tablesorter-infoOnly",cssNoSort:"tablesorter-noSort",cssIgnoreRow:"tablesorter-ignoreRow",cssIcon:"tablesorter-icon",cssIconNone:"",cssIconAsc:"",cssIconDesc:"",cssIconDisabled:"",pointerClick:"click",pointerDown:"mousedown",pointerUp:"mouseup",selectorHeaders:"> thead th, > thead td",selectorSort:"th, td",selectorRemove:".remove-me",debug:!1,headerList:[],empties:{},strings:{},parsers:[],globalize:0,imgAttr:0},css:{table:"tablesorter",cssHasChild:"tablesorter-hasChildRow",childRow:"tablesorter-childRow",colgroup:"tablesorter-colgroup",header:"tablesorter-header",headerRow:"tablesorter-headerRow",headerIn:"tablesorter-header-inner",icon:"tablesorter-icon",processing:"tablesorter-processing",sortAsc:"tablesorter-headerAsc",sortDesc:"tablesorter-headerDesc",sortNone:"tablesorter-headerUnSorted"},language:{sortAsc:"Ascending sort applied, ",sortDesc:"Descending sort applied, ",sortNone:"No sort applied, ",sortDisabled:"sorting is disabled",nextAsc:"activate to apply an ascending sort",nextDesc:"activate to apply a descending sort",nextNone:"activate to remove the sort"},regex:{templateContent:/\{content\}/g,templateIcon:/\{icon\}/g,templateName:/\{name\}/i,spaces:/\s+/g,nonWord:/\W/g,formElements:/(input|select|button|textarea)/i,chunk:/(^([+\-]?(?:\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)?)?$|^0x[0-9a-f]+$|\d+)/gi,chunks:/(^\\0|\\0$)/,hex:/^0x[0-9a-f]+$/i,comma:/,/g,digitNonUS:/[\s|\.]/g,digitNegativeTest:/^\s*\([.\d]+\)/,digitNegativeReplace:/^\s*\(([.\d]+)\)/,digitTest:/^[\-+(]?\d+[)]?$/,digitReplace:/[,.'"\s]/g},string:{max:1,min:-1,emptymin:1,emptymax:-1,zero:0,none:0,null:0,top:!0,bottom:!1},keyCodes:{enter:13},dates:{},instanceMethods:{},setup:function(t,r){var e,o,s,a;t&&t.tHead&&0!==t.tBodies.length&&!0!==t.hasInitialized?(e="",o=A(t),s=A.metadata,t.hasInitialized=!1,t.isProcessing=!0,t.config=r,A.data(t,"tablesorter",r),L.debug(r,"core")&&(console[console.group?"group":"log"]("Initializing tablesorter v"+L.version),A.data(t,"startoveralltimer",new Date)),r.supportsDataObject=((a=A.fn.jquery.split("."))[0]=parseInt(a[0],10),1
':"",i.$headers=A(A.map(i.$table.find(i.selectorHeaders),function(e,t){var r,o,s,a,n=A(e);if(!L.getClosest(n,"tr").hasClass(i.cssIgnoreRow))return/(th|td)/i.test(e.nodeName)||(a=L.getClosest(n,"th, td"),n.attr("data-column",a.attr("data-column"))),r=L.getColumnData(i.table,i.headers,t,!0),i.headerContent[t]=n.html(),""===i.headerTemplate||n.find("."+L.css.headerIn).length||(s=i.headerTemplate.replace(L.regex.templateContent,n.html()).replace(L.regex.templateIcon,n.find("."+L.css.icon).length?"":d),i.onRenderTemplate&&(o=i.onRenderTemplate.apply(n,[t,s]))&&"string"==typeof o&&(s=o),n.html('")),i.onRenderHeader&&i.onRenderHeader.apply(n,[t,i,i.$table]),s=parseInt(n.attr("data-column"),10),e.column=s,a=L.getOrder(L.getData(n,r,"sortInitialOrder")||i.sortInitialOrder),i.sortVars[s]={count:-1,order:a?i.sortReset?[1,0,2]:[1,0]:i.sortReset?[0,1,2]:[0,1],lockedOrder:!1,sortedBy:""},void 0!==(a=L.getData(n,r,"lockedOrder")||!1)&&!1!==a&&(i.sortVars[s].lockedOrder=!0,i.sortVars[s].order=L.getOrder(a)?[1,1]:[0,0]),i.headerList[t]=e,n.addClass(L.css.header+" "+i.cssHeader),L.getClosest(n,"tr").addClass(L.css.headerRow+" "+i.cssHeaderRow).attr("role","row"),i.tabIndex&&n.attr("tabindex",0),e})),i.$headerIndexed=[],r=0;r'),t=e.$table.width(),s=(o=e.$tbodies.find("tr:first").children(":visible")).length,a=0;a").css("width",r));e.$table.prepend(n)}},getData:function(e,t,r){var o,s="",a=A(e);return a.length?(o=!!A.metadata&&a.metadata(),e=" "+(a.attr("class")||""),void 0!==a.data(r)||void 0!==a.data(r.toLowerCase())?s+=a.data(r)||a.data(r.toLowerCase()):o&&void 0!==o[r]?s+=o[r]:t&&void 0!==t[r]?s+=t[r]:" "!==e&&e.match(" "+r+"-")&&(s=e.match(new RegExp("\\s"+r+"-([\\w-]+)"))[1]||""),A.trim(s)):""},getColumnData:function(e,t,r,o,s){if("object"!=typeof t||null===t)return t;var a,e=(e=A(e)[0]).config,s=s||e.$headers,n=e.$headerIndexed&&e.$headerIndexed[r]||s.find('[data-column="'+r+'"]:last');if(void 0!==t[r])return o?t[r]:t[s.index(n)];for(a in t)if("string"==typeof a&&n.filter(a).add(n.find(a)).length)return t[a]},isProcessing:function(e,t,r){var o=(e=A(e))[0].config,s=r||e.find("."+L.css.header);t?(void 0!==r&&0'),A.fn.detach?t.detach():t.remove();r=A(e).find("colgroup.tablesorter-savemyplace");t.insertAfter(r),r.remove(),e.isProcessing=!1},clearTableBody:function(e){A(e)[0].config.$tbodies.children().detach()},characterEquivalents:{a:"áàâãäąå",A:"ÁÀÂÃÄĄÅ",c:"çćč",C:"ÇĆČ",e:"éèêëěę",E:"ÉÈÊËĚĘ",i:"íìİîïı",I:"ÍÌİÎÏ",o:"óòôõöō",O:"ÓÒÔÕÖŌ",ss:"ß",SS:"ẞ",u:"úùûüů",U:"ÚÙÛÜŮ"},replaceAccents:function(e){var t,r="[",o=L.characterEquivalents;if(!L.characterRegex){for(t in L.characterRegexArray={},o)"string"==typeof t&&(r+=o[t],L.characterRegexArray[t]=new RegExp("["+o[t]+"]","g"));L.characterRegex=new RegExp(r+"]")}if(L.characterRegex.test(e))for(t in o)"string"==typeof t&&(e=e.replace(L.characterRegexArray[t],t));return e},validateOptions:function(e){var t,r,o,s,a="headers sortForce sortList sortAppend widgets".split(" "),n=e.originalSettings;if(n){for(t in L.debug(e,"core")&&(s=new Date),n)if("undefined"===(o=typeof L.defaults[t]))console.warn('Tablesorter Warning! "table.config.'+t+'" option not recognized');else if("object"===o)for(r in n[t])o=L.defaults[t]&&typeof L.defaults[t][r],A.inArray(t,a)<0&&"undefined"===o&&console.warn('Tablesorter Warning! "table.config.'+t+"."+r+'" option not recognized');L.debug(e,"core")&&console.log("validate options time:"+L.benchmark(s))}},restoreHeaders:function(e){for(var t,r=A(e)[0].config,o=r.$table.find(r.selectorHeaders),s=o.length,a=0;a tr").children("th, td"),!1===t&&0<=A.inArray("uitheme",s.widgets)&&(o.triggerHandler("applyWidgetId",["uitheme"]),o.triggerHandler("applyWidgetId",["zebra"])),a.find("tr").not(n).remove(),a="sortReset update updateRows updateAll updateHeaders updateCell addRows updateComplete sorton appendCache updateCache applyWidgetId applyWidgets refreshWidgets removeWidget destroy mouseup mouseleave "+"keypress sortBegin sortEnd resetToLoadState ".split(" ").join(s.namespace+" "),o.removeData("tablesorter").unbind(a.replace(L.regex.spaces," ")),s.$headers.add(i).removeClass([L.css.header,s.cssHeader,s.cssAsc,s.cssDesc,L.css.sortAsc,L.css.sortDesc,L.css.sortNone].join(" ")).removeAttr("data-column").removeAttr("aria-label").attr("aria-disabled","true"),n.find(s.selectorSort).unbind("mousedown mouseup keypress ".split(" ").join(s.namespace+" ").replace(L.regex.spaces," ")),L.restoreHeaders(e),o.toggleClass(L.css.table+" "+s.tableClass+" tablesorter-"+s.theme,!1===t),o.removeClass(s.namespace.slice(1)),e.hasInitialized=!1,delete e.config.cache,"function"==typeof r&&r(e),L.debug(s,"core")&&console.log("tablesorter has been removed"))}};A.fn.tablesorter=function(t){return this.each(function(){var e=A.extend(!0,{},L.defaults,t,L.instanceMethods);e.originalSettings=t,!this.hasInitialized&&L.buildTable&&"TABLE"!==this.nodeName?L.buildTable(this,e):L.setup(this,e)})},window.console&&window.console.log||(L.logs=[],console={},console.log=console.warn=console.error=console.table=function(){var e=1