mirror of
https://github.com/unraid/webgui.git
synced 2026-05-18 04:10:03 -05:00
Merge branch 'master' of github.com:limetech/webgui
This commit is contained in:
@@ -17,9 +17,8 @@ Tag="folder-o"
|
||||
?>
|
||||
<?
|
||||
$width = [166,300];
|
||||
|
||||
function data_disks($disk) {
|
||||
return ($disk['type']=='Data' && $disk['status']=='DISK_OK');
|
||||
return ( ($disk['type']=='Data' || $disk['type'] == "Cache") && $disk['status']=='DISK_OK');
|
||||
}
|
||||
?>
|
||||
<style>
|
||||
@@ -44,7 +43,7 @@ function setNewPerms(form) {
|
||||
dirs += item.value;
|
||||
}
|
||||
}
|
||||
if (dirs) swal({title:"_(Proceed)_?",text:"_(This will update folder & file permissions)_",type:'warning',html:true,showCancelButton:true,confirmButtonText:"_(Proceed)_",cancelButtonText:"_(Cancel)_"},function(){openBox("/webGui/scripts/newperms&arg1="+dirs,"_(New Permissions)_",490,430,true);});
|
||||
if (dirs) swal({title:"_(Proceed)_?",text:"_(This will update folder & file permissions)_",type:'warning',html:true,showCancelButton:true,confirmButtonText:"_(Proceed)_",cancelButtonText:"_(Cancel)_"},function(){openBox("/webGui/scripts/newperms&arg1="+dirs,"_(New Permissions)_",490,600,true);});
|
||||
}
|
||||
$(function() {
|
||||
$('#s1').dropdownchecklist({emptyText:"_(None)_", width:<?=$width[0]?>, firstItemChecksAll:true, explicitClose:"..._(close)_"});
|
||||
@@ -93,9 +92,6 @@ Note that this tool may negatively affect any docker containers if you allow you
|
||||
<span class="block"><div class="div">_(Disks)_</div>
|
||||
<select id="s1" name="includeDisk" size="1" multiple="multiple" style="display:none">
|
||||
<option value=''>_(All)_</option>
|
||||
<?if (isset($disks['cache'])):?>
|
||||
<option value='/mnt/cache'>_(Cache)_</option>
|
||||
<?endif;?>
|
||||
<?foreach (array_filter($disks,'data_disks') as $disk):?>
|
||||
<?=mk_option(1,"/mnt/{$disk['name']}",_(my_disk($disk['name'])),3)?>
|
||||
<?endforeach;?>
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/bin/bash
|
||||
|
||||
#!/usr/bin/php
|
||||
<?
|
||||
# Usage: newperms [dir] [owner] [group]
|
||||
# Recursively changes the ownership and permissions of the directory and all files/subdirs
|
||||
# within the directory.
|
||||
@@ -16,35 +16,44 @@
|
||||
# go+u Copy the user permissions to group and other
|
||||
# ugo+X Set the 'x' bit for directories in user, group, and other
|
||||
|
||||
function process {
|
||||
list="$1"
|
||||
[[ $# -ge 2 ]] && owner=$2 || owner=nobody
|
||||
[[ $# -ge 3 ]] && group=$3 || group=users
|
||||
ifs=$IFS; IFS='|'
|
||||
for dir in $list; do
|
||||
echo "$dir"
|
||||
if [[ -d $dir ]]; then
|
||||
echo processing "$dir"
|
||||
echo ... chmod -R u-x,go-rwx,go+u,ugo+X "$dir"
|
||||
chmod -R u-x,go-rwx,go+u,ugo+X "$dir"
|
||||
echo ... chown -R $owner:$group "$dir"
|
||||
chown -R $owner:$group "$dir"
|
||||
echo ... sync
|
||||
sync
|
||||
fi
|
||||
done
|
||||
IFS=$ifs
|
||||
function process($path) {
|
||||
global $argv;
|
||||
|
||||
$owner = $argv[2] ?: "nobody";
|
||||
$group = $argv[3] ?: "users";
|
||||
|
||||
if ( is_dir($path) ) {
|
||||
echo "processing ".escapeshellarg($path)."\n";
|
||||
echo "... chmod -R u-x,go-rwx,go+u,ugo+X ".escapeshellarg($path)."\n";
|
||||
passthru("chmod -R u-x,go-rwx,go+u,ugo+X ".escapeshellarg($path));
|
||||
echo "... chown -R $owner:$group ".escapeshellarg($path)."\n";
|
||||
passthru("chown -R $owner:$group ".escapeshellarg($path));
|
||||
echo "... sync\n";
|
||||
passthru("sync");
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
if [[ -n $1 ]]; then
|
||||
process "$@"
|
||||
else
|
||||
process /mnt/cache
|
||||
for disk in /mnt/disk[0-9]*; do
|
||||
process $disk
|
||||
done
|
||||
fi
|
||||
$startTime = time();
|
||||
|
||||
echo
|
||||
secs=$SECONDS
|
||||
printf "completed, elapsed time: %.2d:%.2d:%.2d\n" $(($secs/3600)) $(($secs%3600/60)) $(($secs%60))
|
||||
if ($argv[1]) {
|
||||
$paths=explode("|",$argv[1]);
|
||||
foreach ($paths as $path)
|
||||
process($path);
|
||||
} else {
|
||||
$disks = parse_ini_file("/var/local/emhttp/disks.ini",true);
|
||||
foreach ($disks as $disk => $prop) {
|
||||
if ( is_dir("/mnt/$disk") && $prop['status'] !== "DISK_NP_DSBL" && $prop['status'] !== "DISK_NP") {
|
||||
process("/mnt/$disk");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$seconds = time() - $startTime;
|
||||
$hours = floor($seconds / 3600);
|
||||
$mins = floor($seconds / 60 % 60);
|
||||
$secs = floor($seconds % 60);
|
||||
|
||||
echo "completed, elapsed time: ".sprintf('%02d:%02d:%02d', $hours, $mins, $secs)."\n";
|
||||
|
||||
?>
|
||||
@@ -15,6 +15,10 @@
|
||||
.jGrowl-notification .jGrowl-close:hover{color:inherit;background:none}
|
||||
.jGrowl-closer{width:400px;color:#808080;background-color:#121510;opacity:0.96;border:2px solid #b0b0b0;margin:5px 0;padding:4px 0;cursor:pointer;font-weight:bold;text-align:center;border-radius:6px}
|
||||
.jGrowl-closer.top{position:fixed;top:130px}
|
||||
#jGrowl {pointer-events: none !important;}
|
||||
.jGrowl-notification:first-of-type {pointer-events: none !important;}
|
||||
.jGrowl-notification {pointer-events:all !important;}
|
||||
.jGrowl-closer.top {pointer-events:all !important;}
|
||||
@media print{.jGrowl{display:none}}
|
||||
.ui-dropdownchecklist{background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #606e7f 40%),linear-gradient(113.4deg, #606e7f 40%, transparent 60%);background-position:calc(100% - 8px),calc(100% - 4px);background-size:4px 6px,4px 6px;background-repeat:no-repeat;border:none;box-shadow:0 1px 0 #606e7f;outline:none;height:3rem;line-height:3rem;cursor:pointer}
|
||||
.ui-dropdownchecklist-selector{border:1px solid #606E7F;display:inline-block;cursor:pointer;padding:1px 14px 1px 6px}
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
.jGrowl-notification .jGrowl-close:hover{color:inherit;background:none}
|
||||
.jGrowl-closer{width:400px;color:#808080;background-color:#121510;opacity:0.96;border:2px solid #b0b0b0;margin:5px 0;padding:4px 0;cursor:pointer;font-weight:bold;text-align:center;border-radius:6px}
|
||||
.jGrowl-closer.top{position:fixed;top:130px}
|
||||
#jGrowl {pointer-events: none !important;}
|
||||
.jGrowl-notification:first-of-type {pointer-events: none !important;}
|
||||
.jGrowl-notification {pointer-events:all !important;}
|
||||
.jGrowl-closer.top {pointer-events:all !important;}
|
||||
@media print{.jGrowl{display:none}}
|
||||
.ui-dropdownchecklist{background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #f2f2f2 40%),linear-gradient(113.4deg, #f2f2f2 40%, transparent 60%);background-position:calc(100% - 4px),100%;background-size:4px 6px,4px 6px;background-repeat:no-repeat;border:none;box-shadow:0 1px 0 #f2f2f2;outline:none;height:2.5rem;line-height:2.5rem;cursor:pointer}
|
||||
.ui-dropdownchecklist-selector{border:none;border-bottom:1px solid #f2f2f2;outline:none;display:inline-block;cursor:pointer;padding:1px 0}
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
.jGrowl-notification .jGrowl-close:hover{color:inherit;background:none}
|
||||
.jGrowl-closer{width:400px;color:#808080;background-color:#121510;opacity:0.96;border:2px solid #b0b0b0;margin:5px 0;padding:4px 0;cursor:pointer;font-weight:bold;text-align:center;border-radius:6px}
|
||||
.jGrowl-closer.top{position:fixed;top:130px}
|
||||
#jGrowl {pointer-events: none !important;}
|
||||
.jGrowl-notification:first-of-type {pointer-events: none !important;}
|
||||
.jGrowl-notification {pointer-events:all !important;}
|
||||
.jGrowl-closer.top {pointer-events:all !important;}
|
||||
@media print{.jGrowl{display:none}}
|
||||
.ui-dropdownchecklist{background-color:transparent;background-image:linear-gradient(66.6deg, transparent 60%, #606e7f 40%),linear-gradient(113.4deg, #606e7f 40%, transparent 60%);background-position:calc(100% - 8px),calc(100% - 4px);background-size:4px 6px,4px 6px;background-repeat:no-repeat;border:none;box-shadow:0 1px 0 #606e7f;outline:none;height:3rem;line-height:3rem;cursor:pointer}
|
||||
.ui-dropdownchecklist-selector{border:1px solid #606E7F;display:inline-block;cursor:pointer;padding:1px 14px 1px 6px}
|
||||
|
||||
@@ -13,6 +13,10 @@
|
||||
.jGrowl-notification .jGrowl-header{font-weight:bold}
|
||||
.jGrowl-notification .jGrowl-close{float:right;text-align:right;margin:0;padding:0;background:none;color:inherit;border:none;cursor:pointer}
|
||||
.jGrowl-notification .jGrowl-close:hover{color:inherit;background:none}
|
||||
#jGrowl {pointer-events: none !important;}
|
||||
.jGrowl-notification:first-of-type {pointer-events: none !important;}
|
||||
.jGrowl-notification {pointer-events:all !important;}
|
||||
.jGrowl-closer.top {pointer-events:all !important;}
|
||||
.jGrowl-closer{width:400px;color:#808080;background-color:#121510;opacity:0.96;border:2px solid #b0b0b0;margin:5px 0;padding:4px 0;cursor:pointer;font-weight:bold;text-align:center;border-radius:6px}
|
||||
.jGrowl-closer.top{position:fixed;top:130px}
|
||||
@media print{.jGrowl{display:none}}
|
||||
|
||||
Reference in New Issue
Block a user