mirror of
https://github.com/unraid/api.git
synced 2025-12-31 13:39:52 -06:00
feat: fix docusaurus build + update snapshot
This commit is contained in:
2
.github/workflows/create-docusaurus-pr.yml
vendored
2
.github/workflows/create-docusaurus-pr.yml
vendored
@@ -1,5 +1,3 @@
|
||||
name: Update API Documentation
|
||||
|
||||
name: Update API Documentation
|
||||
on:
|
||||
push:
|
||||
|
||||
@@ -1 +1 @@
|
||||
1738683073575
|
||||
1739303188175
|
||||
@@ -20,6 +20,7 @@ $themes2 = in_array($theme,['gray','azure']);
|
||||
$config = "/boot/config";
|
||||
$entity = $notify['entity'] & 1 == 1;
|
||||
$alerts = '/tmp/plugins/my_alerts.txt';
|
||||
$wlan0 = file_exists('/sys/class/net/wlan0');
|
||||
|
||||
// adjust the text color in docker log window
|
||||
$fgcolor = in_array($theme,['white','azure']) ? '#1c1c1c' : '#f2f2f2';
|
||||
@@ -77,6 +78,7 @@ html{font-size:<?=$display['font']?>%}
|
||||
<?endif;?>
|
||||
<?
|
||||
$nchan = ['webGui/nchan/notify_poller','webGui/nchan/session_check'];
|
||||
if ($wlan0) $nchan[] = 'webGui/nchan/wlan0';
|
||||
$safemode = _var($var,'safeMode')=='yes';
|
||||
$tasks = find_pages('Tasks');
|
||||
$buttons = find_pages('Buttons');
|
||||
@@ -252,7 +254,7 @@ function openWindow(cmd,title,height,width) {
|
||||
}
|
||||
function openTerminal(tag,name,more) {
|
||||
if (/MSIE|Edge/.test(navigator.userAgent)) {
|
||||
swal({title:"_(Unsupported Feature)_",text:"_(Sorry, this feature is not supported by MSIE/Edge)_.<br>_(Please try a different browser)_",type:'error',html:true,confirmButtonText:"_(Ok)_"});
|
||||
swal({title:"_(Unsupported Feature)_",text:"_(Sorry, this feature is not supported by MSIE/Edge)_.<br>_(Please try a different browser)_",type:'error',html:true,animation:'none',confirmButtonText:"_(Ok)_"});
|
||||
return;
|
||||
}
|
||||
// open terminal window (run in background)
|
||||
@@ -409,7 +411,7 @@ function openDone(data) {
|
||||
if (data == '_DONE_') {
|
||||
$('div.spinner.fixed').hide();
|
||||
$('button.confirm').text("<?=_('Done')?>").prop('disabled',false).show();
|
||||
if ( typeof ca_done_override !== 'undefined' ) {
|
||||
if (typeof ca_done_override !== 'undefined') {
|
||||
if (ca_done_override == true) {
|
||||
$("button.confirm").trigger("click");
|
||||
ca_done_override = false;
|
||||
@@ -529,7 +531,7 @@ function hideUpgrade(set) { /** @note can likely be removed, not used in webgui
|
||||
}
|
||||
function confirmUpgrade(confirm) {
|
||||
if (confirm) {
|
||||
swal({title:"<?=_('Update')?> Unraid OS",text:"<?=_('Do you want to update to the new version')?>?",type:'warning',html:true,showCancelButton:true,closeOnConfirm:false,confirmButtonText:"<?=_('Proceed')?>",cancelButtonText:"<?=_('Cancel')?>"},function(){
|
||||
swal({title:"<?=_('Update')?> Unraid OS",text:"<?=_('Do you want to update to the new version')?>?",type:'warning',html:true,animation:'none',showCancelButton:true,closeOnConfirm:false,confirmButtonText:"<?=_('Proceed')?>",cancelButtonText:"<?=_('Cancel')?>"},function(){
|
||||
openPlugin("plugin update unRAIDServer.plg","<?=_('Update')?> Unraid OS");
|
||||
});
|
||||
} else {
|
||||
@@ -654,6 +656,7 @@ $.ajaxPrefilter(function(s, orig, xhr){
|
||||
</div>
|
||||
<?include "$docroot/plugins/dynamix.my.servers/include/myservers2.php"?>
|
||||
</div>
|
||||
<a href="#" class="move_to_end" title="<?=_('Move To End')?>"><i class="fa fa-arrow-circle-down"></i></a>
|
||||
<a href="#" class="back_to_top" title="<?=_('Back To Top')?>"><i class="fa fa-arrow-circle-up"></i></a>
|
||||
<?
|
||||
// Build page menus
|
||||
@@ -720,7 +723,7 @@ if (isset($myPage['Load']) && $myPage['Load']>0) echo "\n<script>timers.reload =
|
||||
echo "<div class='tabs'>";
|
||||
$tab = 1;
|
||||
$pages = [];
|
||||
if (!empty($myPage['text']) && page_enabled($myPage)) $pages[$myPage['name']] = $myPage;
|
||||
if (!empty($myPage['text'])) $pages[$myPage['name']] = $myPage;
|
||||
if (_var($myPage,'Type')=='xmenu') $pages = array_merge($pages, find_pages($myPage['name']));
|
||||
if (isset($myPage['Tabs'])) $display['tabs'] = strtolower($myPage['Tabs'])=='true' ? 0 : 1;
|
||||
$tabbed = $display['tabs']==0 && count($pages)>1;
|
||||
@@ -728,7 +731,7 @@ $tabbed = $display['tabs']==0 && count($pages)>1;
|
||||
foreach ($pages as $page) {
|
||||
$close = false;
|
||||
if (isset($page['Title'])) {
|
||||
eval("\$title=\"{$page['Title']}\";");
|
||||
eval("\$title=\"".htmlspecialchars($page['Title'])."\";");
|
||||
if ($tabbed) {
|
||||
echo "<div class='tab'><input type='radio' id='tab{$tab}' name='tabs' onclick='settab(this.id)'><label for='tab{$tab}'>";
|
||||
echo tab_title($title,$page['root'],_var($page,'Tag',false));
|
||||
@@ -745,7 +748,7 @@ foreach ($pages as $page) {
|
||||
if (isset($page['Type']) && $page['Type']=='menu') {
|
||||
$pgs = find_pages($page['name']);
|
||||
foreach ($pgs as $pg) {
|
||||
@eval("\$title=\"{$pg['Title']}\";");
|
||||
@eval("\$title=\"".htmlspecialchars($pg['Title'])."\";");
|
||||
$icon = _var($pg,'Icon',"<i class='icon-app PanelIcon'></i>");
|
||||
if (substr($icon,-4)=='.png') {
|
||||
$root = $pg['root'];
|
||||
@@ -820,6 +823,7 @@ default:
|
||||
echo "<span class='green strong'><i class='fa fa-play-circle'></i> ",_('Array Started'),"</span>$progress"; break;
|
||||
}
|
||||
echo "</span></span><span id='countdown'></span><span id='user-notice' class='red-text'></span>";
|
||||
if ($wlan0) echo "<span id='wlan0' class='grey-text' onclick='wlanSettings()'><i class='fa fa-wifi fa-fw'></i></span>";
|
||||
echo "<span id='copyright'>Unraid® webGui ©2024, Lime Technology, Inc.";
|
||||
echo " <a href='https://docs.unraid.net/go/manual/' target='_blank' title=\""._('Online manual')."\"><i class='fa fa-book'></i> "._('manual')."</a>";
|
||||
echo "</span></div>";
|
||||
@@ -923,6 +927,20 @@ defaultPage.on('message', function(msg,meta) {
|
||||
}
|
||||
});
|
||||
|
||||
<?if ($wlan0):?>
|
||||
function wlanSettings() {
|
||||
$.cookie('one','tab<?=count(glob("$docroot/webGui/Eth*.page"))?>');
|
||||
window.location = '/Settings/NetworkSettings';
|
||||
}
|
||||
|
||||
var nchan_wlan0 = new NchanSubscriber('/sub/wlan0',{subscriber:'websocket'});
|
||||
nchan_wlan0.on('message', function(msg) {
|
||||
var wlan = JSON.parse(msg);
|
||||
$('#wlan0').removeClass().addClass(wlan.color).attr('title',wlan.title);
|
||||
});
|
||||
nchan_wlan0.start();
|
||||
<?endif;?>
|
||||
|
||||
var nchan_plugins = new NchanSubscriber('/sub/plugins',{subscriber:'websocket'});
|
||||
nchan_plugins.on('message', function(data) {
|
||||
if (!data || openDone(data)) return;
|
||||
@@ -1034,13 +1052,12 @@ nchan_vmaction.on('message', function(data) {
|
||||
box.scrollTop(box[0].scrollHeight);
|
||||
});
|
||||
|
||||
var backtotopoffset = 250;
|
||||
var backtotopduration = 500;
|
||||
const scrollDuration = 500;
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > backtotopoffset) {
|
||||
$('.back_to_top').fadeIn(backtotopduration);
|
||||
if ($(this).scrollTop() > 0) {
|
||||
$('.back_to_top').fadeIn(scrollDuration);
|
||||
} else {
|
||||
$('.back_to_top').fadeOut(backtotopduration);
|
||||
$('.back_to_top').fadeOut(scrollDuration);
|
||||
}
|
||||
<?if ($themes1):?>
|
||||
var top = $('div#header').height()-1; // header height has 1 extra pixel to cover overlap
|
||||
@@ -1049,9 +1066,16 @@ $(window).scroll(function() {
|
||||
$('div.upgrade_notice').css($(this).scrollTop() > 24 ? {position:'fixed',top:'0'} : {position:'absolute',top:'24px'});
|
||||
<?endif;?>
|
||||
});
|
||||
|
||||
$('.move_to_end').click(function(event) {
|
||||
event.preventDefault();
|
||||
$('html,body').animate({scrollTop:$(document).height()},scrollDuration);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.back_to_top').click(function(event) {
|
||||
event.preventDefault();
|
||||
$('html,body').animate({scrollTop:0},backtotopduration);
|
||||
$('html,body').animate({scrollTop:0},scrollDuration);
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1128,6 +1152,7 @@ $(function() {
|
||||
});
|
||||
}
|
||||
$('form').append($('<input>').attr({type:'hidden', name:'csrf_token', value:csrf_token}));
|
||||
setInterval(function(){if ($(document).height() > $(window).height()) $('.move_to_end').fadeIn(scrollDuration); else $('.move_to_end').fadeOut(scrollDuration);},250);
|
||||
});
|
||||
|
||||
var gui_pages_available = [];
|
||||
@@ -1147,56 +1172,45 @@ function isValidURL(url) {
|
||||
}
|
||||
}
|
||||
|
||||
$('body').on("click","a,.ca_href", function(e) {
|
||||
if ($(this).hasClass("ca_href") ) {
|
||||
$('body').on('click','a,.ca_href', function(e) {
|
||||
if ($(this).hasClass('ca_href')) {
|
||||
var ca_href = true;
|
||||
var href=$(this).attr("data-href");
|
||||
var target=$(this).attr("data-target");
|
||||
var href=$(this).attr('data-href');
|
||||
var target=$(this).attr('data-target');
|
||||
} else {
|
||||
var ca_href = false;
|
||||
var href = $(this).attr("href");
|
||||
var target = $(this).attr("target");
|
||||
var href = $(this).attr('href');
|
||||
var target = $(this).attr('target');
|
||||
}
|
||||
if ( href ) {
|
||||
if (href) {
|
||||
href = href.trim();
|
||||
if ( href.match('https?://[^\.]*.(my)?unraid.net/') || href.indexOf("https://unraid.net/") == 0 || href == "https://unraid.net" || href.indexOf("http://lime-technology.com") == 0) {
|
||||
if ( ca_href ) {
|
||||
window.open(href,target);
|
||||
}
|
||||
// Sanitize href to prevent XSS
|
||||
href = href.replace(/[<>"]/g, '');
|
||||
if (href.match('https?://[^\.]*.(my)?unraid.net/') || href.indexOf('https://unraid.net/') == 0 || href == 'https://unraid.net' || href.indexOf('http://lime-technology.com') == 0) {
|
||||
if (ca_href) window.open(href,target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (href !== "#" && href.indexOf("javascript") !== 0) {
|
||||
}
|
||||
if (href !== '#' && href.indexOf('javascript') !== 0) {
|
||||
var dom = isValidURL(href);
|
||||
if ( dom == false ) {
|
||||
if ( href.indexOf("/") == 0 ) { // all internal links start with "/"
|
||||
return;
|
||||
if (dom == false) {
|
||||
if (href.indexOf('/') == 0) return; // all internal links start with "/"
|
||||
var baseURLpage = href.split('/');
|
||||
if (gui_pages_available.includes(baseURLpage[0])) return;
|
||||
}
|
||||
var baseURLpage = href.split("/");
|
||||
if ( gui_pages_available.includes(baseURLpage[0]) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( $(this).hasClass("localURL") ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(this).hasClass('localURL')) return;
|
||||
try {
|
||||
var domainsAllowed = JSON.parse($.cookie("allowedDomains"));
|
||||
var domainsAllowed = JSON.parse($.cookie('allowedDomains'));
|
||||
} catch(e) {
|
||||
var domainsAllowed = new Object();
|
||||
}
|
||||
$.cookie("allowedDomains",JSON.stringify(domainsAllowed),{expires:3650}); // rewrite cookie to further extend expiration by 400 days
|
||||
|
||||
if ( domainsAllowed[dom.hostname] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.cookie('allowedDomains',JSON.stringify(domainsAllowed),{expires:3650}); // rewrite cookie to further extend expiration by 400 days
|
||||
if (domainsAllowed[dom.hostname]) return;
|
||||
e.preventDefault();
|
||||
swal({
|
||||
title: "<?=_('External Link')?>",
|
||||
text: "<span title='"+href+"'><?=_('Clicking OK will take you to a 3rd party website not associated with Lime Technology')?><br><br><b>"+href+"<br><br><input id='Link_Always_Allow' type='checkbox'></input><?=_('Always Allow')?> "+dom.hostname+"</span>",
|
||||
html: true,
|
||||
animation: 'none',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
@@ -1204,16 +1218,14 @@ $('body').on("click","a,.ca_href", function(e) {
|
||||
confirmButtonText: "<?=_('OK')?>"
|
||||
},function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
if ( $("#Link_Always_Allow").is(":checked") ) {
|
||||
if ($('#Link_Always_Allow').is(':checked')) {
|
||||
domainsAllowed[dom.hostname] = true;
|
||||
$.cookie("allowedDomains",JSON.stringify(domainsAllowed),{expires:3650});
|
||||
$.cookie('allowedDomains',JSON.stringify(domainsAllowed),{expires:3650});
|
||||
}
|
||||
var popupOpen = window.open(href,target);
|
||||
if ( !popupOpen || popupOpen.closed || typeof popupOpen == "undefined" ) {
|
||||
var popupWarning = addBannerWarning("<?=_('Popup Blocked.');?>");
|
||||
setTimeout(function() {
|
||||
removeBannerWarning(popupWarning);}
|
||||
,10000);
|
||||
if (!popupOpen || popupOpen.closed || typeof popupOpen == 'undefined') {
|
||||
var popupWarning = addBannerWarning("<?=_('Popup Blocked');?>");
|
||||
setTimeout(function(){removeBannerWarning(popupWarning);},10000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -1 +1 @@
|
||||
1738681678475
|
||||
1739303187535
|
||||
@@ -1 +1 @@
|
||||
1738681678771
|
||||
1739303187849
|
||||
@@ -1 +1 @@
|
||||
1738681679144
|
||||
1739303188587
|
||||
@@ -20,6 +20,7 @@ $themes2 = in_array($theme,['gray','azure']);
|
||||
$config = "/boot/config";
|
||||
$entity = $notify['entity'] & 1 == 1;
|
||||
$alerts = '/tmp/plugins/my_alerts.txt';
|
||||
$wlan0 = file_exists('/sys/class/net/wlan0');
|
||||
|
||||
// adjust the text color in docker log window
|
||||
$fgcolor = in_array($theme,['white','azure']) ? '#1c1c1c' : '#f2f2f2';
|
||||
@@ -77,6 +78,7 @@ html{font-size:<?=$display['font']?>%}
|
||||
<?endif;?>
|
||||
<?
|
||||
$nchan = ['webGui/nchan/notify_poller','webGui/nchan/session_check'];
|
||||
if ($wlan0) $nchan[] = 'webGui/nchan/wlan0';
|
||||
$safemode = _var($var,'safeMode')=='yes';
|
||||
$tasks = find_pages('Tasks');
|
||||
$buttons = find_pages('Buttons');
|
||||
@@ -252,7 +254,7 @@ function openWindow(cmd,title,height,width) {
|
||||
}
|
||||
function openTerminal(tag,name,more) {
|
||||
if (/MSIE|Edge/.test(navigator.userAgent)) {
|
||||
swal({title:"_(Unsupported Feature)_",text:"_(Sorry, this feature is not supported by MSIE/Edge)_.<br>_(Please try a different browser)_",type:'error',html:true,confirmButtonText:"_(Ok)_"});
|
||||
swal({title:"_(Unsupported Feature)_",text:"_(Sorry, this feature is not supported by MSIE/Edge)_.<br>_(Please try a different browser)_",type:'error',html:true,animation:'none',confirmButtonText:"_(Ok)_"});
|
||||
return;
|
||||
}
|
||||
// open terminal window (run in background)
|
||||
@@ -409,7 +411,7 @@ function openDone(data) {
|
||||
if (data == '_DONE_') {
|
||||
$('div.spinner.fixed').hide();
|
||||
$('button.confirm').text("<?=_('Done')?>").prop('disabled',false).show();
|
||||
if ( typeof ca_done_override !== 'undefined' ) {
|
||||
if (typeof ca_done_override !== 'undefined') {
|
||||
if (ca_done_override == true) {
|
||||
$("button.confirm").trigger("click");
|
||||
ca_done_override = false;
|
||||
@@ -529,7 +531,7 @@ function hideUpgrade(set) { /** @note can likely be removed, not used in webgui
|
||||
}
|
||||
function confirmUpgrade(confirm) {
|
||||
if (confirm) {
|
||||
swal({title:"<?=_('Update')?> Unraid OS",text:"<?=_('Do you want to update to the new version')?>?",type:'warning',html:true,showCancelButton:true,closeOnConfirm:false,confirmButtonText:"<?=_('Proceed')?>",cancelButtonText:"<?=_('Cancel')?>"},function(){
|
||||
swal({title:"<?=_('Update')?> Unraid OS",text:"<?=_('Do you want to update to the new version')?>?",type:'warning',html:true,animation:'none',showCancelButton:true,closeOnConfirm:false,confirmButtonText:"<?=_('Proceed')?>",cancelButtonText:"<?=_('Cancel')?>"},function(){
|
||||
openPlugin("plugin update unRAIDServer.plg","<?=_('Update')?> Unraid OS");
|
||||
});
|
||||
} else {
|
||||
@@ -645,6 +647,7 @@ $.ajaxPrefilter(function(s, orig, xhr){
|
||||
</div>
|
||||
<?include "$docroot/plugins/dynamix.my.servers/include/myservers2.php"?>
|
||||
</div>
|
||||
<a href="#" class="move_to_end" title="<?=_('Move To End')?>"><i class="fa fa-arrow-circle-down"></i></a>
|
||||
<a href="#" class="back_to_top" title="<?=_('Back To Top')?>"><i class="fa fa-arrow-circle-up"></i></a>
|
||||
<?
|
||||
// Build page menus
|
||||
@@ -711,7 +714,7 @@ if (isset($myPage['Load']) && $myPage['Load']>0) echo "\n<script>timers.reload =
|
||||
echo "<div class='tabs'>";
|
||||
$tab = 1;
|
||||
$pages = [];
|
||||
if (!empty($myPage['text']) && page_enabled($myPage)) $pages[$myPage['name']] = $myPage;
|
||||
if (!empty($myPage['text'])) $pages[$myPage['name']] = $myPage;
|
||||
if (_var($myPage,'Type')=='xmenu') $pages = array_merge($pages, find_pages($myPage['name']));
|
||||
if (isset($myPage['Tabs'])) $display['tabs'] = strtolower($myPage['Tabs'])=='true' ? 0 : 1;
|
||||
$tabbed = $display['tabs']==0 && count($pages)>1;
|
||||
@@ -719,7 +722,7 @@ $tabbed = $display['tabs']==0 && count($pages)>1;
|
||||
foreach ($pages as $page) {
|
||||
$close = false;
|
||||
if (isset($page['Title'])) {
|
||||
eval("\$title=\"{$page['Title']}\";");
|
||||
eval("\$title=\"".htmlspecialchars($page['Title'])."\";");
|
||||
if ($tabbed) {
|
||||
echo "<div class='tab'><input type='radio' id='tab{$tab}' name='tabs' onclick='settab(this.id)'><label for='tab{$tab}'>";
|
||||
echo tab_title($title,$page['root'],_var($page,'Tag',false));
|
||||
@@ -736,7 +739,7 @@ foreach ($pages as $page) {
|
||||
if (isset($page['Type']) && $page['Type']=='menu') {
|
||||
$pgs = find_pages($page['name']);
|
||||
foreach ($pgs as $pg) {
|
||||
@eval("\$title=\"{$pg['Title']}\";");
|
||||
@eval("\$title=\"".htmlspecialchars($pg['Title'])."\";");
|
||||
$icon = _var($pg,'Icon',"<i class='icon-app PanelIcon'></i>");
|
||||
if (substr($icon,-4)=='.png') {
|
||||
$root = $pg['root'];
|
||||
@@ -811,6 +814,7 @@ default:
|
||||
echo "<span class='green strong'><i class='fa fa-play-circle'></i> ",_('Array Started'),"</span>$progress"; break;
|
||||
}
|
||||
echo "</span></span><span id='countdown'></span><span id='user-notice' class='red-text'></span>";
|
||||
if ($wlan0) echo "<span id='wlan0' class='grey-text' onclick='wlanSettings()'><i class='fa fa-wifi fa-fw'></i></span>";
|
||||
echo "<span id='copyright'>Unraid® webGui ©2024, Lime Technology, Inc.";
|
||||
echo " <a href='https://docs.unraid.net/go/manual/' target='_blank' title=\""._('Online manual')."\"><i class='fa fa-book'></i> "._('manual')."</a>";
|
||||
echo "</span></div>";
|
||||
@@ -906,6 +910,20 @@ defaultPage.on('message', function(msg,meta) {
|
||||
}
|
||||
});
|
||||
|
||||
<?if ($wlan0):?>
|
||||
function wlanSettings() {
|
||||
$.cookie('one','tab<?=count(glob("$docroot/webGui/Eth*.page"))?>');
|
||||
window.location = '/Settings/NetworkSettings';
|
||||
}
|
||||
|
||||
var nchan_wlan0 = new NchanSubscriber('/sub/wlan0',{subscriber:'websocket'});
|
||||
nchan_wlan0.on('message', function(msg) {
|
||||
var wlan = JSON.parse(msg);
|
||||
$('#wlan0').removeClass().addClass(wlan.color).attr('title',wlan.title);
|
||||
});
|
||||
nchan_wlan0.start();
|
||||
<?endif;?>
|
||||
|
||||
var nchan_plugins = new NchanSubscriber('/sub/plugins',{subscriber:'websocket'});
|
||||
nchan_plugins.on('message', function(data) {
|
||||
if (!data || openDone(data)) return;
|
||||
@@ -1017,13 +1035,12 @@ nchan_vmaction.on('message', function(data) {
|
||||
box.scrollTop(box[0].scrollHeight);
|
||||
});
|
||||
|
||||
var backtotopoffset = 250;
|
||||
var backtotopduration = 500;
|
||||
const scrollDuration = 500;
|
||||
$(window).scroll(function() {
|
||||
if ($(this).scrollTop() > backtotopoffset) {
|
||||
$('.back_to_top').fadeIn(backtotopduration);
|
||||
if ($(this).scrollTop() > 0) {
|
||||
$('.back_to_top').fadeIn(scrollDuration);
|
||||
} else {
|
||||
$('.back_to_top').fadeOut(backtotopduration);
|
||||
$('.back_to_top').fadeOut(scrollDuration);
|
||||
}
|
||||
<?if ($themes1):?>
|
||||
var top = $('div#header').height()-1; // header height has 1 extra pixel to cover overlap
|
||||
@@ -1032,9 +1049,16 @@ $(window).scroll(function() {
|
||||
$('div.upgrade_notice').css($(this).scrollTop() > 24 ? {position:'fixed',top:'0'} : {position:'absolute',top:'24px'});
|
||||
<?endif;?>
|
||||
});
|
||||
|
||||
$('.move_to_end').click(function(event) {
|
||||
event.preventDefault();
|
||||
$('html,body').animate({scrollTop:$(document).height()},scrollDuration);
|
||||
return false;
|
||||
});
|
||||
|
||||
$('.back_to_top').click(function(event) {
|
||||
event.preventDefault();
|
||||
$('html,body').animate({scrollTop:0},backtotopduration);
|
||||
$('html,body').animate({scrollTop:0},scrollDuration);
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1111,6 +1135,7 @@ $(function() {
|
||||
});
|
||||
}
|
||||
$('form').append($('<input>').attr({type:'hidden', name:'csrf_token', value:csrf_token}));
|
||||
setInterval(function(){if ($(document).height() > $(window).height()) $('.move_to_end').fadeIn(scrollDuration); else $('.move_to_end').fadeOut(scrollDuration);},250);
|
||||
});
|
||||
|
||||
var gui_pages_available = [];
|
||||
@@ -1130,56 +1155,45 @@ function isValidURL(url) {
|
||||
}
|
||||
}
|
||||
|
||||
$('body').on("click","a,.ca_href", function(e) {
|
||||
if ($(this).hasClass("ca_href") ) {
|
||||
$('body').on('click','a,.ca_href', function(e) {
|
||||
if ($(this).hasClass('ca_href')) {
|
||||
var ca_href = true;
|
||||
var href=$(this).attr("data-href");
|
||||
var target=$(this).attr("data-target");
|
||||
var href=$(this).attr('data-href');
|
||||
var target=$(this).attr('data-target');
|
||||
} else {
|
||||
var ca_href = false;
|
||||
var href = $(this).attr("href");
|
||||
var target = $(this).attr("target");
|
||||
var href = $(this).attr('href');
|
||||
var target = $(this).attr('target');
|
||||
}
|
||||
if ( href ) {
|
||||
if (href) {
|
||||
href = href.trim();
|
||||
if ( href.match('https?://[^\.]*.(my)?unraid.net/') || href.indexOf("https://unraid.net/") == 0 || href == "https://unraid.net" || href.indexOf("http://lime-technology.com") == 0) {
|
||||
if ( ca_href ) {
|
||||
window.open(href,target);
|
||||
}
|
||||
// Sanitize href to prevent XSS
|
||||
href = href.replace(/[<>"]/g, '');
|
||||
if (href.match('https?://[^\.]*.(my)?unraid.net/') || href.indexOf('https://unraid.net/') == 0 || href == 'https://unraid.net' || href.indexOf('http://lime-technology.com') == 0) {
|
||||
if (ca_href) window.open(href,target);
|
||||
return;
|
||||
}
|
||||
|
||||
if (href !== "#" && href.indexOf("javascript") !== 0) {
|
||||
}
|
||||
if (href !== '#' && href.indexOf('javascript') !== 0) {
|
||||
var dom = isValidURL(href);
|
||||
if ( dom == false ) {
|
||||
if ( href.indexOf("/") == 0 ) { // all internal links start with "/"
|
||||
return;
|
||||
if (dom == false) {
|
||||
if (href.indexOf('/') == 0) return; // all internal links start with "/"
|
||||
var baseURLpage = href.split('/');
|
||||
if (gui_pages_available.includes(baseURLpage[0])) return;
|
||||
}
|
||||
var baseURLpage = href.split("/");
|
||||
if ( gui_pages_available.includes(baseURLpage[0]) ) {
|
||||
return;
|
||||
}
|
||||
}
|
||||
if ( $(this).hasClass("localURL") ) {
|
||||
return;
|
||||
}
|
||||
|
||||
if ($(this).hasClass('localURL')) return;
|
||||
try {
|
||||
var domainsAllowed = JSON.parse($.cookie("allowedDomains"));
|
||||
var domainsAllowed = JSON.parse($.cookie('allowedDomains'));
|
||||
} catch(e) {
|
||||
var domainsAllowed = new Object();
|
||||
}
|
||||
$.cookie("allowedDomains",JSON.stringify(domainsAllowed),{expires:3650}); // rewrite cookie to further extend expiration by 400 days
|
||||
|
||||
if ( domainsAllowed[dom.hostname] ) {
|
||||
return;
|
||||
}
|
||||
|
||||
$.cookie('allowedDomains',JSON.stringify(domainsAllowed),{expires:3650}); // rewrite cookie to further extend expiration by 400 days
|
||||
if (domainsAllowed[dom.hostname]) return;
|
||||
e.preventDefault();
|
||||
swal({
|
||||
title: "<?=_('External Link')?>",
|
||||
text: "<span title='"+href+"'><?=_('Clicking OK will take you to a 3rd party website not associated with Lime Technology')?><br><br><b>"+href+"<br><br><input id='Link_Always_Allow' type='checkbox'></input><?=_('Always Allow')?> "+dom.hostname+"</span>",
|
||||
html: true,
|
||||
animation: 'none',
|
||||
type: 'warning',
|
||||
showCancelButton: true,
|
||||
showConfirmButton: true,
|
||||
@@ -1187,16 +1201,14 @@ $('body').on("click","a,.ca_href", function(e) {
|
||||
confirmButtonText: "<?=_('OK')?>"
|
||||
},function(isConfirm) {
|
||||
if (isConfirm) {
|
||||
if ( $("#Link_Always_Allow").is(":checked") ) {
|
||||
if ($('#Link_Always_Allow').is(':checked')) {
|
||||
domainsAllowed[dom.hostname] = true;
|
||||
$.cookie("allowedDomains",JSON.stringify(domainsAllowed),{expires:3650});
|
||||
$.cookie('allowedDomains',JSON.stringify(domainsAllowed),{expires:3650});
|
||||
}
|
||||
var popupOpen = window.open(href,target);
|
||||
if ( !popupOpen || popupOpen.closed || typeof popupOpen == "undefined" ) {
|
||||
var popupWarning = addBannerWarning("<?=_('Popup Blocked.');?>");
|
||||
setTimeout(function() {
|
||||
removeBannerWarning(popupWarning);}
|
||||
,10000);
|
||||
if (!popupOpen || popupOpen.closed || typeof popupOpen == 'undefined') {
|
||||
var popupWarning = addBannerWarning("<?=_('Popup Blocked');?>");
|
||||
setTimeout(function(){removeBannerWarning(popupWarning);},10000);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
@@ -2,7 +2,7 @@ Index: /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php
|
||||
===================================================================
|
||||
--- /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php original
|
||||
+++ /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php modified
|
||||
@@ -554,20 +554,11 @@
|
||||
@@ -556,20 +556,11 @@
|
||||
return 'three';
|
||||
}
|
||||
function openNotifier() {
|
||||
@@ -24,7 +24,7 @@ Index: /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php
|
||||
}
|
||||
function closeNotifier() {
|
||||
$.post('/webGui/include/Notify.php',{cmd:'get',csrf_token:csrf_token},function(msg) {
|
||||
@@ -695,12 +686,12 @@
|
||||
@@ -698,12 +689,12 @@
|
||||
}
|
||||
// create list of nchan scripts to be started
|
||||
if (isset($button['Nchan'])) nchan_merge($button['root'], $button['Nchan']);
|
||||
@@ -38,7 +38,7 @@ Index: /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php
|
||||
foreach ($buttons as $button) {
|
||||
annotate($button['file']);
|
||||
// include page specific stylesheets (if existing)
|
||||
@@ -901,26 +892,18 @@
|
||||
@@ -905,26 +896,18 @@
|
||||
case 'warning': bell2++; break;
|
||||
case 'normal' : bell3++; break;
|
||||
}
|
||||
@@ -69,8 +69,8 @@ Index: /usr/local/emhttp/plugins/dynamix/include/DefaultPageLayout.php
|
||||
}
|
||||
});
|
||||
|
||||
var nchan_plugins = new NchanSubscriber('/sub/plugins',{subscriber:'websocket'});
|
||||
@@ -1219,7 +1202,8 @@
|
||||
<?if ($wlan0):?>
|
||||
@@ -1231,7 +1214,8 @@
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user