causefx 8 лет назад
Родитель
Сommit
f12b06faa6
2 измененных файлов с 45 добавлено и 21 удалено
  1. 20 0
      api/functions/homepage-functions.php
  2. 25 21
      js/functions.js

+ 20 - 0
api/functions/homepage-functions.php

@@ -881,6 +881,26 @@ function getHomepageList(){
             'image' => 'plugins/images/tabs/deluge.png',
             'category' => 'Downloader',
             'settings' => array(
+				'custom' => '
+				<div class="row">
+                    <div class="col-lg-12">
+                        <div class="panel panel-info">
+                            <div class="panel-heading">
+								<span lang="en">Notice</span>
+                            </div>
+                            <div class="panel-wrapper collapse in" aria-expanded="true">
+                                <div class="panel-body">
+									<ul class="list-icons">
+                                        <li><i class="fa fa-chevron-right text-danger"></i> <a href="https://github.com/idlesign/deluge-webapi/raw/master/dist/WebAPI-0.2.0-py2.7.egg" target="_blank">Download Plugin</a></li>
+                                        <li><i class="fa fa-chevron-right text-danger"></i> Open Deluge Web UI, go to "Preferences -> Plugins -> Install plugin" and choose egg file.</li>
+                                        <li><i class="fa fa-chevron-right text-danger"></i> Activate WebAPI plugin </li>
+                                    </ul>
+                                </div>
+                            </div>
+                        </div>
+                    </div>
+				</div>
+				',
                 'Enable' => array(
                     array(
                         'type' => 'switch',

+ 25 - 21
js/functions.js

@@ -691,30 +691,34 @@ function buildFormGroup(array){
 	$.each(array, function(i,v) {
 		var count = 0;
 		var total = v.length;
-		group += `
-			<!-- FORM GROUP -->
-			<h4 class="box-title" lang="en">`+i+`</h4>
-			<hr class="m-t-0 m-b-40">
-			<div class="row">
-		`;
-		$.each(v, function(i,v) {
-			count++;
-			if(count%2 !== 0 ){ group += '<div class="row start">'; };
+		if(i == 'custom'){
+			group += v;
+		}else{
 			group += `
-				<!-- INPUT BOX -->
-				<div class="col-md-6 p-b-10">
-					<div class="form-group">
-						<label class="control-label col-md-3" lang="en">`+v.label+`</label>
-						<div class="col-md-9">
-							`+buildFormItem(v)+`
+				<!-- FORM GROUP -->
+				<h4 class="box-title" lang="en">`+i+`</h4>
+				<hr class="m-t-0 m-b-40">
+				<div class="row">
+			`;
+			$.each(v, function(i,v) {
+				count++;
+				if(count%2 !== 0 ){ group += '<div class="row start">'; };
+				group += `
+					<!-- INPUT BOX -->
+					<div class="col-md-6 p-b-10">
+						<div class="form-group">
+							<label class="control-label col-md-3" lang="en">`+v.label+`</label>
+							<div class="col-md-9">
+								`+buildFormItem(v)+`
+							</div>
 						</div>
 					</div>
-				</div>
-				<!--/ INPUT BOX -->
-			`;
-			if(count%2 == 0 || count == total ){ group += '</div><!--end-->'; };
-		});
-		group += '</div>';
+					<!--/ INPUT BOX -->
+				`;
+				if(count%2 == 0 || count == total ){ group += '</div><!--end-->'; };
+			});
+			group += '</div>';
+		}
 	});
 	return group;
 }