supported apps stuff

This commit is contained in:
KodeStar
2018-02-05 23:08:37 +00:00
parent 983cf98b9e
commit ade028767a
14 changed files with 44 additions and 13 deletions

View File

@@ -252,6 +252,7 @@ class ItemController extends Controller
} }
$output['icon'] = $app_details->icon(); $output['icon'] = $app_details->icon();
$output['colour'] = $app_details->defaultColour(); $output['colour'] = $app_details->defaultColour();
$output['config'] = $app_details->configDetails();
return json_encode($output); return json_encode($output);
} }

View File

@@ -6,4 +6,6 @@ interface Applications {
public function icon(); public function icon();
public function configDetails();
} }

View File

@@ -3,11 +3,15 @@
class Nzbget implements Contracts\Applications { class Nzbget implements Contracts\Applications {
public function defaultColour() public function defaultColour()
{ {
return '#ccc'; return '#124019';
} }
public function icon() public function icon()
{ {
return 'supportedapps/nzbget.png'; return 'supportedapps/nzbget.png';
} }
public function configDetails()
{
return 'nzbget';
}
} }

View File

@@ -9,4 +9,8 @@ class Plex implements Contracts\Applications {
{ {
return 'supportedapps/plex.png'; return 'supportedapps/plex.png';
} }
public function configDetails()
{
return null;
}
} }

5
public/css/app.css vendored
View File

@@ -1007,6 +1007,11 @@ a.settinglink {
max-width: 150px; max-width: 150px;
} }
#sapconfig {
display: none;
width: 100%;
}
/*! Huebee v2.0.0 /*! Huebee v2.0.0
http://huebee.buzz http://huebee.buzz
---------------------------------------------- */ ---------------------------------------------- */

5
public/js/app.js vendored
View File

@@ -34,11 +34,6 @@ $.when( $.ready ).then(function() {
$("#sortable").sortable("disable"); $("#sortable").sortable("disable");
$('.color-picker').each( function( i, elem ) {
var hueb = new Huebee( elem, {
// options
});
});
$('#app').on('click', '#config-button', function(e) { $('#app').on('click', '#config-button', function(e) {
e.preventDefault(); e.preventDefault();
var app = $('#app'); var app = $('#app');

View File

@@ -1,4 +1,4 @@
{ {
"/css/app.css": "/css/app.css?id=69336a09561650860b52", "/css/app.css": "/css/app.css?id=d32556b7ae5fe4651548",
"/js/app.js": "/js/app.js?id=2dffa24cf7255229e085" "/js/app.js": "/js/app.js?id=559585a774e3f088503a"
} }

View File

@@ -25,11 +25,6 @@ $.when( $.ready ).then(function() {
$("#sortable").sortable("disable"); $("#sortable").sortable("disable");
$('.color-picker').each( function( i, elem ) {
var hueb = new Huebee( elem, {
// options
});
});
$('#app').on('click', '#config-button', function(e) { $('#app').on('click', '#config-button', function(e) {
e.preventDefault(); e.preventDefault();
var app = $('#app'); var app = $('#app');

View File

@@ -647,3 +647,8 @@ div.create {
max-width: 150px; max-width: 150px;
} }
} }
#sapconfig {
display: none;
width: 100%;
}

View File

@@ -52,6 +52,8 @@
</label> </label>
</div> </div>
<div id="sapconfig"></div>
</div> </div>
<footer> <footer>

View File

@@ -1,5 +1,11 @@
<script> <script>
$( function() { $( function() {
var elem = $('.color-picker')[0];
var hueb = new Huebee( elem, {
// options
});
var availableTags = [ var availableTags = [
<?php <?php
$supported = App\Item::supportedOptions(); $supported = App\Item::supportedOptions();
@@ -14,6 +20,13 @@
$.post('/appload', { app: ui.item.value }, function(data) { $.post('/appload', { app: ui.item.value }, function(data) {
$('#appimage').html("<img src='/storage/"+data.icon+"' /><input type='hidden' name='icon' value='"+data.icon+"' />"); $('#appimage').html("<img src='/storage/"+data.icon+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
$('input[name=colour]').val(data.colour); $('input[name=colour]').val(data.colour);
hueb.setColor( data.colour );
$('input[name=pinned]').prop('checked', true);
if(data.config != null) {
$.get('/view/'+data.config, function(getdata) {
$('#sapconfig').html(getdata).show();
});
}
}, "json"); }, "json");
} }
}); });

View File

@@ -0,0 +1 @@
here

View File

@@ -24,6 +24,10 @@ Route::post('order', 'ItemController@setOrder')->name('items.order');
Route::post('appload', 'ItemController@appload')->name('appload'); Route::post('appload', 'ItemController@appload')->name('appload');
Route::get('view/{name_view}', function ($name_view) {
return view('supportedapps.'.$name_view);
});
/** /**
* Settings. * Settings.
*/ */

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB