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['colour'] = $app_details->defaultColour();
$output['config'] = $app_details->configDetails();
return json_encode($output);
}

View file

@ -5,5 +5,7 @@ interface Applications {
public function defaultColour();
public function icon();
public function configDetails();
}

View file

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

View file

@ -9,4 +9,8 @@ class Plex implements Contracts\Applications {
{
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;
}
#sapconfig {
display: none;
width: 100%;
}
/*! Huebee v2.0.0
http://huebee.buzz
---------------------------------------------- */

5
public/js/app.js vendored
View file

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

View file

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

View file

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

View file

@ -646,4 +646,9 @@ div.create {
img {
max-width: 150px;
}
}
#sapconfig {
display: none;
width: 100%;
}

View file

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

View file

@ -1,5 +1,11 @@
<script>
$( function() {
var elem = $('.color-picker')[0];
var hueb = new Huebee( elem, {
// options
});
var availableTags = [
<?php
$supported = App\Item::supportedOptions();
@ -14,6 +20,13 @@
$.post('/appload', { app: ui.item.value }, function(data) {
$('#appimage').html("<img src='/storage/"+data.icon+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
$('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");
}
});

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::get('view/{name_view}', function ($name_view) {
return view('supportedapps.'.$name_view);
});
/**
* Settings.
*/

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.8 KiB