mirror of
https://github.com/linuxserver/Heimdall.git
synced 2026-02-21 12:10:34 +09:00
Initial supported apps support
This commit is contained in:
@@ -246,7 +246,13 @@ class ItemController extends Controller
|
||||
public function appload(Request $request)
|
||||
{
|
||||
$app = $request->input('app');
|
||||
return "a: ".$app;
|
||||
if($app) {
|
||||
$all_supported = Item::supportedList();
|
||||
$app_details = new $all_supported[$app];
|
||||
}
|
||||
$output['icon'] = $app_details->icon();
|
||||
$output['colour'] = $app_details->defaultColour();
|
||||
return json_encode($output);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -26,8 +26,8 @@ class Item extends Model
|
||||
public static function supportedList()
|
||||
{
|
||||
return [
|
||||
'NZBGet' => App\SupportedApps\Nzbget::class,
|
||||
'Plex' => App\SupportedApps\Plex::class,
|
||||
'NZBGet' => \App\SupportedApps\Nzbget::class,
|
||||
'Plex' => \App\SupportedApps\Plex::class,
|
||||
];
|
||||
}
|
||||
public static function supportedOptions()
|
||||
|
||||
@@ -3,5 +3,7 @@
|
||||
interface Applications {
|
||||
|
||||
public function defaultColour();
|
||||
|
||||
public function icon();
|
||||
|
||||
}
|
||||
@@ -5,4 +5,9 @@ class Nzbget implements Contracts\Applications {
|
||||
{
|
||||
return '#ccc';
|
||||
}
|
||||
public function icon()
|
||||
{
|
||||
return 'supportedapps/nzbget.png';
|
||||
}
|
||||
|
||||
}
|
||||
@@ -5,4 +5,8 @@ class Plex implements Contracts\Applications {
|
||||
{
|
||||
return '#222';
|
||||
}
|
||||
public function icon()
|
||||
{
|
||||
return 'supportedapps/plex.png';
|
||||
}
|
||||
}
|
||||
4
public/css/app.css
vendored
4
public/css/app.css
vendored
@@ -1003,6 +1003,10 @@ a.settinglink {
|
||||
font-weight: 700;
|
||||
}
|
||||
|
||||
#appimage img {
|
||||
max-width: 150px;
|
||||
}
|
||||
|
||||
/*! Huebee v2.0.0
|
||||
http://huebee.buzz
|
||||
---------------------------------------------- */
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
{
|
||||
"/css/app.css": "/css/app.css?id=e01da6a30207cefea3dd",
|
||||
"/css/app.css": "/css/app.css?id=69336a09561650860b52",
|
||||
"/js/app.js": "/js/app.js?id=2dffa24cf7255229e085"
|
||||
}
|
||||
6
resources/assets/sass/_app.scss
vendored
6
resources/assets/sass/_app.scss
vendored
@@ -640,4 +640,10 @@ div.create {
|
||||
.ui-state-hover, .ui-state-active {
|
||||
font-weight: 700;
|
||||
|
||||
}
|
||||
|
||||
#appimage {
|
||||
img {
|
||||
max-width: 150px;
|
||||
}
|
||||
}
|
||||
@@ -28,10 +28,12 @@
|
||||
|
||||
<div class="input">
|
||||
<label>Icon</label>
|
||||
<div id="appimage">
|
||||
@if(isset($item->icon) && !empty($item->icon))
|
||||
<a href="{{ asset('storage/'.$item->icon) }}">View current icon</a>
|
||||
<img src="{{ asset('storage/'.$item->icon) }}" />
|
||||
{!! Form::hidden('icon', $item->icon, ['class' => 'form-control']) !!}
|
||||
@endif
|
||||
</div>
|
||||
<input name="file" type="file" class="form-control">
|
||||
|
||||
</div>
|
||||
|
||||
@@ -12,8 +12,9 @@
|
||||
source: availableTags,
|
||||
select: function( event, ui ) {
|
||||
$.post('/appload', { app: ui.item.value }, function(data) {
|
||||
alert(data);
|
||||
});
|
||||
$('#appimage').html("<img src='/storage/"+data.icon+"' /><input type='hidden' name='icon' value='"+data.icon+"' />");
|
||||
$('input[name=colour]').val(data.colour);
|
||||
}, "json");
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user