Browse Source

add note about socks multiple api endpoint

CauseFX 5 years ago
parent
commit
bf32794f02

+ 13 - 0
api/classes/organizr.class.php

@@ -6039,6 +6039,19 @@ class Organizr
 		}
 	}
 	
+	public function socksHeadingHTML($app)
+	{
+		return '
+		<h3 lang="en">' . ucwords($app) . ' SOCKS API Connection</h3>
+		<p>Using this feature allows you to access the API without having to reverse proxy it.  Just access it from: </p>
+		<code>' . $this->getServerPath() . 'api/v2/socks/' . $app . '/</code>
+		<p>If you are using multiple URL\'s (using the csv method) you will have to use the url like these: </p>
+		<code>' . $this->getServerPath() . 'api/v2/multiple/socks/' . $app . '/1</code>
+		<br/>
+		<code>' . $this->getServerPath() . 'api/v2/multiple/socks/' . $app . '/2</code>
+		';
+	}
+	
 	public function socks($url, $enabled, $auth, $requestObject, $header = null, $multiple = null)
 	{
 		$error = false;

+ 1 - 5
api/homepage/lidarr.php

@@ -55,11 +55,7 @@ trait LidarrHomepageItem
 						'html' => '
 							<div class="panel panel-default">
 								<div class="panel-wrapper collapse in">
-									<div class="panel-body">
-										<h3 lang="en">Lidarr SOCKS API Connection</h3>
-										<p>Using this feature allows you to access the API without having to reverse proxy it.  Just access it from: </p>
-										<code>' . $this->getServerPath() . 'api/v2/socks/lidarr/</code>
-									</div>
+									<div class="panel-body">' . $this->socksHeadingHTML('lidarr') . '</div>
 								</div>
 							</div>'
 					),

+ 1 - 5
api/homepage/nzbget.php

@@ -61,11 +61,7 @@ trait NZBGetHomepageItem
 						'html' => '
 							<div class="panel panel-default">
 								<div class="panel-wrapper collapse in">
-									<div class="panel-body">
-										<h3 lang="en">Nzbget SOCKS API Connection</h3>
-										<p>Using this feature allows you to access the API without having to reverse proxy it.  Just access it from: </p>
-										<code>' . $this->getServerPath() . 'api/v2/socks/nzbget/</code>
-									</div>
+									<div class="panel-body">' . $this->socksHeadingHTML('nzbget') . '</div>
 								</div>
 							</div>'
 					),

+ 1 - 5
api/homepage/radarr.php

@@ -55,11 +55,7 @@ trait RadarrHomepageItem
 						'html' => '
 							<div class="panel panel-default">
 								<div class="panel-wrapper collapse in">
-									<div class="panel-body">
-										<h3 lang="en">Radarr SOCKS API Connection</h3>
-										<p>Using this feature allows you to access the API without having to reverse proxy it.  Just access it from: </p>
-										<code>' . $this->getServerPath() . 'api/v2/socks/radarr/</code>
-									</div>
+									<div class="panel-body">' . $this->socksHeadingHTML('radarr') . '</div>
 								</div>
 							</div>'
 					),

+ 1 - 5
api/homepage/sabnzbd.php

@@ -56,11 +56,7 @@ trait SabNZBdHomepageItem
 						'html' => '
 							<div class="panel panel-default">
 								<div class="panel-wrapper collapse in">
-									<div class="panel-body">
-										<h3 lang="en">Sabnzbd SOCKS API Connection</h3>
-										<p>Using this feature allows you to access the API without having to reverse proxy it.  Just access it from: </p>
-										<code>' . $this->getServerPath() . 'api/v2/socks/sabnzbd/</code>
-									</div>
+									<div class="panel-body">' . $this->socksHeadingHTML('sabnzbd') . '</div>
 								</div>
 							</div>'
 					),

+ 1 - 5
api/homepage/sonarr.php

@@ -72,11 +72,7 @@ trait SonarrHomepageItem
 						'html' => '
 							<div class="panel panel-default">
 								<div class="panel-wrapper collapse in">
-									<div class="panel-body">
-										<h3 lang="en">Sonarr SOCKS API Connection</h3>
-										<p>Using this feature allows you to access the API without having to reverse proxy it.  Just access it from: </p>
-										<code>' . $this->getServerPath() . 'api/v2/socks/sonarr/</code>
-									</div>
+									<div class="panel-body">' . $this->socksHeadingHTML('sonarr') . '</div>
 								</div>
 							</div>'
 					),