Selaa lähdekoodia

add tautulli socks

CauseFX 4 vuotta sitten
vanhempi
commit
cc11dd7475
3 muutettua tiedostoa jossa 40 lisäystä ja 0 poistoa
  1. 2 0
      api/config/default.php
  2. 26 0
      api/homepage/tautulli.php
  3. 12 0
      api/v2/routes/socks.php

+ 2 - 0
api/config/default.php

@@ -369,6 +369,8 @@ return array(
 	'tautulliHeader' => 'Tautulli',
 	'tautulliHeaderToggle' => true,
 	'tautulliFriendlyName' => true,
+	'tautulliSocksEnabled' => false,
+	'tautulliSocksAuth' => '999',
 	'homepagePiholeEnabled' => false,
 	'homepagePiholeAuth' => '1',
 	'homepagePiholeRefresh' => '10000',

+ 26 - 0
api/homepage/tautulli.php

@@ -70,6 +70,32 @@ trait TautulliHomepageItem
 						'options' => $this->timeOptions()
 					),
 				),
+				'API SOCKS' => array(
+					array(
+						'type' => 'html',
+						'override' => 12,
+						'label' => '',
+						'html' => '
+							<div class="panel panel-default">
+								<div class="panel-wrapper collapse in">
+									<div class="panel-body">' . $this->socksHeadingHTML('tautulli') . '</div>
+								</div>
+							</div>'
+					),
+					array(
+						'type' => 'switch',
+						'name' => 'tautulliSocksEnabled',
+						'label' => 'Enable',
+						'value' => $this->config['tautulliSocksEnabled']
+					),
+					array(
+						'type' => 'select',
+						'name' => 'tautulliSocksAuth',
+						'label' => 'Minimum Authentication',
+						'value' => $this->config['tautulliSocksAuth'],
+						'options' => $this->groupOptions
+					),
+				),
 				'Library Stats' => array(
 					array(
 						'type' => 'switch',

+ 12 - 0
api/v2/routes/socks.php

@@ -32,6 +32,12 @@ $app->any('/multiple/socks/{app}/{instance}/{route:.*}', function ($request, $re
 			$auth = 'nzbgetSocksAuth';
 			$header = 'Authorization';
 			break;
+		case 'tautulli':
+			$url = 'tautulliURL';
+			$enabled = 'tautulliSocksEnabled';
+			$auth = 'tautulliSocksAuth';
+			$header = null;
+			break;
 		default:
 			$Organizr->setAPIResponse('error', 'Application not supported for socks', 404);
 			$response->getBody()->write(jsonE($GLOBALS['api']));
@@ -79,6 +85,12 @@ $app->any('/socks/{app}/{route:.*}', function ($request, $response, $args) {
 			$auth = 'nzbgetSocksAuth';
 			$header = 'Authorization';
 			break;
+		case 'tautulli':
+			$url = 'tautulliURL';
+			$enabled = 'tautulliSocksEnabled';
+			$auth = 'tautulliSocksAuth';
+			$header = null;
+			break;
 		default:
 			$Organizr->setAPIResponse('error', 'Application not supported for socks', 404);
 			$response->getBody()->write(jsonE($GLOBALS['api']));