Explorar el Código

New Settings - Speed Fixes

causefx hace 8 años
padre
commit
80b08cc635
Se han modificado 5 ficheros con 387 adiciones y 93 borrados
  1. 2 2
      auth.php
  2. 4 4
      bower_components/speed/speedtest_worker.js
  3. 222 25
      functions.php
  4. 158 61
      settings.php
  5. 1 1
      user.php

+ 2 - 2
auth.php

@@ -18,14 +18,14 @@ if (isset($_GET['admin'])) {
     if($USER->authenticated && $USER->role == "admin" && !in_array(strtoupper($USER->username), getBannedUsers($ban))) {
         !$debug ? exit(http_response_code(200)) : die("$USER->username on $currentIP Authorized At Admin Level");
 	} else {
-        !$debug ? exit(http_response_code(401)) : die("$USER->username on $currentIP Not Authorized At Admin Level");
+        !$debug ? writeLog("error", "Denied Access to $USER->username on $currentIP") : die("$USER->username on $currentIP Not Authorized At Admin Level");
     }
 }
 if (isset($_GET['user'])) {
     if($USER->authenticated && !in_array(strtoupper($USER->username), getBannedUsers($ban))) {
         !$debug ? exit(http_response_code(200)) : die("$USER->username on $currentIP Authorized At User Level");
 	} else {
-        !$debug ? exit(http_response_code(401)) : die("$USER->username on $currentIP Not Authorized At User Level");
+        !$debug ? writeLog("error", "Denied Access to $USER->username on $currentIP") : die("$USER->username on $currentIP Not Authorized At User Level");
 	}
 }
 if (!isset($_GET['user']) && !isset($_GET['admin']) && !isset($_GET['whitelist'])) {

+ 4 - 4
bower_components/speed/speedtest_worker.js

@@ -19,8 +19,8 @@ function twarn(s){log+=Date.now()+' WARN: '+s+'\n'; console.warn(s)}
 
 // test settings. can be overridden by sending specific values with the start command
 var settings = {
-  time_ul: 15, // duration of upload test in seconds
-  time_dl: 15, // duration of download test in seconds
+  time_ul: 10, // duration of upload test in seconds
+  time_dl: 10, // duration of download test in seconds
   time_ulGraceTime: 3, //time to wait in seconds before actually measuring ul speed (wait for buffers to fill)
   time_dlGraceTime: 1.5, //time to wait in seconds before actually measuring dl speed (wait for TCP window to increase)
   count_ping: 35, // number of pings to perform in ping test
@@ -28,8 +28,8 @@ var settings = {
   url_ul: 'empty.php', // path to an empty file, used for upload test. must be relative to this js file
   url_ping: 'empty.php', // path to an empty file, used for ping test. must be relative to this js file
   url_getIp: 'getIP.php', // path to getIP.php relative to this js file, or a similar thing that outputs the client's ip
-  xhr_dlMultistream: 20, // number of download streams to use (can be different if enable_quirks is active)
-  xhr_ulMultistream: 6, // number of upload streams to use (can be different if enable_quirks is active)
+  xhr_dlMultistream: 10, // number of download streams to use (can be different if enable_quirks is active)
+  xhr_ulMultistream: 3, // number of upload streams to use (can be different if enable_quirks is active)
   xhr_ignoreErrors: 1, // 0=fail on errors, 1=attempt to restart a stream if it fails, 2=ignore all errors
   xhr_dlUseBlob: false, // if set to true, it reduces ram usage but uses the hard drive (useful with large garbagePhp_chunkSize and/or high xhr_dlMultistream)
   garbagePhp_chunkSize: 20, // size of chunks sent by garbage.php (can be different if enable_quirks is active)

La diferencia del archivo ha sido suprimido porque es demasiado grande
+ 222 - 25
functions.php


+ 158 - 61
settings.php

@@ -178,6 +178,28 @@ if(SLIMBAR == "true") {
 		</script>
 		
         <style>
+			@-webkit-keyframes fadeIn {
+				from { opacity: 0; }
+				to { opacity: 1; }
+			}  
+			@keyframes fadeIn {
+				from { opacity: 0; }
+				to { opacity: 1; }
+			}
+			button.settingsMenu:hover {
+				width: 250px !important;
+				z-index: 10000;
+				color: black !important;
+			}
+			button.settingsMenu:hover p{
+				display: block !important;
+				-webkit-animation: fadeIn 1s;
+				animation: fadeIn 1s;
+			}
+			button.settingsMenuActive {
+				margin-left: 0px !important;
+				color: black !important;
+			}
             .loop-animation {
                 animation-iteration-count: infinite;
                 -webkit-animation-iteration-count: infinite;
@@ -213,12 +235,12 @@ if(SLIMBAR == "true") {
                     height: 100%;
                     position: fixed;
                     max-width: 100%;
-                    width: 84%;
-                    right: -84%;
+                    width: calc(100% - 50px) !important;
+                    right: calc(-100% - 50px);
                 }.email-content .email-header, .email-new .email-header{
                     position: fixed;
                     padding: 10px 30px;
-                    width: 84%;
+                    width: calc(100% - 50px) !important;
                     z-index: 1000;
                 }
             }ul.inbox-nav.nav {
@@ -334,7 +356,7 @@ if(SLIMBAR == "true") {
                             </div>
                             <form id="urlTestForm" onsubmit="return false;">
                                 <div class="modal-body">
-                                    Let's Check this URL
+									<?php echo translate("TEST_URL"); ?>
                                     <input type="text" class="form-control material" name="url-test" placeholder="<?php echo translate("URL"); ?>" autocorrect="off" autocapitalize="off" value="">
                                 </div>
                                 <div class="modal-footer">
@@ -348,35 +370,119 @@ if(SLIMBAR == "true") {
                 <br/>
                 <div id="versionCheck"></div>
                 <div class="row">
-                    <div class="col-lg-2">
-						<button id="apply" style="width: 100%; display: none;" class="btn waves btn-success btn-sm text-uppercase waves-effect waves-float animated tada" type="submit">
-							<?php echo $language->translate("APPLY_CHANGES");?>
-						</button>
-                        <div class="content-box profile-sidebar box-shadow">
-                            <img src="images/organizr-logo-h-d.png" width="100%" style="margin-top: -10px;">
-                            <div class="profile-usermenu">
-                                <ul class="nav" id="settings-list">
-                                <!--
-                                <span class="fa-stack fa-lg pull-right" style="margin-top: -8px;margin-right: -15px;">
-                                    <i class="fa fa-square-o fa-stack-2x" style="font-size:null;"></i>
-                                    <i class="fa fa-twitter fa-stack-1x" style="font-size:null;"></i>
-                                </span>
-                                    -->
-                                    <li><a id="open-tabs" box="tab-box"><i class="fa fa-list red-orange pull-right"></i>Edit Tabs</a></li>
-                                    <li><a id="open-colors" box="color-box"><i class="fa fa-paint-brush green pull-right"></i>Edit Colors</a></li>
-                                    <li><a id="open-users" box="users-box"><i class="fa fa-user red pull-right"></i>Manage Users</a></li>
-                                    <li><a id="open-logs" box="logs-box"><i class="fa fa-file-text-o blue pull-right"></i>View Logs</a></li>
-                                    <li><a id="open-homepage" box="homepage-box"><i class=" fa fa-home yellow pull-right"></i>Edit Homepage</a></li>
-                                    <li><a id="open-advanced" box="advanced-box"><i class=" fa fa-cog light-blue pull-right"></i>Advanced</a></li>
-                                    <?php if(!empty(PLEXURL)){?><li><a id="open-invites" box="invites-box"><i class=" fa fa-user-plus gray pull-right"></i>Plex Invites</a></li><?php }?>
-                                    <li><a id="open-info" box="info-box"><i class=" fa fa-info-circle orange pull-right"></i>About</a></li>
-                                    <li><a id="open-donate" box="donate-box"><i class=" fa fa-money red pull-right"></i>Donate</a></li>
-                                </ul>
-                            </div>
-                        </div>
+					<?php 
+					if($userDevice !== "phone"){
+						echo '<div class="col-xs-1" style="width: 60px">';
+						echo '
+						<button id="apply" type="submit" style="display:none;border-radius: 20px !important; -webkit-border-radius: 20px !important;margin-bottom: -20px;z-index:10000;" class="btn btn-success btn-icon waves waves-circle waves-effect waves-float settingsMenu animated tada">
+						<i class="fa fa-retweet fa-fw pull-left" style="padding-left: 12px;"></i>
+						<p class="" style="text-align: center;direction: rtl;display:none;"><strong>'.$language->translate("APPLY_CHANGES").'</strong></p>
+					</button>
+						';
+					}else{
+						echo '<div class="col-sm-2">'; 
+						echo '<button id="apply" style="width: 100%; display: none;" class="btn waves btn-success btn-sm text-uppercase waves-effect waves-float animated tada" type="submit">'.$language->translate("APPLY_CHANGES").'</button>';
+					}?>
+						
+
+<?php 
+$buildMenu = array(
+	array(
+		'id' => 'open-tabs',
+		'box' => 'tab-box',
+		'name' => 'Edit Tabs',
+		'icon_1' => 'circle',
+		'icon_2' => 'th-list',
+		'color' => 'red-orange',
+		'color2' => 'palette-Red-A700 bg',
+		'padding' => '8',
+	),
+	array(
+		'id' => 'open-colors',
+		'box' => 'color-box',
+		'name' => 'Edit Colors',
+		'icon_1' => 'circle',
+		'icon_2' => 'paint-brush',
+		'color' => 'red',
+		'color2' => 'palette-Indigo-A700 bg',
+		'padding' => '8',
+	),
+	array(
+		'id' => 'open-users',
+		'box' => 'users-box',
+		'name' => 'Manage Users',
+		'icon_1' => 'circle',
+		'icon_2' => 'user',
+		'color' => 'green',
+		'color2' => 'palette-Blue-Grey-700 bg',
+		'padding' => '9',
+	),
+	array(
+		'id' => 'open-logs',
+		'box' => 'logs-box',
+		'name' => 'View Logs',
+		'icon_1' => 'circle',
+		'icon_2' => 'list-alt',
+		'color' => 'blue',
+		'color2' => 'palette-Light-Blue-A700 bg',
+		'padding' => '8',
+	),
+	array(
+		'id' => 'open-homepage',
+		'box' => 'homepage-box',
+		'name' => 'Edit Homepage',
+		'icon_1' => 'circle',
+		'icon_2' => 'home',
+		'color' => 'yellow',
+		'color2' => 'palette-Yellow-A700 bg',
+		'padding' => '9',
+	),
+	array(
+		'id' => 'open-invites',
+		'box' => 'invites-box',
+		'name' => 'Plex Invites',
+		'icon_1' => 'circle',
+		'icon_2' => 'user-plus',
+		'color' => 'light-blue',
+		'color2' => 'palette-Amber-A700 bg',
+		'padding' => '7',
+	),
+	array(
+		'id' => 'open-advanced',
+		'box' => 'advanced-box',
+		'name' => 'Advanced',
+		'icon_1' => 'circle',
+		'icon_2' => 'cog',
+		'color' => 'gray',
+		'color2' => 'light-blue-bg',
+		'padding' => '8',
+	),array(
+		'id' => 'open-info',
+		'box' => 'info-box',
+		'name' => 'About',
+		'icon_1' => 'circle',
+		'icon_2' => 'info-circle',
+		'color' => 'orange',
+		'color2' => 'palette-Blue-A700 bg',
+		'padding' => '8',
+	),array(
+		'id' => 'open-donate',
+		'box' => 'donate-box',
+		'name' => 'Donate',
+		'icon_1' => 'square',
+		'icon_2' => 'money',
+		'color' => 'red',
+		'color2' => 'palette-Green-A700 bg',
+		'padding' => '7',
+	),
+);
+if($userDevice !== "phone"){ echo "<br><br><br>".buildMenu($buildMenu); }else{ echo buildMenuPhone($buildMenu); }
+?>								
+
+
                     </div>
                     <div class="col-lg-10">
-                        
+						<h1 class="text-center">ORGANIZR <3 YOU</h1>
                     </div>
                 </div>
                 <div class="email-content tab-box white-bg">
@@ -485,7 +591,7 @@ echo buildSettings(
                         ),
                         array(
 							'type' => 'button',
-							'labelTranslate' => 'LAYER#CAKE',
+							'label' => 'LAYER#CAKE',
 							'icon' => 'birthday-cake',
 							'id' => 'layerCake',
 							'buttonType' => 'dark',
@@ -1731,31 +1837,23 @@ echo buildSettings(
                                             <div class="content-box profile-sidebar box-shadow">
                                                 <img src="images/organizr-logo-h-d.png" width="100%" style="margin-top: -10px;">
                                                 <div class="profile-usermenu">
-                                                    <ul class="nav" id="theme-list">
-                                                        
-
-                                                    </ul>
+                                                    <ul class="nav" id="theme-list"></ul>
                                                 </div>
                                             </div>
                                         </div>
                                         <div class="col-lg-10">
                                             <h1 id="chooseLayer">Choose A Theme To Preview</h1>
                                             <div class="row">
-                                                <div id="layerCakePreview" class="col-lg-10">
-                                                    
-                                                        
-
-                                                </div>
-                                                <div id="layerCakeInfo" class="col-lg-2">
-
-                                                </div>
-                                        </div>
-                                    </div>
-                                </div>
-                            </div>
-                        </div>
-                    </div>
-                </div>
+                                                <div id="layerCakePreview" class="col-lg-10"></div>
+                                                <div id="layerCakeInfo" class="col-lg-2"></div>
+                                        	</div>
+                                    	</div>
+                                	</div>
+                            	</div>
+                        	</div>
+                    	</div>
+                	</div>
+				</div>
                 <div class="email-content speed-box white-bg">
                     <div class="email-body">
                         <div class="email-header gray-bg">
@@ -1765,12 +1863,10 @@ echo buildSettings(
                         <div class="email-inner small-box">
                             <div class="email-inner-section">
                                 <div class="small-box fade in" id="speedOrg">
-           
                                     <div class="row">
                                         <div class="col-lg-12">
                                             <div class="content-box">
-                                                <div class="content-title big-box i-block">
-                                                </div>
+                                                <div class="content-title big-box i-block"></div>
                                                 <div class="clearfix"></div>
                                                 <div class="big-box">
                                                     <div id="morris-line" class="morris-container"></div>
@@ -1778,7 +1874,6 @@ echo buildSettings(
                                             </div>
                                         </div>
 									</div>
-
 									<?php if(file_exists(DATABASE_LOCATION."speedtest.db")){ ?>
                                     <div id="speedTestTable" class="table-responsive">
                                         <table id="speedLogs" class="datatable display">
@@ -1792,13 +1887,10 @@ echo buildSettings(
                                                     <th><?php echo $language->translate("JITTER");?></th>
                                                 </tr>
                                             </thead>
-                                            <tbody>
-											<?php echo speedTestDisplay(speedTestData(),"table");?>
-                                            </tbody>
+                                            <tbody><?php echo speedTestDisplay(speedTestData(),"table");?></tbody>
                                         </table>
                                     </div>
                                     <?php } ?>
-
                                 </div>
                             </div>
                         </div>
@@ -2616,7 +2708,11 @@ echo buildSettings(
         <?php endif; ?>
 
 		<script>
-        	<?php echo speedTestDisplay(speedTestData(),"graph");?>
+			<?php echo speedTestDisplay(speedTestData(),"graph");?>
+			$(".settingsMenu").click(function() {
+                $(".settingsMenu").removeClass("settingsMenuActive");
+                $(this).addClass("settingsMenuActive");
+            })
             //Tooltips
             $('[data-toggle="tooltip"]').tooltip();
             //IP INFO
@@ -3191,7 +3287,8 @@ echo buildSettings(
 
             });
             $(".email-header .close-button").click(function () {
-                $(".email-content").removeClass("email-active");
+				$(".email-content").removeClass("email-active");
+				$(".settingsMenu").removeClass("settingsMenuActive");
                 $('html').removeClass("overhid");
                 $("#settings-list").find("li").removeClass("active");
             });

+ 1 - 1
user.php

@@ -9,7 +9,7 @@
 	 */
 	
 	// Include functions if not already included
-	require_once(__DIR__ . '/functions.php');
+	require_once('functions.php');
 	 
     // Autoload frameworks
 	require_once(__DIR__ . '/vendor/autoload.php');

Algunos archivos no se mostraron porque demasiados archivos cambiaron en este cambio