mirror of
https://github.com/linuxserver/Heimdall.git
synced 2025-11-24 17:20:52 +09:00
Initial upload icon support
This commit is contained in:
@@ -4,8 +4,8 @@ namespace App\Http\Controllers;
|
|||||||
|
|
||||||
use Illuminate\Http\Request;
|
use Illuminate\Http\Request;
|
||||||
use App\Item;
|
use App\Item;
|
||||||
//use App\SupportedApps\Contracts\Applications;
|
|
||||||
use App\SupportedApps\Nzbget;
|
use App\SupportedApps\Nzbget;
|
||||||
|
use Illuminate\Support\Facades\Storage;
|
||||||
|
|
||||||
class ItemController extends Controller
|
class ItemController extends Controller
|
||||||
{
|
{
|
||||||
@@ -60,6 +60,13 @@ class ItemController extends Controller
|
|||||||
'url' => 'required',
|
'url' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if($request->hasFile('file')) {
|
||||||
|
$path = $request->file('file')->store('icons');
|
||||||
|
$request->merge([
|
||||||
|
'icon' => $path
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
Item::create($request->all());
|
Item::create($request->all());
|
||||||
|
|
||||||
return redirect()->route('dash')
|
return redirect()->route('dash')
|
||||||
@@ -107,6 +114,14 @@ class ItemController extends Controller
|
|||||||
'url' => 'required',
|
'url' => 'required',
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
if($request->hasFile('file')) {
|
||||||
|
$path = $request->file('file')->store('icons');
|
||||||
|
$request->merge([
|
||||||
|
'icon' => $path
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
Item::find($id)->update($request->all());
|
Item::find($id)->update($request->all());
|
||||||
|
|
||||||
return redirect()->route('dash')
|
return redirect()->route('dash')
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ class AppServiceProvider extends ServiceProvider
|
|||||||
// first time setup
|
// first time setup
|
||||||
touch(database_path(env('DB_DATABASE')));
|
touch(database_path(env('DB_DATABASE')));
|
||||||
Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true));
|
Artisan::call('migrate', array('--path' => 'database/migrations', '--force' => true));
|
||||||
|
Artisan::call('storage:link');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ return [
|
|||||||
|
|
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
'default' => env('FILESYSTEM_DRIVER', 'local'),
|
'default' => env('FILESYSTEM_DRIVER', 'public'),
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|--------------------------------------------------------------------------
|
|--------------------------------------------------------------------------
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<section class="item-container">
|
<section class="item-container">
|
||||||
<div class="item" style="background-color: {{ $app->colour }}">
|
<div class="item" style="background-color: {{ $app->colour }}">
|
||||||
@if($app->icon)
|
@if($app->icon)
|
||||||
<img src="" />
|
<img src="{{ asset('storage/'.$app->icon) }}" />
|
||||||
@else
|
@else
|
||||||
<i class="fas fa-app-store-ios"></i>
|
<i class="fas fa-app-store-ios"></i>
|
||||||
@endif
|
@endif
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{!! Form::open(array('route' => 'items.store','method'=>'POST')) !!}
|
{!! Form::open(array('route' => 'items.store', 'files' => true, 'method'=>'POST')) !!}
|
||||||
@include('items.form')
|
@include('items.form')
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
|
|
||||||
|
|||||||
@@ -2,7 +2,7 @@
|
|||||||
|
|
||||||
@section('content')
|
@section('content')
|
||||||
|
|
||||||
{!! Form::model($item, ['method' => 'PATCH','route' => ['items.update', $item->id]]) !!}
|
{!! Form::model($item, ['method' => 'PATCH', 'files' => true, 'route' => ['items.update', $item->id]]) !!}
|
||||||
@include('items.form')
|
@include('items.form')
|
||||||
{!! Form::close() !!}
|
{!! Form::close() !!}
|
||||||
|
|
||||||
|
|||||||
@@ -8,10 +8,10 @@
|
|||||||
</header>
|
</header>
|
||||||
<div class="create">
|
<div class="create">
|
||||||
{!! csrf_field() !!}
|
{!! csrf_field() !!}
|
||||||
<div class="input">
|
<!--<div class="input">
|
||||||
<label>Application name</label>
|
<label>Application name</label>
|
||||||
{!! Form::select('supported', \App\Item::supportedOptions(), array('placeholder' => 'Title','class' => 'form-control')) !!}
|
{!! Form::select('supported', \App\Item::supportedOptions(), array('placeholder' => 'Title','class' => 'form-control')) !!}
|
||||||
</div>
|
</div>-->
|
||||||
|
|
||||||
<div class="input">
|
<div class="input">
|
||||||
<label>Application name</label>
|
<label>Application name</label>
|
||||||
@@ -25,6 +25,29 @@
|
|||||||
<label>URL</label>
|
<label>URL</label>
|
||||||
{!! Form::text('url', null, array('placeholder' => 'Url','class' => 'form-control')) !!}
|
{!! Form::text('url', null, array('placeholder' => 'Url','class' => 'form-control')) !!}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<div class="input">
|
||||||
|
<label>Icon *</label>
|
||||||
|
@if(isset($item->icon) && !empty($item->icon))
|
||||||
|
{{ asset('storage/'.$item->icon) }}
|
||||||
|
{!! Form::hidden('icon', $item->icon, ['class' => 'form-control']) !!}
|
||||||
|
@endif
|
||||||
|
<input name="file" type="file" class="form-control">
|
||||||
|
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
<label class="switch">
|
||||||
|
<?php
|
||||||
|
$checked = false;
|
||||||
|
if(isset($item->pinned) && $item->pinned === 1) $checked = true;
|
||||||
|
$set_checked = ($checked) ? ' checked="checked"' : '';
|
||||||
|
?>
|
||||||
|
<input type="checkbox" name="active" value="1"<?php echo $set_checked;?> />
|
||||||
|
<span class="slider round"></span>
|
||||||
|
</label>
|
||||||
|
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</section>
|
</section>
|
||||||
|
|||||||
Reference in New Issue
Block a user