Просмотр исходного кода

Added enable sound setting for up/down sounds

causefx 7 лет назад
Родитель
Сommit
39ea137330
8 измененных файлов с 36 добавлено и 9 удалено
  1. 2 1
      api/config/default.php
  2. 8 0
      api/functions/organizr-functions.php
  3. 0 0
      css/dark.css
  4. 17 1
      css/organizr.css
  5. 0 0
      css/organizr.min.css
  6. 3 2
      index.php
  7. 2 0
      js/custom.js
  8. 4 5
      js/functions.js

+ 2 - 1
api/config/default.php

@@ -189,5 +189,6 @@ return array(
 	'minimalLoginScreen' => false,
 	'unsortedTabs' => 'top',
 	'cacheImageSize' => '2',
-	'plexoAuth' => false
+	'plexoAuth' => false,
+	'statusSounds' => false
 );

+ 8 - 0
api/functions/organizr-functions.php

@@ -50,6 +50,7 @@ function organizrSpecialSettings()
 		'ping' => array(
 			'onlineSound' => $GLOBALS['pingOnlineSound'],
 			'offlineSound' => $GLOBALS['pingOfflineSound'],
+			'statusSounds' => $GLOBALS['statusSounds'],
 			'auth' => $GLOBALS['pingAuth'],
 			'authMessage' => $GLOBALS['pingAuthMessage'],
 			'authMs' => $GLOBALS['pingAuthMs'],
@@ -622,6 +623,13 @@ function getSettingsMain()
 				'label' => 'Show Ping Time',
 				'value' => $GLOBALS['pingMs']
 			),
+			array(
+				'type' => 'switch',
+				'name' => 'statusSounds',
+				'label' => 'Enable Notify Sounds',
+				'value' => $GLOBALS['statusSounds'],
+				'help' => 'Will play a sound if the server goes down and will play sound if comes back up.',
+			),
 			array(
 				'type' => 'select',
 				'name' => 'pingAuthMs',

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
css/dark.css


+ 17 - 1
css/organizr.css

@@ -1184,4 +1184,20 @@ img.img-chooser {
 span.fc-image,
 span.fc-title {
     margin-left: 5px;
-}
+}
+.string { color: green; }
+.number { color: darkorange; }
+.boolean { color: blue; }
+.null { color: magenta; }
+.key { color: #53e69d; }
+/*
+body,
+html {
+    overflow: hidden;
+}
+
+#page-wrapper {
+    max-height: 568px;
+    min-height: 568px;
+}
+*/

Разница между файлами не показана из-за своего большого размера
+ 0 - 0
css/organizr.min.css


+ 3 - 2
index.php

@@ -140,7 +140,7 @@
                                             <div class="input-group-btn">
                                                 <button type="button"
                                                         class="btn waves-effect waves-light btn-info dropdown-toggle"
-                                                        data-toggle="dropdown" aria-expanded="false"><span lang="en">Suggestions</span>
+                                                        data-toggle="dropdown" aria-expanded="false"><span lang="en">Commands</span>
                                                     <span class="caret"></span></button>
                                                 <ul class="dropdown-menu dropdown-menu-right">
                                                     <li><a onclick="orgDebugList('activeInfo.settings.sso.ombi');"
@@ -156,7 +156,8 @@
                             <div id="debugResultsBox" class="sl-item hidden">
                                 <div class="sl-left bg-info"><i class="mdi mdi-receipt"></i></div>
                                 <div class="sl-right">
-                                    <div><a href="#">Results</a></div>
+                                    <div><span lang="en">Results For cmd:</span>&nbsp;<span class="cmdName"></span>
+                                    </div>
                                     <div id="debugResults" class="desc"></div>
                                 </div>
                             </div>

+ 2 - 0
js/custom.js

@@ -55,6 +55,8 @@ $(document).ready(function () {
             }
             if (height > topOffset) {
                 $("#page-wrapper").css("min-height", (height) + "px");
+                //$("#page-wrapper").css("max-height", (height) + "px");
+
             }
         },
         url = window.location,

+ 4 - 5
js/functions.js

@@ -49,10 +49,9 @@ function orgDebug(cmd) {
         result = eval(cmd);
     }
     if (result !== '') {
-        console.log(result);
-        console.log(typeof result);
         $('#debugResultsBox').removeClass('hidden');
         $('#debugResults').html(formatDebug(result));
+        $('.cmdName').text(cmd);
     } else {
 
     }
@@ -67,7 +66,7 @@ function formatDebug(result){
             formatted = result;
 
     }
-    return '<pre>' + formatted + '</pre>';
+    return '<pre class="whitebox bg-org text-success">' + formatted + '</pre>';
 }
 function orgDebugList(cmd){
     if(cmd !== ''){
@@ -5266,14 +5265,14 @@ function pingUpdate(pingList,timeout){
                         catElm.html(error);
                         elm.parent().find('img').addClass('grayscale');
                         var msg = (sendMessage) ? message(tabName,'Server Down',activeInfo.settings.notifications.position,'#FFF','error','600000') : '';
-                        var audio = (sendMessage) ? audioDown.play() : '';
+                        var audio = (sendMessage && activeInfo.settings.ping.statusSounds) ? audioDown.play() : '';
                         break;
                     default:
                         if(catElm.length > 0){ goodCount = goodCount + 1; catElm.attr('data-good', goodCount); if(badCount == 0){ catElm.html(success); } }
                         elm.html(success);
                         elm.parent().find('img').removeClass('grayscale');
                         var msg = (sendMessage) ? message(tabName,'Server Back Online',activeInfo.settings.notifications.position,'#FFF','success','600000') : '';
-                        var audio = (sendMessage) ? audioUp.play() : '';
+                        var audio = (sendMessage && activeInfo.settings.ping.statusSounds) ? audioUp.play() : '';
                 }
             });
         }

Некоторые файлы не были показаны из-за большого количества измененных файлов